oxfmt 0.47.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configuration_schema.json +68 -10
- package/dist/acorn-ay2Aj6GQ.js +4972 -0
- package/dist/angular-z1ZEe5V_.js +4004 -0
- package/dist/{apis-hnICGpKH.js → apis-By1xj7IP.js} +15 -4
- package/dist/babel-Cs312VeV.js +9885 -0
- package/dist/{bindings--Yo3ZB_Z.js → bindings-Cdg_nxGV.js} +26 -26
- package/dist/{chunk-DSjvVL_1-DvmJ8i3j.js → chunk-DSjvVL_1-B3jw0SMn.js} +1 -1
- package/dist/chunk-HkwdBwDg.js +37 -0
- package/dist/cli-worker.js +1 -1
- package/dist/cli.js +3 -3
- package/dist/{dist-DBVLDX4Z.js → dist-Bbs0xV9H.js} +22 -17
- package/dist/{estree-CvnLDdmw.js → estree-DZBnPYMx.js} +1914 -1911
- package/dist/flow-ChhAFZSt.js +52916 -0
- package/dist/glimmer-Cg8KQipT.js +7533 -0
- package/dist/graphql-DsP-ifm0.js +1944 -0
- package/dist/html-7pWx9LND.js +7139 -0
- package/dist/index.d.ts +60 -4
- package/dist/index.js +2 -2
- package/dist/{jiti-Bb1dT6Cw-DpVi6yB1.js → jiti-Bb1dT6Cw-DezGRPD7.js} +5 -7
- package/dist/markdown-CCrs3bBt.js +6880 -0
- package/dist/{meriyah-CIaAh_Jq.js → meriyah-TC7VDz8E.js} +4649 -4647
- package/dist/{migrate-prettier-mSf_N9fW.js → migrate-prettier-Bze9N_6F.js} +1 -1
- package/dist/plugin-CwlqDRt_.js +1870 -0
- package/dist/postcss-ZbUej7DN.js +6788 -0
- package/dist/{prettier-plugin-oxfmt-CLoiASgP.js → prettier-plugin-oxfmt-BjdgYnLg.js} +1 -0
- package/dist/prettier-s1WPCGVk.js +15601 -0
- package/dist/{resolve-pWjAK-4f-BnvQ49el.js → resolve-pWjAK-4f-BnquIxPb.js} +2 -2
- package/dist/{sorter-BZkvDMjt-CgLjPuXI.js → sorter-BZkvDMjt-y2u_e1ZW.js} +6 -6
- package/dist/{sorter-C3ZRVYzK.js → sorter-l2HyESZg.js} +2 -2
- package/dist/typescript-Cgpjcksz.js +22899 -0
- package/dist/{utils-D8dQkKEd-CoIwOuFZ.js → utils-D8dQkKEd-Dgy5UIHl.js} +1 -1
- package/dist/{v3-D-mr2VVh-DA8uo048.js → v3-D-mr2VVh-Bw8A9MXh.js} +4 -4
- package/dist/{v4-C-HWEQJm-olIGVWd7.js → v4-C-HWEQJm-B81QD_Ac.js} +4 -4
- package/dist/yaml-DLZBHI7f.js +5280 -0
- package/package.json +28 -20
- package/dist/acorn-K_XpABqm.js +0 -4968
- package/dist/angular-B2OHapHD.js +0 -4057
- package/dist/babel-DA0BK-9N.js +0 -9883
- package/dist/chunk-DrSxFLj_.js +0 -14
- package/dist/flow-BthqNux8.js +0 -52912
- package/dist/glimmer-0WQITj6v.js +0 -7541
- package/dist/graphql-CZVKp936.js +0 -1945
- package/dist/html-CC61hPUL.js +0 -7137
- package/dist/markdown-BkJWkmO_.js +0 -6876
- package/dist/postcss-C8WoCp9x.js +0 -6785
- package/dist/prettier-DpEoE-3g.js +0 -15596
- package/dist/typescript-Cg8onQ4r.js +0 -22936
- package/dist/yaml-CTxkSwZx.js +0 -5281
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?:
|
|
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:
|
|
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
|
*
|
|
@@ -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
|
|
2
|
-
import { a as sortTailwindClasses, i as resolvePlugins, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-
|
|
1
|
+
import { n as jsTextToDoc$1, t as format$1 } from "./bindings-Cdg_nxGV.js";
|
|
2
|
+
import { a as sortTailwindClasses, i as resolvePlugins, n as formatEmbeddedDoc, r as formatFile, t as formatEmbeddedCode } from "./apis-By1xj7IP.js";
|
|
3
3
|
//#region src-js/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* Define an oxfmt configuration with type inference.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as __toESM, i as __require, t as __commonJSMin } from "./chunk-DSjvVL_1-
|
|
1
|
+
import { a as __toESM, i as __require, t as __commonJSMin } from "./chunk-DSjvVL_1-B3jw0SMn.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
//#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.3997fbd_prettier@3.
|
|
3
|
+
//#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.3997fbd_prettier-plugin-svelte@3.5.1_prettie_57f1f908c644a91a29f5821c3681dd20/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
|
-
|
|
4010
|
-
const kt = (
|
|
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 ?
|
|
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
|
},
|