@contractkit/plugin-typescript 0.20.0 → 0.21.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.20.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
2
+ > @contractkit/plugin-typescript@0.21.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.20.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
6
+ > @contractkit/plugin-typescript@0.21.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 146.20 KB
15
- ESM dist/index.js.map 317.95 KB
16
- ESM ⚡️ Build success in 371ms
14
+ ESM dist/index.js 149.46 KB
15
+ ESM dist/index.js.map 325.97 KB
16
+ ESM ⚡️ Build success in 327ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 6464ms
18
+ DTS ⚡️ Build success in 6545ms
19
19
  DTS dist/index.d.ts 1.82 KB
@@ -1,35 +1,35 @@
1
1
 
2
- > @contractkit/plugin-typescript@0.20.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
2
+ > @contractkit/plugin-typescript@0.21.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-operation.test.ts (88 tests) 265ms
10
- ✓ tests/codegen-sdk.test.ts (131 tests) 333ms
11
- ✓ tests/codegen-contract.test.ts (124 tests) 184ms
12
- ✓ tests/codegen-plain-types.test.ts (61 tests) 56ms
13
- ✓ tests/pipeline.test.ts (25 tests) 281ms
14
- ✓ tests/codegen-server.test.ts (19 tests) 37ms
9
+ ✓ tests/codegen-contract.test.ts (124 tests) 299ms
10
+ ✓ tests/codegen-operation.test.ts (88 tests) 281ms
11
+ ✓ tests/codegen-sdk.test.ts (132 tests) 366ms
12
+ ✓ tests/codegen-plain-types.test.ts (61 tests) 46ms
13
+ ✓ tests/pipeline.test.ts (25 tests) 127ms
14
+ ✓ tests/codegen-server.test.ts (19 tests) 44ms
15
15
 
16
16
   Test Files  6 passed (6)
17
-  Tests  448 passed (448)
18
-  Start at  11:38:17
19
-  Duration  6.86s (transform 3.00s, setup 0ms, import 12.86s, tests 1.16s, environment 9ms)
17
+  Tests  449 passed (449)
18
+  Start at  11:53:46
19
+  Duration  7.18s (transform 4.25s, setup 0ms, import 14.68s, tests 1.16s, 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 | 80 | 75.35 | 83.45 | 82.47 |
26
- src | 79.77 | 75.03 | 83.01 | 82.23 |
25
+ All files | 79.96 | 75.1 | 83.54 | 82.56 |
26
+ src | 79.75 | 74.78 | 83.1 | 82.32 |
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.26 | 83.01 | 87.14 | 91.22 | ...1087-1088,1091
31
- index.ts | 58.69 | 47.22 | 63.82 | 63.33 | ...51-754,770-789
32
- path-utils.ts | 36.52 | 27.53 | 75 | 38.14 | ...32-136,147-187
30
+ codegen-sdk.ts | 88.07 | 82.56 | 87.32 | 91.3 | ...1106-1107,1110
31
+ index.ts | 60.23 | 47.91 | 63.04 | 65.37 | ...08-811,827-846
32
+ path-utils.ts | 41.04 | 31.32 | 78.57 | 42.47 | ...64-168,179-219
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,17 @@
1
1
  # @contractkit/contractkit-plugin-typescript
2
2
 
3
+ ## 0.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2aad136: Move `<Area>Client` classes out of `sdk.ts` and into their own `<area>.client.ts` files. Previously the SDK aggregator declared the `<Area>Client` class inline and merged area-level methods into it; now the merged class is emitted to a synthesized `<area>.client.ts` next to its leaf subarea clients, and `sdk.ts` only imports it. The aggregator is now a thin file: imports + a `Sdk` class with property wiring.
8
+
9
+ The area-client output path is derived from the same `output.clients` template as leaf clients via the new `computeSdkAreaClientOutPath` helper — `{filename}` and `{area}` substitute to the area name, `{subarea}` to empty (with double-slashes collapsed and any hidden `.client.ts` segment fixed up). For typical templates like `src/{area}/{subarea}.client.ts` or `src/{area}/{filename}.client.ts`, this produces `src/<area>/<area>.client.ts`.
10
+
11
+ `generateSdkAggregator`'s `SdkAreaInfo` shape changed: `inlineFiles` and `subareaClients` are gone — the aggregator now takes a single `client: SdkClientInfo` per area pointing at the new file. Plugins / tooling consuming `generateSdkAggregator` directly need to update. The new `generateAreaClient` function takes the inline-file list + subarea clients and returns the `<area>.client.ts` content. Per-area cache units mean a change to one file's ops only re-renders that area's client.
12
+
13
+ Consumers who imported an `<Area>Client` type directly from `sdk.ts` need to import from `./<area>/<area>.client.ts` (or `./<area>/<area>.js` after compile) instead — `Sdk` and `SdkOptions` continue to come from `sdk.ts`.
14
+
3
15
  ## 0.20.0
4
16
 
5
17
  ### Minor Changes