oxfmt 0.51.0 → 0.52.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.
Files changed (33) hide show
  1. package/dist/{acorn-Cz3eAoi8.js → acorn-C-l7ouWN.js} +1 -1
  2. package/dist/{angular-BzDc3wVg.js → angular-4Mc0TmPv.js} +3 -5
  3. package/dist/{apis-H4bwlBNm.js → apis-Cc9jzUH4.js} +6 -6
  4. package/dist/{babel-Cs312VeV.js → babel-DjR61Wf3.js} +2 -3
  5. package/dist/{bindings-qpSSlUMn.js → bindings-BJw0GhQr.js} +26 -26
  6. package/dist/cli-worker.js +1 -1
  7. package/dist/cli.js +44 -25
  8. package/dist/{dist-DieWQ1D0.js → dist-CJyFMFm2.js} +70 -50
  9. package/dist/{estree-BL2Xy2uB.js → estree-DHQPBKqf.js} +1 -1
  10. package/dist/{flow-Bj4lBR-Y.js → flow-Cz3mJAtC.js} +1 -1
  11. package/dist/{glimmer-C2ccnwyy.js → glimmer-ubhL-0tG.js} +1 -1
  12. package/dist/{graphql-D73FSqwO.js → graphql-Cl0TIiHU.js} +1 -1
  13. package/dist/{html-ENhiK7MR.js → html-Cqnv8X__.js} +1 -1
  14. package/dist/index.js +2 -2
  15. package/dist/{init-BbKOMZ57.js → init-DGfXRYLw.js} +1 -1
  16. package/dist/{jiti-Bb1dT6Cw-BtDs_aWX.js → jiti-Bb1dT6Cw-B_5IaZk7.js} +2 -2
  17. package/dist/{markdown-CDTH7TpJ.js → markdown-Eujfu-fQ.js} +1 -1
  18. package/dist/{meriyah-C-N-xeFc.js → meriyah-DESRG6oe.js} +1 -1
  19. package/dist/{migrate-biome-BMqs7-eg.js → migrate-biome-P928W9-y.js} +1 -1
  20. package/dist/{migrate-prettier-CBzqnxHw.js → migrate-prettier-CotsZUFl.js} +2 -2
  21. package/dist/{plugin-DiRKvkOT.js → plugin-C4twtOn4.js} +433 -374
  22. package/dist/{postcss-CS83Slco.js → postcss-BFLfznNY.js} +1 -1
  23. package/dist/{prettier-D7Ly-aG0.js → prettier-Cy-lZk4k.js} +15 -15
  24. package/dist/{sorter-BZkvDMjt-r7M4pM9t.js → sorter-BZkvDMjt-C3eOnP5z.js} +7 -7
  25. package/dist/{sorter-D0Nd4qpi.js → sorter-CHFUGfz-.js} +1 -1
  26. package/dist/{typescript-DkgFgfZO.js → typescript-lqJOqGcK.js} +1 -1
  27. package/dist/{v3-D-mr2VVh-DBBWnwM8.js → v3-D-mr2VVh-BXhnMySQ.js} +3 -3
  28. package/dist/{v4-C-HWEQJm-OZwT-Lc8.js → v4-C-HWEQJm-CvgekpKf.js} +3 -3
  29. package/dist/{yaml-Ddi9JTUZ.js → yaml-D3PpfZBy.js} +1 -1
  30. package/package.json +25 -21
  31. /package/dist/{chunk-HkwdBwDg.js → chunk-CNf5ZN-e.js} +0 -0
  32. /package/dist/{prettier-plugin-oxfmt-Besh6ER1.js → prettier-plugin-oxfmt-Dj6FaAil.js} +0 -0
  33. /package/dist/{shared-BTEY2VsW.js → shared-BiMl-bLP.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { n as __esmMin } from "./chunk-HkwdBwDg.js";
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-HkwdBwDg.js";
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-HkwdBwDg.js";
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-D7Ly-aG0.js");
16
+ const prettier = await import("./prettier-Cy-lZk4k.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-DieWQ1D0.js"));
87
+ CACHES.tailwindPlugin ??= await loadCached("tailwindPlugin", () => import("./dist-CJyFMFm2.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-D0Nd4qpi.js"));
97
+ CACHES.tailwindSorter ??= await loadCached("tailwindSorter", () => import("./sorter-CHFUGfz-.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-DiRKvkOT.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)));
111
+ CACHES.sveltePlugin ??= await loadCached("sveltePlugin", async () => await import("./plugin-C4twtOn4.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-Besh6ER1.js"));
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-HkwdBwDg.js";
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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
60
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
74
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
89
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
103
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
118
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
132
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
147
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
161
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
175
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
190
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
204
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
219
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
233
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
248
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
262
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
277
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
291
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
306
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
320
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
335
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
349
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
364
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
378
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
393
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
407
+ if (bindingPackageVersion !== "0.52.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.52.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.51.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.51.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
421
+ if (bindingPackageVersion !== "0.52.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.52.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);
@@ -1,2 +1,2 @@
1
- import { i as sortTailwindClasses, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-H4bwlBNm.js";
1
+ import { i as sortTailwindClasses, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-Cc9jzUH4.js";
2
2
  export { formatEmbeddedCode, formatEmbeddedDoc, formatFile, sortTailwindClasses };
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as runCli } from "./bindings-qpSSlUMn.js";
1
+ import { r as runCli } from "./bindings-BJw0GhQr.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/node_version.ts
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, overwrites `err.message` with a
98
- * Node.js upgrade hint that already includes the original message.
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 rewritten message for unsupported TS module load).
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 && err instanceof Error) err.message = 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
- async function loadJsConfig(path) {
131
- const config = await importJsConfig(path, Date.now());
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
- const config = await importJsConfig(path, Date.now());
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-BbKOMZ57.js").then((m) => m.runInit());
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-CBzqnxHw.js").then((m) => m.runMigratePrettier());
182
+ await import("./migrate-prettier-CotsZUFl.js").then((m) => m.runMigratePrettier());
164
183
  return;
165
184
  }
166
185
  if (mode === "migrate:biome") {
167
- await import("./migrate-biome-BMqs7-eg.js").then((m) => m.runMigrateBiome());
186
+ await import("./migrate-biome-P928W9-y.js").then((m) => m.runMigrateBiome());
168
187
  return;
169
188
  }
170
189
  await disposeExternalFormatter();