@contractkit/plugin-typescript 0.17.5 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
 
2
- > @contractkit/plugin-typescript@0.17.5 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
2
+ > @contractkit/plugin-typescript@0.19.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
3
3
  > eslint --max-warnings=0 && pnpm run build
4
4
 
5
5
 
6
- > @contractkit/plugin-typescript@0.17.5 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
6
+ > @contractkit/plugin-typescript@0.19.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
7
7
  > tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
8
8
 
9
9
  CLI Building entry: src/index.ts
@@ -11,9 +11,9 @@
11
11
  CLI tsup v8.5.1
12
12
  CLI Target: esnext
13
13
  ESM Build start
14
- ESM dist/index.js 126.39 KB
15
- ESM dist/index.js.map 274.93 KB
16
- ESM ⚡️ Build success in 349ms
14
+ ESM dist/index.js 145.87 KB
15
+ ESM dist/index.js.map 317.00 KB
16
+ ESM ⚡️ Build success in 449ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 5193ms
19
- DTS dist/index.d.ts 3.44 KB
18
+ DTS ⚡️ Build success in 6617ms
19
+ DTS dist/index.d.ts 1.82 KB
@@ -1,35 +1,35 @@
1
1
 
2
- > @contractkit/plugin-typescript@0.17.5 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
2
+ > @contractkit/plugin-typescript@0.19.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
3
3
  > vitest run --coverage
4
4
 
5
5
 
6
6
   RUN  v4.1.5 /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
7
7
  Coverage enabled with v8
8
8
 
9
- ✓ tests/codegen-contract.test.ts (124 tests) 98ms
10
- ✓ tests/codegen-operation.test.ts (88 tests) 134ms
11
- ✓ tests/codegen-sdk.test.ts (123 tests) 127ms
12
- ✓ tests/codegen-server.test.ts (15 tests) 26ms
13
- ✓ tests/codegen-plain-types.test.ts (61 tests) 38ms
14
- ✓ tests/pipeline.test.ts (25 tests) 185ms
9
+ ✓ tests/codegen-contract.test.ts (124 tests) 300ms
10
+ ✓ tests/codegen-operation.test.ts (88 tests) 264ms
11
+ ✓ tests/codegen-sdk.test.ts (131 tests) 201ms
12
+ ✓ tests/codegen-plain-types.test.ts (61 tests) 34ms
13
+ ✓ tests/pipeline.test.ts (25 tests) 198ms
14
+ ✓ tests/codegen-server.test.ts (19 tests) 28ms
15
15
 
16
16
   Test Files  6 passed (6)
17
-  Tests  436 passed (436)
18
-  Start at  12:37:07
19
-  Duration  6.66s (transform 3.78s, setup 0ms, import 13.89s, tests 608ms, environment 9ms)
17
+  Tests  448 passed (448)
18
+  Start at  11:09:07
19
+  Duration  7.56s (transform 4.43s, setup 0ms, import 15.37s, tests 1.02s, environment 1ms)
20
20
 
21
21
   % Coverage report from v8
22
22
  -------------------|---------|----------|---------|---------|-------------------
23
23
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
24
24
  -------------------|---------|----------|---------|---------|-------------------
25
- All files | 77.84 | 74.45 | 82.5 | 79.74 |
26
- src | 77.54 | 74.08 | 81.92 | 79.4 |
25
+ All files | 79.96 | 75.35 | 83.41 | 82.44 |
26
+ src | 79.74 | 75.03 | 82.97 | 82.19 |
27
27
  ...n-contract.ts | 87.83 | 82.12 | 90.08 | 88.96 | ...1069,1074-1075
28
28
  ...-operation.ts | 78.18 | 74.26 | 78.08 | 79.69 | ...68-679,684-685
29
29
  ...lain-types.ts | 89.08 | 78.37 | 96.66 | 92.3 | ...31,243,249,301
