Repository navigation
Commit dbd7e42
authored
fix(codegen-ts): drop dprint-node from the CLI install (#579)
* fix(cli): stop installing dprint-node with every CLI install
ts-poet requires dprint-node (about 25 MB of platform binaries) at module
load. Vendor ts-poet's printer as codegen-ts/src/poet.ts (Apache-2.0,
licence kept) and format with the same dprint TypeScript plugin, 0.87.1,
through its WebAssembly build (@dprint/typescript + @dprint/formatter).
Output is byte-identical: every codegen golden and conformance fixture
is unchanged.
poet.ts is an engine module, so owned and ejected templates take Code
from @metaobjectsdev/codegen-ts/engine and class identity holds. The
config loader still maps a legacy bare ts-poet import to that entry.
check-peer-ranges now refuses dprint-node, ts-poet and @types/* in a
published package's dependencies or required peers unless allowlisted.
No published package declared @types/*; @types/node arrives only
through the libSQL driver, which is out of scope.
Fresh CLI install: 151 MB (134,525,165 bytes) -> 133 MB (115,177,311 bytes).
* docs(changelog): note the standalone binary no longer crashes on dprint-node
* fix(codegen-ts): address review of the vendored printer
- A formatter that fails to load now throws instead of silently
emitting unformatted code; only a format error falls back.
- The CLI pins @metaobjectsdev/codegen-ts/engine to the same build
(dist vs src) as the package root, so both reach one poet.ts.
- The engine entry re-exports only code/imp/joinCode/Import/Code from
the printer, as it did from ts-poet.
- Restore ts-poet's toString() call for non-plain placeholders.
- Refresh the index.ts comment and narrow the CHANGELOG claims about
legacy ts-poet imports and the standalone binary.
* refactor: drop unused printer helpers; reuse the workspace walk in the peer guard
Remove asOneline/oneline, Import.fromMaybeString and arrayOf from the
vendored printer (no callers). check-peer-ranges enumerates packages
through publish-set.mjs's enumerateWorkspacePackages instead of its own
readdir walk.
* fix(codegen-ts): import-path.ts takes the vendored printer; refresh install numbers after #567
* no-mistakes(review): guard: refuse install-only deps via optionalDependencies; add real-check tests
* no-mistakes(review): apply reviewer inline fixes
* no-mistakes(review): wire peer-ranges guard test into gate_peer_ranges lane
* no-mistakes(test): apply changes made during test validation
* no-mistakes(document): Doc sync: ts-poet printer, guard, binary1 parent c3455eb commit dbd7e42
53 files changed
Lines changed: 1140 additions & 160 deletions
File tree
- docs/features
- fixtures/generator-registry-conformance
- scripts
- server/typescript/packages
- cli
- src/lib
- test
- codegen-ts-angular
- src/templates
- codegen-ts-react
- src/templates
- codegen-ts-tanstack
- src/templates
- codegen-ts
- src
- templates
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
129 | 154 | | |
130 | 155 | | |
131 | 156 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments