@contractkit/prettier-plugin 0.14.2 → 0.14.4
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 -5
- package/.turbo/turbo-test$colon$ci.log +11 -20
- package/CHANGELOG.md +40 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -713
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -5
- package/dist/indent.d.ts +0 -2
- package/dist/indent.d.ts.map +0 -1
- package/dist/print-ck.d.ts +0 -20
- package/dist/print-ck.d.ts.map +0 -1
- package/dist/print-contract.d.ts +0 -13
- package/dist/print-contract.d.ts.map +0 -1
- package/dist/print-operation.d.ts +0 -48
- package/dist/print-operation.d.ts.map +0 -1
- package/dist/print-type.d.ts +0 -26
- package/dist/print-type.d.ts.map +0 -1
- package/src/indent.ts +0 -1
- package/src/print-ck.ts +0 -179
- package/src/print-contract.ts +0 -86
- package/src/print-operation.ts +0 -454
- package/src/print-type.ts +0 -155
- package/tests/print-ck.test.ts +0 -1121
- package/tests/round-trip.test.ts +0 -694
|
@@ -5,9 +5,9 @@ $ tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly
|
|
|
5
5
|
[34mCLI[39m tsup v8.5.1
|
|
6
6
|
[34mCLI[39m Target: esnext
|
|
7
7
|
[34mESM[39m Build start
|
|
8
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
9
|
-
[32mESM[39m [1mdist/index.js.map [22m[
|
|
10
|
-
[32mESM[39m ⚡️ Build success in
|
|
8
|
+
[32mESM[39m [1mdist/index.js [22m[32m1.37 KB[39m
|
|
9
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m3.18 KB[39m
|
|
10
|
+
[32mESM[39m ⚡️ Build success in 65ms
|
|
11
11
|
[34mDTS[39m Build start
|
|
12
|
-
[32mDTS[39m ⚡️ Build success in
|
|
13
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
12
|
+
[32mDTS[39m ⚡️ Build success in 2885ms
|
|
13
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m622.00 B[39m
|
|
@@ -3,26 +3,17 @@ $ vitest run --coverage
|
|
|
3
3
|
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.5 [39m[90m/home/runner/work/ContractKit/ContractKit/apps/prettier-plugin[39m
|
|
4
4
|
[2mCoverage enabled with [22m[33mv8[39m
|
|
5
5
|
|
|
6
|
-
[32m✓[39m tests/format-plugin.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
7
|
-
[32m✓[39m tests/print-ck.test.ts [2m([22m[2m81 tests[22m[2m)[22m[33m 600[2mms[22m[39m
|
|
8
|
-
[32m✓[39m tests/round-trip.test.ts [2m([22m[2m49 tests[22m[2m)[22m[33m 1974[2mms[22m[39m
|
|
9
|
-
[33m[2m✓[22m[39m formats test.ck to itself [33m 733[2mms[22m[39m
|
|
10
|
-
[33m[2m✓[22m[39m formatting is a fixed point for source #0 [33m 602[2mms[22m[39m
|
|
6
|
+
[32m✓[39m tests/format-plugin.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 103[2mms[22m[39m
|
|
11
7
|
|
|
12
|
-
[2m Test Files [22m [1m[
|
|
13
|
-
[2m Tests [22m [1m[
|
|
14
|
-
[2m Start at [22m
|
|
15
|
-
[2m Duration [22m
|
|
8
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
9
|
+
[2m Tests [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
10
|
+
[2m Start at [22m 17:30:03
|
|
11
|
+
[2m Duration [22m 3.90s[2m (transform 1.38s, setup 0ms, import 2.83s, tests 103ms, environment 0ms)[22m
|
|
16
12
|
|
|
17
13
|
[34m % [39m[2mCoverage report from [22m[33mv8[39m
|
|
18
|
-
|
|
19
|
-
File
|
|
20
|
-
|
|
21
|
-
All files
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
print-ck.ts | 90.59 | 88.26 | 100 | 100 | ...57-158,172,176
|
|
25
|
-
print-contract.ts | 74.28 | 60.29 | 100 | 80 | 70-76,83
|
|
26
|
-
...t-operation.ts | 78.77 | 71.42 | 95 | 87.55 | ...63,380,388-399
|
|
27
|
-
print-type.ts | 69.56 | 64.42 | 81.81 | 72 | ...,45-61,148-151
|
|
28
|
-
-------------------|---------|----------|---------|---------|-------------------
|
|
14
|
+
----------|---------|----------|---------|---------|-------------------
|
|
15
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
16
|
+
----------|---------|----------|---------|---------|-------------------
|
|
17
|
+
All files | 81.81 | 100 | 100 | 80 |
|
|
18
|
+
index.ts | 81.81 | 100 | 100 | 80 | 46-47
|
|
19
|
+
----------|---------|----------|---------|---------|-------------------
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @contractkit/prettier-plugin-contractkit
|
|
2
2
|
|
|
3
|
+
## 0.14.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [e102a2c]
|
|
8
|
+
- @contractkit/core@0.28.0
|
|
9
|
+
|
|
10
|
+
## 0.14.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- aea5e21: Move the `.ck` printer into core, so the language has exactly one
|
|
15
|
+
|
|
16
|
+
`.ck` had two printers: the prettier plugin's `printCk` and a hand-rolled one inside
|
|
17
|
+
`openapi-to-ck`. Only the prettier copy was covered by the round-trip tests that the grammar
|
|
18
|
+
checklist points at, so the other silently fell behind the grammar — it ignored `hasBlock` and
|
|
19
|
+
the `(documented)` response modifier, could not emit `mcp:`, `plugins:`, `name:`, `override`,
|
|
20
|
+
`format(output=)` or options-level header globals, and emitted source that does not parse for a
|
|
21
|
+
regex containing `/` or an enum value carrying both quote styles.
|
|
22
|
+
|
|
23
|
+
`printCk` now lives in `@contractkit/core` next to `parseCk` and is exported from it. The
|
|
24
|
+
prettier plugin re-exports it unchanged, and `openapi-to-ck`'s `astToCk` is a thin adapter over
|
|
25
|
+
it, so all of the above now print correctly.
|
|
26
|
+
|
|
27
|
+
Three printing fixes come with the move, all of which affect `pnpm format` on existing files:
|
|
28
|
+
- A regex containing `/` prints as `regex="…"` instead of an unterminated regex literal.
|
|
29
|
+
- A string containing `"` prints single-quoted; one carrying both quote styles is degraded
|
|
30
|
+
rather than emitted unparseable (use the new `isUnquotable` to warn before printing).
|
|
31
|
+
- A description containing newlines is flattened when it prints as a trailing `# …` comment,
|
|
32
|
+
instead of leaking the remainder as raw source.
|
|
33
|
+
|
|
34
|
+
Files containing any of these currently cannot round-trip at all, so this is a fix rather than a
|
|
35
|
+
break. `openapi-to-ck` output changes shape in two ways: model descriptions now print as a
|
|
36
|
+
doc-comment block above the `contract` rather than as a trailing comment, and scalar constraints
|
|
37
|
+
use the canonical `len=` / positional `format` spellings.
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [aea5e21]
|
|
40
|
+
- Updated dependencies [5dc2693]
|
|
41
|
+
- @contractkit/core@0.27.0
|
|
42
|
+
|
|
3
43
|
## 0.14.2
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { CkRootNode } from '@contractkit/core';
|
|
|
3
3
|
/**
|
|
4
4
|
* Prettier plugin registering the `.ck` language, its parser, and its printer.
|
|
5
5
|
*
|
|
6
|
-
* The parser is `parseCk` and the printer is `printCk`,
|
|
7
|
-
*
|
|
6
|
+
* The parser is `parseCk` and the printer is `printCk`, both from `@contractkit/core`, so all
|
|
7
|
+
* formatting behaviour lives there rather than here — this module only adapts them to
|
|
8
8
|
* prettier's interface. `tests/format-plugin.test.ts` covers that adapter layer, which a
|
|
9
9
|
* printer-level test cannot reach.
|
|
10
10
|
*/
|
|
11
11
|
declare const plugin: Plugin<CkRootNode>;
|
|
12
12
|
export default plugin;
|
|
13
|
-
export { printCk, DEFAULT_PRINT_WIDTH } from '
|
|
13
|
+
export { printCk, DEFAULT_PRINT_WIDTH } from '@contractkit/core';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiBpD;;;;;;;GAOG;AACH,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,UAAU,CA8B9B,CAAC;AAEF,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|