@contractkit/plugin-typescript 0.19.1 → 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.
- package/.turbo/turbo-build$colon$ci.log +6 -6
- package/.turbo/turbo-test$colon$ci.log +15 -15
- package/CHANGELOG.md +27 -0
- package/coverage/clover.xml +432 -394
- package/coverage/coverage-final.json +3 -3
- package/coverage/index.html +17 -17
- package/coverage/src/codegen-contract.ts.html +1 -1
- package/coverage/src/codegen-operation.ts.html +1 -1
- package/coverage/src/codegen-plain-types.ts.html +1 -1
- package/coverage/src/codegen-sdk.ts.html +291 -180
- package/coverage/src/index.html +36 -36
- package/coverage/src/index.ts.html +291 -81
- package/coverage/src/path-utils.ts.html +109 -13
- package/coverage/src/ts-render.ts.html +1 -1
- package/coverage/tests/helpers.ts.html +1 -1
- package/coverage/tests/index.html +1 -1
- package/dist/codegen-sdk.d.ts +40 -15
- package/dist/codegen-sdk.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +190 -99
- package/dist/index.js.map +1 -1
- package/dist/path-utils.d.ts +11 -0
- package/dist/path-utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/codegen-sdk.ts +133 -96
- package/src/index.ts +114 -44
- package/src/path-utils.ts +32 -0
- package/tests/codegen-sdk.test.ts +73 -78
- package/tests/codegen-server.test.ts +29 -16
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @contractkit/plugin-typescript@0.
|
|
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.
|
|
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
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
[34mCLI[39m tsup v8.5.1
|
|
12
12
|
[34mCLI[39m Target: esnext
|
|
13
13
|
[34mESM[39m Build start
|
|
14
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
15
|
-
[32mESM[39m [1mdist/index.js.map [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m149.46 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m325.97 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 327ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 6545ms
|
|
19
19
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.82 KB[39m
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
|
|
2
|
-
> @contractkit/plugin-typescript@0.
|
|
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
|
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.5 [39m[90m/home/runner/work/ContractKit/ContractKit/packages/plugin-typescript[39m
|
|
7
7
|
[2mCoverage enabled with [22m[33mv8[39m
|
|
8
8
|
|
|
9
|
-
[32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m124 tests[22m[2m)[22m[32m
|
|
10
|
-
[32m✓[39m tests/codegen-
|
|
11
|
-
[32m✓[39m tests/codegen-
|
|
12
|
-
[32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m
|
|
13
|
-
[32m✓[39m tests/
|
|
14
|
-
[32m✓[39m tests/
|
|
9
|
+
[32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m124 tests[22m[2m)[22m[32m 299[2mms[22m[39m
|
|
10
|
+
[32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m 281[2mms[22m[39m
|
|
11
|
+
[32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[33m 366[2mms[22m[39m
|
|
12
|
+
[32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 46[2mms[22m[39m
|
|
13
|
+
[32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 127[2mms[22m[39m
|
|
14
|
+
[32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
15
15
|
|
|
16
16
|
[2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
17
|
-
[2m Tests [22m [1m[
|
|
18
|
-
[2m Start at [22m 11:
|
|
19
|
-
[2m Duration [22m 7.
|
|
17
|
+
[2m Tests [22m [1m[32m449 passed[39m[22m[90m (449)[39m
|
|
18
|
+
[2m Start at [22m 11:53:46
|
|
19
|
+
[2m Duration [22m 7.18s[2m (transform 4.25s, setup 0ms, import 14.68s, tests 1.16s, environment 1ms)[22m
|
|
20
20
|
|
|
21
21
|
[34m % [39m[2mCoverage report from [22m[33mv8[39m
|
|
22
22
|
-------------------|---------|----------|---------|---------|-------------------
|
|
23
23
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
24
24
|
-------------------|---------|----------|---------|---------|-------------------
|
|
25
|
-
All files | 79.96 |
|
|
26
|
-
src | 79.
|
|
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.
|
|
31
|
-
index.ts |
|
|
32
|
-
path-utils.ts |
|
|
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,32 @@
|
|
|
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
|
+
|
|
15
|
+
## 0.20.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 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.
|
|
20
|
+
|
|
21
|
+
`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.
|
|
22
|
+
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [4ac6d4d]
|
|
28
|
+
- @contractkit/core@0.16.0
|
|
29
|
+
|
|
3
30
|
## 0.19.1
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|