@contractkit/plugin-typescript
Advanced tools
| > @contractkit/plugin-typescript@0.23.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript | ||
| > @contractkit/plugin-typescript@0.23.1 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript | ||
| > eslint --max-warnings=0 && pnpm run build | ||
| > @contractkit/plugin-typescript@0.23.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript | ||
| > @contractkit/plugin-typescript@0.23.1 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript | ||
| > tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration | ||
@@ -14,7 +14,7 @@ | ||
| [34mESM[39m Build start | ||
| [32mESM[39m [1mdist/index.js [22m[32m149.58 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m326.20 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 341ms | ||
| [32mESM[39m [1mdist/index.js [22m[32m149.66 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m326.35 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 367ms | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 4515ms | ||
| [32mDTS[39m ⚡️ Build success in 6065ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m1.82 KB[39m |
| > @contractkit/plugin-typescript@0.23.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript | ||
| > @contractkit/plugin-typescript@0.23.1 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript | ||
| > vitest run --coverage | ||
@@ -9,13 +9,13 @@ | ||
| [32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m124 tests[22m[2m)[22m[32m 100[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m 143[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m 53[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 32[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 36[2mms[22m[39m | ||
| [32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 186[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m125 tests[22m[2m)[22m[32m 78[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m 128[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m 109[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 62[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 88[2mms[22m[39m | ||
| [32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 277[2mms[22m[39m | ||
| [2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m | ||
| [2m Tests [22m [1m[32m449 passed[39m[22m[90m (449)[39m | ||
| [2m Start at [22m 12:06:49 | ||
| [2m Duration [22m 6.12s[2m (transform 4.90s, setup 0ms, import 11.76s, tests 549ms, environment 20ms)[22m | ||
| [2m Tests [22m [1m[32m450 passed[39m[22m[90m (450)[39m | ||
| [2m Start at [22m 14:28:27 | ||
| [2m Duration [22m 6.25s[2m (transform 3.59s, setup 0ms, import 11.84s, tests 741ms, environment 3ms)[22m | ||
@@ -26,5 +26,5 @@ [34m % [39m[2mCoverage report from [22m[33mv8[39m | ||
| -------------------|---------|----------|---------|---------|------------------- | ||
| All files | 79.96 | 75.1 | 83.5 | 82.57 | | ||
| src | 79.75 | 74.78 | 83.06 | 82.33 | | ||
| ...n-contract.ts | 87.83 | 82.12 | 90.08 | 88.96 | ...1069,1074-1075 | ||
| All files | 79.97 | 75.13 | 83.5 | 82.58 | | ||
| src | 79.75 | 74.81 | 83.06 | 82.34 | | ||
| ...n-contract.ts | 87.85 | 82.2 | 90.08 | 88.98 | ...1070,1075-1076 | ||
| ...-operation.ts | 78.13 | 74.26 | 77.77 | 79.69 | ...69-680,685-686 | ||
@@ -31,0 +31,0 @@ ...lain-types.ts | 89.08 | 78.37 | 96.66 | 92.3 | ...31,243,249,301 |
+6
-0
| # @contractkit/contractkit-plugin-typescript | ||
| ## 0.23.1 | ||
| ### Patch Changes | ||
| - 22c4a0b: Coerce `null` to `undefined` for optional fields in model-level `format(input=...)` / `format(output=...)` transforms, matching the existing behavior for inline objects. | ||
| ## 0.23.0 | ||
@@ -4,0 +10,0 @@ |
+12
-12
@@ -26,5 +26,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">79.96% </span> | ||
| <span class="strong">79.97% </span> | ||
| <span class="quiet">Statements</span> | ||
| <span class='fraction'>2028/2536</span> | ||
| <span class='fraction'>2029/2537</span> | ||
| </div> | ||
@@ -34,5 +34,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">75.1% </span> | ||
| <span class="strong">75.13% </span> | ||
| <span class="quiet">Branches</span> | ||
| <span class='fraction'>1228/1635</span> | ||
| <span class='fraction'>1230/1637</span> | ||
| </div> | ||
@@ -49,5 +49,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">82.57% </span> | ||
| <span class="strong">82.58% </span> | ||
| <span class="quiet">Lines</span> | ||
| <span class='fraction'>1777/2152</span> | ||
| <span class='fraction'>1778/2153</span> | ||
| </div> | ||
@@ -90,9 +90,9 @@ | ||
| <td data-value="79.75" class="pct medium">79.75%</td> | ||
| <td data-value="2484" class="abs medium">1981/2484</td> | ||
| <td data-value="74.78" class="pct medium">74.78%</td> | ||
| <td data-value="1602" class="abs medium">1198/1602</td> | ||
| <td data-value="2485" class="abs medium">1982/2485</td> | ||
| <td data-value="74.81" class="pct medium">74.81%</td> | ||
| <td data-value="1604" class="abs medium">1200/1604</td> | ||
| <td data-value="83.06" class="pct high">83.06%</td> | ||
| <td data-value="372" class="abs high">309/372</td> | ||
| <td data-value="82.33" class="pct high">82.33%</td> | ||
| <td data-value="2106" class="abs high">1734/2106</td> | ||
| <td data-value="82.34" class="pct high">82.34%</td> | ||
| <td data-value="2107" class="abs high">1735/2107</td> | ||
| </tr> | ||
@@ -123,3 +123,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-12T12:06:55.452Z | ||
| at 2026-05-12T14:28:33.558Z | ||
| </div> | ||
@@ -126,0 +126,0 @@ <script src="prettify.js"></script> |
@@ -985,3 +985,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-12T12:06:55.452Z | ||
| at 2026-05-12T14:28:33.558Z | ||
| </div> | ||
@@ -988,0 +988,0 @@ <script src="../prettify.js"></script> |
+13
-13
@@ -28,3 +28,3 @@ | ||
| <span class="quiet">Statements</span> | ||
| <span class='fraction'>1981/2484</span> | ||
| <span class='fraction'>1982/2485</span> | ||
| </div> | ||
@@ -34,5 +34,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">74.78% </span> | ||
| <span class="strong">74.81% </span> | ||
| <span class="quiet">Branches</span> | ||
| <span class='fraction'>1198/1602</span> | ||
| <span class='fraction'>1200/1604</span> | ||
| </div> | ||
@@ -49,5 +49,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">82.33% </span> | ||
| <span class="strong">82.34% </span> | ||
| <span class="quiet">Lines</span> | ||
| <span class='fraction'>1734/2106</span> | ||
| <span class='fraction'>1735/2107</span> | ||
| </div> | ||
@@ -86,13 +86,13 @@ | ||
| <td class="file high" data-value="codegen-contract.ts"><a href="codegen-contract.ts.html">codegen-contract.ts</a></td> | ||
| <td data-value="87.83" class="pic high"> | ||
| <td data-value="87.85" class="pic high"> | ||
| <div class="chart"><div class="cover-fill" style="width: 87%"></div><div class="cover-empty" style="width: 13%"></div></div> | ||
| </td> | ||
| <td data-value="87.83" class="pct high">87.83%</td> | ||
| <td data-value="674" class="abs high">592/674</td> | ||
| <td data-value="82.12" class="pct high">82.12%</td> | ||
| <td data-value="470" class="abs high">386/470</td> | ||
| <td data-value="87.85" class="pct high">87.85%</td> | ||
| <td data-value="675" class="abs high">593/675</td> | ||
| <td data-value="82.2" class="pct high">82.2%</td> | ||
| <td data-value="472" class="abs high">388/472</td> | ||
| <td data-value="90.08" class="pct high">90.08%</td> | ||
| <td data-value="121" class="abs high">109/121</td> | ||
| <td data-value="88.96" class="pct high">88.96%</td> | ||
| <td data-value="553" class="abs high">492/553</td> | ||
| <td data-value="88.98" class="pct high">88.98%</td> | ||
| <td data-value="554" class="abs high">493/554</td> | ||
| </tr> | ||
@@ -198,3 +198,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-12T12:06:55.452Z | ||
| at 2026-05-12T14:28:33.558Z | ||
| </div> | ||
@@ -201,0 +201,0 @@ <script src="../prettify.js"></script> |
@@ -733,3 +733,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-12T12:06:55.452Z | ||
| at 2026-05-12T14:28:33.558Z | ||
| </div> | ||
@@ -736,0 +736,0 @@ <script src="../prettify.js"></script> |
@@ -580,3 +580,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-12T12:06:55.452Z | ||
| at 2026-05-12T14:28:33.558Z | ||
| </div> | ||
@@ -583,0 +583,0 @@ <script src="../prettify.js"></script> |
@@ -344,7 +344,7 @@ | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">892x</span> | ||
| <span class="cline-any cline-yes">895x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">318x</span> | ||
| <span class="cline-any cline-yes">320x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -393,3 +393,3 @@ <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">257x</span> | ||
| <span class="cline-any cline-yes">259x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -406,3 +406,3 @@ <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">178x</span> | ||
| <span class="cline-any cline-yes">179x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -417,3 +417,3 @@ <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">137x</span> | ||
| <span class="cline-any cline-yes">138x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -818,3 +818,3 @@ <span class="cline-any cline-neutral"> </span> | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-12T12:06:55.452Z | ||
| at 2026-05-12T14:28:33.558Z | ||
| </div> | ||
@@ -821,0 +821,0 @@ <script src="../prettify.js"></script> |
@@ -104,3 +104,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-12T12:06:55.452Z | ||
| at 2026-05-12T14:28:33.558Z | ||
| </div> | ||
@@ -107,0 +107,0 @@ <script src="../prettify.js"></script> |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"codegen-contract.d.ts","sourceRoot":"","sources":["../src/codegen-contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,gBAAgB,EAChB,SAAS,EAET,gBAAgB,EAWhB,UAAU,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,mGAAmG;AACnG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAcpE;AAED,0EAA0E;AAC1E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA4BvG;AAmCD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CA6D/D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAgB3F;AAED,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD"} |
+1
-1
| { | ||
| "name": "@contractkit/plugin-typescript", | ||
| "version": "0.23.0", | ||
| "version": "0.23.1", | ||
| "description": "ContractKit built-in plugin: TypeScript codegen (SDK clients, Koa routers, Zod schemas, plain types)", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -303,3 +303,4 @@ import { relative, dirname } from 'node:path'; | ||
| const outputKey = applyCase(field.name, outputCase); | ||
| lines.push(` ${quoteKey(outputKey)}: data.${inputKey},`); | ||
| const val = field.optional ? `data.${inputKey} ?? undefined` : `data.${inputKey}`; | ||
| lines.push(` ${quoteKey(outputKey)}: ${val},`); | ||
| } | ||
@@ -306,0 +307,0 @@ lines.push(`}));`); |
@@ -1063,7 +1063,21 @@ import { generateContract, renderType } from '../src/codegen-contract.js'; | ||
| expect(output).toContain('grantType: data.grant_type'); | ||
| expect(output).toContain('clientId: data.client_id'); | ||
| expect(output).toContain('clientId: data.client_id ?? undefined'); | ||
| expect(output).toContain('clientSecret: data.client_secret'); | ||
| expect(output).toContain('export type Child = z.output<typeof Child>'); | ||
| }); | ||
| it('input=snake: optional fields coerce null → undefined in the transform', () => { | ||
| const root = contractRoot([ | ||
| model( | ||
| 'User', | ||
| [field('firstName', scalarType('string')), field('clientId', scalarType('uuid'), { optional: true })], | ||
| { inputCase: 'snake' }, | ||
| ), | ||
| ]); | ||
| const output = generateContract(root); | ||
| expect(output).toContain('client_id: z.uuid().nullish()'); | ||
| expect(output).toContain('firstName: data.first_name,'); | ||
| expect(output).toContain('clientId: data.client_id ?? undefined,'); | ||
| }); | ||
| }); | ||
| }); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2533395
0.07%16224
0.1%