|
| 1 | +# @etherpad/openapi-codegen |
| 2 | + |
| 3 | +Private, build-time-only package. It exists purely to pin the TypeScript that |
| 4 | +`openapi-typescript` runs against. |
| 5 | + |
| 6 | +`openapi-typescript` builds its output using the TypeScript **compiler API** |
| 7 | +(`ts.factory`, `ts.SyntaxKind`, the printer). TypeScript 7 is the native port, |
| 8 | +and its main export is only `./lib/version.cjs` — the compiler API isn't there |
| 9 | +at all, so the codegen dies with: |
| 10 | + |
| 11 | +``` |
| 12 | +TypeError: Cannot read properties of undefined (reading 'createKeywordTypeNode') |
| 13 | +``` |
| 14 | + |
| 15 | +Its declared peer range is `typescript: ^5.x`, and 7.13.0 is the newest |
| 16 | +release, so there is nothing to upgrade to yet. |
| 17 | + |
| 18 | +Pinning it from the workspace root doesn't work: `openapi-typescript` takes |
| 19 | +`typescript` as a *peer* dependency, so pnpm satisfies it from whichever |
| 20 | +package depends on it. While `admin` both depended on `openapi-typescript` |
| 21 | +and declared `typescript: ^7.0.2`, the peer always resolved to 7 — neither |
| 22 | +`overrides` nor `packageExtensions` overrides that. Giving the tool its own |
| 23 | +package, whose only TypeScript is 6.x, is what makes the peer resolve to a |
| 24 | +version with a working compiler API. |
| 25 | + |
| 26 | +The tool only runs at build time to emit `admin/src/api/schema.d.ts`, and that |
| 27 | +output is plain text which `tsc` 7 then consumes normally. Nothing here ships. |
| 28 | + |
| 29 | +**Delete this package** once `openapi-typescript` supports the native compiler: |
| 30 | +move `openapi-typescript` back into `admin`'s devDependencies and point |
| 31 | +`admin/scripts/gen-api.mjs` at it directly. |
0 commit comments