oxfmt 0.41.0 → 0.43.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.
- package/configuration_schema.json +120 -12
- package/dist/{apis-CF7S9zfN.js → apis-mHnrEtPz.js} +47 -37
- package/dist/{babel-CL6HLzZ0.js → babel-Fkr5EfJ9.js} +2 -2
- package/dist/{bindings-D6U4DxG3.js → bindings-mh4tfrCL.js} +26 -26
- package/dist/cli-worker.d.ts +6 -7
- package/dist/cli-worker.js +1 -1
- package/dist/cli.js +3 -3
- package/dist/{dist-BxJy1HJ_.js → dist-D4weCFEt.js} +5 -5
- package/dist/{graphql-C66DjsEv.js → graphql-BTqRh-7l.js} +1 -0
- package/dist/index.d.ts +117 -6
- package/dist/index.js +2 -2
- package/dist/{jiti-Bb1dT6Cw-BzC3jhZX.js → jiti-Bb1dT6Cw-CnTrJOrf.js} +3 -6
- package/dist/{migrate-prettier-DCQhmQ6e.js → migrate-prettier-CpiJRvlG.js} +1 -1
- package/dist/{prettier-DmvT5K0i.js → prettier-Dwwk1Fyx.js} +5 -5
- package/dist/{prettier-plugin-oxfmt-BqWJLUOn.js → prettier-plugin-oxfmt-CLoiASgP.js} +0 -2
- package/dist/{resolve-pWjAK-4f-C1Z6M6r2.js → resolve-pWjAK-4f-ColMfOaZ.js} +1 -2
- package/dist/{sorter-BZkvDMjt-tVbe6MxP.js → sorter-BZkvDMjt-BJdi7rG8.js} +4 -4
- package/dist/sorter-DNWmw8Iu.js +3 -0
- package/dist/{typescript-8enly1_u.js → typescript-G7g7T3yt.js} +3 -1
- package/dist/{v3-D-mr2VVh-FqDpKDIq.js → v3-D-mr2VVh-CisVsFM0.js} +1 -1
- package/dist/{v4-C-HWEQJm-6MZhb6TA.js → v4-C-HWEQJm-CbHL6UrB.js} +2 -2
- package/dist/{yaml-B6CM-Uf_.js → yaml-BID5Twob.js} +2 -2
- package/package.json +20 -20
- package/dist/sorter-DFoFc7QW.js +0 -3
|
@@ -63,6 +63,15 @@
|
|
|
63
63
|
"type": "boolean",
|
|
64
64
|
"markdownDescription": "Whether to insert a final newline at the end of the file.\n\n- Default: `true`\n- Overrides `.editorconfig.insert_final_newline`"
|
|
65
65
|
},
|
|
66
|
+
"jsdoc": {
|
|
67
|
+
"description": "Enable JSDoc comment formatting.\n\nWhen enabled, JSDoc comments are normalized and reformatted:\ntag aliases are canonicalized, descriptions are capitalized,\nlong lines are wrapped, and short comments are collapsed to single-line.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled",
|
|
68
|
+
"allOf": [
|
|
69
|
+
{
|
|
70
|
+
"$ref": "#/definitions/JsdocUserConfig"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"markdownDescription": "Enable JSDoc comment formatting.\n\nWhen enabled, JSDoc comments are normalized and reformatted:\ntag aliases are canonicalized, descriptions are capitalized,\nlong lines are wrapped, and short comments are collapsed to single-line.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled"
|
|
74
|
+
},
|
|
66
75
|
"jsxSingleQuote": {
|
|
67
76
|
"description": "Use single quotes instead of double quotes in JSX.\n\n- Default: `false`",
|
|
68
77
|
"type": "boolean",
|
|
@@ -126,13 +135,13 @@
|
|
|
126
135
|
"markdownDescription": "Use single quotes instead of double quotes.\n\nFor JSX, you can set the `jsxSingleQuote` option.\n\n- Default: `false`"
|
|
127
136
|
},
|
|
128
137
|
"sortImports": {
|
|
129
|
-
"description": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\n- Default: Disabled",
|
|
138
|
+
"description": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled",
|
|
130
139
|
"allOf": [
|
|
131
140
|
{
|
|
132
|
-
"$ref": "#/definitions/
|
|
141
|
+
"$ref": "#/definitions/SortImportsUserConfig"
|
|
133
142
|
}
|
|
134
143
|
],
|
|
135
|
-
"markdownDescription": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\n- Default: Disabled"
|
|
144
|
+
"markdownDescription": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled"
|
|
136
145
|
},
|
|
137
146
|
"sortPackageJson": {
|
|
138
147
|
"description": "Sort `package.json` keys.\n\nThe algorithm is NOT compatible with [prettier-plugin-sort-packagejson](https://github.com/matzkoh/prettier-plugin-packagejson).\nBut we believe it is clearer and easier to navigate.\nFor details, see each field's documentation.\n\n- Default: `true`",
|
|
@@ -144,13 +153,13 @@
|
|
|
144
153
|
"markdownDescription": "Sort `package.json` keys.\n\nThe algorithm is NOT compatible with [prettier-plugin-sort-packagejson](https://github.com/matzkoh/prettier-plugin-packagejson).\nBut we believe it is clearer and easier to navigate.\nFor details, see each field's documentation.\n\n- Default: `true`"
|
|
145
154
|
},
|
|
146
155
|
"sortTailwindcss": {
|
|
147
|
-
"description": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\n- Default: Disabled",
|
|
156
|
+
"description": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled",
|
|
148
157
|
"allOf": [
|
|
149
158
|
{
|
|
150
|
-
"$ref": "#/definitions/
|
|
159
|
+
"$ref": "#/definitions/SortTailwindcssUserConfig"
|
|
151
160
|
}
|
|
152
161
|
],
|
|
153
|
-
"markdownDescription": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\n- Default: Disabled"
|
|
162
|
+
"markdownDescription": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled"
|
|
154
163
|
},
|
|
155
164
|
"tabWidth": {
|
|
156
165
|
"description": "Specify the number of spaces per indentation-level.\n\n- Default: `2`\n- Overrides `.editorconfig.indent_size`",
|
|
@@ -291,6 +300,15 @@
|
|
|
291
300
|
"type": "boolean",
|
|
292
301
|
"markdownDescription": "Whether to insert a final newline at the end of the file.\n\n- Default: `true`\n- Overrides `.editorconfig.insert_final_newline`"
|
|
293
302
|
},
|
|
303
|
+
"jsdoc": {
|
|
304
|
+
"description": "Enable JSDoc comment formatting.\n\nWhen enabled, JSDoc comments are normalized and reformatted:\ntag aliases are canonicalized, descriptions are capitalized,\nlong lines are wrapped, and short comments are collapsed to single-line.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled",
|
|
305
|
+
"allOf": [
|
|
306
|
+
{
|
|
307
|
+
"$ref": "#/definitions/JsdocUserConfig"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"markdownDescription": "Enable JSDoc comment formatting.\n\nWhen enabled, JSDoc comments are normalized and reformatted:\ntag aliases are canonicalized, descriptions are capitalized,\nlong lines are wrapped, and short comments are collapsed to single-line.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled"
|
|
311
|
+
},
|
|
294
312
|
"jsxSingleQuote": {
|
|
295
313
|
"description": "Use single quotes instead of double quotes in JSX.\n\n- Default: `false`",
|
|
296
314
|
"type": "boolean",
|
|
@@ -346,13 +364,13 @@
|
|
|
346
364
|
"markdownDescription": "Use single quotes instead of double quotes.\n\nFor JSX, you can set the `jsxSingleQuote` option.\n\n- Default: `false`"
|
|
347
365
|
},
|
|
348
366
|
"sortImports": {
|
|
349
|
-
"description": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\n- Default: Disabled",
|
|
367
|
+
"description": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled",
|
|
350
368
|
"allOf": [
|
|
351
369
|
{
|
|
352
|
-
"$ref": "#/definitions/
|
|
370
|
+
"$ref": "#/definitions/SortImportsUserConfig"
|
|
353
371
|
}
|
|
354
372
|
],
|
|
355
|
-
"markdownDescription": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\n- Default: Disabled"
|
|
373
|
+
"markdownDescription": "Sort import statements.\n\nUsing the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled"
|
|
356
374
|
},
|
|
357
375
|
"sortPackageJson": {
|
|
358
376
|
"description": "Sort `package.json` keys.\n\nThe algorithm is NOT compatible with [prettier-plugin-sort-packagejson](https://github.com/matzkoh/prettier-plugin-packagejson).\nBut we believe it is clearer and easier to navigate.\nFor details, see each field's documentation.\n\n- Default: `true`",
|
|
@@ -364,13 +382,13 @@
|
|
|
364
382
|
"markdownDescription": "Sort `package.json` keys.\n\nThe algorithm is NOT compatible with [prettier-plugin-sort-packagejson](https://github.com/matzkoh/prettier-plugin-packagejson).\nBut we believe it is clearer and easier to navigate.\nFor details, see each field's documentation.\n\n- Default: `true`"
|
|
365
383
|
},
|
|
366
384
|
"sortTailwindcss": {
|
|
367
|
-
"description": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\n- Default: Disabled",
|
|
385
|
+
"description": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled",
|
|
368
386
|
"allOf": [
|
|
369
387
|
{
|
|
370
|
-
"$ref": "#/definitions/
|
|
388
|
+
"$ref": "#/definitions/SortTailwindcssUserConfig"
|
|
371
389
|
}
|
|
372
390
|
],
|
|
373
|
-
"markdownDescription": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\n- Default: Disabled"
|
|
391
|
+
"markdownDescription": "Sort Tailwind CSS classes.\n\nUsing the same algorithm as [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss).\nOption names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).\nFor details, see each field's documentation.\n\nPass `true` or an object to enable with defaults, or omit/set `false` to disable.\n\n- Default: Disabled"
|
|
374
392
|
},
|
|
375
393
|
"tabWidth": {
|
|
376
394
|
"description": "Specify the number of spaces per indentation-level.\n\n- Default: `2`\n- Overrides `.editorconfig.indent_size`",
|
|
@@ -408,6 +426,76 @@
|
|
|
408
426
|
"ignore"
|
|
409
427
|
]
|
|
410
428
|
},
|
|
429
|
+
"JsdocConfig": {
|
|
430
|
+
"type": "object",
|
|
431
|
+
"properties": {
|
|
432
|
+
"addDefaultToDescription": {
|
|
433
|
+
"description": "Append default values to `@param` descriptions (e.g. \"Default is `value`\").\n\n- Default: `true`",
|
|
434
|
+
"type": "boolean",
|
|
435
|
+
"markdownDescription": "Append default values to `@param` descriptions (e.g. \"Default is `value`\").\n\n- Default: `true`"
|
|
436
|
+
},
|
|
437
|
+
"bracketSpacing": {
|
|
438
|
+
"description": "Add spaces inside JSDoc type braces: `{string}` → `{ string }`.\n\n- Default: `false`",
|
|
439
|
+
"type": "boolean",
|
|
440
|
+
"markdownDescription": "Add spaces inside JSDoc type braces: `{string}` → `{ string }`.\n\n- Default: `false`"
|
|
441
|
+
},
|
|
442
|
+
"capitalizeDescriptions": {
|
|
443
|
+
"description": "Capitalize the first letter of tag descriptions.\n\n- Default: `true`",
|
|
444
|
+
"type": "boolean",
|
|
445
|
+
"markdownDescription": "Capitalize the first letter of tag descriptions.\n\n- Default: `true`"
|
|
446
|
+
},
|
|
447
|
+
"commentLineStrategy": {
|
|
448
|
+
"description": "How to format comment blocks.\n\n- `\"singleLine\"` — Convert to single-line `/** content */` when possible.\n- `\"multiline\"` — Always use multi-line format.\n- `\"keep\"` — Preserve original formatting.\n\n- Default: `\"singleLine\"`",
|
|
449
|
+
"type": "string",
|
|
450
|
+
"markdownDescription": "How to format comment blocks.\n\n- `\"singleLine\"` — Convert to single-line `/** content */` when possible.\n- `\"multiline\"` — Always use multi-line format.\n- `\"keep\"` — Preserve original formatting.\n\n- Default: `\"singleLine\"`"
|
|
451
|
+
},
|
|
452
|
+
"descriptionTag": {
|
|
453
|
+
"description": "Emit `@description` tag instead of inline description.\n\n- Default: `false`",
|
|
454
|
+
"type": "boolean",
|
|
455
|
+
"markdownDescription": "Emit `@description` tag instead of inline description.\n\n- Default: `false`"
|
|
456
|
+
},
|
|
457
|
+
"descriptionWithDot": {
|
|
458
|
+
"description": "Add a trailing dot to the end of descriptions.\n\n- Default: `false`",
|
|
459
|
+
"type": "boolean",
|
|
460
|
+
"markdownDescription": "Add a trailing dot to the end of descriptions.\n\n- Default: `false`"
|
|
461
|
+
},
|
|
462
|
+
"keepUnparsableExampleIndent": {
|
|
463
|
+
"description": "Preserve indentation in unparsable `@example` code.\n\n- Default: `false`",
|
|
464
|
+
"type": "boolean",
|
|
465
|
+
"markdownDescription": "Preserve indentation in unparsable `@example` code.\n\n- Default: `false`"
|
|
466
|
+
},
|
|
467
|
+
"lineWrappingStyle": {
|
|
468
|
+
"description": "Strategy for wrapping description lines at print width.\n\n- `\"greedy\"` — Always re-wrap text to fit within print width.\n- `\"balance\"` — Preserve original line breaks if all lines fit within print width.\n\n- Default: `\"greedy\"`",
|
|
469
|
+
"type": "string",
|
|
470
|
+
"markdownDescription": "Strategy for wrapping description lines at print width.\n\n- `\"greedy\"` — Always re-wrap text to fit within print width.\n- `\"balance\"` — Preserve original line breaks if all lines fit within print width.\n\n- Default: `\"greedy\"`"
|
|
471
|
+
},
|
|
472
|
+
"preferCodeFences": {
|
|
473
|
+
"description": "Use fenced code blocks (```` ``` ````) instead of 4-space indentation for code without a language tag.\n\n- Default: `false`",
|
|
474
|
+
"type": "boolean",
|
|
475
|
+
"markdownDescription": "Use fenced code blocks (```` ``` ````) instead of 4-space indentation for code without a language tag.\n\n- Default: `false`"
|
|
476
|
+
},
|
|
477
|
+
"separateReturnsFromParam": {
|
|
478
|
+
"description": "Add a blank line between the last `@param` and `@returns`.\n\n- Default: `false`",
|
|
479
|
+
"type": "boolean",
|
|
480
|
+
"markdownDescription": "Add a blank line between the last `@param` and `@returns`.\n\n- Default: `false`"
|
|
481
|
+
},
|
|
482
|
+
"separateTagGroups": {
|
|
483
|
+
"description": "Add blank lines between different tag groups (e.g. between `@param` and `@returns`).\n\n- Default: `false`",
|
|
484
|
+
"type": "boolean",
|
|
485
|
+
"markdownDescription": "Add blank lines between different tag groups (e.g. between `@param` and `@returns`).\n\n- Default: `false`"
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"JsdocUserConfig": {
|
|
490
|
+
"anyOf": [
|
|
491
|
+
{
|
|
492
|
+
"type": "boolean"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"$ref": "#/definitions/JsdocConfig"
|
|
496
|
+
}
|
|
497
|
+
]
|
|
498
|
+
},
|
|
411
499
|
"NewlinesBetweenMarker": {
|
|
412
500
|
"description": "A marker object for overriding `newlinesBetween` at a specific group boundary.",
|
|
413
501
|
"type": "object",
|
|
@@ -567,6 +655,16 @@
|
|
|
567
655
|
}
|
|
568
656
|
}
|
|
569
657
|
},
|
|
658
|
+
"SortImportsUserConfig": {
|
|
659
|
+
"anyOf": [
|
|
660
|
+
{
|
|
661
|
+
"type": "boolean"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"$ref": "#/definitions/SortImportsConfig"
|
|
665
|
+
}
|
|
666
|
+
]
|
|
667
|
+
},
|
|
570
668
|
"SortOrderConfig": {
|
|
571
669
|
"type": "string",
|
|
572
670
|
"enum": [
|
|
@@ -635,6 +733,16 @@
|
|
|
635
733
|
}
|
|
636
734
|
}
|
|
637
735
|
},
|
|
736
|
+
"SortTailwindcssUserConfig": {
|
|
737
|
+
"anyOf": [
|
|
738
|
+
{
|
|
739
|
+
"type": "boolean"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"$ref": "#/definitions/SortTailwindcssConfig"
|
|
743
|
+
}
|
|
744
|
+
]
|
|
745
|
+
},
|
|
638
746
|
"TrailingCommaConfig": {
|
|
639
747
|
"type": "string",
|
|
640
748
|
"enum": [
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
//#region src-js/libs/apis.ts
|
|
2
|
-
|
|
2
|
+
const CACHES = {
|
|
3
|
+
prettier: null,
|
|
4
|
+
tailwindPlugin: null,
|
|
5
|
+
tailwindSorter: null,
|
|
6
|
+
oxfmtPlugin: null
|
|
7
|
+
};
|
|
3
8
|
async function loadPrettier() {
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
if (!CACHES.prettier) {
|
|
10
|
+
CACHES.prettier = await import("./prettier-Dwwk1Fyx.js");
|
|
11
|
+
const { formatOptionsHiddenDefaults } = CACHES.prettier.__internal;
|
|
12
|
+
formatOptionsHiddenDefaults.parentParser = null;
|
|
13
|
+
formatOptionsHiddenDefaults.__onHtmlRoot = null;
|
|
14
|
+
formatOptionsHiddenDefaults.__inJsTemplate = null;
|
|
15
|
+
}
|
|
16
|
+
return CACHES.prettier;
|
|
7
17
|
}
|
|
8
18
|
/**
|
|
9
19
|
* TODO: Plugins support
|
|
@@ -22,43 +32,48 @@ async function resolvePlugins() {
|
|
|
22
32
|
* @returns Formatted code
|
|
23
33
|
*/
|
|
24
34
|
async function formatFile({ code, options }) {
|
|
25
|
-
const prettier = await loadPrettier();
|
|
26
|
-
await setupTailwindPlugin(options);
|
|
27
|
-
await setupOxfmtPlugin(options);
|
|
35
|
+
const prettier = CACHES.prettier ?? await loadPrettier();
|
|
36
|
+
if ("_useTailwindPlugin" in options) await setupTailwindPlugin(options);
|
|
37
|
+
if ("_oxfmtPluginOptionsJson" in options) await setupOxfmtPlugin(options);
|
|
28
38
|
return prettier.format(code, options);
|
|
29
39
|
}
|
|
30
40
|
/**
|
|
31
|
-
* Format
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* For now, html|css|md-in-js are using this.
|
|
41
|
+
* Format non-js code snippets into formatted string.
|
|
42
|
+
* Mainly used for formatting code fences within JSDoc,
|
|
43
|
+
* and is also used as a temporary fallback for html-in-js.
|
|
35
44
|
*
|
|
36
45
|
* @returns Formatted code snippet
|
|
37
46
|
*/
|
|
38
47
|
async function formatEmbeddedCode({ code, options }) {
|
|
39
|
-
const prettier = await loadPrettier();
|
|
40
|
-
await setupTailwindPlugin(options);
|
|
48
|
+
const prettier = CACHES.prettier ?? await loadPrettier();
|
|
49
|
+
if ("_useTailwindPlugin" in options) await setupTailwindPlugin(options);
|
|
41
50
|
return prettier.format(code, options);
|
|
42
51
|
}
|
|
43
52
|
/**
|
|
44
|
-
* Format
|
|
53
|
+
* Format non-js code snippets into Prettier `Doc` JSON strings.
|
|
45
54
|
*
|
|
46
|
-
* This makes
|
|
55
|
+
* This makes our printer correctly handle `printWidth` even for embedded code.
|
|
47
56
|
* - For gql-in-js, `texts` contains multiple parts split by `${}` in a template literal
|
|
48
57
|
* - For others, `texts` always contains a single string with `${}` parts replaced by placeholders
|
|
49
58
|
* However, this function does not need to be aware of that,
|
|
50
59
|
* as it simply formats each text part independently and returns an array of formatted parts.
|
|
51
60
|
*
|
|
52
|
-
* @returns Doc JSON strings
|
|
61
|
+
* @returns Doc JSON strings
|
|
53
62
|
*/
|
|
54
63
|
async function formatEmbeddedDoc({ texts, options }) {
|
|
55
|
-
const prettier = await loadPrettier();
|
|
56
|
-
await setupTailwindPlugin(options);
|
|
64
|
+
const prettier = CACHES.prettier ?? await loadPrettier();
|
|
65
|
+
if ("_useTailwindPlugin" in options) await setupTailwindPlugin(options);
|
|
57
66
|
return Promise.all(texts.map(async (text) => {
|
|
67
|
+
const metadata = {};
|
|
68
|
+
if (options.parser === "html" || options.parser === "angular") {
|
|
69
|
+
options.parentParser = "OXFMT";
|
|
70
|
+
options.__onHtmlRoot = (root) => metadata.htmlHasMultipleRootElements = (root.children?.length ?? 0) > 1;
|
|
71
|
+
}
|
|
72
|
+
if (options.parser === "markdown") options.__inJsTemplate = true;
|
|
58
73
|
const doc = await prettier.__debug.printToDoc(text, options);
|
|
59
74
|
const symbolToNumber = /* @__PURE__ */ new Map();
|
|
60
75
|
let nextId = 1;
|
|
61
|
-
return JSON.stringify(doc, (_key, value) => {
|
|
76
|
+
return JSON.stringify([doc, metadata], (_key, value) => {
|
|
62
77
|
if (typeof value === "symbol") {
|
|
63
78
|
if (!symbolToNumber.has(value)) symbolToNumber.set(value, nextId++);
|
|
64
79
|
return symbolToNumber.get(value);
|
|
@@ -68,31 +83,30 @@ async function formatEmbeddedDoc({ texts, options }) {
|
|
|
68
83
|
});
|
|
69
84
|
}));
|
|
70
85
|
}
|
|
71
|
-
let tailwindPluginCache;
|
|
72
86
|
async function loadTailwindPlugin() {
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
return tailwindPluginCache;
|
|
87
|
+
if (!CACHES.tailwindPlugin) CACHES.tailwindPlugin = await import("./dist-D4weCFEt.js");
|
|
88
|
+
return CACHES.tailwindPlugin;
|
|
76
89
|
}
|
|
77
90
|
/**
|
|
78
|
-
* Load Tailwind CSS plugin
|
|
79
|
-
* The flag is added by Rust side only for relevant parsers.
|
|
80
|
-
*
|
|
91
|
+
* Load Tailwind CSS plugin.
|
|
81
92
|
* Option mapping (sortTailwindcss.xxx → tailwindXxx) is also done in Rust side.
|
|
82
93
|
*/
|
|
83
94
|
async function setupTailwindPlugin(options) {
|
|
84
|
-
|
|
85
|
-
const tailwindPlugin = await loadTailwindPlugin();
|
|
95
|
+
const tailwindPlugin = CACHES.tailwindPlugin ?? await loadTailwindPlugin();
|
|
86
96
|
options.plugins ??= [];
|
|
87
97
|
options.plugins.push(tailwindPlugin);
|
|
88
98
|
}
|
|
99
|
+
async function loadTailwindSorter() {
|
|
100
|
+
if (!CACHES.tailwindSorter) CACHES.tailwindSorter = await import("./sorter-DNWmw8Iu.js");
|
|
101
|
+
return CACHES.tailwindSorter;
|
|
102
|
+
}
|
|
89
103
|
/**
|
|
90
104
|
* Process Tailwind CSS classes found in JS/TS files in batch.
|
|
91
105
|
* @param args - Object containing classes and options (filepath is in options.filepath)
|
|
92
106
|
* @returns Array of sorted class strings (same order/length as input)
|
|
93
107
|
*/
|
|
94
108
|
async function sortTailwindClasses({ classes, options }) {
|
|
95
|
-
const { createSorter } = await
|
|
109
|
+
const { createSorter } = CACHES.tailwindSorter ?? await loadTailwindSorter();
|
|
96
110
|
return (await createSorter({
|
|
97
111
|
filepath: options.filepath,
|
|
98
112
|
stylesheetPath: options.tailwindStylesheet,
|
|
@@ -101,19 +115,15 @@ async function sortTailwindClasses({ classes, options }) {
|
|
|
101
115
|
preserveDuplicates: options.tailwindPreserveDuplicates
|
|
102
116
|
})).sortClassAttributes(classes);
|
|
103
117
|
}
|
|
104
|
-
let oxfmtPluginCache;
|
|
105
118
|
async function loadOxfmtPlugin() {
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
return oxfmtPluginCache;
|
|
119
|
+
if (!CACHES.oxfmtPlugin) CACHES.oxfmtPlugin = await import("./prettier-plugin-oxfmt-CLoiASgP.js");
|
|
120
|
+
return CACHES.oxfmtPlugin;
|
|
109
121
|
}
|
|
110
122
|
/**
|
|
111
|
-
* Load oxfmt plugin for js-in-xxx parsers
|
|
112
|
-
* The flag is added by Rust side only for relevant parsers.
|
|
123
|
+
* Load oxfmt plugin for js-in-xxx parsers.
|
|
113
124
|
*/
|
|
114
125
|
async function setupOxfmtPlugin(options) {
|
|
115
|
-
|
|
116
|
-
const oxcPlugin = await loadOxfmtPlugin();
|
|
126
|
+
const oxcPlugin = CACHES.oxfmtPlugin ?? await loadOxfmtPlugin();
|
|
117
127
|
options.plugins ??= [];
|
|
118
128
|
options.plugins.push(oxcPlugin);
|
|
119
129
|
}
|
|
@@ -304,11 +304,11 @@ function F(a, t) {
|
|
|
304
304
|
if (Array.isArray(a)) return (s) => F(s, a[0]);
|
|
305
305
|
let e = {};
|
|
306
306
|
for (let s of Object.keys(a)) {
|
|
307
|
-
let i = a[s], r = typeof i == "string" ? { message: () => i } : typeof i == "function" ? { message: i } : i, { message: n } = r, o = Ws(r, ei)
|
|
307
|
+
let i = a[s], r = typeof i == "string" ? { message: () => i } : typeof i == "function" ? { message: i } : i, { message: n } = r, o = Ws(r, ei);
|
|
308
308
|
e[s] = ti(Object.assign({
|
|
309
309
|
code: "BABEL_PARSER_SYNTAX_ERROR",
|
|
310
310
|
reasonCode: s,
|
|
311
|
-
toMessage:
|
|
311
|
+
toMessage: typeof n == "string" ? () => n : n
|
|
312
312
|
}, t ? { syntaxPlugin: t } : {}, o));
|
|
313
313
|
}
|
|
314
314
|
return e;
|
|
@@ -57,7 +57,7 @@ function requireNative() {
|
|
|
57
57
|
try {
|
|
58
58
|
const binding = require("@oxfmt/binding-android-arm64");
|
|
59
59
|
const bindingPackageVersion = require("@oxfmt/binding-android-arm64/package.json").version;
|
|
60
|
-
if (bindingPackageVersion !== "0.
|
|
60
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
61
61
|
return binding;
|
|
62
62
|
} catch (e) {
|
|
63
63
|
loadErrors.push(e);
|
|
@@ -71,7 +71,7 @@ function requireNative() {
|
|
|
71
71
|
try {
|
|
72
72
|
const binding = require("@oxfmt/binding-android-arm-eabi");
|
|
73
73
|
const bindingPackageVersion = require("@oxfmt/binding-android-arm-eabi/package.json").version;
|
|
74
|
-
if (bindingPackageVersion !== "0.
|
|
74
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
75
75
|
return binding;
|
|
76
76
|
} catch (e) {
|
|
77
77
|
loadErrors.push(e);
|
|
@@ -86,7 +86,7 @@ function requireNative() {
|
|
|
86
86
|
try {
|
|
87
87
|
const binding = require("@oxfmt/binding-win32-x64-gnu");
|
|
88
88
|
const bindingPackageVersion = require("@oxfmt/binding-win32-x64-gnu/package.json").version;
|
|
89
|
-
if (bindingPackageVersion !== "0.
|
|
89
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
90
90
|
return binding;
|
|
91
91
|
} catch (e) {
|
|
92
92
|
loadErrors.push(e);
|
|
@@ -100,7 +100,7 @@ function requireNative() {
|
|
|
100
100
|
try {
|
|
101
101
|
const binding = require("@oxfmt/binding-win32-x64-msvc");
|
|
102
102
|
const bindingPackageVersion = require("@oxfmt/binding-win32-x64-msvc/package.json").version;
|
|
103
|
-
if (bindingPackageVersion !== "0.
|
|
103
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
104
104
|
return binding;
|
|
105
105
|
} catch (e) {
|
|
106
106
|
loadErrors.push(e);
|
|
@@ -115,7 +115,7 @@ function requireNative() {
|
|
|
115
115
|
try {
|
|
116
116
|
const binding = require("@oxfmt/binding-win32-ia32-msvc");
|
|
117
117
|
const bindingPackageVersion = require("@oxfmt/binding-win32-ia32-msvc/package.json").version;
|
|
118
|
-
if (bindingPackageVersion !== "0.
|
|
118
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
119
119
|
return binding;
|
|
120
120
|
} catch (e) {
|
|
121
121
|
loadErrors.push(e);
|
|
@@ -129,7 +129,7 @@ function requireNative() {
|
|
|
129
129
|
try {
|
|
130
130
|
const binding = require("@oxfmt/binding-win32-arm64-msvc");
|
|
131
131
|
const bindingPackageVersion = require("@oxfmt/binding-win32-arm64-msvc/package.json").version;
|
|
132
|
-
if (bindingPackageVersion !== "0.
|
|
132
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
133
133
|
return binding;
|
|
134
134
|
} catch (e) {
|
|
135
135
|
loadErrors.push(e);
|
|
@@ -144,7 +144,7 @@ function requireNative() {
|
|
|
144
144
|
try {
|
|
145
145
|
const binding = require("@oxfmt/binding-darwin-universal");
|
|
146
146
|
const bindingPackageVersion = require("@oxfmt/binding-darwin-universal/package.json").version;
|
|
147
|
-
if (bindingPackageVersion !== "0.
|
|
147
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
148
148
|
return binding;
|
|
149
149
|
} catch (e) {
|
|
150
150
|
loadErrors.push(e);
|
|
@@ -158,7 +158,7 @@ function requireNative() {
|
|
|
158
158
|
try {
|
|
159
159
|
const binding = require("@oxfmt/binding-darwin-x64");
|
|
160
160
|
const bindingPackageVersion = require("@oxfmt/binding-darwin-x64/package.json").version;
|
|
161
|
-
if (bindingPackageVersion !== "0.
|
|
161
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
162
162
|
return binding;
|
|
163
163
|
} catch (e) {
|
|
164
164
|
loadErrors.push(e);
|
|
@@ -172,7 +172,7 @@ function requireNative() {
|
|
|
172
172
|
try {
|
|
173
173
|
const binding = require("@oxfmt/binding-darwin-arm64");
|
|
174
174
|
const bindingPackageVersion = require("@oxfmt/binding-darwin-arm64/package.json").version;
|
|
175
|
-
if (bindingPackageVersion !== "0.
|
|
175
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
176
176
|
return binding;
|
|
177
177
|
} catch (e) {
|
|
178
178
|
loadErrors.push(e);
|
|
@@ -187,7 +187,7 @@ function requireNative() {
|
|
|
187
187
|
try {
|
|
188
188
|
const binding = require("@oxfmt/binding-freebsd-x64");
|
|
189
189
|
const bindingPackageVersion = require("@oxfmt/binding-freebsd-x64/package.json").version;
|
|
190
|
-
if (bindingPackageVersion !== "0.
|
|
190
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
191
191
|
return binding;
|
|
192
192
|
} catch (e) {
|
|
193
193
|
loadErrors.push(e);
|
|
@@ -201,7 +201,7 @@ function requireNative() {
|
|
|
201
201
|
try {
|
|
202
202
|
const binding = require("@oxfmt/binding-freebsd-arm64");
|
|
203
203
|
const bindingPackageVersion = require("@oxfmt/binding-freebsd-arm64/package.json").version;
|
|
204
|
-
if (bindingPackageVersion !== "0.
|
|
204
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
205
205
|
return binding;
|
|
206
206
|
} catch (e) {
|
|
207
207
|
loadErrors.push(e);
|
|
@@ -216,7 +216,7 @@ function requireNative() {
|
|
|
216
216
|
try {
|
|
217
217
|
const binding = require("@oxfmt/binding-linux-x64-musl");
|
|
218
218
|
const bindingPackageVersion = require("@oxfmt/binding-linux-x64-musl/package.json").version;
|
|
219
|
-
if (bindingPackageVersion !== "0.
|
|
219
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
220
220
|
return binding;
|
|
221
221
|
} catch (e) {
|
|
222
222
|
loadErrors.push(e);
|
|
@@ -230,7 +230,7 @@ function requireNative() {
|
|
|
230
230
|
try {
|
|
231
231
|
const binding = require("@oxfmt/binding-linux-x64-gnu");
|
|
232
232
|
const bindingPackageVersion = require("@oxfmt/binding-linux-x64-gnu/package.json").version;
|
|
233
|
-
if (bindingPackageVersion !== "0.
|
|
233
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
234
234
|
return binding;
|
|
235
235
|
} catch (e) {
|
|
236
236
|
loadErrors.push(e);
|
|
@@ -245,7 +245,7 @@ function requireNative() {
|
|
|
245
245
|
try {
|
|
246
246
|
const binding = require("@oxfmt/binding-linux-arm64-musl");
|
|
247
247
|
const bindingPackageVersion = require("@oxfmt/binding-linux-arm64-musl/package.json").version;
|
|
248
|
-
if (bindingPackageVersion !== "0.
|
|
248
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
249
249
|
return binding;
|
|
250
250
|
} catch (e) {
|
|
251
251
|
loadErrors.push(e);
|
|
@@ -259,7 +259,7 @@ function requireNative() {
|
|
|
259
259
|
try {
|
|
260
260
|
const binding = require("@oxfmt/binding-linux-arm64-gnu");
|
|
261
261
|
const bindingPackageVersion = require("@oxfmt/binding-linux-arm64-gnu/package.json").version;
|
|
262
|
-
if (bindingPackageVersion !== "0.
|
|
262
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
263
263
|
return binding;
|
|
264
264
|
} catch (e) {
|
|
265
265
|
loadErrors.push(e);
|
|
@@ -274,7 +274,7 @@ function requireNative() {
|
|
|
274
274
|
try {
|
|
275
275
|
const binding = require("@oxfmt/binding-linux-arm-musleabihf");
|
|
276
276
|
const bindingPackageVersion = require("@oxfmt/binding-linux-arm-musleabihf/package.json").version;
|
|
277
|
-
if (bindingPackageVersion !== "0.
|
|
277
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
278
278
|
return binding;
|
|
279
279
|
} catch (e) {
|
|
280
280
|
loadErrors.push(e);
|
|
@@ -288,7 +288,7 @@ function requireNative() {
|
|
|
288
288
|
try {
|
|
289
289
|
const binding = require("@oxfmt/binding-linux-arm-gnueabihf");
|
|
290
290
|
const bindingPackageVersion = require("@oxfmt/binding-linux-arm-gnueabihf/package.json").version;
|
|
291
|
-
if (bindingPackageVersion !== "0.
|
|
291
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
292
292
|
return binding;
|
|
293
293
|
} catch (e) {
|
|
294
294
|
loadErrors.push(e);
|
|
@@ -303,7 +303,7 @@ function requireNative() {
|
|
|
303
303
|
try {
|
|
304
304
|
const binding = require("@oxfmt/binding-linux-loong64-musl");
|
|
305
305
|
const bindingPackageVersion = require("@oxfmt/binding-linux-loong64-musl/package.json").version;
|
|
306
|
-
if (bindingPackageVersion !== "0.
|
|
306
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
307
307
|
return binding;
|
|
308
308
|
} catch (e) {
|
|
309
309
|
loadErrors.push(e);
|
|
@@ -317,7 +317,7 @@ function requireNative() {
|
|
|
317
317
|
try {
|
|
318
318
|
const binding = require("@oxfmt/binding-linux-loong64-gnu");
|
|
319
319
|
const bindingPackageVersion = require("@oxfmt/binding-linux-loong64-gnu/package.json").version;
|
|
320
|
-
if (bindingPackageVersion !== "0.
|
|
320
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
321
321
|
return binding;
|
|
322
322
|
} catch (e) {
|
|
323
323
|
loadErrors.push(e);
|
|
@@ -332,7 +332,7 @@ function requireNative() {
|
|
|
332
332
|
try {
|
|
333
333
|
const binding = require("@oxfmt/binding-linux-riscv64-musl");
|
|
334
334
|
const bindingPackageVersion = require("@oxfmt/binding-linux-riscv64-musl/package.json").version;
|
|
335
|
-
if (bindingPackageVersion !== "0.
|
|
335
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
336
336
|
return binding;
|
|
337
337
|
} catch (e) {
|
|
338
338
|
loadErrors.push(e);
|
|
@@ -346,7 +346,7 @@ function requireNative() {
|
|
|
346
346
|
try {
|
|
347
347
|
const binding = require("@oxfmt/binding-linux-riscv64-gnu");
|
|
348
348
|
const bindingPackageVersion = require("@oxfmt/binding-linux-riscv64-gnu/package.json").version;
|
|
349
|
-
if (bindingPackageVersion !== "0.
|
|
349
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
350
350
|
return binding;
|
|
351
351
|
} catch (e) {
|
|
352
352
|
loadErrors.push(e);
|
|
@@ -361,7 +361,7 @@ function requireNative() {
|
|
|
361
361
|
try {
|
|
362
362
|
const binding = require("@oxfmt/binding-linux-ppc64-gnu");
|
|
363
363
|
const bindingPackageVersion = require("@oxfmt/binding-linux-ppc64-gnu/package.json").version;
|
|
364
|
-
if (bindingPackageVersion !== "0.
|
|
364
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
365
365
|
return binding;
|
|
366
366
|
} catch (e) {
|
|
367
367
|
loadErrors.push(e);
|
|
@@ -375,7 +375,7 @@ function requireNative() {
|
|
|
375
375
|
try {
|
|
376
376
|
const binding = require("@oxfmt/binding-linux-s390x-gnu");
|
|
377
377
|
const bindingPackageVersion = require("@oxfmt/binding-linux-s390x-gnu/package.json").version;
|
|
378
|
-
if (bindingPackageVersion !== "0.
|
|
378
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
379
379
|
return binding;
|
|
380
380
|
} catch (e) {
|
|
381
381
|
loadErrors.push(e);
|
|
@@ -390,7 +390,7 @@ function requireNative() {
|
|
|
390
390
|
try {
|
|
391
391
|
const binding = require("@oxfmt/binding-openharmony-arm64");
|
|
392
392
|
const bindingPackageVersion = require("@oxfmt/binding-openharmony-arm64/package.json").version;
|
|
393
|
-
if (bindingPackageVersion !== "0.
|
|
393
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
394
394
|
return binding;
|
|
395
395
|
} catch (e) {
|
|
396
396
|
loadErrors.push(e);
|
|
@@ -404,7 +404,7 @@ function requireNative() {
|
|
|
404
404
|
try {
|
|
405
405
|
const binding = require("@oxfmt/binding-openharmony-x64");
|
|
406
406
|
const bindingPackageVersion = require("@oxfmt/binding-openharmony-x64/package.json").version;
|
|
407
|
-
if (bindingPackageVersion !== "0.
|
|
407
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
408
408
|
return binding;
|
|
409
409
|
} catch (e) {
|
|
410
410
|
loadErrors.push(e);
|
|
@@ -418,7 +418,7 @@ function requireNative() {
|
|
|
418
418
|
try {
|
|
419
419
|
const binding = require("@oxfmt/binding-openharmony-arm");
|
|
420
420
|
const bindingPackageVersion = require("@oxfmt/binding-openharmony-arm/package.json").version;
|
|
421
|
-
if (bindingPackageVersion !== "0.
|
|
421
|
+
if (bindingPackageVersion !== "0.43.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.43.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
422
422
|
return binding;
|
|
423
423
|
} catch (e) {
|
|
424
424
|
loadErrors.push(e);
|
package/dist/cli-worker.d.ts
CHANGED
|
@@ -593,10 +593,9 @@ type FormatEmbeddedCodeParam = {
|
|
|
593
593
|
options: Options$1;
|
|
594
594
|
};
|
|
595
595
|
/**
|
|
596
|
-
* Format
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
* For now, html|css|md-in-js are using this.
|
|
596
|
+
* Format non-js code snippets into formatted string.
|
|
597
|
+
* Mainly used for formatting code fences within JSDoc,
|
|
598
|
+
* and is also used as a temporary fallback for html-in-js.
|
|
600
599
|
*
|
|
601
600
|
* @returns Formatted code snippet
|
|
602
601
|
*/
|
|
@@ -609,15 +608,15 @@ type FormatEmbeddedDocParam = {
|
|
|
609
608
|
options: Options$1;
|
|
610
609
|
};
|
|
611
610
|
/**
|
|
612
|
-
* Format
|
|
611
|
+
* Format non-js code snippets into Prettier `Doc` JSON strings.
|
|
613
612
|
*
|
|
614
|
-
* This makes
|
|
613
|
+
* This makes our printer correctly handle `printWidth` even for embedded code.
|
|
615
614
|
* - For gql-in-js, `texts` contains multiple parts split by `${}` in a template literal
|
|
616
615
|
* - For others, `texts` always contains a single string with `${}` parts replaced by placeholders
|
|
617
616
|
* However, this function does not need to be aware of that,
|
|
618
617
|
* as it simply formats each text part independently and returns an array of formatted parts.
|
|
619
618
|
*
|
|
620
|
-
* @returns Doc JSON strings
|
|
619
|
+
* @returns Doc JSON strings
|
|
621
620
|
*/
|
|
622
621
|
declare function formatEmbeddedDoc({
|
|
623
622
|
texts,
|
package/dist/cli-worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as sortTailwindClasses, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-
|
|
1
|
+
import { a as sortTailwindClasses, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-mHnrEtPz.js";
|
|
2
2
|
export { formatEmbeddedCode, formatEmbeddedDoc, formatFile, sortTailwindClasses };
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as runCli } from "./bindings-
|
|
2
|
-
import { i as resolvePlugins } from "./apis-
|
|
1
|
+
import { r as runCli } from "./bindings-mh4tfrCL.js";
|
|
2
|
+
import { i as resolvePlugins } from "./apis-mHnrEtPz.js";
|
|
3
3
|
import Tinypool from "tinypool";
|
|
4
4
|
import { basename } from "node:path";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
@@ -97,7 +97,7 @@ async function loadJsConfig(path) {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
if (mode === "migrate:prettier") {
|
|
100
|
-
await import("./migrate-prettier-
|
|
100
|
+
await import("./migrate-prettier-CpiJRvlG.js").then((m) => m.runMigratePrettier());
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
if (mode === "migrate:biome") {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as __toESM, t as __commonJSMin } from "./chunk-DSjvVL_1-BYdvZw3N.js";
|
|
2
|
-
import { n as loadIfExists, r as maybeResolve, t as expiringMap } from "./resolve-pWjAK-4f-
|
|
2
|
+
import { n as loadIfExists, r as maybeResolve, t as expiringMap } from "./resolve-pWjAK-4f-ColMfOaZ.js";
|
|
3
3
|
import { i as visit, n as cacheForDirs, r as spliceChangesIntoString } from "./utils-D8dQkKEd-BtAa7w-M.js";
|
|
4
|
-
import { a as sortClasses, i as sortClassList, n as error, o as warn, r as getTailwindConfig$1 } from "./sorter-BZkvDMjt-
|
|
4
|
+
import { a as sortClasses, i as sortClassList, n as error, o as warn, r as getTailwindConfig$1 } from "./sorter-BZkvDMjt-BJdi7rG8.js";
|
|
5
5
|
import { parsers as sn } from "./angular-BS7_jn7o.js";
|
|
6
|
-
import { parsers as ra, t as babel_exports } from "./babel-
|
|
6
|
+
import { parsers as ra, t as babel_exports } from "./babel-Fkr5EfJ9.js";
|
|
7
7
|
import { parsers as en, t as postcss_exports } from "./postcss-k2aCwkzC.js";
|
|
8
|
-
import index_exports from "./prettier-
|
|
8
|
+
import index_exports from "./prettier-Dwwk1Fyx.js";
|
|
9
9
|
import * as path from "node:path";
|
|
10
10
|
import { isAbsolute } from "path";
|
|
11
11
|
//#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.3997fbd_prettier@3.8.1/node_modules/prettier-plugin-tailwindcss/dist/index.mjs
|
|
@@ -1094,7 +1094,7 @@ const { parsers, printers } = createPlugin([
|
|
|
1094
1094
|
__js_expression: { load: [babel_exports] },
|
|
1095
1095
|
typescript: { load: [{
|
|
1096
1096
|
name: "prettier/plugins/typescript",
|
|
1097
|
-
importer: () => import("./typescript-
|
|
1097
|
+
importer: () => import("./typescript-G7g7T3yt.js")
|
|
1098
1098
|
}] },
|
|
1099
1099
|
meriyah: { load: [{
|
|
1100
1100
|
name: "prettier/plugins/meriyah",
|
|
@@ -342,6 +342,7 @@ var Ce = At, H = class {
|
|
|
342
342
|
DirectiveCoordinate: ["name"],
|
|
343
343
|
DirectiveArgumentCoordinate: ["name", "argumentName"]
|
|
344
344
|
};
|
|
345
|
+
new Set(Object.keys(ce));
|
|
345
346
|
var C;
|
|
346
347
|
(function(e) {
|
|
347
348
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
package/dist/index.d.ts
CHANGED
|
@@ -28,12 +28,15 @@ type ArrowParensConfig = "always" | "avoid";
|
|
|
28
28
|
type EmbeddedLanguageFormattingConfig = "auto" | "off";
|
|
29
29
|
type EndOfLineConfig = "lf" | "crlf" | "cr";
|
|
30
30
|
type HtmlWhitespaceSensitivityConfig = "css" | "strict" | "ignore";
|
|
31
|
+
type JsdocUserConfig = boolean | JsdocConfig;
|
|
31
32
|
type ObjectWrapConfig = "preserve" | "collapse";
|
|
32
33
|
type ProseWrapConfig = "always" | "never" | "preserve";
|
|
33
34
|
type QuotePropsConfig = "as-needed" | "consistent" | "preserve";
|
|
35
|
+
type SortImportsUserConfig = boolean | SortImportsConfig;
|
|
34
36
|
type SortGroupItemConfig = NewlinesBetweenMarker | string | string[];
|
|
35
37
|
type SortOrderConfig = "asc" | "desc";
|
|
36
38
|
type SortPackageJsonUserConfig = boolean | SortPackageJsonConfig;
|
|
39
|
+
type SortTailwindcssUserConfig = boolean | SortTailwindcssConfig;
|
|
37
40
|
type TrailingCommaConfig = "all" | "es5" | "none";
|
|
38
41
|
/**
|
|
39
42
|
* Configuration options for the Oxfmt.
|
|
@@ -98,6 +101,18 @@ interface Oxfmtrc {
|
|
|
98
101
|
* - Overrides `.editorconfig.insert_final_newline`
|
|
99
102
|
*/
|
|
100
103
|
insertFinalNewline?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Enable JSDoc comment formatting.
|
|
106
|
+
*
|
|
107
|
+
* When enabled, JSDoc comments are normalized and reformatted:
|
|
108
|
+
* tag aliases are canonicalized, descriptions are capitalized,
|
|
109
|
+
* long lines are wrapped, and short comments are collapsed to single-line.
|
|
110
|
+
*
|
|
111
|
+
* Pass `true` or an object to enable with defaults, or omit/set `false` to disable.
|
|
112
|
+
*
|
|
113
|
+
* - Default: Disabled
|
|
114
|
+
*/
|
|
115
|
+
jsdoc?: JsdocUserConfig;
|
|
101
116
|
/**
|
|
102
117
|
* Use single quotes instead of double quotes in JSX.
|
|
103
118
|
*
|
|
@@ -171,9 +186,11 @@ interface Oxfmtrc {
|
|
|
171
186
|
* Using the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).
|
|
172
187
|
* For details, see each field's documentation.
|
|
173
188
|
*
|
|
189
|
+
* Pass `true` or an object to enable with defaults, or omit/set `false` to disable.
|
|
190
|
+
*
|
|
174
191
|
* - Default: Disabled
|
|
175
192
|
*/
|
|
176
|
-
sortImports?:
|
|
193
|
+
sortImports?: SortImportsUserConfig;
|
|
177
194
|
/**
|
|
178
195
|
* Sort `package.json` keys.
|
|
179
196
|
*
|
|
@@ -191,9 +208,11 @@ interface Oxfmtrc {
|
|
|
191
208
|
* Option names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).
|
|
192
209
|
* For details, see each field's documentation.
|
|
193
210
|
*
|
|
211
|
+
* Pass `true` or an object to enable with defaults, or omit/set `false` to disable.
|
|
212
|
+
*
|
|
194
213
|
* - Default: Disabled
|
|
195
214
|
*/
|
|
196
|
-
sortTailwindcss?:
|
|
215
|
+
sortTailwindcss?: SortTailwindcssUserConfig;
|
|
197
216
|
/**
|
|
198
217
|
* Specify the number of spaces per indentation-level.
|
|
199
218
|
*
|
|
@@ -224,6 +243,82 @@ interface Oxfmtrc {
|
|
|
224
243
|
vueIndentScriptAndStyle?: boolean;
|
|
225
244
|
[k: string]: unknown;
|
|
226
245
|
}
|
|
246
|
+
interface JsdocConfig {
|
|
247
|
+
/**
|
|
248
|
+
* Append default values to `@param` descriptions (e.g. "Default is `value`").
|
|
249
|
+
*
|
|
250
|
+
* - Default: `true`
|
|
251
|
+
*/
|
|
252
|
+
addDefaultToDescription?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Add spaces inside JSDoc type braces: `{string}` → `{ string }`.
|
|
255
|
+
*
|
|
256
|
+
* - Default: `false`
|
|
257
|
+
*/
|
|
258
|
+
bracketSpacing?: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Capitalize the first letter of tag descriptions.
|
|
261
|
+
*
|
|
262
|
+
* - Default: `true`
|
|
263
|
+
*/
|
|
264
|
+
capitalizeDescriptions?: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* How to format comment blocks.
|
|
267
|
+
*
|
|
268
|
+
* - `"singleLine"` — Convert to single-line `/** content * /` when possible.
|
|
269
|
+
* - `"multiline"` — Always use multi-line format.
|
|
270
|
+
* - `"keep"` — Preserve original formatting.
|
|
271
|
+
*
|
|
272
|
+
* - Default: `"singleLine"`
|
|
273
|
+
*/
|
|
274
|
+
commentLineStrategy?: string;
|
|
275
|
+
/**
|
|
276
|
+
* Emit `@description` tag instead of inline description.
|
|
277
|
+
*
|
|
278
|
+
* - Default: `false`
|
|
279
|
+
*/
|
|
280
|
+
descriptionTag?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Add a trailing dot to the end of descriptions.
|
|
283
|
+
*
|
|
284
|
+
* - Default: `false`
|
|
285
|
+
*/
|
|
286
|
+
descriptionWithDot?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Preserve indentation in unparsable `@example` code.
|
|
289
|
+
*
|
|
290
|
+
* - Default: `false`
|
|
291
|
+
*/
|
|
292
|
+
keepUnparsableExampleIndent?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Strategy for wrapping description lines at print width.
|
|
295
|
+
*
|
|
296
|
+
* - `"greedy"` — Always re-wrap text to fit within print width.
|
|
297
|
+
* - `"balance"` — Preserve original line breaks if all lines fit within print width.
|
|
298
|
+
*
|
|
299
|
+
* - Default: `"greedy"`
|
|
300
|
+
*/
|
|
301
|
+
lineWrappingStyle?: string;
|
|
302
|
+
/**
|
|
303
|
+
* Use fenced code blocks (```` ``` ````) instead of 4-space indentation for code without a language tag.
|
|
304
|
+
*
|
|
305
|
+
* - Default: `false`
|
|
306
|
+
*/
|
|
307
|
+
preferCodeFences?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Add a blank line between the last `@param` and `@returns`.
|
|
310
|
+
*
|
|
311
|
+
* - Default: `false`
|
|
312
|
+
*/
|
|
313
|
+
separateReturnsFromParam?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Add blank lines between different tag groups (e.g. between `@param` and `@returns`).
|
|
316
|
+
*
|
|
317
|
+
* - Default: `false`
|
|
318
|
+
*/
|
|
319
|
+
separateTagGroups?: boolean;
|
|
320
|
+
[k: string]: unknown;
|
|
321
|
+
}
|
|
227
322
|
interface OxfmtOverrideConfig {
|
|
228
323
|
/**
|
|
229
324
|
* Glob patterns to exclude from this override.
|
|
@@ -290,6 +385,18 @@ interface FormatConfig {
|
|
|
290
385
|
* - Overrides `.editorconfig.insert_final_newline`
|
|
291
386
|
*/
|
|
292
387
|
insertFinalNewline?: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Enable JSDoc comment formatting.
|
|
390
|
+
*
|
|
391
|
+
* When enabled, JSDoc comments are normalized and reformatted:
|
|
392
|
+
* tag aliases are canonicalized, descriptions are capitalized,
|
|
393
|
+
* long lines are wrapped, and short comments are collapsed to single-line.
|
|
394
|
+
*
|
|
395
|
+
* Pass `true` or an object to enable with defaults, or omit/set `false` to disable.
|
|
396
|
+
*
|
|
397
|
+
* - Default: Disabled
|
|
398
|
+
*/
|
|
399
|
+
jsdoc?: JsdocUserConfig;
|
|
293
400
|
/**
|
|
294
401
|
* Use single quotes instead of double quotes in JSX.
|
|
295
402
|
*
|
|
@@ -356,9 +463,11 @@ interface FormatConfig {
|
|
|
356
463
|
* Using the similar algorithm as [eslint-plugin-perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).
|
|
357
464
|
* For details, see each field's documentation.
|
|
358
465
|
*
|
|
466
|
+
* Pass `true` or an object to enable with defaults, or omit/set `false` to disable.
|
|
467
|
+
*
|
|
359
468
|
* - Default: Disabled
|
|
360
469
|
*/
|
|
361
|
-
sortImports?:
|
|
470
|
+
sortImports?: SortImportsUserConfig;
|
|
362
471
|
/**
|
|
363
472
|
* Sort `package.json` keys.
|
|
364
473
|
*
|
|
@@ -376,9 +485,11 @@ interface FormatConfig {
|
|
|
376
485
|
* Option names omit the `tailwind` prefix used in the original plugin (e.g., `config` instead of `tailwindConfig`).
|
|
377
486
|
* For details, see each field's documentation.
|
|
378
487
|
*
|
|
488
|
+
* Pass `true` or an object to enable with defaults, or omit/set `false` to disable.
|
|
489
|
+
*
|
|
379
490
|
* - Default: Disabled
|
|
380
491
|
*/
|
|
381
|
-
sortTailwindcss?:
|
|
492
|
+
sortTailwindcss?: SortTailwindcssUserConfig;
|
|
382
493
|
/**
|
|
383
494
|
* Specify the number of spaces per indentation-level.
|
|
384
495
|
*
|
|
@@ -639,7 +750,7 @@ interface SortTailwindcssConfig {
|
|
|
639
750
|
}
|
|
640
751
|
//#endregion
|
|
641
752
|
//#region src-js/index.d.ts
|
|
642
|
-
|
|
753
|
+
interface OxfmtConfig extends Oxfmtrc {}
|
|
643
754
|
/**
|
|
644
755
|
* Configuration options for the `format()` API.
|
|
645
756
|
*
|
|
@@ -673,4 +784,4 @@ declare function format(fileName: string, sourceText: string, options?: FormatCo
|
|
|
673
784
|
*/
|
|
674
785
|
declare function jsTextToDoc(sourceExt: string, sourceText: string, oxfmtPluginOptionsJson: string, parentContext: string): Promise<string | null>;
|
|
675
786
|
//#endregion
|
|
676
|
-
export {
|
|
787
|
+
export { ArrowParensConfig, CustomGroupItemConfig, EmbeddedLanguageFormattingConfig, EndOfLineConfig, FormatConfig, FormatOptions, HtmlWhitespaceSensitivityConfig, JsdocConfig, JsdocUserConfig, NewlinesBetweenMarker, ObjectWrapConfig, OxfmtConfig, OxfmtOverrideConfig, Oxfmtrc, ProseWrapConfig, QuotePropsConfig, SortGroupItemConfig, SortImportsConfig, SortImportsOptions, SortImportsUserConfig, SortOrderConfig, SortPackageJsonConfig, SortPackageJsonOptions, SortPackageJsonUserConfig, SortTailwindcssConfig, SortTailwindcssOptions, SortTailwindcssUserConfig, TailwindcssOptions, TrailingCommaConfig, defineConfig, format, jsTextToDoc };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as jsTextToDoc$1, t as format$1 } from "./bindings-
|
|
2
|
-
import { a as sortTailwindClasses, i as resolvePlugins, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-
|
|
1
|
+
import { n as jsTextToDoc$1, t as format$1 } from "./bindings-mh4tfrCL.js";
|
|
2
|
+
import { a as sortTailwindClasses, i as resolvePlugins, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-mHnrEtPz.js";
|
|
3
3
|
//#region src-js/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* Define an oxfmt configuration with type inference.
|
|
@@ -19499,11 +19499,11 @@ var require_babel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
19499
19499
|
if (Array.isArray(e)) return (t) => ParseErrorEnum(t, e[0]);
|
|
19500
19500
|
const r = {};
|
|
19501
19501
|
for (const n of Object.keys(e)) {
|
|
19502
|
-
const s = e[n], i = "string" == typeof s ? { message: () => s } : "function" == typeof s ? { message: s } : s, { message: o } = i, a = _objectWithoutPropertiesLoose(i, p)
|
|
19502
|
+
const s = e[n], i = "string" == typeof s ? { message: () => s } : "function" == typeof s ? { message: s } : s, { message: o } = i, a = _objectWithoutPropertiesLoose(i, p);
|
|
19503
19503
|
r[n] = toParseErrorConstructor(Object.assign({
|
|
19504
19504
|
code: "BABEL_PARSER_SYNTAX_ERROR",
|
|
19505
19505
|
reasonCode: n,
|
|
19506
|
-
toMessage:
|
|
19506
|
+
toMessage: "string" == typeof o ? () => o : o
|
|
19507
19507
|
}, t ? { syntaxPlugin: t } : {}, a));
|
|
19508
19508
|
}
|
|
19509
19509
|
return r;
|
|
@@ -31757,10 +31757,7 @@ var require_babel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31757
31757
|
for (let t = 0; t < e.length; t++) {
|
|
31758
31758
|
const r = e[t];
|
|
31759
31759
|
let n;
|
|
31760
|
-
if (r ? "object" != typeof r ? n = "contains a non-object node" : r.type ? r instanceof s.default && (n = "has a NodePath when it expected a raw object") : n = "without a type" : n = "has falsy node", n) {
|
|
31761
|
-
const e = Array.isArray(r) ? "array" : typeof r;
|
|
31762
|
-
throw new Error(`Node list ${n} with the index of ${t} and type of ${e}`);
|
|
31763
|
-
}
|
|
31760
|
+
if (r ? "object" != typeof r ? n = "contains a non-object node" : r.type ? r instanceof s.default && (n = "has a NodePath when it expected a raw object") : n = "without a type" : n = "has falsy node", n) throw new Error(`Node list ${n} with the index of ${t} and type of ${Array.isArray(r) ? "array" : typeof r}`);
|
|
31764
31761
|
}
|
|
31765
31762
|
return e;
|
|
31766
31763
|
}
|
|
@@ -9,7 +9,7 @@ import { readFile } from "node:fs/promises";
|
|
|
9
9
|
async function runMigratePrettier() {
|
|
10
10
|
const cwd = process.cwd();
|
|
11
11
|
if (await hasOxfmtrcFile(cwd)) return exitWithError("Oxfmt configuration file already exists.");
|
|
12
|
-
const { resolveConfigFile, resolveConfig } = await import("./prettier-
|
|
12
|
+
const { resolveConfigFile, resolveConfig } = await import("./prettier-Dwwk1Fyx.js");
|
|
13
13
|
const prettierConfigPath = await resolveConfigFile(join(cwd, "dummy.js"));
|
|
14
14
|
if (!prettierConfigPath) {
|
|
15
15
|
console.log("No Prettier configuration file found.");
|
|
@@ -11340,7 +11340,7 @@ async function loadConfigFromPackageYaml(file) {
|
|
|
11340
11340
|
var parseYaml;
|
|
11341
11341
|
async function loadYaml(file) {
|
|
11342
11342
|
const content = await read_file_default(file);
|
|
11343
|
-
if (!parseYaml) ({__parsePrettierYamlConfig: parseYaml} = await import("./yaml-
|
|
11343
|
+
if (!parseYaml) ({__parsePrettierYamlConfig: parseYaml} = await import("./yaml-BID5Twob.js"));
|
|
11344
11344
|
try {
|
|
11345
11345
|
return parseYaml(content);
|
|
11346
11346
|
} catch (error) {
|
|
@@ -15192,7 +15192,7 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
15192
15192
|
]
|
|
15193
15193
|
},
|
|
15194
15194
|
{
|
|
15195
|
-
importPlugin: () => import("./babel-
|
|
15195
|
+
importPlugin: () => import("./babel-Fkr5EfJ9.js"),
|
|
15196
15196
|
parsers: [
|
|
15197
15197
|
"babel",
|
|
15198
15198
|
"babel-flow",
|
|
@@ -15220,7 +15220,7 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
15220
15220
|
printers: ["glimmer"]
|
|
15221
15221
|
},
|
|
15222
15222
|
{
|
|
15223
|
-
importPlugin: () => import("./graphql-
|
|
15223
|
+
importPlugin: () => import("./graphql-BTqRh-7l.js"),
|
|
15224
15224
|
parsers: ["graphql"],
|
|
15225
15225
|
printers: ["graphql"]
|
|
15226
15226
|
},
|
|
@@ -15258,11 +15258,11 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
15258
15258
|
printers: ["postcss"]
|
|
15259
15259
|
},
|
|
15260
15260
|
{
|
|
15261
|
-
importPlugin: () => import("./typescript-
|
|
15261
|
+
importPlugin: () => import("./typescript-G7g7T3yt.js"),
|
|
15262
15262
|
parsers: ["typescript"]
|
|
15263
15263
|
},
|
|
15264
15264
|
{
|
|
15265
|
-
importPlugin: () => import("./yaml-
|
|
15265
|
+
importPlugin: () => import("./yaml-BID5Twob.js"),
|
|
15266
15266
|
parsers: ["yaml"],
|
|
15267
15267
|
printers: ["yaml"]
|
|
15268
15268
|
}
|
|
@@ -4116,8 +4116,7 @@ var import_lib = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4116
4116
|
};
|
|
4117
4117
|
}
|
|
4118
4118
|
const mergeExports = (obj, exports$1) => {
|
|
4119
|
-
|
|
4120
|
-
Object.defineProperties(obj, descriptors);
|
|
4119
|
+
Object.defineProperties(obj, Object.getOwnPropertyDescriptors(exports$1));
|
|
4121
4120
|
return Object.freeze(obj);
|
|
4122
4121
|
};
|
|
4123
4122
|
module.exports = mergeExports(resolve, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveJsFrom, t as expiringMap } from "./resolve-pWjAK-4f-
|
|
1
|
+
import { a as resolveJsFrom, t as expiringMap } from "./resolve-pWjAK-4f-ColMfOaZ.js";
|
|
2
2
|
import { n as cacheForDirs, t as bigSign } from "./utils-D8dQkKEd-BtAa7w-M.js";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -103,14 +103,14 @@ async function getTailwindConfig(options) {
|
|
|
103
103
|
if (!stylesheet && !(mod === null || mod === void 0 ? void 0 : mod.__unstable__loadDesignSystem)) jsConfig = jsConfig ?? findClosestJsConfig(inputDir);
|
|
104
104
|
if (jsConfig) {
|
|
105
105
|
if (!stylesheet) return pathToApiMap.remember(`${pkgDir}:${jsConfig}`, async () => {
|
|
106
|
-
const { loadV3 } = await import("./v3-D-mr2VVh-
|
|
106
|
+
const { loadV3 } = await import("./v3-D-mr2VVh-CisVsFM0.js");
|
|
107
107
|
return loadV3(pkgDir, jsConfig);
|
|
108
108
|
});
|
|
109
109
|
error("explicit-stylesheet-and-config-together", base, `You have specified a Tailwind CSS stylesheet and a Tailwind CSS config at the same time. Use stylesheetPath unless you are using v3. Preferring the stylesheet.`);
|
|
110
110
|
}
|
|
111
111
|
if (mod && !mod.__unstable__loadDesignSystem) {
|
|
112
112
|
if (!stylesheet) return pathToApiMap.remember(`${pkgDir}:${jsConfig}`, async () => {
|
|
113
|
-
const { loadV3 } = await import("./v3-D-mr2VVh-
|
|
113
|
+
const { loadV3 } = await import("./v3-D-mr2VVh-CisVsFM0.js");
|
|
114
114
|
return loadV3(pkgDir, jsConfig);
|
|
115
115
|
});
|
|
116
116
|
mod = null;
|
|
@@ -118,7 +118,7 @@ async function getTailwindConfig(options) {
|
|
|
118
118
|
}
|
|
119
119
|
if (mod && mod.__unstable__loadDesignSystem && pkgDir) stylesheet ?? (stylesheet = `${pkgDir}/theme.css`);
|
|
120
120
|
return pathToApiMap.remember(`${pkgDir}:${stylesheet}`, async () => {
|
|
121
|
-
const { loadV4 } = await import("./v4-C-HWEQJm-
|
|
121
|
+
const { loadV4 } = await import("./v4-C-HWEQJm-CbHL6UrB.js");
|
|
122
122
|
return loadV4(mod, stylesheet);
|
|
123
123
|
});
|
|
124
124
|
}
|
|
@@ -11499,7 +11499,9 @@ var qp = [
|
|
|
11499
11499
|
"wasi",
|
|
11500
11500
|
"worker_threads",
|
|
11501
11501
|
"zlib"
|
|
11502
|
-
]
|
|
11502
|
+
];
|
|
11503
|
+
new Set(qp);
|
|
11504
|
+
var Ab = new Set([
|
|
11503
11505
|
"node:sea",
|
|
11504
11506
|
"node:sqlite",
|
|
11505
11507
|
"node:test",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as __toESM, i as __require, n as __esmMin, t as __commonJSMin } from "./chunk-DSjvVL_1-BYdvZw3N.js";
|
|
2
2
|
import { t as bigSign } from "./utils-D8dQkKEd-BtAa7w-M.js";
|
|
3
|
-
import { t as createJiti } from "./jiti-Bb1dT6Cw-
|
|
3
|
+
import { t as createJiti } from "./jiti-Bb1dT6Cw-CnTrJOrf.js";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
6
|
//#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.3997fbd_prettier@3.8.1/node_modules/prettier-plugin-tailwindcss/dist/v3-D-mr2VVh.mjs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __exportAll } from "./chunk-DSjvVL_1-BYdvZw3N.js";
|
|
2
|
-
import { a as resolveJsFrom, i as resolveCssFrom } from "./resolve-pWjAK-4f-
|
|
3
|
-
import { t as createJiti } from "./jiti-Bb1dT6Cw-
|
|
2
|
+
import { a as resolveJsFrom, i as resolveCssFrom } from "./resolve-pWjAK-4f-ColMfOaZ.js";
|
|
3
|
+
import { t as createJiti } from "./jiti-Bb1dT6Cw-CnTrJOrf.js";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
@@ -5109,8 +5109,8 @@ var Zn, er = class {
|
|
|
5109
5109
|
}
|
|
5110
5110
|
#n(e) {
|
|
5111
5111
|
if (!Zn) {
|
|
5112
|
-
let [o] = this.#e
|
|
5113
|
-
Zn = Object.getOwnPropertyDescriptor(
|
|
5112
|
+
let [o] = this.#e;
|
|
5113
|
+
Zn = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(o)), "rangeAsLinePos").get;
|
|
5114
5114
|
}
|
|
5115
5115
|
if (this.#t ?? (this.#t = { root: { context: { src: this.text } } }), this.text === "" && e.origStart === 0 && e.origEnd === 0) return {
|
|
5116
5116
|
start: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxfmt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Formatter for the JavaScript Oxidation Compiler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"formatter",
|
|
@@ -67,24 +67,24 @@
|
|
|
67
67
|
},
|
|
68
68
|
"preferUnplugged": true,
|
|
69
69
|
"optionalDependencies": {
|
|
70
|
-
"@oxfmt/binding-darwin-arm64": "0.
|
|
71
|
-
"@oxfmt/binding-android-arm64": "0.
|
|
72
|
-
"@oxfmt/binding-win32-arm64-msvc": "0.
|
|
73
|
-
"@oxfmt/binding-linux-arm64-gnu": "0.
|
|
74
|
-
"@oxfmt/binding-linux-arm64-musl": "0.
|
|
75
|
-
"@oxfmt/binding-openharmony-arm64": "0.
|
|
76
|
-
"@oxfmt/binding-android-arm-eabi": "0.
|
|
77
|
-
"@oxfmt/binding-linux-arm-gnueabihf": "0.
|
|
78
|
-
"@oxfmt/binding-linux-arm-musleabihf": "0.
|
|
79
|
-
"@oxfmt/binding-win32-ia32-msvc": "0.
|
|
80
|
-
"@oxfmt/binding-linux-ppc64-gnu": "0.
|
|
81
|
-
"@oxfmt/binding-linux-riscv64-gnu": "0.
|
|
82
|
-
"@oxfmt/binding-linux-riscv64-musl": "0.
|
|
83
|
-
"@oxfmt/binding-linux-s390x-gnu": "0.
|
|
84
|
-
"@oxfmt/binding-darwin-x64": "0.
|
|
85
|
-
"@oxfmt/binding-win32-x64-msvc": "0.
|
|
86
|
-
"@oxfmt/binding-freebsd-x64": "0.
|
|
87
|
-
"@oxfmt/binding-linux-x64-gnu": "0.
|
|
88
|
-
"@oxfmt/binding-linux-x64-musl": "0.
|
|
70
|
+
"@oxfmt/binding-darwin-arm64": "0.43.0",
|
|
71
|
+
"@oxfmt/binding-android-arm64": "0.43.0",
|
|
72
|
+
"@oxfmt/binding-win32-arm64-msvc": "0.43.0",
|
|
73
|
+
"@oxfmt/binding-linux-arm64-gnu": "0.43.0",
|
|
74
|
+
"@oxfmt/binding-linux-arm64-musl": "0.43.0",
|
|
75
|
+
"@oxfmt/binding-openharmony-arm64": "0.43.0",
|
|
76
|
+
"@oxfmt/binding-android-arm-eabi": "0.43.0",
|
|
77
|
+
"@oxfmt/binding-linux-arm-gnueabihf": "0.43.0",
|
|
78
|
+
"@oxfmt/binding-linux-arm-musleabihf": "0.43.0",
|
|
79
|
+
"@oxfmt/binding-win32-ia32-msvc": "0.43.0",
|
|
80
|
+
"@oxfmt/binding-linux-ppc64-gnu": "0.43.0",
|
|
81
|
+
"@oxfmt/binding-linux-riscv64-gnu": "0.43.0",
|
|
82
|
+
"@oxfmt/binding-linux-riscv64-musl": "0.43.0",
|
|
83
|
+
"@oxfmt/binding-linux-s390x-gnu": "0.43.0",
|
|
84
|
+
"@oxfmt/binding-darwin-x64": "0.43.0",
|
|
85
|
+
"@oxfmt/binding-win32-x64-msvc": "0.43.0",
|
|
86
|
+
"@oxfmt/binding-freebsd-x64": "0.43.0",
|
|
87
|
+
"@oxfmt/binding-linux-x64-gnu": "0.43.0",
|
|
88
|
+
"@oxfmt/binding-linux-x64-musl": "0.43.0"
|
|
89
89
|
}
|
|
90
90
|
}
|
package/dist/sorter-DFoFc7QW.js
DELETED