oxfmt 0.48.0 → 0.50.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 (50) hide show
  1. package/configuration_schema.json +70 -12
  2. package/dist/acorn-sBRpswSh.js +4972 -0
  3. package/dist/angular-DtI-eDW8.js +4004 -0
  4. package/dist/{apis-hnICGpKH.js → apis-CKvPKBJI.js} +51 -5
  5. package/dist/babel-DaNjvh9L.js +9885 -0
  6. package/dist/{bindings-DSOLttxo.js → bindings-Dj_YoR0Z.js} +26 -26
  7. package/dist/cli-worker.js +1 -1
  8. package/dist/cli.js +5 -5
  9. package/dist/{dist-DBVLDX4Z.js → dist-D_YbN99t.js} +19 -17
  10. package/dist/{estree-CvnLDdmw.js → estree-CzfNsl8m.js} +1914 -1911
  11. package/dist/flow-c9AjoQam.js +52916 -0
  12. package/dist/glimmer-D_zkI0w_.js +7533 -0
  13. package/dist/graphql-BFXkB4Nq.js +1944 -0
  14. package/dist/html-DkcPxRXg.js +7139 -0
  15. package/dist/index.d.ts +61 -5
  16. package/dist/index.js +2 -2
  17. package/dist/{init-BbKOMZ57.js → init-C3nxU_Wc.js} +1 -1
  18. package/dist/{jiti-Bb1dT6Cw-DpVi6yB1.js → jiti-Bb1dT6Cw-C0N20Za1.js} +5 -7
  19. package/dist/markdown-DVLNmbQg.js +6880 -0
  20. package/dist/{meriyah-CIaAh_Jq.js → meriyah-BGPf00Rn.js} +4649 -4647
  21. package/dist/{migrate-biome-BMqs7-eg.js → migrate-biome-DclTzwKW.js} +1 -1
  22. package/dist/{migrate-prettier-mSf_N9fW.js → migrate-prettier-DLfviW85.js} +2 -2
  23. package/dist/plugin-DOdiccQR.js +1914 -0
  24. package/dist/postcss-D-ql-dm8.js +6788 -0
  25. package/dist/prettier-Cw36juP9.js +15601 -0
  26. package/dist/{prettier-plugin-oxfmt-CLoiASgP.js → prettier-plugin-oxfmt-BlJcmKAv.js} +38 -3
  27. package/dist/{resolve-pWjAK-4f-BnvQ49el.js → sorter-BZkvDMjt-DpGe0QK9.js} +325 -4
  28. package/dist/{sorter-C3ZRVYzK.js → sorter-w0dgpoFw.js} +1 -2
  29. package/dist/typescript-C_eN_ThF.js +22899 -0
  30. package/dist/{v3-D-mr2VVh-DA8uo048.js → v3-D-mr2VVh-CU7hQIit.js} +3 -4
  31. package/dist/{v4-C-HWEQJm-olIGVWd7.js → v4-C-HWEQJm-C8EWwksG.js} +3 -4
  32. package/dist/yaml-Bqxyk-13.js +5280 -0
  33. package/package.json +28 -20
  34. package/dist/acorn-K_XpABqm.js +0 -4968
  35. package/dist/angular-B2OHapHD.js +0 -4057
  36. package/dist/babel-DA0BK-9N.js +0 -9883
  37. package/dist/chunk-DSjvVL_1-DvmJ8i3j.js +0 -36
  38. package/dist/chunk-DrSxFLj_.js +0 -14
  39. package/dist/flow-BthqNux8.js +0 -52912
  40. package/dist/glimmer-0WQITj6v.js +0 -7541
  41. package/dist/graphql-CZVKp936.js +0 -1945
  42. package/dist/html-CC61hPUL.js +0 -7137
  43. package/dist/markdown-BkJWkmO_.js +0 -6876
  44. package/dist/postcss-C8WoCp9x.js +0 -6785
  45. package/dist/prettier-DpEoE-3g.js +0 -15596
  46. package/dist/sorter-BZkvDMjt-CgLjPuXI.js +0 -212
  47. package/dist/typescript-Cg8onQ4r.js +0 -22936
  48. package/dist/utils-D8dQkKEd-CoIwOuFZ.js +0 -81
  49. package/dist/yaml-CTxkSwZx.js +0 -5281
  50. /package/dist/{shared-BTEY2VsW.js → shared-BtJbjkue.js} +0 -0
package/dist/index.d.ts CHANGED
@@ -30,6 +30,11 @@ type EndOfLineConfig = "lf" | "crlf" | "cr";
30
30
  type HtmlWhitespaceSensitivityConfig = "css" | "strict" | "ignore";
31
31
  type JsdocUserConfig = boolean | JsdocConfig;
