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.19.1
to
0.20.0
+6
-6
.turbo/turbo-build$colon$ci.log
> @contractkit/plugin-typescript@0.19.1 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> @contractkit/plugin-typescript@0.20.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> eslint --max-warnings=0 && pnpm run build
> @contractkit/plugin-typescript@0.19.1 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> @contractkit/plugin-typescript@0.20.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 145.87 KB
ESM dist/index.js.map 317.00 KB
ESM ⚡️ Build success in 429ms
ESM dist/index.js 146.20 KB
ESM dist/index.js.map 317.95 KB
ESM ⚡️ Build success in 371ms
DTS Build start
DTS ⚡️ Build success in 5070ms
DTS ⚡️ Build success in 6464ms
DTS dist/index.d.ts 1.82 KB
> @contractkit/plugin-typescript@0.19.1 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> @contractkit/plugin-typescript@0.20.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
> vitest run --coverage

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

✓ tests/codegen-contract.test.ts (124 tests) 95ms
✓ tests/codegen-sdk.test.ts (131 tests) 179ms
✓ tests/codegen-operation.test.ts (88 tests) 62ms
✓ tests/codegen-plain-types.test.ts (61 tests) 39ms
✓ tests/codegen-server.test.ts (19 tests) 84ms
✓ tests/pipeline.test.ts (25 tests) 217ms
✓ tests/codegen-operation.test.ts (88 tests) 265ms
✓ tests/codegen-sdk.test.ts (131 tests) 333ms
✓ tests/codegen-contract.test.ts (124 tests) 184ms
✓ tests/codegen-plain-types.test.ts (61 tests) 56ms
✓ tests/pipeline.test.ts (25 tests) 281ms
✓ tests/codegen-server.test.ts (19 tests) 37ms
 Test Files  6 passed (6)
 Tests  448 passed (448)
 Start at  11:16:36
 Duration  7.07s (transform 4.48s, setup 0ms, import 13.30s, tests 677ms, environment 20ms)
 Start at  11:38:17
 Duration  6.86s (transform 3.00s, setup 0ms, import 12.86s, tests 1.16s, environment 9ms)

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

-------------------|---------|----------|---------|---------|-------------------
All files | 79.96 | 75.35 | 83.41 | 82.44 |
src | 79.74 | 75.03 | 82.97 | 82.19 |
All files | 80 | 75.35 | 83.45 | 82.47 |
src | 79.77 | 75.03 | 83.01 | 82.23 |
...n-contract.ts | 87.83 | 82.12 | 90.08 | 88.96 | ...1069,1074-1075

@@ -33,3 +33,3 @@ ...-operation.ts | 78.18 | 74.26 | 78.08 | 79.69 | ...68-679,684-685

codegen-sdk.ts | 88.26 | 83.01 | 87.14 | 91.22 | ...1087-1088,1091
index.ts | 58.17 | 47.22 | 63.04 | 62.78 | ...48-751,757-776
index.ts | 58.69 | 47.22 | 63.82 | 63.33 | ...51-754,770-789
path-utils.ts | 36.52 | 27.53 | 75 | 38.14 | ...32-136,147-187

@@ -36,0 +36,0 @@ ts-render.ts | 82.19 | 85.39 | 72.22 | 87.09 | 56,90,126,157-165

# @contractkit/contractkit-plugin-typescript
## 0.20.0
### Minor Changes
- 4ac6d4d: Move plugin incremental-build manifests under the CLI cache directory (default `.contractkit/cache/`, configurable via `config.cache.dir`). Bruno's `.contractkit-bruno-manifest.json` (in the bruno-collection dir), Python's `.contractkit-python-manifest.json` (in the python-sdk dir), and TypeScript's `.contractkit-typescript-manifest.json` (at rootDir) now all live as `bruno-manifest.json` / `python-manifest.json` / `typescript-manifest.json` under `ctx.cacheDir`, alongside the CLI's existing `build.json` and HTTP cache. Output dirs no longer contain build state.
`PluginContext` gains a `cacheDir: string` field. `runIncrementalCodegen` no longer takes a `manifestFilename` argument and no longer bundles the manifest into `filesToWrite` — the result's `manifest` is returned separately so plugins can persist it wherever they want. New helper `serializeIncrementalManifest(manifest)` produces the JSON form.
After upgrading, the old in-output manifests can be deleted manually (or with `--force`); plugins will simply do a full regen on the first run since they won't find a manifest at the new path.
### Patch Changes
- Updated dependencies [4ac6d4d]
- @contractkit/core@0.16.0
## 0.19.1

