@contractkit/plugin-typescript 0.24.0 → 0.25.1

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,19 +1,13 @@
1
-
2
- > @contractkit/plugin-typescript@0.24.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
3
- > eslint --max-warnings=0 && pnpm run build
4
-
5
-
6
- > @contractkit/plugin-typescript@0.24.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
7
- > tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
8
-
1
+ $ eslint --max-warnings=0 && pnpm run build
2
+ $ tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
9
3
  CLI Building entry: src/index.ts
10
4
  CLI Using tsconfig: tsconfig.json
11
5
  CLI tsup v8.5.1
12
6
  CLI Target: esnext
13
7
  ESM Build start
14
8
  ESM dist/index.js 149.94 KB
15
- ESM dist/index.js.map 327.56 KB
16
- ESM ⚡️ Build success in 339ms
9
+ ESM dist/index.js.map 327.66 KB
10
+ ESM ⚡️ Build success in 391ms
17
11
  DTS Build start
18
- DTS ⚡️ Build success in 4724ms
12
+ DTS ⚡️ Build success in 6137ms
19
13
  DTS dist/index.d.ts 1.82 KB
@@ -1,31 +1,28 @@
1
-
2
- > @contractkit/plugin-typescript@0.24.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
3
- > vitest run --coverage
4
-
1
+ $ vitest run --coverage
5
2
 
6
3
   RUN  v4.1.5 /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
7
4
  Coverage enabled with v8
8
5
 
9
- ✓ tests/codegen-operation.test.ts (88 tests) 104ms
10
- ✓ tests/codegen-contract.test.ts (127 tests) 116ms
11
- ✓ tests/codegen-sdk.test.ts (132 tests) 134ms
6
+ ✓ tests/codegen-operation.test.ts (88 tests) 124ms
7
+ ✓ tests/codegen-contract.test.ts (127 tests) 148ms
8
+ ✓ tests/codegen-sdk.test.ts (132 tests) 176ms
12
9
  ✓ tests/codegen-plain-types.test.ts (61 tests) 34ms
13
- ✓ tests/pipeline.test.ts (25 tests) 149ms
14
- ✓ tests/codegen-server.test.ts (19 tests) 31ms
10
+ ✓ tests/codegen-server.test.ts (19 tests) 44ms
11
+ ✓ tests/pipeline.test.ts (25 tests) 126ms
15
12
 
16
13
   Test Files  6 passed (6)
17
14
   Tests  452 passed (452)
18
-  Start at  15:00:19
19
-  Duration  5.63s (transform 3.00s, setup 0ms, import 10.57s, tests 567ms, environment 4ms)
15
+  Start at  11:53:22
16
+  Duration  7.18s (transform 4.19s, setup 0ms, import 13.58s, tests 652ms, environment 1ms)
20
17
 
21
18
   % Coverage report from v8
22
19
  -------------------|---------|----------|---------|---------|-------------------
23
20
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
24
21
  -------------------|---------|----------|---------|---------|-------------------
25
- All files | 80 | 75.28 | 83.5 | 82.61 |
26
- src | 79.79 | 74.96 | 83.06 | 82.37 |
22
+ All files | 80.01 | 75.28 | 83.5 | 82.62 |
23
+ src | 79.79 | 74.96 | 83.06 | 82.38 |
27
24
  ...n-contract.ts | 87.92 | 82.7 | 90.08 | 89.06 | ...1085,1090-1091
28
- ...-operation.ts | 78.13 | 74.26 | 77.77 | 79.69 | ...69-680,685-686
25
+ ...-operation.ts | 78.18 | 74.26 | 77.77 | 79.75 | ...75-686,691-692
29
26
  ...lain-types.ts | 89.08 | 78.37 | 96.66 | 92.3 | ...31,243,249,301
30
27
  codegen-sdk.ts | 88.09 | 82.56 | 87.32 | 91.32 | ...1108-1109,1112
31
28
  index.ts | 60.23 | 47.91 | 63.04 | 65.37 | ...08-811,827-846
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @contractkit/contractkit-plugin-typescript
2
2
 
3
+ ## 0.25.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a049895]
8
+ - @contractkit/core@0.19.0
9
+
10
+ ## 0.25.0
11
+
12
+ ### Minor Changes
13
+
14
+ - dd8197b: **Breaking:** Replace the `requireMfa: boolean` field in `security: { ... }` blocks with `policy: <ident|none>`, and switch the generated Koa router middleware from `requireSecurity` to ServerKit's new `requirePolicy`.
15
+
16
+ The `security` declaration on operations, routes, and the file-level `options { security: { ... } }` block no longer accepts a `requireMfa:` line. The new field is `policy:` and takes a bare identifier (the named policy) or the keyword `none` to explicitly bypass policy enforcement. Existing `.ck` files that use `requireMfa:` will fail to parse.
17
+
18
+ ```ck
19
+ # Before
20
+ security: {
21
+ requireMfa: true
22
+ }
23
+
24
+ # After
25
+ security: {
26
+ policy: paymentsWrite
27
+ }
28
+
29
+ # Explicit bypass
30
+ security: {
31
+ policy: none
32
+ }
33
+ ```
34
+
35
+ **`@contractkit/core`** — `SecurityFields` interface drops `requireMfa` / `requireMfaDescription` and adds `policy?: string | false` / `policyDescription?: string`. The grammar's `SecurityRequireMfaLine` is replaced by `SecurityPolicyLine` (`policyKw ":" (noneKw | identifier)`). `security: none` (the route-level public sentinel) is unchanged.
36
+
37
+ **`@contractkit/plugin-typescript`** — Generated Koa routers now import `requirePolicy` from `@maroonedsoftware/koa` (previously `requireSecurity`) and emit `requirePolicy({ policy: 'name' })`, `requirePolicy({ policy: false })`, or bare `requirePolicy()`. Consumers must upgrade ServerKit alongside.
38
+
39
+ **`@contractkit/prettier-plugin`** — Formats `policy: <name>` and `policy: none` lines inside security blocks. Files containing `requireMfa:` will no longer round-trip and will surface as parse errors.
40
+
41
+ **`@contractkit/plugin-markdown`** — The "Security: authenticated" admonition now shows `policy: <name|none>` instead of `requireMfa: <bool>`.
42
+
43
+ **`@contractkit/openapi-to-ck`** — Non-empty OpenAPI `security` requirements continue to collapse to an empty `security: {}` (authenticated, default policy); the serializer now emits `policy:` lines when the field is set.
44
+
45
+ **`contractkit-vscode-extension`** — TextMate grammar highlights `policy:` inside the security block; LSP completion offers `policy` instead of `requireMfa`. Re-run `pnpm run vscode:install` to pick up the change.
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies [dd8197b]
50
+ - @contractkit/core@0.18.0
51
+
3
52
  ## 0.24.0
4
53
 
5
54
  ### Minor Changes