32
32
  type ObjectWrapConfig = "preserve" | "collapse";
33
+ /**
34
+ * A set of glob patterns.
35
+ * Patterns are matched against paths relative to the configuration file's directory.
36
+ */
37
+ type GlobSet = string[];
33
38
  type ProseWrapConfig = "always" | "never" | "preserve";
34
39
  type QuotePropsConfig = "as-needed" | "consistent" | "preserve";
35
40
  type SortImportsUserConfig = boolean | SortImportsConfig;
@@ -37,6 +42,7 @@ type SortGroupItemConfig = NewlinesBetweenMarker | string | string[];
37
42
  type SortOrderConfig = "asc" | "desc";
38
43
  type SortPackageJsonUserConfig = boolean | SortPackageJsonConfig;
39
44
  type SortTailwindcssUserConfig = boolean | SortTailwindcssConfig;
45
+ type SvelteUserConfig = boolean | SvelteConfig;
40
46
  type TrailingCommaConfig = "all" | "es5" | "none";
41
47
  /**
42
48
  * Configuration options for the Oxfmt.
@@ -214,6 +220,20 @@ interface Oxfmtrc {
214
220
  * - Default: Disabled
215
221
  */
216
222
  sortTailwindcss?: SortTailwindcssUserConfig;
223
+ /**
224
+ * Options for `prettier-plugin-svelte`.
225
+ *
226
+ * Pass `true` or an object to enable `.svelte` file formatting,
227
+ * or `false` (handy in overrides) / omit to disable.
228
+ * Setting `true` resets to defaults — any options inherited from a parent scope are dropped.
229
+ *
230
+ * NOTE: `prettier-plugin-svelte` requires the `svelte` package (`svelte/compiler`) at runtime,
231
+ * but Oxfmt does NOT bundle or auto-install it.
232
+ * You must install `svelte` yourself in your project, formatting will fail at runtime otherwise.
233
+ *
234
+ * - Default: Disabled
235
+ */
236
+ svelte?: SvelteUserConfig;
217
237
  /**
218
238
  * Specify the number of spaces per indentation-level.
219
239
  *
@@ -324,12 +344,11 @@ interface OxfmtOverrideConfig {
324
344
  /**
325
345
  * Glob patterns to exclude from this override.
326
346
  */
327
- excludeFiles?: string[];
347
+ excludeFiles?: GlobSet;
328
348
  /**
329
349
  * Glob patterns to match files for this override.
330
- * All patterns are relative to the Oxfmt configuration file.
331
350
  */
332
- files: string[];
351
+ files: GlobSet;
333
352
  /**
334
353
  * Format options to apply for matched files.
335
354
  */
@@ -492,6 +511,20 @@ interface FormatConfig {
492
511
  * - Default: Disabled
493
512
  */
494
513
  sortTailwindcss?: SortTailwindcssUserConfig;
514
+ /**
515
+ * Options for `prettier-plugin-svelte`.
516
+ *
517
+ * Pass `true` or an object to enable `.svelte` file formatting,
518
+ * or `false` (handy in overrides) / omit to disable.
519
+ * Setting `true` resets to defaults — any options inherited from a parent scope are dropped.
520
+ *
521
+ * NOTE: `prettier-plugin-svelte` requires the `svelte` package (`svelte/compiler`) at runtime,
522
+ * but Oxfmt does NOT bundle or auto-install it.
523
+ * You must install `svelte` yourself in your project, formatting will fail at runtime otherwise.
524
+ *
525
+ * - Default: Disabled
526
+ */
527
+ svelte?: SvelteUserConfig;
495
528
  /**
496
529
  * Specify the number of spaces per indentation-level.
497
530
  *
@@ -602,7 +635,7 @@ interface SortImportsConfig {
602
635
  *
603
636
  * This is useful for distinguishing your own modules from external dependencies.
604
637
  *
605
- * - Default: `["~/", "@/"]`
638
+ * - Default: `["~/", "@/", "#"]`
606
639
  */
607
640
  internalPattern?: string[];
608
641
  /**
@@ -750,6 +783,29 @@ interface SortTailwindcssConfig {
750
783
  stylesheet?: string;
751
784
  [k: string]: unknown;
752
785
  }
786
+ interface SvelteConfig {
787
+ /**
788
+ * Whether to allow attribute shorthand if attribute name and expression are same.
789
+ *
790
+ * - Default: `true`
791
+ */
792
+ allowShorthand?: boolean;
793
+ /**
794
+ * Whether to indent code inside `<script>` and `<style>` tags.
795
+ *
796
+ * - Default: `true`
797
+ */
798
+ indentScriptAndStyle?: boolean;
799
+ /**
800
+ * The order in which Svelte component sections are printed.
801
+ * Format: join the keywords `options`, `scripts`, `markup`, `styles` with a `-` in the order you want;
802
+ * or `none` if you don't want to reorder anything.
803
+ *
804
+ * - Default: `"options-scripts-markup-styles"`
805
+ */
806
+ sortOrder?: string;
807
+ [k: string]: unknown;
808
+ }
753
809
  //#endregion
