@contractkit/plugin-typescript 0.16.1 → 0.17.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,35 +1,21 @@
1
-
2
- 
3
- > @contractkit/plugin-typescript@0.16.0 build:ci /Users/robert/projects/contractkit/packages/plugin-typescript
4
- > eslint --max-warnings=0 && pnpm run build
5
-
6
- =============
7
-
8
-
9
- WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
10
-
11
-
12
- * @typescript-eslint/typescript-estree version: 8.57.2
13
- * Supported TypeScript versions: >=4.8.4 <6.0.0
14
- * Your TypeScript version: 6.0.2
15
-
16
-
17
- Please only submit bug reports when using the officially supported version.
18
-
19
-
20
- =============
21
-
22
- > @contractkit/plugin-typescript@0.16.0 build /Users/robert/projects/contractkit/packages/plugin-typescript
23
- > tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
24
-
25
- CLI Building entry: src/index.ts
26
- CLI Using tsconfig: tsconfig.json
27
- CLI tsup v8.5.1
28
- CLI Target: esnext
29
- ESM Build start
30
- ESM dist/index.js 123.76 KB
31
- ESM dist/index.js.map 267.25 KB
32
- ESM ⚡️ Build success in 156ms
33
- DTS Build start
34
- DTS ⚡️ Build success in 702ms
35
- DTS dist/index.d.ts 3.44 KB
1
+  WARN  Issue while reading "/home/runner/work/ContractKit/ContractKit/.npmrc". Failed to replace env in config: ${NPM_TOKEN}
2
+
3
+ > @contractkit/plugin-typescript@0.17.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
4
+ > eslint --max-warnings=0 && pnpm run build
5
+
6
+  WARN  Issue while reading "/home/runner/work/ContractKit/ContractKit/.npmrc". Failed to replace env in config: ${NPM_TOKEN}
7
+
8
+ > @contractkit/plugin-typescript@0.17.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
9
+ > tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
10
+
11
+ CLI Building entry: src/index.ts
12
+ CLI Using tsconfig: tsconfig.json
13
+ CLI tsup v8.5.1
14
+ CLI Target: esnext
15
+ ESM Build start
16
+ ESM dist/index.js 124.43 KB
17
+ ESM dist/index.js.map 269.86 KB
18
+ ESM ⚡️ Build success in 321ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 5018ms
21
+ DTS dist/index.d.ts 3.44 KB
@@ -1,81 +1,37 @@
1
-
2
- 
3
- > @contractkit/plugin-typescript@0.16.0 test:ci /Users/robert/projects/contractkit/packages/plugin-typescript
4
- > vitest run --coverage
5
-
6
- [?25l
7
-  RUN  v4.1.5 /Users/robert/projects/contractkit/packages/plugin-typescript
8
- Coverage enabled with v8
9
-
10
- [?2026h
11
-  ❯ tests/codegen-operation.test.ts [queued]
12
-
13
-  Test Files 0 passed (6)
14
-  Tests 0 passed (0)
15
-  Start at 08:51:09
16
-  Duration 206ms
17
- [?2026l[?2026h
18
-  tests/codegen-contract.test.ts [queued]
19
-  tests/codegen-operation.test.ts [queued]
20
-  ❯ tests/codegen-plain-types.test.ts [queued]
21
-  ❯ tests/codegen-sdk.test.ts [queued]
22
-  tests/codegen-server.test.ts [queued]
23
-  ❯ tests/pipeline.test.ts [queued]
24
-
25
-  Test Files 0 passed (6)
26
-  Tests 0 passed (0)
27
-  Start at 08:51:09
28
-  Duration 481ms
29
- [?2026l[?2026h
30
-  tests/codegen-contract.test.ts [queued]
31
-  ❯ tests/codegen-operation.test.ts [queued]
32
-  tests/codegen-plain-types.test.ts [queued]
33
-  tests/codegen-sdk.test.ts [queued]
34
-  tests/codegen-server.test.ts [queued]
35
-  tests/pipeline.test.ts [queued]
36
-
37
-  Test Files 0 passed (6)
38
-  Tests 0 passed (0)
39
-  Start at 08:51:09
40
-  Duration 928ms
41
- [?2026l[?2026h
42
-  ❯ tests/codegen-contract.test.ts [queued]
43
-  ❯ tests/codegen-operation.test.ts [queued]
44
-  ❯ tests/codegen-plain-types.test.ts [queued]
45
-  ❯ tests/codegen-sdk.test.ts [queued]
46
-  ❯ tests/codegen-server.test.ts [queued]
47
-  ❯ tests/pipeline.test.ts 0/25
48
-
49
-  Test Files 0 passed (6)
50
-  Tests 0 passed (25)
51
-  Start at 08:51:09
52
-  Duration 1.13s
53
- [?2026l ✓ tests/codegen-plain-types.test.ts (58 tests) 8ms
54
- ✓ tests/codegen-contract.test.ts (120 tests) 11ms
55
- ✓ tests/codegen-server.test.ts (15 tests) 10ms
56
- ✓ tests/codegen-operation.test.ts (86 tests) 28ms
57
- ✓ tests/pipeline.test.ts (25 tests) 47ms
58
- ✓ tests/codegen-sdk.test.ts (123 tests) 13ms
59
-
60
-  Test Files  6 passed (6)
61
-  Tests  427 passed (427)
62
-  Start at  08:51:09
63
-  Duration  1.31s (transform 1.99s, setup 0ms, import 4.86s, tests 118ms, environment 0ms)
64
-
65
-  % Coverage report from v8
66
- -------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------
67
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
68
- -------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------
69
- All files  |  77.37 |  73.85 |  82.17 |  79.25 |  
70
-  src  |  77.05 |  73.45 |  81.57 |  78.88 |  
71
-  codegen-contract.ts  |  87.38 |  81.19 |  90.16 |  88.24 | 102,259,348-349,414-416,418,420,432-434,439,494,595,642-646,654-658,664-674,724-726,730,739-755,796-797,807-816,830-831,898,964-969,974-975,980-981
72
-  codegen-operation.ts  |  78.18 |  74.26 |  78.08 |  79.69 | 30,44-77,85-94,164,172-173,312,387,423-426,500-502,511-514,577-597,618,632-646,651-652,668-679,684-685 
73
-  codegen-plain-types.ts |  87.5 |  76.76 |  92.85 |  91.66 | 50-55,91,111,185,199,211,217,269 
74
-  codegen-sdk.ts  |  88.75 |  83.6 |  85 |  91.49 | 23,308-309,578-585,594-599,606-623,678,712-729 
75
-  index.ts  |  23.35 |  19.51 |  33.33 |  25.69 | 136,139,175-375,391,394,397,415,418,421 
76
-  path-utils.ts  |  23.47 |  18.84 |  58.33 |  23.71 | 24-25,51,54-55,80-187 
77
-  ts-render.ts  |  82.19 |  85.39 |  72.22 |  87.09 | 56,90,126,157-165 
78
-  tests  |  90.38 |  90.9 |  89.28 |  93.47 |  
79
-  helpers.ts  |  90.38 |  90.9 |  89.28 |  93.47 | 110-118 
80
- -------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------
81
- [?25h
1
+  WARN  Issue while reading "/home/runner/work/ContractKit/ContractKit/.npmrc". Failed to replace env in config: ${NPM_TOKEN}
2
+
3
+ > @contractkit/plugin-typescript@0.17.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
4
+ > vitest run --coverage
5
+
6
+
7
+  RUN  v4.1.5 /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
8
+ Coverage enabled with v8
9
+
10
+ ✓ tests/codegen-operation.test.ts (88 tests) 117ms
11
+ ✓ tests/codegen-contract.test.ts (122 tests) 181ms
12
+ ✓ tests/codegen-sdk.test.ts (123 tests) 181ms
13
+ ✓ tests/codegen-plain-types.test.ts (58 tests) 35ms
14
+ ✓ tests/codegen-server.test.ts (15 tests) 19ms
15
+ ✓ tests/pipeline.test.ts (25 tests) 162ms
16
+
17
+  Test Files  6 passed (6)
18
+  Tests  431 passed (431)
19
+  Start at  20:56:41
20
+  Duration  6.44s (transform 3.92s, setup 0ms, import 13.45s, tests 694ms, environment 1ms)
21
+
22
+  % Coverage report from v8
23
+ -------------------|---------|----------|---------|---------|-------------------
24
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
25
+ -------------------|---------|----------|---------|---------|-------------------
26
+ All files | 77.47 | 74.06 | 82.02 | 79.41 |
27
+ src | 77.16 | 73.68 | 81.4 | 79.06 |
28
+ ...n-contract.ts | 87.57 | 81.63 | 89.91 | 88.57 | ...1025,1030-1031
29
+ ...-operation.ts | 78.18 | 74.26 | 78.08 | 79.69 | ...68-679,684-685
30
+ ...lain-types.ts | 87.5 | 76.76 | 92.85 | 91.66 | ...99,211,217,269
31
+ codegen-sdk.ts | 88.75 | 83.6 | 85 | 91.49 | ...23,678,712-729
32
+ index.ts | 23.35 | 19.51 | 33.33 | 25.69 | ...97,415,418,421
33
+ path-utils.ts | 23.47 | 18.84 | 58.33 | 23.71 | ...1,54-55,80-187
34
+ ts-render.ts | 82.19 | 85.39 | 72.22 | 87.09 | 56,90,126,157-165
35
+ tests | 90.38 | 90.9 | 89.28 | 93.47 |
36
+ helpers.ts | 90.38 | 90.9 | 89.28 | 93.47 | 110-118
37
+ -------------------|---------|----------|---------|---------|-------------------
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @contractkit/contractkit-plugin-typescript
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b3f7da9: Fix `ref & ref` type alias intersections generating `ZodIntersection` instead of `ZodObject`
8
+
9
+ Contracts like `contract Foo: A & B` (two model refs, no inline fields) previously emitted `A.and(B)`, producing a `ZodIntersection`. This broke `.strict()` calls on the result and caused each strict schema to reject the other's keys at runtime.
10
+
11
+ All three rendering paths (`renderIntersection`, `renderInputType`, `renderQueryType`) now emit `.extend(B.shape)` chains for any `ref & (ref | inlineObject)*` intersection, matching the pattern already used for multi-base model inheritance.
12
+
3
13
  ## 0.16.1
4
14
 
5
15
  ### Patch Changes