@@ -4,0 +19,0 @@

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

<div class='fl pad1y space-right2'>
<span class="strong">79.96% </span>
<span class="strong">80% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1992/2491</span>
<span class='fraction'>1996/2495</span>
</div>

@@ -41,5 +41,5 @@

<div class='fl pad1y space-right2'>
<span class="strong">83.41% </span>
<span class="strong">83.45% </span>
<span class="quiet">Functions</span>
<span class='fraction'>332/398</span>
<span class='fraction'>333/399</span>
</div>

@@ -49,5 +49,5 @@

<div class='fl pad1y space-right2'>
<span class="strong">82.44% </span>
<span class="strong">82.47% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1742/2113</span>
<span class='fraction'>1746/2117</span>
</div>

@@ -67,3 +67,3 @@

</div>
<div class='status-line medium'></div>
<div class='status-line high'></div>
<div class="pad1">

@@ -87,13 +87,13 @@ <table class="coverage-summary">

<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.77" 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="2439" class="abs medium">1945/2439</td>
<td data-value="79.77" class="pct medium">79.77%</td>
<td data-value="2443" class="abs medium">1949/2443</td>
<td data-value="75.03" class="pct medium">75.03%</td>
<td data-value="1586" class="abs medium">1190/1586</td>
<td data-value="82.97" class="pct high">82.97%</td>
<td data-value="370" class="abs high">307/370</td>
<td data-value="82.19" class="pct high">82.19%</td>
<td data-value="2067" class="abs high">1699/2067</td>
<td data-value="83.01" class="pct high">83.01%</td>
<td data-value="371" class="abs high">308/371</td>
<td data-value="82.23" class="pct high">82.23%</td>
<td data-value="2071" class="abs high">1703/2071</td>
</tr>

@@ -124,3 +124,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:43.674Z
at 2026-05-07T11:38:24.644Z
</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-07T11:16:43.674Z
at 2026-05-07T11:38:24.644Z
</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.77% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1945/2439</span>
<span class='fraction'>1949/2443</span>
</div>

@@ -41,5 +41,5 @@

<div class='fl pad1y space-right2'>
<span class="strong">82.97% </span>
<span class="strong">83.01% </span>
<span class="quiet">Functions</span>
<span class='fraction'>307/370</span>
<span class='fraction'>308/371</span>
</div>

@@ -49,5 +49,5 @@

<div class='fl pad1y space-right2'>
<span class="strong">82.19% </span>
<span class="strong">82.23% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1699/2067</span>
<span class='fraction'>1703/2071</span>
</div>

@@ -146,13 +146,13 @@

<td class="file medium" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
<td data-value="58.17" class="pic medium">
<td data-value="58.69" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 58%"></div><div class="cover-empty" style="width: 42%"></div></div>
</td>
<td data-value="58.17" class="pct medium">58.17%</td>
<td data-value="318" class="abs medium">185/318</td>
<td data-value="58.69" class="pct medium">58.69%</td>
<td data-value="322" class="abs medium">189/322</td>
<td data-value="47.22" class="pct low">47.22%</td>
<td data-value="144" class="abs low">68/144</td>
<td data-value="63.04" class="pct medium">63.04%</td>
<td data-value="46" class="abs medium">29/46</td>
<td data-value="62.78" class="pct medium">62.78%</td>
<td data-value="266" class="abs medium">167/266</td>
<td data-value="63.82" class="pct medium">63.82%</td>
<td data-value="47" class="abs medium">30/47</td>
<td data-value="63.33" class="pct medium">63.33%</td>
<td data-value="270" class="abs medium">171/270</td>
</tr>

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

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:43.674Z
at 2026-05-07T11:38:24.644Z
</div>

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

