@contractkit/prettier-plugin 0.14.1 → 0.14.3
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 +10 -19
- package/CHANGELOG.md +41 -0
- package/LICENSE +21 -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 +5 -4
- 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 90ms
|
|
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 1985ms
|
|
13
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m622.00 B[39m
|
|
@@ -4,25 +4,16 @@ $ vitest run --coverage
|
|
|
4
4
|
[2mCoverage enabled with [22m[33mv8[39m
|
|
5
5
|
|
|
6
6
|
[32m✓[39m tests/format-plugin.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 136[2mms[22m[39m
|
|
7
|
-
[32m✓[39m tests/print-ck.test.ts [2m([22m[2m81 tests[22m[2m)[22m[33m 1049[2mms[22m[39m
|
|
8
|
-
[32m✓[39m tests/round-trip.test.ts [2m([22m[2m49 tests[22m[2m)[22m[33m 2210[2mms[22m[39m
|
|
9
|
-
[33m[2m✓[22m[39m formats test.ck to itself [33m 918[2mms[22m[39m
|
|
10
|
-
[33m[2m✓[22m[39m formatting is a fixed point for source #0 [33m 515[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 16:35:30
|
|
11
|
+
[2m Duration [22m 4.67s[2m (transform 1.44s, setup 0ms, import 3.46s, tests 136ms, 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,46 @@
|
|
|
1
1
|
# @contractkit/prettier-plugin-contractkit
|
|
2
2
|
|
|
3
|
+
## 0.14.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- aea5e21: Move the `.ck` printer into core, so the language has exactly one
|
|
8
|
+
|
|
9
|
+
`.ck` had two printers: the prettier plugin's `printCk` and a hand-rolled one inside
|
|
10
|
+
`openapi-to-ck`. Only the prettier copy was covered by the round-trip tests that the grammar
|
|
11
|
+
checklist points at, so the other silently fell behind the grammar — it ignored `hasBlock` and
|
|
12
|
+
the `(documented)` response modifier, could not emit `mcp:`, `plugins:`, `name:`, `override`,
|
|
13
|
+
`format(output=)` or options-level header globals, and emitted source that does not parse for a
|
|
14
|
+
regex containing `/` or an enum value carrying both quote styles.
|
|
15
|
+
|
|
16
|
+
`printCk` now lives in `@contractkit/core` next to `parseCk` and is exported from it. The
|
|
17
|
+
prettier plugin re-exports it unchanged, and `openapi-to-ck`'s `astToCk` is a thin adapter over
|
|
18
|
+
it, so all of the above now print correctly.
|
|
19
|
+
|
|
20
|
+
Three printing fixes come with the move, all of which affect `pnpm format` on existing files:
|
|
21
|
+
- A regex containing `/` prints as `regex="…"` instead of an unterminated regex literal.
|
|
22
|
+
- A string containing `"` prints single-quoted; one carrying both quote styles is degraded
|
|
23
|
+
rather than emitted unparseable (use the new `isUnquotable` to warn before printing).
|
|
24
|
+
- A description containing newlines is flattened when it prints as a trailing `# …` comment,
|
|
25
|
+
instead of leaking the remainder as raw source.
|
|
26
|
+
|
|
27
|
+
Files containing any of these currently cannot round-trip at all, so this is a fix rather than a
|
|
28
|
+
break. `openapi-to-ck` output changes shape in two ways: model descriptions now print as a
|
|
29
|
+
doc-comment block above the `contract` rather than as a trailing comment, and scalar constraints
|
|
30
|
+
use the canonical `len=` / positional `format` spellings.
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [aea5e21]
|
|
33
|
+
- Updated dependencies [5dc2693]
|
|
34
|
+
- @contractkit/core@0.27.0
|
|
35
|
+
|
|
36
|
+
## 0.14.2
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- ca1c139: Declare the MIT license explicitly: every package now ships a `LICENSE` file in its published tarball and sets `"license": "MIT"` in its manifest, so license scanners and registries report the terms correctly.
|
|
41
|
+
- Updated dependencies [ca1c139]
|
|
42
|
+
- @contractkit/core@0.26.1
|
|
43
|
+
|
|
3
44
|
## 0.14.1
|
|
4
45
|
|
|
5
46
|
### Patch Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Marooned Software
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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"}
|