oxfmt 0.51.0 → 0.53.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/dist/{acorn-Cz3eAoi8.js → acorn-C-l7ouWN.js} +1 -1
- package/dist/{angular-BzDc3wVg.js → angular-4Mc0TmPv.js} +3 -5
- package/dist/{apis-H4bwlBNm.js → apis-DOCQy_NG.js} +6 -6
- package/dist/{babel-Cs312VeV.js → babel-DjR61Wf3.js} +2 -3
- package/dist/{bindings-qpSSlUMn.js → bindings-ChKdN0o7.js} +31 -30
- package/dist/chunk-DSjvVL_1-CrjveNIv.js +36 -0
- package/dist/cli-worker.js +1 -1
- package/dist/cli.js +44 -25
- package/dist/{dist-DieWQ1D0.js → dist-Cb-CB0nt.js} +71 -50
- package/dist/{estree-BL2Xy2uB.js → estree-DHQPBKqf.js} +1 -1
- package/dist/{flow-Bj4lBR-Y.js → flow-Cz3mJAtC.js} +1 -1
- package/dist/{glimmer-C2ccnwyy.js → glimmer-ubhL-0tG.js} +1 -1
- package/dist/{graphql-D73FSqwO.js → graphql-Cl0TIiHU.js} +1 -1
- package/dist/{html-ENhiK7MR.js → html-Cqnv8X__.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-BbKOMZ57.js → init-DGfXRYLw.js} +1 -1
- package/dist/{jiti-Bb1dT6Cw-BtDs_aWX.js → jiti-Bb1dT6Cw-bfahw2Ut.js} +2 -2
- package/dist/{markdown-CDTH7TpJ.js → markdown-Eujfu-fQ.js} +1 -1
- package/dist/{meriyah-C-N-xeFc.js → meriyah-DESRG6oe.js} +1 -1
- package/dist/{migrate-biome-BMqs7-eg.js → migrate-biome-P928W9-y.js} +1 -1
- package/dist/{migrate-prettier-CBzqnxHw.js → migrate-prettier-DWPaoKDl.js} +2 -2
- package/dist/{plugin-DiRKvkOT.js → plugin-DOvWpprN.js} +434 -375
- package/dist/{postcss-CS83Slco.js → postcss-BFLfznNY.js} +1 -1
- package/dist/{prettier-D7Ly-aG0.js → prettier-CttUn4xj.js} +15 -15
- package/dist/{sorter-BZkvDMjt-r7M4pM9t.js → sorter-BZkvDMjt-X7PZZf-k.js} +8 -42
- package/dist/{sorter-D0Nd4qpi.js → sorter-o4mwRTof.js} +1 -1
- package/dist/{typescript-DkgFgfZO.js → typescript-lqJOqGcK.js} +1 -1
- package/dist/{v3-D-mr2VVh-DBBWnwM8.js → v3-D-mr2VVh-BYLPgMY0.js} +4 -3
- package/dist/{v4-C-HWEQJm-OZwT-Lc8.js → v4-C-HWEQJm-DbK_mluY.js} +4 -3
- package/dist/{yaml-Ddi9JTUZ.js → yaml-BT3ntp8h.js} +3 -3
- package/package.json +25 -21
- /package/dist/{chunk-HkwdBwDg.js → chunk-CNf5ZN-e.js} +0 -0
- /package/dist/{prettier-plugin-oxfmt-Besh6ER1.js → prettier-plugin-oxfmt-Dj6FaAil.js} +0 -0
- /package/dist/{shared-BTEY2VsW.js → shared-BiMl-bLP.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __esmMin } from "./chunk-
|
|
1
|
+
import { n as __esmMin } from "./chunk-CNf5ZN-e.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/prettier@3.8.3/node_modules/prettier/plugins/acorn.mjs
|
|
3
3
|
function je(e, t) {
|
|
4
4
|
for (var i = 65536, s = 0; s < t.length; s += 2) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __esmMin } from "./chunk-
|
|
1
|
+
import { n as __esmMin } from "./chunk-CNf5ZN-e.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/prettier@3.8.3/node_modules/prettier/plugins/angular.mjs
|
|
3
3
|
function Fr(t) {
|
|
4
4
|
return typeof t == "string" ? (e) => e === t : (e) => t.test(e);
|
|
@@ -3502,8 +3502,7 @@ var init_angular = __esmMin((() => {
|
|
|
3502
3502
|
result: Ls()[t](e, n.sourceSpan, 0),
|
|
3503
3503
|
comments: Hi(e)
|
|
3504
3504
|
});
|
|
3505
|
-
}, Rs = tt("parseAction"), $s = tt("parseBinding")
|
|
3506
|
-
Ds = tt("parseInterpolationExpression"), Bs = (t) => {
|
|
3505
|
+
}, Rs = tt("parseAction"), $s = tt("parseBinding"), Ds = tt("parseInterpolationExpression"), Bs = (t) => {
|
|
3507
3506
|
let e = Ps(t);
|
|
3508
3507
|
return Ms({
|
|
3509
3508
|
...e,
|
|
@@ -3995,8 +3994,7 @@ var init_angular = __esmMin((() => {
|
|
|
3995
3994
|
it = (t) => (e) => {
|
|
3996
3995
|
let { result: n, comments: s } = t(e);
|
|
3997
3996
|
return Object.assign(yr(n), { comments: s });
|
|
3998
|
-
}, ot = it(Rs), cn = it($s);
|
|
3999
|
-
un = it(Ds), pn = (t) => Lr(Bs(t).result.templateBindings, t);
|
|
3997
|
+
}, ot = it(Rs), cn = it($s), un = it(Ds), pn = (t) => Lr(Bs(t).result.templateBindings, t);
|
|
4000
3998
|
no = at(ot), so = at(cn), ro = at(un), io = at(pn);
|
|
4001
3999
|
}));
|
|
4002
4000
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as __toESM } from "./chunk-
|
|
1
|
+
import { o as __toESM } from "./chunk-CNf5ZN-e.js";
|
|
2
2
|
//#region src-js/libs/apis.ts
|
|
3
3
|
const CACHES = {
|
|
4
4
|
prettier: null,
|
|
@@ -13,7 +13,7 @@ async function loadCached(key, loader) {
|
|
|
13
13
|
}
|
|
14
14
|
async function loadPrettier() {
|
|
15
15
|
return loadCached("prettier", async () => {
|
|
16
|
-
const prettier = await import("./prettier-
|
|
16
|
+
const prettier = await import("./prettier-CttUn4xj.js");
|
|
17
17
|
const { formatOptionsHiddenDefaults } = prettier.__internal;
|
|
18
18
|
formatOptionsHiddenDefaults.parentParser = null;
|
|
19
19
|
formatOptionsHiddenDefaults.__onHtmlRoot = null;
|
|
@@ -84,7 +84,7 @@ async function formatEmbeddedDoc({ texts, options }) {
|
|
|
84
84
|
* Option mapping (sortTailwindcss.xxx → tailwindXxx) is also done in Rust side.
|
|
85
85
|
*/
|
|
86
86
|
async function setupTailwindPlugin(options) {
|
|
87
|
-
CACHES.tailwindPlugin ??= await loadCached("tailwindPlugin", () => import("./dist-
|
|
87
|
+
CACHES.tailwindPlugin ??= await loadCached("tailwindPlugin", () => import("./dist-Cb-CB0nt.js"));
|
|
88
88
|
options.plugins ??= [];
|
|
89
89
|
options.plugins.push(CACHES.tailwindPlugin);
|
|
90
90
|
}
|
|
@@ -94,7 +94,7 @@ async function setupTailwindPlugin(options) {
|
|
|
94
94
|
* @returns Array of sorted class strings (same order/length as input)
|
|
95
95
|
*/
|
|
96
96
|
async function sortTailwindClasses({ classes, options }) {
|
|
97
|
-
CACHES.tailwindSorter ??= await loadCached("tailwindSorter", () => import("./sorter-
|
|
97
|
+
CACHES.tailwindSorter ??= await loadCached("tailwindSorter", () => import("./sorter-o4mwRTof.js"));
|
|
98
98
|
const { createSorter } = CACHES.tailwindSorter;
|
|
99
99
|
return (await createSorter({
|
|
100
100
|
filepath: options.filepath,
|
|
@@ -108,7 +108,7 @@ async function sortTailwindClasses({ classes, options }) {
|
|
|
108
108
|
* Load prettier-plugin-svelte to provide the `svelte` parser.
|
|
109
109
|
*/
|
|
110
110
|
async function setupSveltePlugin(options) {
|
|
111
|
-
CACHES.sveltePlugin ??= await loadCached("sveltePlugin", async () => await import("./plugin-
|
|
111
|
+
CACHES.sveltePlugin ??= await loadCached("sveltePlugin", async () => await import("./plugin-DOvWpprN.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)));
|
|
112
112
|
options.plugins ??= [];
|
|
113
113
|
options.plugins.push(CACHES.sveltePlugin);
|
|
114
114
|
}
|
|
@@ -116,7 +116,7 @@ async function setupSveltePlugin(options) {
|
|
|
116
116
|
* Load oxfmt plugin for js-in-xxx parsers.
|
|
117
117
|
*/
|
|
118
118
|
async function setupOxfmtPlugin(options) {
|
|
119
|
-
CACHES.oxfmtPlugin ??= await loadCached("oxfmtPlugin", async () => await import("./prettier-plugin-oxfmt-
|
|
119
|
+
CACHES.oxfmtPlugin ??= await loadCached("oxfmtPlugin", async () => await import("./prettier-plugin-oxfmt-Dj6FaAil.js"));
|
|
120
120
|
options.plugins ??= [];
|
|
121
121
|
options.plugins.push(CACHES.oxfmtPlugin);
|
|
122
122
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __esmMin, r as __exportAll } from "./chunk-
|
|
1
|
+
import { n as __esmMin, r as __exportAll } from "./chunk-CNf5ZN-e.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/prettier@3.8.3/node_modules/prettier/plugins/babel.mjs
|
|
3
3
|
var babel_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
default: () => Ks,
|
|
@@ -9057,8 +9057,7 @@ var init_babel = __esmMin((() => {
|
|
|
9057
9057
|
};
|
|
9058
9058
|
ar(oi);
|
|
9059
9059
|
Wt = /* @__PURE__ */ new Map();
|
|
9060
|
-
cs = ke(" ");
|
|
9061
|
-
ls = ke(/[^\n\r]/u);
|
|
9060
|
+
cs = ke(" "), ls = ke(/[^\n\r]/u);
|
|
9062
9061
|
ps = or;
|
|
9063
9062
|
us = (a) => a === `
|
|
9064
9063
|
` || a === "\r" || a === "\u2028" || a === "\u2029";
|
|
@@ -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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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.53.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);
|
|
@@ -427,20 +427,21 @@ function requireNative() {
|
|
|
427
427
|
else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
428
428
|
}
|
|
429
429
|
nativeBinding = requireNative();
|
|
430
|
-
|
|
430
|
+
const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || process.env.NAPI_RS_FORCE_WASI === "error";
|
|
431
|
+
if (!nativeBinding || forceWasi) {
|
|
431
432
|
let wasiBinding = null;
|
|
432
433
|
let wasiBindingError = null;
|
|
433
434
|
try {
|
|
434
435
|
wasiBinding = require("./oxfmt.wasi.cjs");
|
|
435
436
|
nativeBinding = wasiBinding;
|
|
436
437
|
} catch (err) {
|
|
437
|
-
if (
|
|
438
|
+
if (forceWasi) wasiBindingError = err;
|
|
438
439
|
}
|
|
439
|
-
if (!nativeBinding ||
|
|
440
|
+
if (!nativeBinding || forceWasi) try {
|
|
440
441
|
wasiBinding = require("@oxfmt/binding-wasm32-wasi");
|
|
441
442
|
nativeBinding = wasiBinding;
|
|
442
443
|
} catch (err) {
|
|
443
|
-
if (
|
|
444
|
+
if (forceWasi) {
|
|
444
445
|
if (!wasiBindingError) wasiBindingError = err;
|
|
445
446
|
else wasiBindingError.cause = err;
|
|
446
447
|
loadErrors.push(err);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.2b6f3c2_prettier-plugin-svelte@4.0.1_prettie_961279539c8b58c29c93389b521be834/node_modules/prettier-plugin-tailwindcss/dist/chunk-DSjvVL_1.mjs
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
|
+
var __exportAll = (all, symbols) => {
|
|
12
|
+
let target = {};
|
|
13
|
+
for (var name in all) __defProp(target, name, {
|
|
14
|
+
get: all[name],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
22
|
+
key = keys[i];
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
24
|
+
get: ((k) => from[k]).bind(null, key),
|
|
25
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return to;
|
|
29
|
+
};
|
|
30
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
31
|
+
value: mod,
|
|
32
|
+
enumerable: true
|
|
33
|
+
}) : target, mod));
|
|
34
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
35
|
+
//#endregion
|
|
36
|
+
export { __toESM as a, __require as i, __esmMin as n, __exportAll as r, __commonJSMin as t };
|
package/dist/cli-worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as sortTailwindClasses, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-
|
|
1
|
+
import { i as sortTailwindClasses, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-DOCQy_NG.js";
|
|
2
2
|
export { formatEmbeddedCode, formatEmbeddedDoc, formatFile, sortTailwindClasses };
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as runCli } from "./bindings-
|
|
1
|
+
import { r as runCli } from "./bindings-ChKdN0o7.js";
|
|
2
2
|
import Tinypool from "tinypool";
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
4
|
import { extname } from "node:path";
|
|
@@ -51,7 +51,10 @@ async function sortTailwindClasses(options, classes) {
|
|
|
51
51
|
}, { name: "sortTailwindClasses" }).catch(() => null);
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region ../shared/src-js/
|
|
54
|
+
//#region ../shared/src-js/utils.ts
|
|
55
|
+
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region ../shared/src-js/js_config/node_version.ts
|
|
55
58
|
const NODE_TYPESCRIPT_SUPPORT_RANGE = "^20.19.0 || >=22.18.0";
|
|
56
59
|
const TS_MODULE_EXTENSIONS = new Set([
|
|
57
60
|
".ts",
|
|
@@ -89,19 +92,19 @@ function getUnsupportedTypeScriptModuleLoadHintForError(err, specifier, nodeVers
|
|
|
89
92
|
return `${getErrorMessage(err)}\n\nTypeScript config files require Node.js ${NODE_TYPESCRIPT_SUPPORT_RANGE}.\nDetected Node.js ${nodeVersion}.\nPlease upgrade Node.js or use a JSON config file instead.`;
|
|
90
93
|
}
|
|
91
94
|
//#endregion
|
|
92
|
-
//#region ../shared/src-js/js_config.ts
|
|
95
|
+
//#region ../shared/src-js/js_config/index.ts
|
|
93
96
|
/**
|
|
94
|
-
* Import a JS/TS config file and return its `default` export.
|
|
97
|
+
* Import a JS/TS config file and return its `default` export as a plain object.
|
|
95
98
|
*
|
|
96
99
|
* - Bypasses Node.js module cache (uses `?cache=<key>`) so changed files reload (used for LSP).
|
|
97
|
-
* - On `ERR_UNKNOWN_FILE_EXTENSION` for TS specifiers,
|
|
98
|
-
*
|
|
100
|
+
* - On `ERR_UNKNOWN_FILE_EXTENSION` for TS specifiers, wraps the error with a Node.js upgrade hint message;
|
|
101
|
+
* The original error is preserved via `Error.cause`.
|
|
99
102
|
*
|
|
100
103
|
* @param path - Absolute path to the JS/TS config file
|
|
101
104
|
* @param cacheKey - Cache-busting key.
|
|
102
105
|
* Callers decide whether to use a fresh value per call or share one across a batch.
|
|
103
|
-
* @throws When the file has no `default` export,
|
|
104
|
-
* or import fails (with
|
|
106
|
+
* @throws When the file has no `default` export, the export is not a plain object,
|
|
107
|
+
* or import fails (wrapped with hint message for unsupported TS module load).
|
|
105
108
|
*/
|
|
106
109
|
async function importJsConfig(path, cacheKey) {
|
|
107
110
|
const fileUrl = pathToFileURL(path);
|
|
@@ -111,15 +114,39 @@ async function importJsConfig(path, cacheKey) {
|
|
|
111
114
|
module = await import(fileUrl.href);
|
|
112
115
|
} catch (err) {
|
|
113
116
|
const hint = getUnsupportedTypeScriptModuleLoadHintForError(err, path);
|
|
114
|
-
if (hint
|
|
117
|
+
if (hint) throw new Error(hint, { cause: err });
|
|
115
118
|
throw err;
|
|
116
119
|
}
|
|
117
120
|
if (module.default === void 0) throw new Error("Configuration file has no default export.");
|
|
121
|
+
if (!isObject(module.default)) throw new Error("Configuration file must have a default export that is an object.");
|
|
118
122
|
return module.default;
|
|
119
123
|
}
|
|
120
124
|
//#endregion
|
|
125
|
+
//#region ../shared/src-js/vite_plus_config.ts
|
|
126
|
+
let vitePlusCache = null;
|
|
127
|
+
/**
|
|
128
|
+
* Resolve a Vite+ config via `vite-plus`'s `resolveConfig` and extract the given field.
|
|
129
|
+
*
|
|
130
|
+
* `vite-plus` is loaded lazily and memoized for the process.
|
|
131
|
+
* Consumers declare it as an optional peer dependency; tsdown leaves the specifier external
|
|
132
|
+
* so the user-installed copy is used at runtime.
|
|
133
|
+
*
|
|
134
|
+
* @param path - Absolute path to the Vite config file
|
|
135
|
+
* @param fieldName - Field name to extract from the resolved config (e.g. `"fmt"`, `"lint"`)
|
|
136
|
+
* @returns The field as an object, or `null` when the field is missing (signals "skip")
|
|
137
|
+
* @throws When the field exists but is not a plain object
|
|
138
|
+
*/
|
|
139
|
+
async function loadViteConfigField(path, fieldName) {
|
|
140
|
+
vitePlusCache ??= import("vite-plus");
|
|
141
|
+
const { resolveConfig } = await vitePlusCache;
|
|
142
|
+
const config = await resolveConfig({ configFile: path }, "build");
|
|
143
|
+
if (!(fieldName in config)) return null;
|
|
144
|
+
const fieldValue = config[fieldName];
|
|
145
|
+
if (!isObject(fieldValue)) throw new Error(`The \`${fieldName}\` field in the default export must be an object.`);
|
|
146
|
+
return fieldValue;
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
121
149
|
//#region src-js/cli/js_config.ts
|
|
122
|
-
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
123
150
|
/**
|
|
124
151
|
* Load and validate a standard oxfmt JS/TS config file.
|
|
125
152
|
* The default export must be a plain object containing oxfmt options.
|
|
@@ -127,25 +154,17 @@ const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v)
|
|
|
127
154
|
* @param path - Absolute path to the JavaScript/TypeScript config file
|
|
128
155
|
* @returns Config object
|
|
129
156
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (!isObject(config)) throw new Error("Configuration file must have a default export that is an object.");
|
|
133
|
-
return config;
|
|
157
|
+
function loadJsConfig(path) {
|
|
158
|
+
return importJsConfig(path, Date.now());
|
|
134
159
|
}
|
|
135
|
-
const VITE_OXFMT_CONFIG_FIELD = "fmt";
|
|
136
160
|
/**
|
|
137
|
-
* Load a Vite+ config file (`vite.config.ts`) and extract the `.fmt` field.
|
|
161
|
+
* Load a Vite+ config file (`vite.config.ts`) via `vite-plus`'s `resolveConfig` and extract the `.fmt` field.
|
|
138
162
|
*
|
|
139
163
|
* @param path - Absolute path to the Vite config file
|
|
140
164
|
* @returns Config object from `.fmt` field, or `null` to signal "skip"
|
|
141
165
|
*/
|
|
142
166
|
async function loadVitePlusConfig(path) {
|
|
143
|
-
|
|
144
|
-
if (!isObject(config)) return null;
|
|
145
|
-
const fmtConfig = config[VITE_OXFMT_CONFIG_FIELD];
|
|
146
|
-
if (fmtConfig === void 0) return null;
|
|
147
|
-
if (!isObject(fmtConfig)) throw new Error(`The \`${VITE_OXFMT_CONFIG_FIELD}\` field in the default export must be an object.`);
|
|
148
|
-
return fmtConfig;
|
|
167
|
+
return loadViteConfigField(path, "fmt");
|
|
149
168
|
}
|
|
150
169
|
//#endregion
|
|
151
170
|
//#region src-js/cli.ts
|
|
@@ -156,15 +175,15 @@ async function loadVitePlusConfig(path) {
|
|
|
156
175
|
if (args.includes("--lsp")) process.stdout.write = process.stderr.write.bind(process.stderr);
|
|
157
176
|
const [mode, exitCode] = await runCli(args, process.env.VP_VERSION ? loadVitePlusConfig : loadJsConfig, initExternalFormatter, formatFile, formatEmbeddedCode, formatEmbeddedDoc, sortTailwindClasses);
|
|
158
177
|
if (mode === "init") {
|
|
159
|
-
await import("./init-
|
|
178
|
+
await import("./init-DGfXRYLw.js").then((m) => m.runInit());
|
|
160
179
|
return;
|
|
161
180
|
}
|
|
162
181
|
if (mode === "migrate:prettier") {
|
|
163
|
-
await import("./migrate-prettier-
|
|
182
|
+
await import("./migrate-prettier-DWPaoKDl.js").then((m) => m.runMigratePrettier());
|
|
164
183
|
return;
|
|
165
184
|
}
|
|
166
185
|
if (mode === "migrate:biome") {
|
|
167
|
-
await import("./migrate-biome-
|
|
186
|
+
await import("./migrate-biome-P928W9-y.js").then((m) => m.runMigrateBiome());
|
|
168
187
|
return;
|
|
169
188
|
}
|
|
170
189
|
await disposeExternalFormatter();
|