754
810
  //#region src-js/index.d.ts
755
811
  interface OxfmtConfig extends Oxfmtrc {}
@@ -786,4 +842,4 @@ declare function format(fileName: string, sourceText: string, options?: FormatCo
786
842
  */
787
843
  declare function jsTextToDoc(sourceExt: string, sourceText: string, oxfmtPluginOptionsJson: string, parentContext: string): Promise<string | null>;
788
844
  //#endregion
789
- 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 };
845
+ export { ArrowParensConfig, CustomGroupItemConfig, EmbeddedLanguageFormattingConfig, EndOfLineConfig, FormatConfig, FormatOptions, GlobSet, HtmlWhitespaceSensitivityConfig, JsdocConfig, JsdocUserConfig, NewlinesBetweenMarker, ObjectWrapConfig, OxfmtConfig, OxfmtOverrideConfig, Oxfmtrc, ProseWrapConfig, QuotePropsConfig, SortGroupItemConfig, SortImportsConfig, SortImportsOptions, SortImportsUserConfig, SortOrderConfig, SortPackageJsonConfig, SortPackageJsonOptions, SortPackageJsonUserConfig, SortTailwindcssConfig, SortTailwindcssOptions, SortTailwindcssUserConfig, SvelteConfig, SvelteUserConfig, 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-DSOLttxo.js";
2
- import { a as sortTailwindClasses, i as resolvePlugins, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-hnICGpKH.js";
1
+ import { a as sortTailwindClasses, i as resolvePlugins, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-CKvPKBJI.js";
2
+ import { n as jsTextToDoc$1, t as format$1 } from "./bindings-Dj_YoR0Z.js";
3
3
  //#region src-js/index.ts
4
4
  /**
5
5
  * Define an oxfmt configuration with type inference.
@@ -1,4 +1,4 @@
1
- import { i as saveOxfmtrcFile, n as exitWithError, r as hasOxfmtrcFile, t as createBlankOxfmtrcFile } from "./shared-BTEY2VsW.js";
1
+ import { i as saveOxfmtrcFile, n as exitWithError, r as hasOxfmtrcFile, t as createBlankOxfmtrcFile } from "./shared-BtJbjkue.js";
2
2
  //#region src-js/cli/migration/init.ts
3
3
  /**
4
4
  * Run the `--init` command to scaffold a default `.oxfmtrc.json` file.
@@ -1,6 +1,6 @@
1
- import { a as __toESM, i as __require, t as __commonJSMin } from "./chunk-DSjvVL_1-DvmJ8i3j.js";
1
+ import { b as __toESM, g as __commonJSMin, y as __require } from "./sorter-BZkvDMjt-DpGe0QK9.js";
2
2
  import { createRequire } from "node:module";
3
- //#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.3997fbd_prettier@3.8.3/node_modules/prettier-plugin-tailwindcss/dist/jiti-Bb1dT6Cw.mjs
3
+ //#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.3997fbd_prettier-plugin-svelte@3.5.2_prettie_981079e52d31d99dd529b9a262e0d726/node_modules/prettier-plugin-tailwindcss/dist/jiti-Bb1dT6Cw.mjs
4
4
  var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
5
  (() => {
6
6
  var e = { "./node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist lazy recursive": function(e) {
@@ -4006,8 +4006,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4006
4006
  const _t = ((_globalThis$process6 = globalThis.process) === null || _globalThis$process6 === void 0 ? void 0 : _globalThis$process6.platform) || "";
4007
4007
  std_env_dist_n(gt.CI) || yt.ci;
4008
4008
  const bt = std_env_dist_n(((_globalThis$process7 = globalThis.process) === null || _globalThis$process7 === void 0 ? void 0 : _globalThis$process7.stdout) && ((_globalThis$process8 = globalThis.process) === null || _globalThis$process8 === void 0 ? void 0 : _globalThis$process8.stdout.isTTY));
4009
- std_env_dist_n(gt.DEBUG), "test" === xt || std_env_dist_n(gt.TEST);
4010
- const kt = (std_env_dist_n(gt.MINIMAL), /^win/i.test(_t)), wt = (/^linux/i.test(_t), /^darwin/i.test(_t), !std_env_dist_n(gt.NO_COLOR) && (std_env_dist_n(gt.FORCE_COLOR) || (bt || kt) && gt.TERM), (((_globalThis$process9 = globalThis.process) === null || _globalThis$process9 === void 0 || (_globalThis$process9 = _globalThis$process9.versions) === null || _globalThis$process9 === void 0 ? void 0 : _globalThis$process9.node) || "").replace(/^v/, "") || null), It = (Number(wt === null || wt === void 0 ? void 0 : wt.split(".")[0]), globalThis.process || Object.create(null)), Ct = { versions: {} }, Rt = (new Proxy(It, { get: (e, t) => "env" === t ? gt : t in e ? e[t] : t in Ct ? Ct[t] : void 0 }), "node" === ((_globalThis$process10 = globalThis.process) === null || _globalThis$process10 === void 0 || (_globalThis$process10 = _globalThis$process10.release) === null || _globalThis$process10 === void 0 ? void 0 : _globalThis$process10.name)), Pt = !!globalThis.Bun || !!((_globalThis$process11 = globalThis.process) === null || _globalThis$process11 === void 0 || (_globalThis$process11 = _globalThis$process11.versions) === null || _globalThis$process11 === void 0 ? void 0 : _globalThis$process11.bun), Tt = !!globalThis.Deno, At = !!globalThis.fastly, Nt = [
4009
+ gt.DEBUG, "test" === xt || gt.TEST;
4010
+ const kt = (gt.MINIMAL, /^win/i.test(_t)), wt = (/^linux/i.test(_t), /^darwin/i.test(_t), !std_env_dist_n(gt.NO_COLOR) && (std_env_dist_n(gt.FORCE_COLOR) || (bt || kt) && gt.TERM), (((_globalThis$process9 = globalThis.process) === null || _globalThis$process9 === void 0 || (_globalThis$process9 = _globalThis$process9.versions) === null || _globalThis$process9 === void 0 ? void 0 : _globalThis$process9.node) || "").replace(/^v/, "") || null), It = (Number(wt === null || wt === void 0 ? void 0 : wt.split(".")[0]), globalThis.process || Object.create(null)), Ct = { versions: {} }, Rt = (new Proxy(It, { get: (e, t) => "env" === t ? gt : t in e ? e[t] : t in Ct ? Ct[t] : void 0 }), "node" === ((_globalThis$process10 = globalThis.process) === null || _globalThis$process10 === void 0 || (_globalThis$process10 = _globalThis$process10.release) === null || _globalThis$process10 === void 0 ? void 0 : _globalThis$process10.name)), Pt = !!globalThis.Bun || !!((_globalThis$process11 = globalThis.process) === null || _globalThis$process11 === void 0 || (_globalThis$process11 = _globalThis$process11.versions) === null || _globalThis$process11 === void 0 ? void 0 : _globalThis$process11.bun), Tt = !!globalThis.Deno, At = !!globalThis.fastly, Nt = [
4011
4011
  [!!globalThis.Netlify, "netlify"],
4012
4012
  [!!globalThis.EdgeRuntime, "edge-light"],
4013
4013
  ["Cloudflare-Workers" === ((_globalThis$navigator = globalThis.navigator) === null || _globalThis$navigator === void 0 ? void 0 : _globalThis$navigator.userAgent), "workerd"],
@@ -4629,7 +4629,6 @@ var require_babel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4629
4629
  if (e && skipSourceless(h, m)) return;
4630
4630
  return insert(h, m, [n]);
4631
4631
  }
4632
- assert(i), assert(o);
4633
4632
  const f = put(c, s), y = a ? put(d, a) : v;
4634
4633
  if (f === u.length && (u[f] = null != l ? l : null), !e || !skipSource(h, m, f, i, o, y)) return insert(h, m, a ? [
4635
4634
  n,
@@ -4644,7 +4643,6 @@ var require_babel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4644
4643
  o
4645
4644
  ]);
4646
4645
  }
4647
- function assert(e) {}
4648
4646
  function getIndex(e, t) {
4649
4647
  for (let r = e.length; r <= t; r++) e[r] = [];
4650
4648
  return e[t];
@@ -4677,7 +4675,7 @@ var require_babel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4677
4675
  }
4678
4676
  function addMappingInternal(e, t, r) {
4679
4677
  const { generated: n, source: s, original: i, name: o, content: a } = r;
4680
- return s ? (assert(i), addSegmentInternal(e, t, n.line - 1, n.column, s, i.line - 1, i.column, o, a)) : addSegmentInternal(e, t, n.line - 1, n.column, null, null, null, null, null);
4678
+ return s ? addSegmentInternal(e, t, n.line - 1, n.column, s, i.line - 1, i.column, o, a) : addSegmentInternal(e, t, n.line - 1, n.column, null, null, null, null, null);
4681
4679
  }
4682
4680
  })(e = r.nmd(e), r("./node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"), r("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js")), e.exports = "default" in (n = e).exports ? n.exports.default : n.exports;
4683
4681
  },