|
2 | 2 |
|
3 | 3 | ## Mission & Purpose |
4 | 4 | - `@denkiyagi/pdf-lib` extends the upstream `pdf-lib` to power PDF generation for `yagisan-reports`, a PDF report generation engine. |
5 | | -- Current focus areas: richer custom font handling via `@denkiyagi/fontkit`, groundwork for improved error handling, adding PDF encryption support, and fixing upstream bugs. |
| 5 | +- Current focus areas: richer custom font handling via `@denkiyagi/fontkit`, improved error handling, adding PDF encryption support, native ESM support, and fixing upstream bugs. |
6 | 6 | - Keep the fork aligned with upstream quality while preserving `yagisan-reports`-specific behaviors; prefer additive changes and call out intentional divergences in `MODIFICATIONS.md` or `MODIFICATION-DEVELOPMENT.md`. |
7 | 7 |
|
8 | 8 | ## Project Orientation |
9 | 9 | - `src/` – Primary TypeScript source for the library; exports must remain framework-agnostic and compatible with browsers and Node. |
10 | | -- `tests/` – Jest-powered regression coverage. |
| 10 | +- `tests/` – vitest-powered unit tests. |
11 | 11 | - `apps/` – Example and manual-test harnesses used to validate real-world document flows. |
| 12 | +- `dist/` – Build outputs (`dist/es` ESM + typings, `dist/umd` UMD bundle). |
12 | 13 | - `assets/` – Sample PDFs, fonts, and images consumed by docs and tests; treat as fixtures when updating expectations. |
13 | | -- `build/`, `rollup.config.mjs`, `tsconfig.json`, `jest.json` – Tooling scaffolding for bundling, type emission, and tests. |
14 | | -- `docs/` – Markdown/docs site material mirrored from upstream; update only when behavior changes. |
| 14 | +- `tsconfig.json`, `tsconfig.build.json`, `rollup.config.mjs`, `vitest.config.ts` – Tooling scaffolding for bundling, type emission, and tests. |
| 15 | +- `docs/` – Markdown/docs site material mirrored from upstream. CAUTION: do not rely on them; they may be outdated. |
15 | 16 | - `scratchpad/` – Throwaway experiments; do not rely on contents for production logic. |
16 | 17 |
|
17 | 18 | ## Tech Stack |
18 | 19 | - Node.js 20+ runtime, Yarn package manager. |
19 | | -- TypeScript 4.x across source and typings. |
| 20 | +- TypeScript 5.x across source and typings. |
| 21 | +- Native ES modules both for source and build outputs. |
| 22 | +- vitest for unit testing. |
20 | 23 | - Critical dependency: `@denkiyagi/fontkit` (our fork) powers font parsing, embedding, and subsetting. |
21 | 24 |
|
22 | 25 | ## Common Commands |
23 | | -- `yarn typecheck` – Checks TypeScript types across the codebase. |
24 | | -- `yarn lint` – Runs the lint rules expected by CI; fix warnings locally to avoid pipeline noise. |
| 26 | +- `yarn typecheck` – Checks TypeScript types across `src/` and `tests/`. |
| 27 | +- `yarn lint` – Runs and fixes the lint rules expected by CI. |
| 28 | +- `yarn test` – Runs the full test suite once. |
| 29 | +- `yarn build` – Builds the library into `dist/` (uses `tsconfig.build.json`). |
| 30 | +- `yarn apps:typecheck` – Checks TypeScript types across `apps/` (requires a prior build). |
25 | 31 |
|
26 | 32 | ## Helpful References |
27 | 33 | - Change log: `MODIFICATIONS.md` (what differs from upstream). |
|
0 commit comments