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.22.0
to
0.23.0
+6
-6
.turbo/turbo-build$colon$ci.log
> @contractkit/plugin-typescript@0.22.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> @contractkit/plugin-typescript@0.23.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> eslint --max-warnings=0 && pnpm run build
> @contractkit/plugin-typescript@0.22.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> @contractkit/plugin-typescript@0.23.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration

@@ -14,7 +14,7 @@

ESM Build start
ESM dist/index.js 149.45 KB
ESM dist/index.js.map 326.03 KB
ESM ⚡️ Build success in 355ms
ESM dist/index.js 149.58 KB
ESM dist/index.js.map 326.20 KB
ESM ⚡️ Build success in 341ms
DTS Build start
DTS ⚡️ Build success in 4808ms
DTS ⚡️ Build success in 4515ms
DTS dist/index.d.ts 1.82 KB
> @contractkit/plugin-typescript@0.22.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> @contractkit/plugin-typescript@0.23.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> vitest run --coverage

@@ -9,13 +9,13 @@

✓ tests/codegen-operation.test.ts (88 tests) 96ms
✓ tests/codegen-contract.test.ts (124 tests) 143ms
✓ tests/codegen-sdk.test.ts (132 tests) 162ms
✓ tests/pipeline.test.ts (25 tests) 180ms
✓ tests/codegen-contract.test.ts (124 tests) 100ms
✓ tests/codegen-sdk.test.ts (132 tests) 143ms
✓ tests/codegen-operation.test.ts (88 tests) 53ms
✓ tests/codegen-plain-types.test.ts (61 tests) 32ms
✓ tests/codegen-server.test.ts (19 tests) 27ms
✓ tests/codegen-server.test.ts (19 tests) 36ms
✓ tests/pipeline.test.ts (25 tests) 186ms
 Test Files  6 passed (6)
 Tests  449 passed (449)
 Start at  13:02:53
 Duration  6.82s (transform 4.81s, setup 0ms, import 13.71s, tests 640ms, environment 1ms)
 Start at  12:06:49
 Duration  6.12s (transform 4.90s, setup 0ms, import 11.76s, tests 549ms, environment 20ms)

@@ -26,8 +26,8 @@  % Coverage report from v8

-------------------|---------|----------|---------|---------|-------------------
All files | 79.96 | 75.1 | 83.5 | 82.56 |
src | 79.74 | 74.78 | 83.06 | 82.32 |
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
...-operation.ts | 78.13 | 74.26 | 77.77 | 79.69 | ...69-680,685-686
...lain-types.ts | 89.08 | 78.37 | 96.66 | 92.3 | ...31,243,249,301
codegen-sdk.ts | 88.07 | 82.56 | 87.32 | 91.3 | ...1106-1107,1110
codegen-sdk.ts | 88.09 | 82.56 | 87.32 | 91.32 | ...1108-1109,1112
index.ts | 60.23 | 47.91 | 63.04 | 65.37 | ...08-811,827-846

@@ -34,0 +34,0 @@ path-utils.ts | 41.04 | 31.32 | 78.57 | 42.47 | ...64-168,179-219

# @contractkit/contractkit-plugin-typescript
## 0.23.0
### Minor Changes
- ff6f8ea: Expose response headers on `SdkError`. The generated error now carries `headers: Headers` (the raw `Headers` instance from the failed response) alongside `status`, `statusText`, and `body`, so catchers can read things like `X-Request-ID`, `Retry-After`, or `WWW-Authenticate` for logging, retry logic, and rate-limit handling.
## 0.22.0

@@ -4,0 +10,0 @@

@@ -28,3 +28,3 @@

<span class="quiet">Statements</span>
<span class='fraction'>2027/2535</span>
<span class='fraction'>2028/2536</span>
</div>

@@ -48,5 +48,5 @@

<div class='fl pad1y space-right2'>
<span class="strong">82.56% </span>
<span class="strong">82.57% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1776/2151</span>
<span class='fraction'>1777/2152</span>
</div>

@@ -85,7 +85,7 @@

<td class="file medium" data-value="src"><a href="src/index.html">src</a></td>
<td data-value="79.74" class="pic medium">
<td data-value="79.75" 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.74" class="pct medium">79.74%</td>
<td data-value="2483" class="abs medium">1980/2483</td>
<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>

@@ -95,4 +95,4 @@ <td data-value="1602" class="abs medium">1198/1602</td>

<td data-value="372" class="abs high">309/372</td>
<td data-value="82.32" class="pct high">82.32%</td>
<td data-value="2105" class="abs high">1733/2105</td>
<td data-value="82.33" class="pct high">82.33%</td>
<td data-value="2106" class="abs high">1734/2106</td>
</tr>

@@ -123,3 +123,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-08T13:03:00.695Z
at 2026-05-12T12:06:55.452Z
</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-08T13:03:00.695Z
at 2026-05-12T12:06:55.452Z
</div>

@@ -988,0 +988,0 @@ <script src="../prettify.js"></script>

@@ -26,5 +26,5 @@

<div class='fl pad1y space-right2'>
<span class="strong">79.74% </span>
<span class="strong">79.75% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1980/2483</span>
<span class='fraction'>1981/2484</span>
</div>

@@ -48,5 +48,5 @@