@@ -637,3 +637,3 @@

<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-05-07T11:16:43.674Z
at 2026-05-07T11:38:24.644Z
</div>

@@ -640,0 +640,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-07T11:16:43.674Z
at 2026-05-07T11:38:24.644Z
</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-07T11:16:43.674Z
at 2026-05-07T11:38:24.644Z
</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-07T11:16:43.674Z
at 2026-05-07T11:38:24.644Z
</div>

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

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

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,iBAAiB,EAQpB,MAAM,mBAAmB,CAAC;AAqC3B,MAAM,WAAW,YAAY;IACzB,wFAAwF;IACxF,OAAO,CAAC,EAA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AAM,CAAC;AAO9C,QAAA,MAAM,MAAM,EAAE,iBAMb,CAAC;AAEF,eAAe,MAAM,CAAC;AAEtB,2GAA2G;AAC3G,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAOzG"}
{
"name": "@contractkit/plugin-typescript",
"version": "0.19.1",
"version": "0.20.0",
"description": "ContractKit built-in plugin: TypeScript codegen (SDK clients, Koa routers, Zod schemas, plain types)",

@@ -29,7 +29,7 @@ "author": {

"dependencies": {
"@contractkit/core": "0.15.1"
"@contractkit/core": "0.16.0"
},
"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": {

import { resolve, join, relative, dirname, basename } from 'node:path';
import { existsSync, readFileSync, rmSync, readdirSync, rmdirSync } from 'node:fs';
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync, readdirSync, rmdirSync } from 'node:fs';
import { generateContract } from './codegen-contract.js';

@@ -19,2 +19,3 @@ import { generateOp } from './codegen-operation.js';

emptyIncrementalManifest,
serializeIncrementalManifest,
hashFingerprint,

@@ -103,3 +104,4 @@ collectTransitiveModelRefs,

const MANIFEST_FILENAME = '.contractkit-typescript-manifest.json';
/** Filename for the persisted TypeScript manifest under the CLI cache directory. */
const CACHE_MANIFEST_FILENAME = 'typescript-manifest.json';

@@ -142,3 +144,3 @@ // ─── Plugin entry points ──────────────────────────────────────────────────

): Promise<void> {
const manifestPath = resolve(rootDir, MANIFEST_FILENAME);
const manifestPath = resolve(ctx.cacheDir, CACHE_MANIFEST_FILENAME);
const prevManifest: IncrementalManifest = ctx.cacheEnabled ? readManifest(manifestPath) : emptyIncrementalManifest(TYPESCRIPT_CODEGEN_VERSION);

@@ -156,3 +158,2 @@

codegenVersion: TYPESCRIPT_CODEGEN_VERSION,
manifestFilename: manifestPath,
prevManifest,

@@ -170,2 +171,4 @@ globalFiles,

}
writeManifest(manifestPath, result.manifest);
}

@@ -760,2 +763,12 @@

/** Write the manifest to `manifestPath`. Creates parent dirs as needed. Errors are swallowed so a broken cache never blocks the build. */
function writeManifest(manifestPath: string, manifest: IncrementalManifest): void {
try {
mkdirSync(dirname(manifestPath), { recursive: true });
writeFileSync(manifestPath, serializeIncrementalManifest(manifest), 'utf-8');
} catch {
// best-effort
}
}
function deleteStalePaths(absPaths: string[]): void {

@@ -762,0 +775,0 @@ if (absPaths.length === 0) return;

@@ -14,2 +14,3 @@ import { describe, it, expect } from 'vitest';

cacheEnabled: true,
cacheDir: `${rootDir}/.contractkit/cache`,
emitFile: (outPath: string, content: string) => {

@@ -16,0 +17,0 @@ emitted.set(outPath, content);

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