@kubb/core 4.1.4 → 4.2.1
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/URLPath-8WVzHBnA.cjs +134 -0
- package/dist/URLPath-8WVzHBnA.cjs.map +1 -0
- package/dist/URLPath-BYceu_vY.js +117 -0
- package/dist/URLPath-BYceu_vY.js.map +1 -0
- package/dist/{acorn-Cg_eXN51.cjs → acorn-BAVXZMtK.cjs} +17 -21
- package/dist/{acorn-Cg_eXN51.cjs.map → acorn-BAVXZMtK.cjs.map} +1 -1
- package/dist/{acorn-Z0oy0vSt.js → acorn-D-VhIOLw.js} +17 -21
- package/dist/{acorn-Z0oy0vSt.js.map → acorn-D-VhIOLw.js.map} +1 -1
- package/dist/{angular-nBly58h0.cjs → angular-Bp0XO9db.cjs} +24 -29
- package/dist/{angular-nBly58h0.cjs.map → angular-Bp0XO9db.cjs.map} +1 -1
- package/dist/{angular-BUlb_iaU.js → angular-Czhp4eq5.js} +24 -29
- package/dist/{angular-BUlb_iaU.js.map → angular-Czhp4eq5.js.map} +1 -1
- package/dist/{babel-DfXTN9QX.js → babel-DCR_B4Qn.js} +27 -37
- package/dist/{babel-DfXTN9QX.js.map → babel-DCR_B4Qn.js.map} +1 -1
- package/dist/{babel-5qXjvTGO.cjs → babel-NI0v59ga.cjs} +27 -37
- package/dist/{babel-5qXjvTGO.cjs.map → babel-NI0v59ga.cjs.map} +1 -1
- package/dist/casing-BSeq_teY.js +100 -0
- package/dist/casing-BSeq_teY.js.map +1 -0
- package/dist/casing-CP-9GGdK.cjs +112 -0
- package/dist/casing-CP-9GGdK.cjs.map +1 -0
- package/dist/{chunk-kPDogv7o.js → chunk-1SJ2vVWa.js} +1 -1
- package/dist/{estree-DyiFjXDy.cjs → estree-C3BZPlpU.cjs} +49 -64
- package/dist/{estree-DyiFjXDy.cjs.map → estree-C3BZPlpU.cjs.map} +1 -1
- package/dist/{estree-Bt3vRtV3.js → estree-DU2NummP.js} +49 -64
- package/dist/{estree-Bt3vRtV3.js.map → estree-DU2NummP.js.map} +1 -1
- package/dist/{flow-DdtBrX0O.cjs → flow-CWUBUkoi.cjs} +978 -1038
- package/dist/{flow-DdtBrX0O.cjs.map → flow-CWUBUkoi.cjs.map} +1 -1
- package/dist/{flow-Bb8_yYns.js → flow-JiEbweKj.js} +978 -1038
- package/dist/{flow-Bb8_yYns.js.map → flow-JiEbweKj.js.map} +1 -1
- package/dist/{fs-BNC5Fj6t.js → fs-BIPMUfpW.js} +3 -4
- package/dist/{fs-BNC5Fj6t.js.map → fs-BIPMUfpW.js.map} +1 -1
- package/dist/{fs-Bi2kuxAm.cjs → fs-RSVoUw3S.cjs} +2 -3
- package/dist/{fs-Bi2kuxAm.cjs.map → fs-RSVoUw3S.cjs.map} +1 -1
- package/dist/fs.cjs +1 -1
- package/dist/fs.d.cts +1 -1
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +2 -2
- package/dist/{glimmer-BuCRLjbI.cjs → glimmer-CX9OqG1j.cjs} +27 -41
- package/dist/{glimmer-BuCRLjbI.cjs.map → glimmer-CX9OqG1j.cjs.map} +1 -1
- package/dist/{glimmer-By8WZPkK.js → glimmer-t9nWn9aE.js} +27 -41
- package/dist/{glimmer-By8WZPkK.js.map → glimmer-t9nWn9aE.js.map} +1 -1
- package/dist/{graphql-DsrNefXx.js → graphql-DjErlIi5.js} +16 -20
- package/dist/{graphql-DsrNefXx.js.map → graphql-DjErlIi5.js.map} +1 -1
- package/dist/{graphql-TN0hv-fx.cjs → graphql-GOxQAKxM.cjs} +16 -20
- package/dist/{graphql-TN0hv-fx.cjs.map → graphql-GOxQAKxM.cjs.map} +1 -1
- package/dist/hooks.cjs +29 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +16 -0
- package/dist/hooks.d.ts +16 -0
- package/dist/hooks.js +25 -0
- package/dist/hooks.js.map +1 -0
- package/dist/{html-1W4-2_9J.cjs → html-CWrdYAhQ.cjs} +26 -27
- package/dist/{html-1W4-2_9J.cjs.map → html-CWrdYAhQ.cjs.map} +1 -1
- package/dist/{html-Y5KDc150.js → html-_apcbx34.js} +26 -27
- package/dist/{html-Y5KDc150.js.map → html-_apcbx34.js.map} +1 -1
- package/dist/{index-CGJ3tdk-.d.ts → index-BTe91LHd.d.ts} +7 -2
- package/dist/{index-CWX6_-da.d.cts → index-BmQIxvw0.d.cts} +5 -2
- package/dist/index.cjs +383 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -10
- package/dist/index.d.ts +43 -10
- package/dist/index.js +376 -23
- package/dist/index.js.map +1 -1
- package/dist/{logger-OWS6fqk0.d.cts → logger-BA-za85-.d.ts} +2 -2
- package/dist/{logger-DBJsdlpZ.cjs → logger-BXL0YCrv.cjs} +8 -12
- package/dist/{logger-DBJsdlpZ.cjs.map → logger-BXL0YCrv.cjs.map} +1 -1
- package/dist/{logger-BKPT4rkB.js → logger-CDxSrFkR.js} +10 -14
- package/dist/{logger-BKPT4rkB.js.map → logger-CDxSrFkR.js.map} +1 -1
- package/dist/{logger-B-4AXUmB.d.ts → logger-DpoDtxfo.d.cts} +2 -2
- package/dist/logger.cjs +1 -1
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +2 -2
- package/dist/{markdown-Drl4Cbq5.js → markdown-ckUc3Q6q.js} +25 -29
- package/dist/{markdown-Drl4Cbq5.js.map → markdown-ckUc3Q6q.js.map} +1 -1
- package/dist/{markdown-Bltb-uzO.cjs → markdown-pzqiRmft.cjs} +25 -29
- package/dist/{markdown-Bltb-uzO.cjs.map → markdown-pzqiRmft.cjs.map} +1 -1
- package/dist/{meriyah-Cz9whwp-.js → meriyah-BjnGqpUs.js} +21 -29
- package/dist/{meriyah-Cz9whwp-.js.map → meriyah-BjnGqpUs.js.map} +1 -1
- package/dist/{meriyah-CdG8HPS2.cjs → meriyah-D_x7itbT.cjs} +21 -29
- package/dist/{meriyah-CdG8HPS2.cjs.map → meriyah-D_x7itbT.cjs.map} +1 -1
- package/dist/mocks.cjs +87 -144
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +4 -3
- package/dist/mocks.d.ts +4 -3
- package/dist/mocks.js +83 -141
- package/dist/mocks.js.map +1 -1
- package/dist/{postcss-B7n9zUIy.cjs → postcss-B_c2wbFu.cjs} +41 -54
- package/dist/{postcss-B7n9zUIy.cjs.map → postcss-B_c2wbFu.cjs.map} +1 -1
- package/dist/{postcss-Dfx_9buT.js → postcss-v7BP6SZ-.js} +41 -54
- package/dist/{postcss-Dfx_9buT.js.map → postcss-v7BP6SZ-.js.map} +1 -1
- package/dist/{prompt-BMs_Y-vT.js → prompt-DBVnG4Me.js} +30 -32
- package/dist/{prompt-BMs_Y-vT.js.map → prompt-DBVnG4Me.js.map} +1 -1
- package/dist/{prompt-BXlYKArM.cjs → prompt-DgONOpPH.cjs} +29 -31
- package/dist/{prompt-BXlYKArM.cjs.map → prompt-DgONOpPH.cjs.map} +1 -1
- package/dist/{transformers-DZ22lE-S.cjs → transformers-BH0KLJJP.cjs} +130 -248
- package/dist/transformers-BH0KLJJP.cjs.map +1 -0
- package/dist/{transformers-BllSzdDt.js → transformers-DzHGqYO2.js} +130 -236
- package/dist/transformers-DzHGqYO2.js.map +1 -0
- package/dist/transformers.cjs +4 -3
- package/dist/transformers.js +2 -1
- package/dist/types-BzI9JlV8.d.ts +5 -0
- package/dist/types-C3ea5qNG.d.cts +5 -0
- package/dist/{PluginManager-BSUDeUfP.d.ts → types-DNxlynJr.d.cts} +187 -246
- package/dist/{PluginManager-a3RiDAFC.d.cts → types-DPeNK0FO.d.ts} +187 -246
- package/dist/{typescript-Evf8GXVW.cjs → typescript-6kMN6Wqz.cjs} +100 -152
- package/dist/{typescript-Evf8GXVW.cjs.map → typescript-6kMN6Wqz.cjs.map} +1 -1
- package/dist/{typescript-C8iCxnaF.js → typescript-B_IBfKSe.js} +101 -153
- package/dist/{typescript-C8iCxnaF.js.map → typescript-B_IBfKSe.js.map} +1 -1
- package/dist/typescript-C5hce4HG.cjs +4 -0
- package/dist/typescript-Cas1XcNz.js +3 -0
- package/dist/utils.cjs +165 -20
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +136 -5
- package/dist/utils.d.ts +136 -5
- package/dist/utils.js +156 -5
- package/dist/utils.js.map +1 -0
- package/dist/{write-O9QWtBJ_.js → write-CxO1CDML.js} +2 -2
- package/dist/{write-O9QWtBJ_.js.map → write-CxO1CDML.js.map} +1 -1
- package/dist/{yaml-Bi_nSoU_.js → yaml-BfWM_B73.js} +141 -157
- package/dist/{yaml-Bi_nSoU_.js.map → yaml-BfWM_B73.js.map} +1 -1
- package/dist/{yaml-B2qeXFgu.cjs → yaml-DZs6MhV1.cjs} +141 -157
- package/dist/{yaml-B2qeXFgu.cjs.map → yaml-DZs6MhV1.cjs.map} +1 -1
- package/package.json +15 -3
- package/src/FileManager.ts +34 -302
- package/src/PluginManager.ts +9 -8
- package/src/__snapshots__/barrel.json +5 -5
- package/src/build.ts +19 -5
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useMode.ts +8 -0
- package/src/hooks/usePlugin.ts +8 -0
- package/src/hooks/usePluginManager.ts +8 -0
- package/src/index.ts +1 -2
- package/src/mocks/index.ts +4 -3
- package/src/plugin.ts +1 -1
- package/src/types.ts +4 -1
- package/src/utils/TreeNode.ts +3 -3
- package/src/utils/index.ts +2 -4
- package/dist/FileManager-B0V0rX5Z.js +0 -881
- package/dist/FileManager-B0V0rX5Z.js.map +0 -1
- package/dist/FileManager-COJW0Zp4.cjs +0 -1003
- package/dist/FileManager-COJW0Zp4.cjs.map +0 -1
- package/dist/index-B7KKQHG8.d.cts +0 -179
- package/dist/index-BhFFCWR1.d.ts +0 -179
- package/dist/transformers-BllSzdDt.js.map +0 -1
- package/dist/transformers-DZ22lE-S.cjs.map +0 -1
- package/dist/typescript-BY9-7pw9.js +0 -3
- package/dist/typescript-PxlX-TH7.cjs +0 -4
- package/src/utils/parser.ts +0 -199
package/dist/mocks.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { File, ResolvedFile } from "./index-
|
|
2
|
-
import { Logger } from "./logger-
|
|
3
|
-
import { PluginManager } from "./
|
|
1
|
+
import { i as File, s as ResolvedFile } from "./index-BmQIxvw0.cjs";
|
|
2
|
+
import { n as Logger } from "./logger-DpoDtxfo.cjs";
|
|
3
|
+
import { x as PluginManager } from "./types-DNxlynJr.cjs";
|
|
4
|
+
import "./types-C3ea5qNG.cjs";
|
|
4
5
|
|
|
5
6
|
//#region src/mocks/index.d.ts
|
|
6
7
|
declare const mockedLogger: Logger;
|
package/dist/mocks.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { File, ResolvedFile } from "./index-
|
|
2
|
-
import { Logger } from "./logger-
|
|
3
|
-
import { PluginManager } from "./
|
|
1
|
+
import { i as File, s as ResolvedFile } from "./index-BTe91LHd.js";
|
|
2
|
+
import { n as Logger } from "./logger-BA-za85-.js";
|
|
3
|
+
import { x as PluginManager } from "./types-DPeNK0FO.js";
|
|
4
|
+
import "./types-BzI9JlV8.js";
|
|
4
5
|
|
|
5
6
|
//#region src/mocks/index.d.ts
|
|
6
7
|
declare const mockedLogger: Logger;
|
package/dist/mocks.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import { camelCase, pascalCase } from "./transformers-BllSzdDt.js";
|
|
5
|
-
import { createFile, getSource } from "./FileManager-B0V0rX5Z.js";
|
|
6
|
-
import { r9 } from "./typescript-C8iCxnaF.js";
|
|
1
|
+
import { n as __export$2 } from "./chunk-1SJ2vVWa.js";
|
|
2
|
+
import { n as pascalCase, t as camelCase } from "./casing-BSeq_teY.js";
|
|
3
|
+
import { n as r9 } from "./typescript-B_IBfKSe.js";
|
|
7
4
|
import path from "node:path";
|
|
5
|
+
import { FileProcessor, createFile } from "@kubb/fabric-core";
|
|
8
6
|
import { builtinModules, createRequire } from "module";
|
|
9
7
|
import * as url from "url";
|
|
10
8
|
import url2, { URL as URL$1, fileURLToPath, pathToFileURL } from "url";
|
|
@@ -124,14 +122,14 @@ function traverseDoc$1(doc, onEnter, onExit, shouldTraverseConditionalGroups) {
|
|
|
124
122
|
case DOC_TYPE_ARRAY$1:
|
|
125
123
|
case DOC_TYPE_FILL$1: {
|
|
126
124
|
const parts = docType === DOC_TYPE_ARRAY$1 ? doc2 : doc2.parts;
|
|
127
|
-
for (let
|
|
125
|
+
for (let i = parts.length - 1; i >= 0; --i) docsStack.push(parts[i]);
|
|
128
126
|
break;
|
|
129
127
|
}
|
|
130
128
|
case DOC_TYPE_IF_BREAK$1:
|
|
131
129
|
docsStack.push(doc2.flatContents, doc2.breakContents);
|
|
132
130
|
break;
|
|
133
131
|
case DOC_TYPE_GROUP$1:
|
|
134
|
-
if (shouldTraverseConditionalGroups && doc2.expandedStates) for (let
|
|
132
|
+
if (shouldTraverseConditionalGroups && doc2.expandedStates) for (let i = doc2.expandedStates.length - 1; i >= 0; --i) docsStack.push(doc2.expandedStates[i]);
|
|
135
133
|
else docsStack.push(doc2.contents);
|
|
136
134
|
break;
|
|
137
135
|
case DOC_TYPE_ALIGN$1:
|
|
@@ -796,11 +794,10 @@ function printDocToString$1(doc, options) {
|
|
|
796
794
|
});
|
|
797
795
|
break;
|
|
798
796
|
} else {
|
|
799
|
-
const state = doc2.expandedStates[i];
|
|
800
797
|
const cmd = {
|
|
801
798
|
ind,
|
|
802
799
|
mode: MODE_FLAT$1,
|
|
803
|
-
doc:
|
|
800
|
+
doc: doc2.expandedStates[i]
|
|
804
801
|
};
|
|
805
802
|
if (fits$1(cmd, cmds, rem, hasLineSuffix, groupModeMap)) {
|
|
806
803
|
cmds.push(cmd);
|
|
@@ -1020,8 +1017,7 @@ var public_default = public_exports$1;
|
|
|
1020
1017
|
//#endregion
|
|
1021
1018
|
//#region ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/index.mjs
|
|
1022
1019
|
const require = createRequire(import.meta.url);
|
|
1023
|
-
|
|
1024
|
-
dirname(__filename);
|
|
1020
|
+
dirname(fileURLToPath(import.meta.url));
|
|
1025
1021
|
var __create = Object.create;
|
|
1026
1022
|
var __defProp = Object.defineProperty;
|
|
1027
1023
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1997,7 +1993,7 @@ var require_parse = __commonJS({ "node_modules/braces/lib/parse.js"(exports, mod
|
|
|
1997
1993
|
}
|
|
1998
1994
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1999
1995
|
depth++;
|
|
2000
|
-
|
|
1996
|
+
block = push2({
|
|
2001
1997
|
type: "brace",
|
|
2002
1998
|
open: true,
|
|
2003
1999
|
close: false,
|
|
@@ -2006,8 +2002,7 @@ var require_parse = __commonJS({ "node_modules/braces/lib/parse.js"(exports, mod
|
|
|
2006
2002
|
commas: 0,
|
|
2007
2003
|
ranges: 0,
|
|
2008
2004
|
nodes: []
|
|
2009
|
-
};
|
|
2010
|
-
block = push2(brace);
|
|
2005
|
+
});
|
|
2011
2006
|
stack2.push(block);
|
|
2012
2007
|
push2({
|
|
2013
2008
|
type: "open",
|
|
@@ -2163,12 +2158,6 @@ var require_constants2 = __commonJS({ "node_modules/micromatch/node_modules/pico
|
|
|
2163
2158
|
var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
2164
2159
|
var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
2165
2160
|
var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
2166
|
-
var NO_DOT = `(?!${DOT_LITERAL})`;
|
|
2167
|
-
var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
2168
|
-
var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
2169
|
-
var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
2170
|
-
var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
2171
|
-
var STAR = `${QMARK}*?`;
|
|
2172
2161
|
var POSIX_CHARS = {
|
|
2173
2162
|
DOT_LITERAL,
|
|
2174
2163
|
PLUS_LITERAL,
|
|
@@ -2178,12 +2167,12 @@ var require_constants2 = __commonJS({ "node_modules/micromatch/node_modules/pico
|
|
|
2178
2167
|
QMARK,
|
|
2179
2168
|
END_ANCHOR,
|
|
2180
2169
|
DOTS_SLASH,
|
|
2181
|
-
NO_DOT
|
|
2182
|
-
NO_DOTS
|
|
2183
|
-
NO_DOT_SLASH,
|
|
2184
|
-
NO_DOTS_SLASH
|
|
2185
|
-
QMARK_NO_DOT
|
|
2186
|
-
STAR
|
|
2170
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
2171
|
+
NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
|
|
2172
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
|
|
2173
|
+
NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
|
|
2174
|
+
QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
|
|
2175
|
+
STAR: `${QMARK}*?`,
|
|
2187
2176
|
START_ANCHOR
|
|
2188
2177
|
};
|
|
2189
2178
|
var WINDOWS_CHARS = {
|
|
@@ -2345,9 +2334,7 @@ var require_utils2 = __commonJS({ "node_modules/micromatch/node_modules/picomatc
|
|
|
2345
2334
|
return output;
|
|
2346
2335
|
};
|
|
2347
2336
|
exports.wrapOutput = (input, state = {}, options8 = {}) => {
|
|
2348
|
-
|
|
2349
|
-
const append = options8.contains ? "" : "$";
|
|
2350
|
-
let output = `${prepend}(?:${input})${append}`;
|
|
2337
|
+
let output = `${options8.contains ? "" : "^"}(?:${input})${options8.contains ? "" : "$"}`;
|
|
2351
2338
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
2352
2339
|
return output;
|
|
2353
2340
|
};
|
|
@@ -2859,8 +2846,7 @@ var require_parse2 = __commonJS({ "node_modules/micromatch/node_modules/picomatc
|
|
|
2859
2846
|
if (inner.includes(":")) {
|
|
2860
2847
|
const idx = prev.value.lastIndexOf("[");
|
|
2861
2848
|
const pre = prev.value.slice(0, idx);
|
|
2862
|
-
const
|
|
2863
|
-
const posix = POSIX_REGEX_SOURCE[rest2];
|
|
2849
|
+
const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
2864
2850
|
if (posix) {
|
|
2865
2851
|
prev.value = pre + posix;
|
|
2866
2852
|
state.backtrack = true;
|
|
@@ -3386,8 +3372,7 @@ var require_parse2 = __commonJS({ "node_modules/micromatch/node_modules/picomatc
|
|
|
3386
3372
|
}
|
|
3387
3373
|
}
|
|
3388
3374
|
};
|
|
3389
|
-
|
|
3390
|
-
let source2 = create(output);
|
|
3375
|
+
let source2 = create(utils$1.removePrefix(input, state));
|
|
3391
3376
|
if (source2 && opts.strictSlashes !== true) source2 += `${SLASH_LITERAL}?`;
|
|
3392
3377
|
return source2;
|
|
3393
3378
|
};
|
|
@@ -4224,8 +4209,7 @@ var require_async2 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/provider
|
|
|
4224
4209
|
callSuccessCallback(callback, entries);
|
|
4225
4210
|
return;
|
|
4226
4211
|
}
|
|
4227
|
-
|
|
4228
|
-
rpl(tasks, (rplError, rplEntries) => {
|
|
4212
|
+
rpl(entries.map((entry) => makeRplTaskEntry(entry, settings)), (rplError, rplEntries) => {
|
|
4229
4213
|
if (rplError !== null) {
|
|
4230
4214
|
callFailureCallback(callback, rplError);
|
|
4231
4215
|
return;
|
|
@@ -4261,7 +4245,7 @@ var require_async2 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/provider
|
|
|
4261
4245
|
callFailureCallback(callback, readdirError);
|
|
4262
4246
|
return;
|
|
4263
4247
|
}
|
|
4264
|
-
|
|
4248
|
+
rpl(names.map((name) => {
|
|
4265
4249
|
const path14 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
4266
4250
|
return (done) => {
|
|
4267
4251
|
fsStat.stat(path14, settings.fsStatSettings, (error, stats) => {
|
|
@@ -4278,8 +4262,7 @@ var require_async2 = __commonJS({ "node_modules/@nodelib/fs.scandir/out/provider
|
|
|
4278
4262
|
done(null, entry);
|
|
4279
4263
|
});
|
|
4280
4264
|
};
|
|
4281
|
-
})
|
|
4282
|
-
rpl(tasks, (rplError, entries) => {
|
|
4265
|
+
}), (rplError, entries) => {
|
|
4283
4266
|
if (rplError !== null) {
|
|
4284
4267
|
callFailureCallback(callback, rplError);
|
|
4285
4268
|
return;
|
|
@@ -5179,8 +5162,7 @@ var require_deep = __commonJS({ "node_modules/fast-glob/out/providers/filters/de
|
|
|
5179
5162
|
_getEntryLevel(basePath, entryPath) {
|
|
5180
5163
|
const entryPathDepth = entryPath.split("/").length;
|
|
5181
5164
|
if (basePath === "") return entryPathDepth;
|
|
5182
|
-
|
|
5183
|
-
return entryPathDepth - basePathDepth;
|
|
5165
|
+
return entryPathDepth - basePath.split("/").length;
|
|
5184
5166
|
}
|
|
5185
5167
|
_isSkippedSymbolicLink(entry) {
|
|
5186
5168
|
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
|
@@ -5668,12 +5650,10 @@ var require_constants4 = __commonJS({ "node_modules/semver/internal/constants.js
|
|
|
5668
5650
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
5669
5651
|
var MAX_LENGTH = 256;
|
|
5670
5652
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
5671
|
-
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
5672
|
-
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
5673
5653
|
module.exports = {
|
|
5674
5654
|
MAX_LENGTH,
|
|
5675
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
5676
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
5655
|
+
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
5656
|
+
MAX_SAFE_BUILD_LENGTH: MAX_LENGTH - 6,
|
|
5677
5657
|
MAX_SAFE_INTEGER,
|
|
5678
5658
|
RELEASE_TYPES: [
|
|
5679
5659
|
"major",
|
|
@@ -7547,8 +7527,7 @@ var require_src = __commonJS({ "node_modules/editorconfig/src/index.js"(exports)
|
|
|
7547
7527
|
var glob = section[0];
|
|
7548
7528
|
var options22 = section[1];
|
|
7549
7529
|
if (!glob) return;
|
|
7550
|
-
|
|
7551
|
-
if (!fnmatch(filepath, fullGlob)) return;
|
|
7530
|
+
if (!fnmatch(filepath, buildFullGlob(pathPrefix, glob))) return;
|
|
7552
7531
|
matches = extendProps(matches, options22);
|
|
7553
7532
|
});
|
|
7554
7533
|
return matches;
|
|
@@ -7640,9 +7619,7 @@ var require_src = __commonJS({ "node_modules/editorconfig/src/index.js"(exports)
|
|
|
7640
7619
|
function parseSync(_filepath, _options) {
|
|
7641
7620
|
if (_options === void 0) _options = {};
|
|
7642
7621
|
var _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
|
|
7643
|
-
|
|
7644
|
-
var files = readConfigFilesSync(filepaths);
|
|
7645
|
-
return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
|
|
7622
|
+
return parseFromConfigs(getConfigsForFiles(readConfigFilesSync(getConfigFileNames(resolvedFilePath, processedOptions))), resolvedFilePath, processedOptions);
|
|
7646
7623
|
}
|
|
7647
7624
|
exports.parseSync = parseSync;
|
|
7648
7625
|
} });
|
|
@@ -8865,10 +8842,8 @@ var require_lib2 = __commonJS({ "node_modules/@babel/code-frame/lib/index.js"(ex
|
|
|
8865
8842
|
if (lineDiff2) for (let i = 0; i <= lineDiff2; i++) {
|
|
8866
8843
|
const lineNumber = i + startLine;
|
|
8867
8844
|
if (!startColumn) markerLines[lineNumber] = true;
|
|
8868
|
-
else if (i === 0)
|
|
8869
|
-
|
|
8870
|
-
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
|
8871
|
-
} else if (i === lineDiff2) markerLines[lineNumber] = [0, endColumn];
|
|
8845
|
+
else if (i === 0) markerLines[lineNumber] = [startColumn, source2[lineNumber - 1].length - startColumn + 1];
|
|
8846
|
+
else if (i === lineDiff2) markerLines[lineNumber] = [0, endColumn];
|
|
8872
8847
|
else markerLines[lineNumber] = [0, source2[lineNumber - i].length];
|
|
8873
8848
|
}
|
|
8874
8849
|
else if (startColumn === endColumn) if (startColumn) markerLines[startLine] = [startColumn, 0];
|
|
@@ -8883,8 +8858,7 @@ var require_lib2 = __commonJS({ "node_modules/@babel/code-frame/lib/index.js"(ex
|
|
|
8883
8858
|
function codeFrameColumns3(rawLines, loc, opts = {}) {
|
|
8884
8859
|
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
|
8885
8860
|
const defs = getDefs(shouldHighlight);
|
|
8886
|
-
const
|
|
8887
|
-
const { start, end, markerLines } = getMarkerLines(loc, lines, opts);
|
|
8861
|
+
const { start, end, markerLines } = getMarkerLines(loc, rawLines.split(NEWLINE), opts);
|
|
8888
8862
|
const hasColumns = loc.start && typeof loc.start.column === "number";
|
|
8889
8863
|
const numberMaxWidth = String(end).length;
|
|
8890
8864
|
let frame = (shouldHighlight ? highlight(rawLines) : rawLines).split(NEWLINE, end).slice(start, end).map((line3, index2) => {
|
|
@@ -9077,8 +9051,7 @@ var require_ignore = __commonJS({ "node_modules/ignore/index.js"(exports, module
|
|
|
9077
9051
|
}],
|
|
9078
9052
|
[/\\\/\\\*\\\*(?=\\\/|$)/g, (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"],
|
|
9079
9053
|
[/(^|[^\\]+)(\\\*)+(?=.+)/g, (_, p1, p2) => {
|
|
9080
|
-
|
|
9081
|
-
return p1 + unescaped;
|
|
9054
|
+
return p1 + p2.replace(/\\\*/g, "[^\\/]*");
|
|
9082
9055
|
}],
|
|
9083
9056
|
[/\\\\\\(?=[$.|*+(){^])/g, () => ESCAPE],
|
|
9084
9057
|
[/\\\\/g, () => ESCAPE],
|
|
@@ -9510,8 +9483,7 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
|
|
|
9510
9483
|
else {
|
|
9511
9484
|
const { callback } = optionsObj;
|
|
9512
9485
|
diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff) => {
|
|
9513
|
-
|
|
9514
|
-
callback(patch);
|
|
9486
|
+
callback(diffLinesResultToPatch(diff));
|
|
9515
9487
|
} }));
|
|
9516
9488
|
}
|
|
9517
9489
|
function diffLinesResultToPatch(diff) {
|
|
@@ -10404,10 +10376,8 @@ function clearEditorconfigCache() {
|
|
|
10404
10376
|
editorconfigCache.clear();
|
|
10405
10377
|
}
|
|
10406
10378
|
async function loadEditorconfigInternal(file, { shouldCache }) {
|
|
10407
|
-
const
|
|
10408
|
-
|
|
10409
|
-
const editorConfig = await import_editorconfig.default.parse(file, { root: root2 });
|
|
10410
|
-
return editorconfig_to_prettier_default(editorConfig);
|
|
10379
|
+
const root2 = await findProjectRoot(path10.dirname(file), { shouldCache });
|
|
10380
|
+
return editorconfig_to_prettier_default(await import_editorconfig.default.parse(file, { root: root2 }));
|
|
10411
10381
|
}
|
|
10412
10382
|
function loadEditorconfig(file, { shouldCache }) {
|
|
10413
10383
|
file = path10.resolve(file);
|
|
@@ -11914,7 +11884,7 @@ async function loadConfigFromPackageYaml(file) {
|
|
|
11914
11884
|
var parseYaml;
|
|
11915
11885
|
async function loadYaml(file) {
|
|
11916
11886
|
const content = await read_file_default(file);
|
|
11917
|
-
if (!parseYaml) ({__parsePrettierYamlConfig: parseYaml} = await import("./yaml-
|
|
11887
|
+
if (!parseYaml) ({__parsePrettierYamlConfig: parseYaml} = await import("./yaml-BfWM_B73.js"));
|
|
11918
11888
|
try {
|
|
11919
11889
|
return parseYaml(content);
|
|
11920
11890
|
} catch (error) {
|
|
@@ -12386,8 +12356,7 @@ function getFileProtocolModuleFormat(url3, _context, ignoreErrors) {
|
|
|
12386
12356
|
const format3 = extensionFormatMap[value];
|
|
12387
12357
|
if (format3) return format3;
|
|
12388
12358
|
if (ignoreErrors) return;
|
|
12389
|
-
|
|
12390
|
-
throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
|
|
12359
|
+
throw new ERR_UNKNOWN_FILE_EXTENSION(value, fileURLToPath(url3));
|
|
12391
12360
|
}
|
|
12392
12361
|
function getHttpProtocolModuleFormat() {}
|
|
12393
12362
|
function defaultGetFormatWithoutErrors(url3, context) {
|
|
@@ -12527,8 +12496,7 @@ function exportsNotFound(subpath, packageJsonUrl, base) {
|
|
|
12527
12496
|
return new ERR_PACKAGE_PATH_NOT_EXPORTED(fileURLToPath(new URL$1(".", packageJsonUrl)), subpath, base && fileURLToPath(base));
|
|
12528
12497
|
}
|
|
12529
12498
|
function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
|
|
12530
|
-
|
|
12531
|
-
throw new ERR_INVALID_MODULE_SPECIFIER(request, reason, base && fileURLToPath(base));
|
|
12499
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(request, `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath(packageJsonUrl)}`, base && fileURLToPath(base));
|
|
12532
12500
|
}
|
|
12533
12501
|
function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
|
|
12534
12502
|
target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
|
|
@@ -12543,18 +12511,14 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
|
|
|
12543
12511
|
new URL$1(target);
|
|
12544
12512
|
isURL2 = true;
|
|
12545
12513
|
} catch {}
|
|
12546
|
-
if (!isURL2)
|
|
12547
|
-
const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target + subpath;
|
|
12548
|
-
return packageResolve(exportTarget, packageJsonUrl, conditions);
|
|
12549
|
-
}
|
|
12514
|
+
if (!isURL2) return packageResolve(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target + subpath, packageJsonUrl, conditions);
|
|
12550
12515
|
}
|
|
12551
12516
|
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
12552
12517
|
}
|
|
12553
12518
|
if (invalidSegmentRegEx.exec(target.slice(2)) !== null) if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {
|
|
12554
12519
|
if (!isPathMap) {
|
|
12555
12520
|
const request = pattern ? match.replace("*", () => subpath) : match + subpath;
|
|
12556
|
-
|
|
12557
|
-
emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJsonUrl, internal, base, true);
|
|
12521
|
+
emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, true);
|
|
12558
12522
|
}
|
|
12559
12523
|
} else throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
12560
12524
|
const resolved = new URL$1(target, packageJsonUrl);
|
|
@@ -12565,10 +12529,7 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
|
|
|
12565
12529
|
if (invalidSegmentRegEx.exec(subpath) !== null) {
|
|
12566
12530
|
const request = pattern ? match.replace("*", () => subpath) : match + subpath;
|
|
12567
12531
|
if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {
|
|
12568
|
-
if (!isPathMap)
|
|
12569
|
-
const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target;
|
|
12570
|
-
emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJsonUrl, internal, base, false);
|
|
12571
|
-
}
|
|
12532
|
+
if (!isPathMap) emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, false);
|
|
12572
12533
|
} else throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
|
|
12573
12534
|
}
|
|
12574
12535
|
if (pattern) return new URL$1(RegExpPrototypeSymbolReplace.call(patternRegEx, resolved.href, () => subpath));
|
|
@@ -12744,10 +12705,9 @@ function parsePackageName(specifier, base) {
|
|
|
12744
12705
|
const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
|
|
12745
12706
|
if (invalidPackageNameRegEx.exec(packageName) !== null) validPackageName = false;
|
|
12746
12707
|
if (!validPackageName) throw new ERR_INVALID_MODULE_SPECIFIER(specifier, "is not a valid package name", fileURLToPath(base));
|
|
12747
|
-
const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
|
|
12748
12708
|
return {
|
|
12749
12709
|
packageName,
|
|
12750
|
-
packageSubpath,
|
|
12710
|
+
packageSubpath: "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)),
|
|
12751
12711
|
isScoped
|
|
12752
12712
|
};
|
|
12753
12713
|
}
|
|
@@ -12938,8 +12898,7 @@ function getSearchFunction(stopDirectory) {
|
|
|
12938
12898
|
}
|
|
12939
12899
|
function searchPrettierConfig(startDirectory, options8 = {}) {
|
|
12940
12900
|
startDirectory = startDirectory ? path10.resolve(startDirectory) : process.cwd();
|
|
12941
|
-
|
|
12942
|
-
return getSearchFunction(stopDirectory)(startDirectory, { cache: options8.shouldCache });
|
|
12901
|
+
return getSearchFunction(mockable_default.getPrettierConfigSearchStopDirectory())(startDirectory, { cache: options8.shouldCache });
|
|
12943
12902
|
}
|
|
12944
12903
|
function clearCache() {
|
|
12945
12904
|
clearPrettierConfigCache();
|
|
@@ -12953,10 +12912,7 @@ function loadEditorconfig2(file, options8) {
|
|
|
12953
12912
|
async function loadPrettierConfig2(file, options8) {
|
|
12954
12913
|
const shouldCache = options8.useCache;
|
|
12955
12914
|
let configFile = options8.config;
|
|
12956
|
-
if (!configFile) {
|
|
12957
|
-
const directory = file ? path10.dirname(path10.resolve(file)) : void 0;
|
|
12958
|
-
configFile = await searchPrettierConfig(directory, { shouldCache });
|
|
12959
|
-
}
|
|
12915
|
+
if (!configFile) configFile = await searchPrettierConfig(file ? path10.dirname(path10.resolve(file)) : void 0, { shouldCache });
|
|
12960
12916
|
if (!configFile) return;
|
|
12961
12917
|
configFile = toPath(configFile);
|
|
12962
12918
|
return {
|
|
@@ -12980,8 +12936,7 @@ async function resolveConfig(fileUrlOrPath, options8) {
|
|
|
12980
12936
|
return merged;
|
|
12981
12937
|
}
|
|
12982
12938
|
async function resolveConfigFile(fileUrlOrPath) {
|
|
12983
|
-
|
|
12984
|
-
return await searchPrettierConfig(directory, { shouldCache: false }) ?? null;
|
|
12939
|
+
return await searchPrettierConfig(fileUrlOrPath ? path10.dirname(path10.resolve(toPath(fileUrlOrPath))) : void 0, { shouldCache: false }) ?? null;
|
|
12985
12940
|
}
|
|
12986
12941
|
function mergeOverrides(configResult, filePath) {
|
|
12987
12942
|
const { config, configFile } = configResult || {};
|
|
@@ -13129,14 +13084,14 @@ function traverseDoc(doc2, onEnter, onExit, shouldTraverseConditionalGroups) {
|
|
|
13129
13084
|
case DOC_TYPE_ARRAY:
|
|
13130
13085
|
case DOC_TYPE_FILL: {
|
|
13131
13086
|
const parts = docType === DOC_TYPE_ARRAY ? doc3 : doc3.parts;
|
|
13132
|
-
for (let
|
|
13087
|
+
for (let i = parts.length - 1; i >= 0; --i) docsStack.push(parts[i]);
|
|
13133
13088
|
break;
|
|
13134
13089
|
}
|
|
13135
13090
|
case DOC_TYPE_IF_BREAK:
|
|
13136
13091
|
docsStack.push(doc3.flatContents, doc3.breakContents);
|
|
13137
13092
|
break;
|
|
13138
13093
|
case DOC_TYPE_GROUP:
|
|
13139
|
-
if (shouldTraverseConditionalGroups && doc3.expandedStates) for (let
|
|
13094
|
+
if (shouldTraverseConditionalGroups && doc3.expandedStates) for (let i = doc3.expandedStates.length - 1; i >= 0; --i) docsStack.push(doc3.expandedStates[i]);
|
|
13140
13095
|
else docsStack.push(doc3.contents);
|
|
13141
13096
|
break;
|
|
13142
13097
|
case DOC_TYPE_ALIGN:
|
|
@@ -13760,11 +13715,10 @@ function printDocToString(doc2, options8) {
|
|
|
13760
13715
|
});
|
|
13761
13716
|
break;
|
|
13762
13717
|
} else {
|
|
13763
|
-
const state = doc3.expandedStates[i];
|
|
13764
13718
|
const cmd = {
|
|
13765
13719
|
ind,
|
|
13766
13720
|
mode: MODE_FLAT,
|
|
13767
|
-
doc:
|
|
13721
|
+
doc: doc3.expandedStates[i]
|
|
13768
13722
|
};
|
|
13769
13723
|
if (fits(cmd, cmds, rem, hasLineSuffix, groupModeMap)) {
|
|
13770
13724
|
cmds.push(cmd);
|
|
@@ -14211,8 +14165,7 @@ function skipNewline(text, startIndex, options8) {
|
|
|
14211
14165
|
var skip_newline_default = skipNewline;
|
|
14212
14166
|
function hasNewline(text, startIndex, options8 = {}) {
|
|
14213
14167
|
const idx = skipSpaces(text, options8.backwards ? startIndex - 1 : startIndex, options8);
|
|
14214
|
-
|
|
14215
|
-
return idx !== idx2;
|
|
14168
|
+
return idx !== skip_newline_default(text, idx, options8);
|
|
14216
14169
|
}
|
|
14217
14170
|
var has_newline_default = hasNewline;
|
|
14218
14171
|
function isNonEmptyArray(object) {
|
|
@@ -14454,18 +14407,15 @@ function printTrailingComment(path14, options8, previousComment) {
|
|
|
14454
14407
|
const printed = printComment(path14, options8);
|
|
14455
14408
|
const { printer: printer$1, originalText, locStart } = options8;
|
|
14456
14409
|
const isBlock = (_a = printer$1.isBlockComment) == null ? void 0 : _a.call(printer$1, comment);
|
|
14457
|
-
if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) {
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
hasLineSuffix: true
|
|
14467
|
-
};
|
|
14468
|
-
}
|
|
14410
|
+
if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) return {
|
|
14411
|
+
doc: lineSuffix([
|
|
14412
|
+
hardline,
|
|
14413
|
+
is_previous_line_empty_default(originalText, locStart(comment)) ? hardline : "",
|
|
14414
|
+
printed
|
|
14415
|
+
]),
|
|
14416
|
+
isBlock,
|
|
14417
|
+
hasLineSuffix: true
|
|
14418
|
+
};
|
|
14469
14419
|
if (!isBlock || (previousComment == null ? void 0 : previousComment.hasLineSuffix)) return {
|
|
14470
14420
|
doc: [lineSuffix([" ", printed]), breakParent],
|
|
14471
14421
|
isBlock,
|
|
@@ -14890,11 +14840,10 @@ function normalizeOptions(options8, optionInfos, { logger = false, isCLI = false
|
|
|
14890
14840
|
schemas: schemas2
|
|
14891
14841
|
});
|
|
14892
14842
|
} : Array.isArray(passThrough) ? (key2, value) => !passThrough.includes(key2) ? void 0 : { [key2]: value } : (key2, value) => ({ [key2]: value });
|
|
14893
|
-
const
|
|
14843
|
+
const normalizer = new Normalizer(optionInfosToSchemas(optionInfos, {
|
|
14894
14844
|
isCLI,
|
|
14895
14845
|
FlagSchema
|
|
14896
|
-
})
|
|
14897
|
-
const normalizer = new Normalizer(schemas, {
|
|
14846
|
+
}), {
|
|
14898
14847
|
logger,
|
|
14899
14848
|
unknown,
|
|
14900
14849
|
descriptor
|
|
@@ -14994,19 +14943,16 @@ function getParserPluginByParserName(plugins, parserName) {
|
|
|
14994
14943
|
if (!parserName) throw new Error("parserName is required.");
|
|
14995
14944
|
const plugin = array_find_last_default(false, plugins, (plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName));
|
|
14996
14945
|
if (plugin) return plugin;
|
|
14997
|
-
|
|
14998
|
-
throw new ConfigError(message);
|
|
14946
|
+
throw new ConfigError(`Couldn't resolve parser "${parserName}".`);
|
|
14999
14947
|
}
|
|
15000
14948
|
function getPrinterPluginByAstFormat(plugins, astFormat) {
|
|
15001
14949
|
if (!astFormat) throw new Error("astFormat is required.");
|
|
15002
14950
|
const plugin = array_find_last_default(false, plugins, (plugin2) => plugin2.printers && Object.prototype.hasOwnProperty.call(plugin2.printers, astFormat));
|
|
15003
14951
|
if (plugin) return plugin;
|
|
15004
|
-
|
|
15005
|
-
throw new ConfigError(message);
|
|
14952
|
+
throw new ConfigError(`Couldn't find plugin for AST format "${astFormat}".`);
|
|
15006
14953
|
}
|
|
15007
14954
|
function resolveParser({ plugins, parser }) {
|
|
15008
|
-
|
|
15009
|
-
return initParser(plugin, parser);
|
|
14955
|
+
return initParser(getParserPluginByParserName(plugins, parser), parser);
|
|
15010
14956
|
}
|
|
15011
14957
|
function initParser(plugin, parserName) {
|
|
15012
14958
|
const parserOrParserInitFunction = plugin.parsers[parserName];
|
|
@@ -15134,8 +15080,7 @@ async function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc2
|
|
|
15134
15080
|
rangeEnd: void 0
|
|
15135
15081
|
}, { passThrough: true });
|
|
15136
15082
|
const { ast } = await parse_default(text, options8);
|
|
15137
|
-
|
|
15138
|
-
return stripTrailingHardline(doc2);
|
|
15083
|
+
return stripTrailingHardline(await printAstToDoc2(ast, options8));
|
|
15139
15084
|
}
|
|
15140
15085
|
function printIgnored(path14, options8) {
|
|
15141
15086
|
const { originalText, [Symbol.for("comments")]: comments, locStart, locEnd, [Symbol.for("printedComments")]: printedComments } = options8;
|
|
@@ -15480,8 +15425,7 @@ async function coreFormat(originalText, opts, addAlignmentSize = 0) {
|
|
|
15480
15425
|
};
|
|
15481
15426
|
const oldCursorNodeCharArray = oldCursorRegionText.split("");
|
|
15482
15427
|
oldCursorNodeCharArray.splice(cursorOffsetRelativeToOldCursorRegionStart, 0, CURSOR);
|
|
15483
|
-
const
|
|
15484
|
-
const cursorNodeDiff = diffArrays(oldCursorNodeCharArray, newCursorNodeCharArray);
|
|
15428
|
+
const cursorNodeDiff = diffArrays(oldCursorNodeCharArray, newCursorRegionText.split(""));
|
|
15485
15429
|
let cursorOffset = newCursorRegionStart;
|
|
15486
15430
|
for (const entry of cursorNodeDiff) if (entry.removed) {
|
|
15487
15431
|
if (entry.value.includes(CURSOR)) break;
|
|
@@ -15612,12 +15556,10 @@ async function parse6(originalText, originalOptions, devOptions) {
|
|
|
15612
15556
|
}
|
|
15613
15557
|
async function formatAst(ast, options8) {
|
|
15614
15558
|
options8 = await normalize_format_options_default(options8);
|
|
15615
|
-
|
|
15616
|
-
return printDocToString(doc2, options8);
|
|
15559
|
+
return printDocToString(await printAstToDoc(ast, options8), options8);
|
|
15617
15560
|
}
|
|
15618
15561
|
async function formatDoc(doc2, options8) {
|
|
15619
|
-
const
|
|
15620
|
-
const { formatted } = await formatWithCursor(text, {
|
|
15562
|
+
const { formatted } = await formatWithCursor(printDocToDebug(doc2), {
|
|
15621
15563
|
...options8,
|
|
15622
15564
|
parser: "__js_expression"
|
|
15623
15565
|
});
|
|
@@ -16413,11 +16355,11 @@ var languages = [
|
|
|
16413
16355
|
];
|
|
16414
16356
|
var { parsers, printers } = createParsersAndPrinters([
|
|
16415
16357
|
{
|
|
16416
|
-
importPlugin: () => import("./acorn-
|
|
16358
|
+
importPlugin: () => import("./acorn-D-VhIOLw.js"),
|
|
16417
16359
|
parsers: ["acorn", "espree"]
|
|
16418
16360
|
},
|
|
16419
16361
|
{
|
|
16420
|
-
importPlugin: () => import("./angular-
|
|
16362
|
+
importPlugin: () => import("./angular-Czhp4eq5.js"),
|
|
16421
16363
|
parsers: [
|
|
16422
16364
|
"__ng_action",
|
|
16423
16365
|
"__ng_binding",
|
|
@@ -16426,7 +16368,7 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
16426
16368
|
]
|
|
16427
16369
|
},
|
|
16428
16370
|
{
|
|
16429
|
-
importPlugin: () => import("./babel-
|
|
16371
|
+
importPlugin: () => import("./babel-DCR_B4Qn.js"),
|
|
16430
16372
|
parsers: [
|
|
16431
16373
|
"babel",
|
|
16432
16374
|
"babel-flow",
|
|
@@ -16445,25 +16387,25 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
16445
16387
|
]
|
|
16446
16388
|
},
|
|
16447
16389
|
{
|
|
16448
|
-
importPlugin: () => import("./estree-
|
|
16390
|
+
importPlugin: () => import("./estree-DU2NummP.js"),
|
|
16449
16391
|
printers: ["estree", "estree-json"]
|
|
16450
16392
|
},
|
|
16451
16393
|
{
|
|
16452
|
-
importPlugin: () => import("./flow-
|
|
16394
|
+
importPlugin: () => import("./flow-JiEbweKj.js"),
|
|
16453
16395
|
parsers: ["flow"]
|
|
16454
16396
|
},
|
|
16455
16397
|
{
|
|
16456
|
-
importPlugin: () => import("./glimmer-
|
|
16398
|
+
importPlugin: () => import("./glimmer-t9nWn9aE.js"),
|
|
16457
16399
|
parsers: ["glimmer"],
|
|
16458
16400
|
printers: ["glimmer"]
|
|
16459
16401
|
},
|
|
16460
16402
|
{
|
|
16461
|
-
importPlugin: () => import("./graphql-
|
|
16403
|
+
importPlugin: () => import("./graphql-DjErlIi5.js"),
|
|
16462
16404
|
parsers: ["graphql"],
|
|
16463
16405
|
printers: ["graphql"]
|
|
16464
16406
|
},
|
|
16465
16407
|
{
|
|
16466
|
-
importPlugin: () => import("./html-
|
|
16408
|
+
importPlugin: () => import("./html-_apcbx34.js"),
|
|
16467
16409
|
parsers: [
|
|
16468
16410
|
"html",
|
|
16469
16411
|
"angular",
|
|
@@ -16474,7 +16416,7 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
16474
16416
|
printers: ["html"]
|
|
16475
16417
|
},
|
|
16476
16418
|
{
|
|
16477
|
-
importPlugin: () => import("./markdown-
|
|
16419
|
+
importPlugin: () => import("./markdown-ckUc3Q6q.js"),
|
|
16478
16420
|
parsers: [
|
|
16479
16421
|
"markdown",
|
|
16480
16422
|
"mdx",
|
|
@@ -16483,11 +16425,11 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
16483
16425
|
printers: ["mdast"]
|
|
16484
16426
|
},
|
|
16485
16427
|
{
|
|
16486
|
-
importPlugin: () => import("./meriyah-
|
|
16428
|
+
importPlugin: () => import("./meriyah-BjnGqpUs.js"),
|
|
16487
16429
|
parsers: ["meriyah"]
|
|
16488
16430
|
},
|
|
16489
16431
|
{
|
|
16490
|
-
importPlugin: () => import("./postcss-
|
|
16432
|
+
importPlugin: () => import("./postcss-v7BP6SZ-.js"),
|
|
16491
16433
|
parsers: [
|
|
16492
16434
|
"css",
|
|
16493
16435
|
"less",
|
|
@@ -16496,11 +16438,11 @@ var { parsers, printers } = createParsersAndPrinters([
|
|
|
16496
16438
|
printers: ["postcss"]
|
|
16497
16439
|
},
|
|
16498
16440
|
{
|
|
16499
|
-
importPlugin: () => import("./typescript-
|
|
16441
|
+
importPlugin: () => import("./typescript-Cas1XcNz.js"),
|
|
16500
16442
|
parsers: ["typescript"]
|
|
16501
16443
|
},
|
|
16502
16444
|
{
|
|
16503
|
-
importPlugin: () => import("./yaml-
|
|
16445
|
+
importPlugin: () => import("./yaml-BfWM_B73.js"),
|
|
16504
16446
|
parsers: ["yaml"],
|
|
16505
16447
|
printers: ["yaml"]
|
|
16506
16448
|
}
|
|
@@ -16714,13 +16656,12 @@ function hasSpaces(text, startIndex, options8 = {}) {
|
|
|
16714
16656
|
var has_spaces_default = hasSpaces;
|
|
16715
16657
|
function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
16716
16658
|
const otherQuote = enclosingQuote === "\"" ? "'" : "\"";
|
|
16717
|
-
|
|
16659
|
+
return enclosingQuote + string_replace_all_default(false, rawText, /\\(.)|(["'])/gsu, (match, escaped, quote) => {
|
|
16718
16660
|
if (escaped === otherQuote) return escaped;
|
|
16719
16661
|
if (quote === enclosingQuote) return "\\" + quote;
|
|
16720
16662
|
if (quote) return quote;
|
|
16721
16663
|
return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(escaped) ? escaped : "\\" + escaped;
|
|
16722
|
-
});
|
|
16723
|
-
return enclosingQuote + raw + enclosingQuote;
|
|
16664
|
+
}) + enclosingQuote;
|
|
16724
16665
|
}
|
|
16725
16666
|
var make_string_default = makeString;
|
|
16726
16667
|
function legacyGetNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
|
|
@@ -16857,8 +16798,9 @@ const createMockedPluginManager = (name) => ({
|
|
|
16857
16798
|
const mockedPluginManager = createMockedPluginManager("");
|
|
16858
16799
|
async function matchFiles(files, pre) {
|
|
16859
16800
|
if (!files) return;
|
|
16801
|
+
const fileProcessor = new FileProcessor();
|
|
16860
16802
|
for await (const file of files) {
|
|
16861
|
-
const source$1 = await
|
|
16803
|
+
const source$1 = await fileProcessor.parse(createFile(file));
|
|
16862
16804
|
let code = source$1;
|
|
16863
16805
|
if (!file.baseName.endsWith(".json")) code = await format$1(source$1);
|
|
16864
16806
|
await expect(code).toMatchFileSnapshot(path.join(...[
|