<div class='fl pad1y space-right2'>
<span class="strong">82.32% </span>
<span class="strong">82.33% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1733/2105</span>
<span class='fraction'>1734/2106</span>
</div>

@@ -130,7 +130,7 @@

<td class="file high" data-value="codegen-sdk.ts"><a href="codegen-sdk.ts.html">codegen-sdk.ts</a></td>
<td data-value="88.07" class="pic high">
<td data-value="88.09" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 88%"></div><div class="cover-empty" style="width: 12%"></div></div>
</td>
<td data-value="88.07" class="pct high">88.07%</td>
<td data-value="629" class="abs high">554/629</td>
<td data-value="88.09" class="pct high">88.09%</td>
<td data-value="630" class="abs high">555/630</td>
<td data-value="82.56" class="pct high">82.56%</td>

@@ -140,4 +140,4 @@ <td data-value="367" class="abs high">303/367</td>

<td data-value="71" class="abs high">62/71</td>
<td data-value="91.3" class="pct high">91.3%</td>
<td data-value="552" class="abs high">504/552</td>
<td data-value="91.32" class="pct high">91.32%</td>
<td data-value="553" class="abs high">505/553</td>
</tr>

@@ -198,3 +198,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-08T13:03:00.695Z
at 2026-05-12T12:06:55.452Z
</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-08T13:03:00.695Z
at 2026-05-12T12:06:55.452Z
</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-08T13:03:00.695Z
at 2026-05-12T12:06:55.452Z
</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-08T13:03:00.695Z
at 2026-05-12T12:06:55.452Z
</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-08T13:03:00.695Z
at 2026-05-12T12:06:55.452Z
</div>

@@ -107,0 +107,0 @@ <script src="../prettify.js"></script>

@@ -1,1 +0,1 @@

{"version":3,"file":"codegen-sdk.d.ts","sourceRoot":"","sources":["../src/codegen-sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkF,MAAM,mBAAmB,CAAC;AA2DpI,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB;IAC9B,6GAA6G;IAC7G,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,8GAA8G;IAC9G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,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;IAC1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,UAAQ,GAAG,OAAO,CAOtF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAmHrF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,GAC3B;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAe5C;AAsTD,gIAAgI;AAChI,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,oGAAoG;AACpG,wBAAgB,w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AC;IACrB,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,kBAAkB;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,mIAAmI;IACnI,cAAc,EAAE,iBAAiB,CAAC;CACrC;AAED,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IAC/B,8FAA8F;IAC9F,eAAe,EAAE,aAAa,EAAE,CAAC;IACjC,iCAAiC;IACjC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC5B,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,+HAA+H;IAC/H,OAAO,EAAE,MAAM,CAAC;IAChB,0GAA0G;IAC1G,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,2EAA2E;IAC3E,cAAc,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,EAAE,CAAC;IAClE,yEAAyE;IACzE,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CA8GjE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAyCvE"}
{
"name": "@contractkit/plugin-typescript",
"version": "0.22.0",
"version": "0.23.0",
"description": "ContractKit built-in plugin: TypeScript codegen (SDK clients, Koa routers, Zod schemas, plain types)",

@@ -32,4 +32,4 @@ "author": {

"devDependencies": {
"@repo/config-eslint": "0.3.1",
"@repo/config-typescript": "0.1.0"
"@repo/config-typescript": "0.1.0",
"@repo/config-eslint": "0.3.1"
},

@@ -36,0 +36,0 @@ "scripts": {

@@ -146,3 +146,3 @@ # @contractkit/contractkit-plugin-typescript

- `SdkOptions` / `SdkFetch` / `SdkError` / `createSdkFetch` — base client primitives
- `SdkOptions` / `SdkFetch` / `SdkError` / `createSdkFetch` — base client primitives. `SdkError` is thrown on any non-2xx response and exposes `status`, `statusText`, `body`, and `headers` (the raw `Headers` instance) for downstream use.
- `buildQueryString(query)` — serialises a query params object to `?key=value` or `''`

@@ -149,0 +149,0 @@ - `parseJson<T>(res)` — deserialises a `Response` body to `T`

@@ -141,2 +141,3 @@ import type { OpRootNode, OpRouteNode, OpOperationNode, OpRequestBodyNode, ContractTypeNode, ParamSource } from '@contractkit/core';

lines.push(' public readonly body: unknown,');
lines.push(' public readonly headers: Headers,');
lines.push(' ) {');

@@ -172,3 +173,3 @@ lines.push(' super(`${status} ${statusText}`);');

lines.push(' try { body = JSON.parse(text); } catch { body = text; }');
lines.push(' throw new SdkError(res.status, res.statusText, body);');
lines.push(' throw new SdkError(res.status, res.statusText, body, res.headers);');
lines.push(' }');

@@ -890,2 +891,3 @@ lines.push(' return res;');

' public readonly body: unknown,',
' public readonly headers: Headers,',
' ) {',

@@ -937,3 +939,3 @@ ' super(`${status} ${statusText}`);',

' try { body = JSON.parse(text); } catch { body = text; }',
' throw new SdkError(res.status, res.statusText, body);',
' throw new SdkError(res.status, res.statusText, body, res.headers);',
' }',

@@ -940,0 +942,0 @@ ' return res;',

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

Sorry, the diff of this file is too big to display