41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
# Development Hints
|
|
|
|
## Dependencies (v2.0.0)
|
|
|
|
- Uses `@push.rocks/smartfs` (v1.2.0) for filesystem operations - SmartFs is class-based with fluent API
|
|
- Uses `@push.rocks/smartfile` (v13.1.0) - note: v13 removed the `.fs` namespace, use smartfs instead
|
|
- Uses `@git.zone/tstest/tapbundle` for tests (NOT @push.rocks/tapbundle)
|
|
- Test files must end with `export default tap.start()`
|
|
|
|
## TC39 Decorators v3
|
|
|
|
All decorated properties in web components use the `accessor` keyword:
|
|
```typescript
|
|
@property({ type: Object })
|
|
accessor letterData: TInvoice;
|
|
```
|
|
|
|
## SmartFs Usage
|
|
|
|
```typescript
|
|
import { SmartFs, SmartFsProviderNode } from '@push.rocks/smartfs';
|
|
const smartfs = new SmartFs(new SmartFsProviderNode());
|
|
|
|
// Reading files
|
|
await smartfs.file('/path/to/file').encoding('utf8').read();
|
|
|
|
// Writing files
|
|
await smartfs.file('/path/to/file').write(buffer);
|
|
|
|
// Directory operations
|
|
await smartfs.directory('/path').exists();
|
|
await smartfs.directory('/path').create();
|
|
```
|
|
|
|
## Project Structure
|
|
|
|
- `ts/` - Node.js server-side code (PdfService)
|
|
- `ts_web/` - Browser web components (Lit-based)
|
|
- `ts_shared/` - Shared code (translations, interfaces)
|
|
- `test/` - Test files
|