Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@contractkit/plugin-typescript

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contractkit/plugin-typescript - npm Package Compare versions

Comparing version
0.25.3
to
0.25.4
+4
-4
.turbo/turbo-build$colon$ci.log

@@ -8,7 +8,7 @@ $ eslint --max-warnings=0 && pnpm run build

ESM Build start
ESM dist/index.js 149.89 KB
ESM dist/index.js.map 327.56 KB
ESM ⚡️ Build success in 392ms
ESM dist/index.js 150.24 KB
ESM dist/index.js.map 328.17 KB
ESM ⚡️ Build success in 444ms
DTS Build start
DTS ⚡️ Build success in 5194ms
DTS ⚡️ Build success in 6175ms
DTS dist/index.d.ts 1.82 KB

@@ -6,13 +6,13 @@ $ vitest run --coverage

✓ tests/codegen-sdk.test.ts (132 tests) 227ms
✓ tests/codegen-operation.test.ts (88 tests) 154ms
✓ tests/codegen-contract.test.ts (127 tests) 180ms
✓ tests/codegen-plain-types.test.ts (61 tests) 40ms
✓ tests/pipeline.test.ts (25 tests) 173ms
✓ tests/codegen-server.test.ts (19 tests) 39ms
✓ tests/codegen-sdk.test.ts (132 tests) 231ms
✓ tests/codegen-operation.test.ts (88 tests) 186ms
✓ tests/codegen-contract.test.ts (127 tests) 163ms
✓ tests/codegen-server.test.ts (19 tests) 90ms
✓ tests/codegen-plain-types.test.ts (61 tests) 63ms
✓ tests/pipeline.test.ts (25 tests) 242ms
 Test Files  6 passed (6)
 Tests  452 passed (452)
 Start at  13:20:47
 Duration  7.42s (transform 6.23s, setup 0ms, import 15.65s, tests 813ms, environment 1ms)
 Start at  13:07:26
 Duration  7.02s (transform 3.96s, setup 0ms, import 13.06s, tests 975ms, environment 1ms)

@@ -23,6 +23,6 @@  % Coverage report from v8

-------------------|---------|----------|---------|---------|-------------------
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

# @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 @@

@@ -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>

@@ -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"}
{
"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