30
- codegen-sdk.ts | 88.75 | 83.6 | 85 | 91.49 | ...23,678,712-729
31
- index.ts | 23.35 | 19.51 | 33.33 | 25.69 | ...97,415,418,421
32
- path-utils.ts | 23.47 | 18.84 | 58.33 | 23.71 | ...1,54-55,80-187
30
+ codegen-sdk.ts | 88.26 | 83.01 | 87.14 | 91.22 | ...1087-1088,1091
31
+ index.ts | 58.17 | 47.22 | 63.04 | 62.78 | ...48-751,757-776
32
+ path-utils.ts | 36.52 | 27.53 | 75 | 38.14 | ...32-136,147-187
33
33
  ts-render.ts | 82.19 | 85.39 | 72.22 | 87.09 | 56,90,126,157-165
34
34
  tests | 90.38 | 90.9 | 89.28 | 93.47 |
35
35
  helpers.ts | 90.38 | 90.9 | 89.28 | 93.47 | 110-118
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @contractkit/contractkit-plugin-typescript
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 10ca07b: Add per-output incremental caching to the Bruno, Python, and TypeScript plugins. Editing a single contract or operation no longer regenerates every output file — only the units whose transitive inputs actually changed are re-rendered, with the rest reused from a per-plugin manifest. `@contractkit/core` exposes the shared utility (`runIncrementalCodegen`, `parseIncrementalManifest`, `hashFingerprint`, `collectTransitiveModelRefs`, manifest types) for plugin authors. `PluginContext` gains a `cacheEnabled` flag so plugins can honor `--force` / `cache: false`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [10ca07b]
12
+ - @contractkit/core@0.15.0
13
+
14
+ ## 0.18.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 6f8e3b6: Group TypeScript SDK clients by `keys.area` and `keys.subarea`. Files declaring `subarea` produce a leaf `<Area><Subarea>Client` exposed at `sdk.<area>.<subarea>`; area-only files (no subarea) inline their methods directly onto a synthesized `<Area>Client` and surface as `sdk.<area>.<method>`. Files with no area keep the legacy flat `sdk.<filename>` shape.
19
+
20
+ `{subarea}` is a new path-template variable on `output.clients` and `output.types`, enabling layouts like `src/{area}/{subarea}.client.ts`. Multiple area-level files merging into one client throw a codegen-time error if any method names collide — disambiguate with `sdk:` or move into a subarea.
21
+
22
+ Breaking: area-level files no longer emit a standalone `*.client.ts` (their methods live on the area client in `sdk.ts`). The `generateSdkAggregator` signature now takes a structured `SdkAggregatorInput` rather than `(clients, importPath?, className?)`.
23
+
3
24
  ## 0.17.5
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -104,6 +104,7 @@ Output paths support the following variables:
104
104
  | `{filename}` | Base name of the `.ck` source file (without extension) |
105
105
  | `{dir}` | Relative directory of the `.ck` source file |
106
106
  | `{area}` | Value of the `area` key from the `options` block |
107
+ | `{subarea}` | Value of the `subarea` key from the `options` block |
107
108
  | `{name}` | The `name` option from the SDK sub-config |
108
109
 
109
110
  ## What gets generated
@@ -124,7 +125,15 @@ Each operation file generates one Koa router. Request bodies and path/query para
124
125
 
125
126
  ### SDK client shape (from `operation`)
126
127
 
127
- Each operation file generates one client class. The aggregator SDK class (in `output.sdk`) instantiates all clients and exposes them as properties.
128
+ Operation files cluster on the SDK based on `keys.area` and `keys.subarea` (set in each file's `options { keys: { ... } }` block):
129
+
130
+ | File metadata | Generated layout |
131
+ | --- | --- |
132
+ | `area: identity, subarea: invitations` | leaf `IdentityInvitationsClient` emitted as `<output.clients>` (path can use `{subarea}`); aggregator wires it as `sdk.identity.invitations` |
133
+ | `area: identity` (no subarea) | methods inlined directly on `IdentityClient` (no standalone `*.client.ts`); exposed as `sdk.identity.<method>` |
134
+ | neither | flat `<Filename>Client` exposed as `sdk.<filename>` (legacy behavior) |
135
+
136
+ Multiple files mapping to the same `(area, subarea)` are merged into one leaf class. Multiple area-level files merge into a single `<Area>Client`; duplicate method names across them throw at codegen — disambiguate with `sdk:` or move one into a subarea.
128
137
 
129
138
  Method names follow this priority:
130
139