@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.
- package/.turbo/turbo-build$colon$ci.log +5 -11
- package/.turbo/turbo-test$colon$ci.log +11 -14
- package/CHANGELOG.md +49 -0
- package/coverage/clover.xml +270 -269
- package/coverage/coverage-final.json +1 -1
- package/coverage/index.html +8 -8
- package/coverage/src/codegen-contract.ts.html +1 -1
- package/coverage/src/codegen-operation.ts.html +29 -11
- package/coverage/src/codegen-plain-types.ts.html +1 -1
- package/coverage/src/codegen-sdk.ts.html +1 -1
- package/coverage/src/index.html +9 -9
- package/coverage/src/index.ts.html +1 -1
- package/coverage/src/path-utils.ts.html +1 -1
- 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/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/codegen-operation.ts +11 -5
- package/tests/codegen-operation.test.ts +36 -36
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
[34mCLI[39m Building entry: src/index.ts
|
|
10
4
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
11
5
|
[34mCLI[39m tsup v8.5.1
|
|
12
6
|
[34mCLI[39m Target: esnext
|
|
13
7
|
[34mESM[39m Build start
|
|
14
8
|
[32mESM[39m [1mdist/index.js [22m[32m149.94 KB[39m
|
|
15
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m327.
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
9
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m327.66 KB[39m
|
|
10
|
+
[32mESM[39m ⚡️ Build success in 391ms
|
|
17
11
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
12
|
+
[32mDTS[39m ⚡️ Build success in 6137ms
|
|
19
13
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.82 KB[39m
|
|
@@ -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
|
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.5 [39m[90m/home/runner/work/ContractKit/ContractKit/packages/plugin-typescript[39m
|
|
7
4
|
[2mCoverage enabled with [22m[33mv8[39m
|
|
8
5
|
|
|
9
|
-
[32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m
|
|
10
|
-
[32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m127 tests[22m[2m)[22m[32m
|
|
11
|
-
[32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m
|
|
6
|
+
[32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m 124[2mms[22m[39m
|
|
7
|
+
[32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m127 tests[22m[2m)[22m[32m 148[2mms[22m[39m
|
|
8
|
+
[32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m 176[2mms[22m[39m
|
|
12
9
|
[32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
13
|
-
[32m✓[39m tests/
|
|
14
|
-
[32m✓[39m tests/
|
|
10
|
+
[32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
11
|
+
[32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 126[2mms[22m[39m
|
|
15
12
|
|
|
16
13
|
[2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
17
14
|
[2m Tests [22m [1m[32m452 passed[39m[22m[90m (452)[39m
|
|
18
|
-
[2m Start at [22m
|
|
19
|
-
[2m Duration [22m
|
|
15
|
+
[2m Start at [22m 11:53:22
|
|
16
|
+
[2m Duration [22m 7.18s[2m (transform 4.19s, setup 0ms, import 13.58s, tests 652ms, environment 1ms)[22m
|
|
20
17
|
|
|
21
18
|
[34m % [39m[2mCoverage report from [22m[33mv8[39m
|
|
22
19
|
-------------------|---------|----------|---------|---------|-------------------
|
|
23
20
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
24
21
|
-------------------|---------|----------|---------|---------|-------------------
|
|
25
|
-
All files |
|
|
26
|
-
src | 79.79 | 74.96 | 83.06 | 82.
|
|
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.
|
|
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
|