@contractkit/plugin-typescript
Advanced tools
@@ -8,7 +8,7 @@ $ eslint --max-warnings=0 && pnpm run build | ||
| [34mESM[39m Build start | ||
| [32mESM[39m [1mdist/index.js [22m[32m149.89 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m327.56 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 392ms | ||
| [32mESM[39m [1mdist/index.js [22m[32m150.24 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m328.17 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 444ms | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 5194ms | ||
| [32mDTS[39m ⚡️ Build success in 6175ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m1.82 KB[39m |
@@ -6,13 +6,13 @@ $ vitest run --coverage | ||
| [32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m 227[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m 154[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m127 tests[22m[2m)[22m[32m 180[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 40[2mms[22m[39m | ||
| [32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 173[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 39[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m 231[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m 186[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m127 tests[22m[2m)[22m[32m 163[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 90[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 63[2mms[22m[39m | ||
| [32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 242[2mms[22m[39m | ||
| [2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m | ||
| [2m Tests [22m [1m[32m452 passed[39m[22m[90m (452)[39m | ||
| [2m Start at [22m 13:20:47 | ||
| [2m Duration [22m 7.42s[2m (transform 6.23s, setup 0ms, import 15.65s, tests 813ms, environment 1ms)[22m | ||
| [2m Start at [22m 13:07:26 | ||
| [2m Duration [22m 7.02s[2m (transform 3.96s, setup 0ms, import 13.06s, tests 975ms, environment 1ms)[22m | ||
@@ -23,6 +23,6 @@ [34m % [39m[2mCoverage report from [22m[33mv8[39m | ||
| -------------------|---------|----------|---------|---------|------------------- | ||
| All files | 80 | 75.28 | 83.5 | 82.6 | | ||
| src | 79.78 | 74.96 | 83.06 | 82.36 | | ||
| All files | 80.04 | 75.34 | 83.66 | 82.63 | | ||
| src | 79.83 | 75.03 | 83.24 | 82.4 | | ||
| ...n-contract.ts | 87.92 | 82.7 | 90.08 | 89.06 | ...1085,1090-1091 | ||
| ...-operation.ts | 78.09 | 74.26 | 77.77 | 79.64 | ...73-684,689-690 | ||
| ...-operation.ts | 78.37 | 74.56 | 78.94 | 79.85 | ...77-688,693-694 | ||
| ...lain-types.ts | 89.08 | 78.37 | 96.66 | 92.3 | ...31,243,249,301 | ||
@@ -29,0 +29,0 @@ codegen-sdk.ts | 88.09 | 82.56 | 87.32 | 91.32 | ...1108-1109,1112 |
+6
-0
| # @contractkit/contractkit-plugin-typescript | ||
| ## 0.25.4 | ||
| ### Patch Changes | ||
| - c5e74a3: Emit the missing `import { MultipartBody } from '@maroonedsoftware/multipart'` in generated Koa routers when an operation declares a `multipart/form-data` request body. | ||
| ## 0.25.3 | ||
@@ -4,0 +10,0 @@ |
+18
-18
@@ -26,5 +26,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">80% </span> | ||
| <span class="strong">80.04% </span> | ||
| <span class="quiet">Statements</span> | ||
| <span class='fraction'>2032/2540</span> | ||
| <span class='fraction'>2038/2546</span> | ||
| </div> | ||
@@ -34,5 +34,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">75.28% </span> | ||
| <span class="strong">75.34% </span> | ||
| <span class="quiet">Branches</span> | ||
| <span class='fraction'>1234/1639</span> | ||
| <span class='fraction'>1238/1643</span> | ||
| </div> | ||
@@ -42,5 +42,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">83.5% </span> | ||
| <span class="strong">83.66% </span> | ||
| <span class="quiet">Functions</span> | ||
| <span class='fraction'>334/400</span> | ||
| <span class='fraction'>338/404</span> | ||
| </div> | ||
@@ -50,5 +50,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">82.6% </span> | ||
| <span class="strong">82.63% </span> | ||
| <span class="quiet">Lines</span> | ||
| <span class='fraction'>1781/2156</span> | ||
| <span class='fraction'>1785/2160</span> | ||
| </div> | ||
@@ -87,13 +87,13 @@ | ||
| <td class="file medium" data-value="src"><a href="src/index.html">src</a></td> | ||
| <td data-value="79.78" class="pic medium"> | ||
| <td data-value="79.83" class="pic medium"> | ||
| <div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div> | ||
| </td> | ||
| <td data-value="79.78" class="pct medium">79.78%</td> | ||
| <td data-value="2488" class="abs medium">1985/2488</td> | ||
| <td data-value="74.96" class="pct medium">74.96%</td> | ||
| <td data-value="1606" class="abs medium">1204/1606</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.36" class="pct high">82.36%</td> | ||
| <td data-value="2110" class="abs high">1738/2110</td> | ||
| <td data-value="79.83" class="pct medium">79.83%</td> | ||
| <td data-value="2494" class="abs medium">1991/2494</td> | ||
| <td data-value="75.03" class="pct medium">75.03%</td> | ||
| <td data-value="1610" class="abs medium">1208/1610</td> | ||
| <td data-value="83.24" class="pct high">83.24%</td> | ||
| <td data-value="376" class="abs high">313/376</td> | ||
| <td data-value="82.4" class="pct high">82.4%</td> | ||
| <td data-value="2114" class="abs high">1742/2114</td> | ||
| </tr> | ||
@@ -124,3 +124,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-17T13:20:54.468Z | ||
| at 2026-06-03T13:07:33.231Z | ||
| </div> | ||
@@ -127,0 +127,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-17T13:20:54.468Z | ||
| at 2026-06-03T13:07:33.231Z | ||
| </div> | ||
@@ -988,0 +988,0 @@ <script src="../prettify.js"></script> |
+18
-18
@@ -26,5 +26,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">79.78% </span> | ||
| <span class="strong">79.83% </span> | ||
| <span class="quiet">Statements</span> | ||
| <span class='fraction'>1985/2488</span> | ||
| <span class='fraction'>1991/2494</span> | ||
| </div> | ||
@@ -34,5 +34,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">74.96% </span> | ||
| <span class="strong">75.03% </span> | ||
| <span class="quiet">Branches</span> | ||
| <span class='fraction'>1204/1606</span> | ||
| <span class='fraction'>1208/1610</span> | ||
| </div> | ||
@@ -42,5 +42,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">83.06% </span> | ||
| <span class="strong">83.24% </span> | ||
| <span class="quiet">Functions</span> | ||
| <span class='fraction'>309/372</span> | ||
| <span class='fraction'>313/376</span> | ||
| </div> | ||
@@ -50,5 +50,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">82.36% </span> | ||
| <span class="strong">82.4% </span> | ||
| <span class="quiet">Lines</span> | ||
| <span class='fraction'>1738/2110</span> | ||
| <span class='fraction'>1742/2114</span> | ||
| </div> | ||
@@ -102,13 +102,13 @@ | ||
| <td class="file medium" data-value="codegen-operation.ts"><a href="codegen-operation.ts.html">codegen-operation.ts</a></td> | ||
| <td data-value="78.09" class="pic medium"> | ||
| <td data-value="78.37" class="pic medium"> | ||
| <div class="chart"><div class="cover-fill" style="width: 78%"></div><div class="cover-empty" style="width: 22%"></div></div> | ||
| </td> | ||
| <td data-value="78.09" class="pct medium">78.09%</td> | ||
| <td data-value="461" class="abs medium">360/461</td> | ||
| <td data-value="74.26" class="pct medium">74.26%</td> | ||
| <td data-value="338" class="abs medium">251/338</td> | ||
| <td data-value="77.77" class="pct medium">77.77%</td> | ||
| <td data-value="72" class="abs medium">56/72</td> | ||
| <td data-value="79.64" class="pct medium">79.64%</td> | ||
| <td data-value="398" class="abs medium">317/398</td> | ||
| <td data-value="78.37" class="pct medium">78.37%</td> | ||
| <td data-value="467" class="abs medium">366/467</td> | ||
| <td data-value="74.56" class="pct medium">74.56%</td> | ||
| <td data-value="342" class="abs medium">255/342</td> | ||
| <td data-value="78.94" class="pct medium">78.94%</td> | ||
| <td data-value="76" class="abs medium">60/76</td> | ||
| <td data-value="79.85" class="pct medium">79.85%</td> | ||
| <td data-value="402" class="abs medium">321/402</td> | ||
| </tr> | ||
@@ -199,3 +199,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-17T13:20:54.468Z | ||
| at 2026-06-03T13:07:33.231Z | ||
| </div> | ||
@@ -202,0 +202,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-17T13:20:54.468Z | ||
| at 2026-06-03T13:07:33.231Z | ||
| </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-17T13:20:54.468Z | ||
| at 2026-06-03T13:07:33.231Z | ||
| </div> | ||
@@ -583,0 +583,0 @@ <script src="../prettify.js"></script> |
@@ -814,3 +814,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-05-17T13:20:54.468Z | ||
| at 2026-06-03T13:07:33.231Z | ||
| </div> | ||
@@ -817,0 +817,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-17T13:20:54.468Z | ||
| at 2026-06-03T13:07:33.231Z | ||
| </div> | ||
@@ -107,0 +107,0 @@ <script src="../prettify.js"></script> |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"codegen-operation.d.ts","sourceRoot":"","sources":["../src/codegen-operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAgC,gBAAgB,EAA2B,MAAM,mBAAmB,CAAC;AAmC7H;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAkE5F;AAID,MAAM,WAAW,gBAAgB;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,qFAAqF;IACrF,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,yHAAyH;AACzH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAwEnF"} | ||
| {"version":3,"file":"codegen-operation.d.ts","sourceRoot":"","sources":["../src/codegen-operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAgC,gBAAgB,EAA2B,MAAM,mBAAmB,CAAC;AAmC7H;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAkE5F;AAID,MAAM,WAAW,gBAAgB;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,qFAAqF;IACrF,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,yHAAyH;AACzH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CA4EnF"} |
+3
-3
| { | ||
| "name": "@contractkit/plugin-typescript", | ||
| "version": "0.25.3", | ||
| "version": "0.25.4", | ||
| "description": "ContractKit built-in plugin: TypeScript codegen (SDK clients, Koa routers, Zod schemas, plain types)", | ||
@@ -32,4 +32,4 @@ "author": { | ||
| "devDependencies": { | ||
| "@repo/config-typescript": "0.1.0", | ||
| "@repo/config-eslint": "0.3.1" | ||
| "@repo/config-eslint": "0.3.1", | ||
| "@repo/config-typescript": "0.1.0" | ||
| }, | ||
@@ -36,0 +36,0 @@ "scripts": { |
@@ -163,2 +163,6 @@ import type { OpRootNode, OpRouteNode, OpOperationNode, ContractTypeNode, ParamSource, ObjectMode } from '@contractkit/core'; | ||
| if (fileUsesMultipart(root)) { | ||
| body.push(`import { MultipartBody } from '@maroonedsoftware/multipart';`); | ||
| } | ||
| const helpers: string[] = []; | ||
@@ -777,2 +781,8 @@ if (opNeedsScalar(root, 'binary')) { | ||
| function fileUsesMultipart(root: OpRootNode): boolean { | ||
| return root.routes.some(route => | ||
| route.operations.some(op => (op.request?.bodies ?? []).some(b => b.contentType === 'multipart/form-data')), | ||
| ); | ||
| } | ||
| function isValidIdentifier(name: string): boolean { | ||
@@ -779,0 +789,0 @@ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name); |
@@ -196,2 +196,3 @@ import { describe, it, expect } from 'vitest'; | ||
| expect(output).toContain('body = await parseAndValidate(ctx.body, UploadMeta)'); | ||
| expect(output).toContain("import { MultipartBody } from '@maroonedsoftware/multipart';"); | ||
| }); | ||
@@ -475,2 +476,3 @@ }); | ||
| expect(output).toContain('ctx.body as MultipartBody'); | ||
| expect(output).toContain("import { MultipartBody } from '@maroonedsoftware/multipart';"); | ||
| }); | ||
@@ -477,0 +479,0 @@ }); |
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
2550401
0.21%16313
0.16%