prettier-plugin-embed 0.3.0 → 0.3.2
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/README.md +14 -4
- package/dist/embedded/css/options.d.ts +2 -2
- package/dist/embedded/es/options.d.ts +4 -4
- package/dist/embedded/markdown/options.d.ts +2 -2
- package/dist/embedded/register.d.ts +2 -2
- package/dist/embedded/sql/options.d.ts +6 -8
- package/dist/embedded/ts/options.d.ts +3 -3
- package/dist/index.js +613 -555
- package/dist/options.d.ts +1 -1
- package/package.json +24 -24
package/dist/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { utils as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { printers as
|
|
8
|
-
import { readFile as
|
|
9
|
-
import { isAbsolute as
|
|
10
|
-
import { Worker as
|
|
11
|
-
import { resolveConfigFile as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
1
|
+
import { utils as q, builders as I } from "prettier/doc";
|
|
2
|
+
import Qe from "prettier/parser-babel";
|
|
3
|
+
import Ze from "prettier/parser-espree";
|
|
4
|
+
import et from "prettier/parser-flow";
|
|
5
|
+
import tt from "prettier/parser-meriyah";
|
|
6
|
+
import nt from "prettier/parser-typescript";
|
|
7
|
+
import { printers as rt } from "prettier/plugins/estree.mjs";
|
|
8
|
+
import { readFile as ot } from "node:fs/promises";
|
|
9
|
+
import { isAbsolute as st, dirname as it, resolve as at, extname as ct } from "node:path";
|
|
10
|
+
import { Worker as dt } from "node:worker_threads";
|
|
11
|
+
import { resolveConfigFile as lt } from "prettier";
|
|
12
|
+
const Me = "embeddedCss", { group: ut, indent: mt, softline: V, lineSuffixBoundary: gt } = I, { mapDoc: pt } = q;
|
|
13
|
+
function ft(t, n) {
|
|
14
14
|
const { node: r } = t;
|
|
15
15
|
let e = n();
|
|
16
|
-
return r?.comments?.length && (e =
|
|
16
|
+
return r?.comments?.length && (e = ut([mt([V, e]), V])), ["${", e, gt, "}"];
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function D(t, n) {
|
|
19
19
|
return t.map(
|
|
20
|
-
(r) =>
|
|
20
|
+
(r) => ft(r, n),
|
|
21
21
|
"expressions"
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
26
|
-
if (typeof
|
|
27
|
-
return
|
|
28
|
-
const
|
|
24
|
+
function L(t, n, r) {
|
|
25
|
+
return pt(t, (o) => {
|
|
26
|
+
if (typeof o != "string")
|
|
27
|
+
return o;
|
|
28
|
+
const s = [], a = o.split(n);
|
|
29
29
|
for (let i = 0; i < a.length; i++) {
|
|
30
|
-
let
|
|
30
|
+
let l = a[i];
|
|
31
31
|
if (i % 2 == 0) {
|
|
32
|
-
if (!
|
|
32
|
+
if (!l)
|
|
33
33
|
continue;
|
|
34
|
-
|
|
34
|
+
l = l.replaceAll(/([\\`]|\${)/g, "\\$1"), s.push(l);
|
|
35
35
|
} else {
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const c = Number(l);
|
|
37
|
+
s.push(r[c]);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return s;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function B(t, n, r) {
|
|
44
44
|
if (!(n.plugins?.some(
|
|
45
45
|
(e) => e.name?.includes(t) ?? !1
|
|
46
46
|
) ?? !1))
|
|
@@ -48,23 +48,23 @@ function A(t, n, r) {
|
|
|
48
48
|
`Cannot format embedded language identified by "${r}", because plugin "${t}" is not loaded.`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ht(t, n, r) {
|
|
52
52
|
if (n === r) {
|
|
53
53
|
t.unshift(n);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
let e = 0,
|
|
57
|
-
for (; e <
|
|
58
|
-
const
|
|
59
|
-
if (t[
|
|
56
|
+
let e = 0, o = t.length;
|
|
57
|
+
for (; e < o; ) {
|
|
58
|
+
const s = e + o >>> 1;
|
|
59
|
+
if (t[s] === r) {
|
|
60
60
|
t.push(n);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
t[
|
|
63
|
+
t[s] < n ? e = s + 1 : o = s;
|
|
64
64
|
}
|
|
65
65
|
t.splice(e, 0, n);
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const Q = (() => {
|
|
68
68
|
const t = [...Array(26).keys()].map((n) => String.fromCharCode(n + 97)).concat([...Array(10).keys()].map((n) => `${n}`));
|
|
69
69
|
return () => {
|
|
70
70
|
let r = "";
|
|
@@ -73,9 +73,9 @@ const V = (() => {
|
|
|
73
73
|
return r;
|
|
74
74
|
};
|
|
75
75
|
})();
|
|
76
|
-
function
|
|
77
|
-
const r =
|
|
78
|
-
`${
|
|
76
|
+
function O(t = "p", n = "") {
|
|
77
|
+
const r = Q(), e = Q(), o = Z(t), s = Z(n), a = (l) => `${t}${r}${l}${e}${n}`, i = new RegExp(
|
|
78
|
+
`${o}${r}(\\d+)${e}${s}`,
|
|
79
79
|
"g"
|
|
80
80
|
);
|
|
81
81
|
return {
|
|
@@ -83,81 +83,87 @@ function L(t = "p", n = "") {
|
|
|
83
83
|
placeholderRegex: i
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Z(t) {
|
|
87
87
|
return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function $(t) {
|
|
90
90
|
return `${t}Identifiers`;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Re(t) {
|
|
93
93
|
return `${t}Parser`;
|
|
94
94
|
}
|
|
95
|
-
const { line:
|
|
95
|
+
const { line: ee, group: T, indent: te, softline: ne } = I, bt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
96
96
|
e = {
|
|
97
97
|
...e,
|
|
98
|
-
...
|
|
98
|
+
...s
|
|
99
99
|
};
|
|
100
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
101
|
-
(
|
|
102
|
-
).join(""),
|
|
100
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O("@p"), c = a.quasis.map(
|
|
101
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
102
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
103
|
+
d.length,
|
|
104
|
+
-m.length || void 0
|
|
105
|
+
), y = D(r, n), f = await t(E, {
|
|
103
106
|
...e,
|
|
104
107
|
parser: "scss"
|
|
105
|
-
}),
|
|
106
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
107
|
-
return
|
|
108
|
+
}), u = L(f, l, y);
|
|
109
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
110
|
+
return T([
|
|
108
111
|
"`",
|
|
109
|
-
|
|
110
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
111
|
-
|
|
112
|
+
d,
|
|
113
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [T(u)] : te([T(u)]),
|
|
114
|
+
m,
|
|
112
115
|
"`"
|
|
113
116
|
]);
|
|
114
|
-
const
|
|
115
|
-
return
|
|
117
|
+
const h = d.length ? ee : ne, _ = m.length ? ee : ne;
|
|
118
|
+
return T([
|
|
116
119
|
"`",
|
|
117
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
118
|
-
|
|
120
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, T(u)] : te([h, T(u)]),
|
|
121
|
+
_,
|
|
119
122
|
"`"
|
|
120
123
|
]);
|
|
121
|
-
},
|
|
122
|
-
[
|
|
124
|
+
}, yt = ["css"], vt = $(Me), Et = {
|
|
125
|
+
[vt]: {
|
|
123
126
|
category: "Global",
|
|
124
127
|
type: "string",
|
|
125
128
|
array: !0,
|
|
126
|
-
default: [{ value: [...
|
|
129
|
+
default: [{ value: [...yt] }],
|
|
127
130
|
description: "Specify embedded CSS language identifiers."
|
|
128
131
|
}
|
|
129
|
-
},
|
|
132
|
+
}, _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
130
133
|
__proto__: null,
|
|
131
|
-
embeddedLanguage:
|
|
132
|
-
embedder:
|
|
133
|
-
options:
|
|
134
|
-
}, Symbol.toStringTag, { value: "Module" })), H = "embeddedEs", { line:
|
|
134
|
+
embeddedLanguage: Me,
|
|
135
|
+
embedder: bt,
|
|
136
|
+
options: Et
|
|
137
|
+
}, Symbol.toStringTag, { value: "Module" })), H = "embeddedEs", { line: re, group: k, indent: oe, softline: se } = I, xt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
135
138
|
e = {
|
|
136
139
|
...e,
|
|
137
|
-
...
|
|
140
|
+
...s
|
|
138
141
|
};
|
|
139
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
140
|
-
(
|
|
141
|
-
).join(""),
|
|
142
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
|
|
143
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
144
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
145
|
+
d.length,
|
|
146
|
+
-m.length || void 0
|
|
147
|
+
), y = D(r, n), f = await t(E, {
|
|
142
148
|
...e,
|
|
143
149
|
parser: e.embeddedEsParser ?? "babel"
|
|
144
|
-
}),
|
|
145
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
146
|
-
return
|
|
150
|
+
}), u = L(f, l, y);
|
|
151
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
152
|
+
return k([
|
|
147
153
|
"`",
|
|
148
|
-
|
|
149
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
150
|
-
|
|
154
|
+
d,
|
|
155
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [k(u)] : oe([k(u)]),
|
|
156
|
+
m,
|
|
151
157
|
"`"
|
|
152
158
|
]);
|
|
153
|
-
const
|
|
154
|
-
return
|
|
159
|
+
const h = d.length ? re : se, _ = m.length ? re : se;
|
|
160
|
+
return k([
|
|
155
161
|
"`",
|
|
156
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
157
|
-
|
|
162
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, k(u)] : oe([h, k(u)]),
|
|
163
|
+
_,
|
|
158
164
|
"`"
|
|
159
165
|
]);
|
|
160
|
-
},
|
|
166
|
+
}, It = [
|
|
161
167
|
"js",
|
|
162
168
|
"jsx",
|
|
163
169
|
"es",
|
|
@@ -166,56 +172,56 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
|
|
|
166
172
|
"cjs",
|
|
167
173
|
"pac",
|
|
168
174
|
"javascript"
|
|
169
|
-
],
|
|
170
|
-
[
|
|
175
|
+
], $t = $(H), St = Re(H), Dt = {
|
|
176
|
+
[$t]: {
|
|
171
177
|
category: "Global",
|
|
172
178
|
type: "string",
|
|
173
179
|
array: !0,
|
|
174
|
-
default: [{ value: [...
|
|
180
|
+
default: [{ value: [...It] }],
|
|
175
181
|
description: "Specify embedded ES language identifiers."
|
|
176
182
|
},
|
|
177
|
-
[
|
|
183
|
+
[St]: {
|
|
178
184
|
category: "Global",
|
|
179
185
|
type: "string",
|
|
180
186
|
array: !1,
|
|
181
187
|
default: "babel",
|
|
182
188
|
description: "Specify the embedded ES language parser."
|
|
183
189
|
}
|
|
184
|
-
},
|
|
190
|
+
}, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
185
191
|
__proto__: null,
|
|
186
192
|
embeddedLanguage: H,
|
|
187
|
-
embedder:
|
|
188
|
-
options:
|
|
189
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
190
|
-
|
|
193
|
+
embedder: xt,
|
|
194
|
+
options: Dt
|
|
195
|
+
}, Symbol.toStringTag, { value: "Module" })), Ne = "embeddedGlsl", { line: ie, group: w, indent: ae, softline: ce } = I, Lt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
196
|
+
B("prettier-plugin-glsl", e, o), e = {
|
|
191
197
|
...e,
|
|
192
|
-
...
|
|
198
|
+
...s
|
|
193
199
|
};
|
|
194
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
195
|
-
(
|
|
196
|
-
).join(""),
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
),
|
|
200
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
|
|
201
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
202
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
203
|
+
d.length,
|
|
204
|
+
-m.length || void 0
|
|
205
|
+
), y = D(r, n), f = await t(E, {
|
|
200
206
|
...e,
|
|
201
207
|
parser: "glsl-parser"
|
|
202
|
-
}),
|
|
203
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
204
|
-
return
|
|
208
|
+
}), u = L(f, l, y);
|
|
209
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
210
|
+
return w([
|
|
205
211
|
"`",
|
|
206
|
-
|
|
207
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
208
|
-
|
|
212
|
+
d,
|
|
213
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(u)] : ae([w(u)]),
|
|
214
|
+
m,
|
|
209
215
|
"`"
|
|
210
216
|
]);
|
|
211
|
-
const
|
|
212
|
-
return
|
|
217
|
+
const h = d.length ? ie : ce, _ = m.length ? ie : ce;
|
|
218
|
+
return w([
|
|
213
219
|
"`",
|
|
214
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
215
|
-
|
|
220
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, w(u)] : ae([h, w(u)]),
|
|
221
|
+
_,
|
|
216
222
|
"`"
|
|
217
223
|
]);
|
|
218
|
-
},
|
|
224
|
+
}, Tt = [
|
|
219
225
|
"glsl",
|
|
220
226
|
"fp",
|
|
221
227
|
"frag",
|
|
@@ -238,63 +244,66 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
|
|
|
238
244
|
"vrx",
|
|
239
245
|
"vsh",
|
|
240
246
|
"vshader"
|
|
241
|
-
], kt =
|
|
247
|
+
], kt = $(Ne), wt = {
|
|
242
248
|
[kt]: {
|
|
243
249
|
category: "Global",
|
|
244
250
|
type: "string",
|
|
245
251
|
array: !0,
|
|
246
|
-
default: [{ value: [...
|
|
252
|
+
default: [{ value: [...Tt] }],
|
|
247
253
|
description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
|
|
248
254
|
}
|
|
249
|
-
},
|
|
255
|
+
}, Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
250
256
|
__proto__: null,
|
|
251
|
-
embeddedLanguage:
|
|
252
|
-
embedder:
|
|
253
|
-
options:
|
|
254
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
257
|
+
embeddedLanguage: Ne,
|
|
258
|
+
embedder: Lt,
|
|
259
|
+
options: wt
|
|
260
|
+
}, Symbol.toStringTag, { value: "Module" })), Fe = "embeddedHtml", { line: de, group: P, indent: le, softline: ue } = I, { mapDoc: jt } = q, Mt = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
255
261
|
e = {
|
|
256
262
|
...e,
|
|
257
|
-
...
|
|
263
|
+
...s
|
|
258
264
|
};
|
|
259
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
260
|
-
(
|
|
261
|
-
).join(""),
|
|
265
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
|
|
266
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
267
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
268
|
+
d.length,
|
|
269
|
+
-m.length || void 0
|
|
270
|
+
), y = D(r, n), f = await t(E, {
|
|
262
271
|
...e,
|
|
263
272
|
parser: "html"
|
|
264
|
-
}),
|
|
265
|
-
if (typeof
|
|
266
|
-
return
|
|
267
|
-
const g = [],
|
|
268
|
-
for (let
|
|
269
|
-
let
|
|
270
|
-
if (
|
|
271
|
-
if (!
|
|
273
|
+
}), u = jt(f, (p) => {
|
|
274
|
+
if (typeof p != "string")
|
|
275
|
+
return p;
|
|
276
|
+
const g = [], b = p.split(l);
|
|
277
|
+
for (let x = 0; x < b.length; x++) {
|
|
278
|
+
let v = b[x];
|
|
279
|
+
if (x % 2 == 0) {
|
|
280
|
+
if (!v)
|
|
272
281
|
continue;
|
|
273
|
-
|
|
282
|
+
v = v.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (v = v.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(v);
|
|
274
283
|
} else {
|
|
275
|
-
const
|
|
276
|
-
g.push(
|
|
284
|
+
const S = Number(v);
|
|
285
|
+
g.push(y[S]);
|
|
277
286
|
}
|
|
278
287
|
}
|
|
279
288
|
return g;
|
|
280
289
|
});
|
|
281
290
|
if (e.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
282
|
-
e.htmlWhitespaceSensitivity === "css" || e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
283
|
-
return
|
|
291
|
+
e.htmlWhitespaceSensitivity === "css" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
292
|
+
return P([
|
|
284
293
|
"`",
|
|
285
|
-
|
|
286
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
287
|
-
|
|
294
|
+
d,
|
|
295
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [P(u)] : le([P(u)]),
|
|
296
|
+
m,
|
|
288
297
|
"`"
|
|
289
298
|
]);
|
|
290
|
-
const
|
|
291
|
-
return
|
|
299
|
+
const h = d.length ? de : ue, _ = m.length ? de : ue;
|
|
300
|
+
return P([
|
|
292
301
|
"`",
|
|
293
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
294
|
-
|
|
302
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, P(u)] : le([h, P(u)]),
|
|
303
|
+
_,
|
|
295
304
|
"`"
|
|
296
305
|
]);
|
|
297
|
-
},
|
|
306
|
+
}, Rt = [
|
|
298
307
|
"html",
|
|
299
308
|
"htm",
|
|
300
309
|
"shtml",
|
|
@@ -307,47 +316,50 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
|
|
|
307
316
|
"jshtm",
|
|
308
317
|
"volt",
|
|
309
318
|
"rhtml"
|
|
310
|
-
],
|
|
311
|
-
[
|
|
319
|
+
], Nt = $(Fe), Ft = {
|
|
320
|
+
[Nt]: {
|
|
312
321
|
category: "Global",
|
|
313
322
|
type: "string",
|
|
314
323
|
array: !0,
|
|
315
|
-
default: [{ value: [...
|
|
324
|
+
default: [{ value: [...Rt] }],
|
|
316
325
|
description: "Specify embedded HTML language identifiers."
|
|
317
326
|
}
|
|
318
|
-
},
|
|
327
|
+
}, At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
319
328
|
__proto__: null,
|
|
320
|
-
embeddedLanguage:
|
|
321
|
-
embedder:
|
|
322
|
-
options:
|
|
323
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
329
|
+
embeddedLanguage: Fe,
|
|
330
|
+
embedder: Mt,
|
|
331
|
+
options: Ft
|
|
332
|
+
}, Symbol.toStringTag, { value: "Module" })), Ae = "embeddedMarkdown", { line: me, group: j, indent: ge, softline: pe } = I, Ct = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
324
333
|
e = {
|
|
325
334
|
...e,
|
|
326
|
-
...
|
|
335
|
+
...s
|
|
327
336
|
};
|
|
328
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
329
|
-
(
|
|
330
|
-
).join(""),
|
|
337
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
|
|
338
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
339
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
340
|
+
d.length,
|
|
341
|
+
-m.length || void 0
|
|
342
|
+
), y = D(r, n), f = await t(E, {
|
|
331
343
|
...e,
|
|
332
344
|
parser: "markdown",
|
|
333
345
|
__inJsTemplate: !0
|
|
334
|
-
}),
|
|
335
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
336
|
-
return
|
|
346
|
+
}), u = L(f, l, y);
|
|
347
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
348
|
+
return j([
|
|
337
349
|
"`",
|
|
338
|
-
|
|
339
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
340
|
-
|
|
350
|
+
d,
|
|
351
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [j(u)] : ge([j(u)]),
|
|
352
|
+
m,
|
|
341
353
|
"`"
|
|
342
354
|
]);
|
|
343
|
-
const
|
|
344
|
-
return
|
|
355
|
+
const h = d.length ? me : pe, _ = m.length ? me : pe;
|
|
356
|
+
return j([
|
|
345
357
|
"`",
|
|
346
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
347
|
-
|
|
358
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, j(u)] : ge([h, j(u)]),
|
|
359
|
+
_,
|
|
348
360
|
"`"
|
|
349
361
|
]);
|
|
350
|
-
},
|
|
362
|
+
}, Bt = [
|
|
351
363
|
"md",
|
|
352
364
|
"livemd",
|
|
353
365
|
"markdown",
|
|
@@ -359,74 +371,74 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
|
|
|
359
371
|
"ronn",
|
|
360
372
|
"scd",
|
|
361
373
|
"workbook"
|
|
362
|
-
],
|
|
363
|
-
[
|
|
374
|
+
], Wt = $(Ae), Ut = {
|
|
375
|
+
[Wt]: {
|
|
364
376
|
category: "Global",
|
|
365
377
|
type: "string",
|
|
366
378
|
array: !0,
|
|
367
|
-
default: [{ value: [...
|
|
379
|
+
default: [{ value: [...Bt] }],
|
|
368
380
|
description: "Specify embedded Markdown language identifiers."
|
|
369
381
|
}
|
|
370
|
-
},
|
|
382
|
+
}, Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
371
383
|
__proto__: null,
|
|
372
|
-
embeddedLanguage:
|
|
373
|
-
embedder:
|
|
374
|
-
options:
|
|
375
|
-
}, Symbol.toStringTag, { value: "Module" })), X = "embeddedNoop",
|
|
376
|
-
[
|
|
384
|
+
embeddedLanguage: Ae,
|
|
385
|
+
embedder: Ct,
|
|
386
|
+
options: Ut
|
|
387
|
+
}, Symbol.toStringTag, { value: "Module" })), X = "embeddedNoop", Gt = $(X), zt = {
|
|
388
|
+
[Gt]: {
|
|
377
389
|
category: "Global",
|
|
378
390
|
type: "string",
|
|
379
391
|
array: !0,
|
|
380
392
|
default: [{ value: [] }],
|
|
381
393
|
description: "Specify embedded language identifiers that will not be formatted."
|
|
382
394
|
}
|
|
383
|
-
},
|
|
395
|
+
}, qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
384
396
|
__proto__: null,
|
|
385
397
|
embeddedLanguage: X,
|
|
386
|
-
options:
|
|
387
|
-
}, Symbol.toStringTag, { value: "Module" })), Ce = "embeddedPhp", { line:
|
|
388
|
-
|
|
398
|
+
options: zt
|
|
399
|
+
}, Symbol.toStringTag, { value: "Module" })), Ce = "embeddedPhp", { line: fe, group: M, indent: he, softline: be } = I, Ht = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
400
|
+
B("@prettier/plugin-php", e, o), e = {
|
|
389
401
|
...e,
|
|
390
|
-
...
|
|
402
|
+
...s
|
|
391
403
|
};
|
|
392
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
393
|
-
(
|
|
394
|
-
).join(""),
|
|
395
|
-
|
|
396
|
-
-
|
|
397
|
-
),
|
|
404
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O("$p"), c = a.quasis.map(
|
|
405
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
406
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
407
|
+
d.length,
|
|
408
|
+
-m.length || void 0
|
|
409
|
+
), y = D(r, n), f = await t(E, {
|
|
398
410
|
...e,
|
|
399
411
|
parser: "php"
|
|
400
|
-
}),
|
|
401
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
402
|
-
return
|
|
412
|
+
}), u = L(f, l, y);
|
|
413
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
414
|
+
return M([
|
|
403
415
|
"`",
|
|
404
|
-
|
|
405
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
406
|
-
|
|
416
|
+
d,
|
|
417
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [M(u)] : he([M(u)]),
|
|
418
|
+
m,
|
|
407
419
|
"`"
|
|
408
420
|
]);
|
|
409
|
-
const
|
|
410
|
-
return
|
|
421
|
+
const h = d.length ? fe : be, _ = m.length ? fe : be;
|
|
422
|
+
return M([
|
|
411
423
|
"`",
|
|
412
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
413
|
-
|
|
424
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, M(u)] : he([h, M(u)]),
|
|
425
|
+
_,
|
|
414
426
|
"`"
|
|
415
427
|
]);
|
|
416
|
-
},
|
|
417
|
-
[
|
|
428
|
+
}, Xt = ["php", "php5", "phtml", "ctp"], Jt = $(Ce), Yt = {
|
|
429
|
+
[Jt]: {
|
|
418
430
|
category: "Global",
|
|
419
431
|
type: "string",
|
|
420
432
|
array: !0,
|
|
421
|
-
default: [{ value: [...
|
|
433
|
+
default: [{ value: [...Xt] }],
|
|
422
434
|
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
|
|
423
435
|
}
|
|
424
|
-
},
|
|
436
|
+
}, Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
425
437
|
__proto__: null,
|
|
426
438
|
embeddedLanguage: Ce,
|
|
427
|
-
embedder:
|
|
428
|
-
options:
|
|
429
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
439
|
+
embedder: Ht,
|
|
440
|
+
options: Yt
|
|
441
|
+
}, Symbol.toStringTag, { value: "Module" })), Be = "embeddedRuby", U = [
|
|
430
442
|
"ruby",
|
|
431
443
|
"arb",
|
|
432
444
|
"axlsx",
|
|
@@ -452,267 +464,313 @@ const { line: Z, group: O, indent: ee, softline: te } = $, pt = async (t, n, r,
|
|
|
452
464
|
"ru",
|
|
453
465
|
"thor",
|
|
454
466
|
"watchr"
|
|
455
|
-
], K = ["rbs"],
|
|
456
|
-
...
|
|
467
|
+
], K = ["rbs"], G = ["haml"], Qt = [
|
|
468
|
+
...U,
|
|
457
469
|
...K,
|
|
458
|
-
...
|
|
459
|
-
],
|
|
460
|
-
[
|
|
470
|
+
...G
|
|
471
|
+
], Zt = "embeddedRubyParser", en = $(Be), tn = {
|
|
472
|
+
[en]: {
|
|
461
473
|
category: "Global",
|
|
462
474
|
type: "string",
|
|
463
475
|
array: !0,
|
|
464
|
-
default: [{ value: [...
|
|
476
|
+
default: [{ value: [...Qt] }],
|
|
465
477
|
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
|
|
466
478
|
},
|
|
467
|
-
[
|
|
479
|
+
[Zt]: {
|
|
468
480
|
category: "Global",
|
|
469
481
|
type: "string",
|
|
470
482
|
array: !1,
|
|
471
483
|
default: void 0,
|
|
472
484
|
description: "Specify the embedded Ruby language parser."
|
|
473
485
|
}
|
|
474
|
-
}, { line:
|
|
475
|
-
|
|
486
|
+
}, { line: ye, group: R, indent: ve, softline: Ee } = I, nn = async (t, n, r, e, { identifier: o, identifiers: s, embeddedOverrideOptions: a }) => {
|
|
487
|
+
B("@prettier/plugin-ruby", e, o), e = {
|
|
476
488
|
...e,
|
|
477
489
|
...a
|
|
478
490
|
};
|
|
479
|
-
const { node: i } = r, { createPlaceholder:
|
|
480
|
-
(
|
|
481
|
-
).join(""),
|
|
482
|
-
|
|
483
|
-
-
|
|
484
|
-
),
|
|
491
|
+
const { node: i } = r, { createPlaceholder: l, placeholderRegex: c } = O(), d = i.quasis.map(
|
|
492
|
+
(b, x, { length: v }) => x === v - 1 ? b.value.cooked : b.value.cooked + l(x)
|
|
493
|
+
).join(""), m = d.match(/^\s+/)?.[0] ?? "", E = d.match(/\s+$/)?.[0] ?? "", y = d.slice(
|
|
494
|
+
m.length,
|
|
495
|
+
-E.length || void 0
|
|
496
|
+
), f = D(r, n), u = rn(e, o, s), h = await t(y, {
|
|
485
497
|
...e,
|
|
486
|
-
parser:
|
|
487
|
-
}),
|
|
488
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
489
|
-
return
|
|
498
|
+
parser: u
|
|
499
|
+
}), _ = L(h, c, f);
|
|
500
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
501
|
+
return R([
|
|
490
502
|
"`",
|
|
491
|
-
|
|
492
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
493
|
-
|
|
503
|
+
m,
|
|
504
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [R(_)] : ve([R(_)]),
|
|
505
|
+
E,
|
|
494
506
|
"`"
|
|
495
507
|
]);
|
|
496
|
-
const
|
|
497
|
-
return
|
|
508
|
+
const p = m.length ? ye : Ee, g = E.length ? ye : Ee;
|
|
509
|
+
return R([
|
|
498
510
|
"`",
|
|
499
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
500
|
-
|
|
511
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [p, R(_)] : ve([p, R(_)]),
|
|
512
|
+
g,
|
|
501
513
|
"`"
|
|
502
514
|
]);
|
|
503
515
|
};
|
|
504
|
-
function
|
|
516
|
+
function rn(t, n, r) {
|
|
505
517
|
if (typeof t.embeddedRubyParser == "string")
|
|
506
518
|
return t.embeddedRubyParser;
|
|
507
519
|
const e = r.indexOf(n);
|
|
508
|
-
for (let
|
|
509
|
-
if (
|
|
510
|
-
return q[0];
|
|
511
|
-
if (nn(n))
|
|
512
|
-
return K[0];
|
|
513
|
-
if (rn(n))
|
|
520
|
+
for (let o = e; o >= 0; --o) {
|
|
521
|
+
if (on(n))
|
|
514
522
|
return U[0];
|
|
523
|
+
if (sn(n))
|
|
524
|
+
return K[0];
|
|
525
|
+
if (an(n))
|
|
526
|
+
return G[0];
|
|
515
527
|
}
|
|
516
528
|
throw new SyntaxError(`Unrecognized ruby identifier: ${n}`);
|
|
517
529
|
}
|
|
518
|
-
function
|
|
519
|
-
return
|
|
530
|
+
function on(t) {
|
|
531
|
+
return U.includes(t);
|
|
520
532
|
}
|
|
521
|
-
function
|
|
533
|
+
function sn(t) {
|
|
522
534
|
return K.includes(t);
|
|
523
535
|
}
|
|
524
|
-
function
|
|
525
|
-
return
|
|
536
|
+
function an(t) {
|
|
537
|
+
return G.includes(t);
|
|
526
538
|
}
|
|
527
|
-
const
|
|
539
|
+
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
528
540
|
__proto__: null,
|
|
529
|
-
HAML_PARSER_IDENTIFIERS:
|
|
541
|
+
HAML_PARSER_IDENTIFIERS: G,
|
|
530
542
|
RBS_PARSER_IDENTIFIERS: K,
|
|
531
|
-
RUBY_PARSER_IDENTIFIERS:
|
|
532
|
-
embeddedLanguage:
|
|
533
|
-
embedder:
|
|
534
|
-
options:
|
|
535
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
536
|
-
|
|
543
|
+
RUBY_PARSER_IDENTIFIERS: U,
|
|
544
|
+
embeddedLanguage: Be,
|
|
545
|
+
embedder: nn,
|
|
546
|
+
options: tn
|
|
547
|
+
}, Symbol.toStringTag, { value: "Module" })), We = "embeddedSql";
|
|
548
|
+
function _e(t, n) {
|
|
549
|
+
var r = Object.keys(t);
|
|
550
|
+
if (Object.getOwnPropertySymbols) {
|
|
551
|
+
var e = Object.getOwnPropertySymbols(t);
|
|
552
|
+
n && (e = e.filter(function(o) {
|
|
553
|
+
return Object.getOwnPropertyDescriptor(t, o).enumerable;
|
|
554
|
+
})), r.push.apply(r, e);
|
|
555
|
+
}
|
|
556
|
+
return r;
|
|
557
|
+
}
|
|
558
|
+
function xe(t) {
|
|
559
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
560
|
+
var r = arguments[n] != null ? arguments[n] : {};
|
|
561
|
+
n % 2 ? _e(Object(r), !0).forEach(function(e) {
|
|
562
|
+
dn(t, e, r[e]);
|
|
563
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : _e(Object(r)).forEach(function(e) {
|
|
564
|
+
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
return t;
|
|
568
|
+
}
|
|
569
|
+
function dn(t, n, r) {
|
|
570
|
+
return n = ln(n), n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
|
|
571
|
+
}
|
|
572
|
+
function ln(t) {
|
|
573
|
+
var n = un(t, "string");
|
|
574
|
+
return typeof n == "symbol" ? n : String(n);
|
|
575
|
+
}
|
|
576
|
+
function un(t, n) {
|
|
577
|
+
if (typeof t != "object" || t === null)
|
|
578
|
+
return t;
|
|
579
|
+
var r = t[Symbol.toPrimitive];
|
|
580
|
+
if (r !== void 0) {
|
|
581
|
+
var e = r.call(t, n || "default");
|
|
582
|
+
if (typeof e != "object")
|
|
583
|
+
return e;
|
|
584
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
585
|
+
}
|
|
586
|
+
return (n === "string" ? String : Number)(t);
|
|
587
|
+
}
|
|
588
|
+
const mn = Ue({});
|
|
589
|
+
function Ue(t) {
|
|
590
|
+
return n.withOptions = (r) => Ue(xe(xe({}, t), r)), n;
|
|
591
|
+
function n(r, ...e) {
|
|
592
|
+
const o = typeof r == "string" ? [r] : r.raw, {
|
|
593
|
+
escapeSpecialCharacters: s = Array.isArray(r)
|
|
594
|
+
} = t;
|
|
595
|
+
let a = "";
|
|
596
|
+
for (let c = 0; c < o.length; c++) {
|
|
597
|
+
let d = o[c];
|
|
598
|
+
s && (d = d.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), a += d, c < e.length && (a += e[c]);
|
|
599
|
+
}
|
|
600
|
+
const i = a.split(`
|
|
601
|
+
`);
|
|
602
|
+
let l = null;
|
|
603
|
+
for (const c of i) {
|
|
604
|
+
const d = c.match(/^(\s+)\S+/);
|
|
605
|
+
if (d) {
|
|
606
|
+
const m = d[1].length;
|
|
607
|
+
l ? l = Math.min(l, m) : l = m;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
if (l !== null) {
|
|
611
|
+
const c = l;
|
|
612
|
+
a = i.map((d) => d[0] === " " || d[0] === " " ? d.slice(c) : d).join(`
|
|
613
|
+
`);
|
|
614
|
+
}
|
|
615
|
+
return a.trim().replace(/\\n/g, `
|
|
616
|
+
`);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
const { hardline: gn, group: N, line: Ie, softline: $e, indent: Se } = I, { mapDoc: pn } = q, fn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
620
|
+
B("prettier-plugin-sql", e, o), e = {
|
|
537
621
|
...e,
|
|
538
|
-
...
|
|
622
|
+
...s
|
|
539
623
|
};
|
|
540
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
541
|
-
(
|
|
542
|
-
).join(""),
|
|
624
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
|
|
625
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
626
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
627
|
+
d.length,
|
|
628
|
+
-m.length || void 0
|
|
629
|
+
), y = D(r, n), f = await t(mn(E), {
|
|
543
630
|
...e,
|
|
544
631
|
parser: "sql"
|
|
545
|
-
}),
|
|
546
|
-
if (typeof
|
|
547
|
-
return
|
|
548
|
-
const g = [],
|
|
549
|
-
for (let
|
|
550
|
-
let
|
|
551
|
-
if (
|
|
552
|
-
if (!
|
|
632
|
+
}), u = pn(f, (p) => {
|
|
633
|
+
if (typeof p != "string")
|
|
634
|
+
return p;
|
|
635
|
+
const g = [], b = p.split(l);
|
|
636
|
+
for (let x = 0; x < b.length; x++) {
|
|
637
|
+
let v = b[x];
|
|
638
|
+
if (x % 2 == 0) {
|
|
639
|
+
if (!v)
|
|
553
640
|
continue;
|
|
554
|
-
|
|
555
|
-
` ? g.push(
|
|
641
|
+
v = v.replaceAll(/([\\`]|\${)/g, "\\$1"), v.split(/(\n)/).forEach((S) => S === `
|
|
642
|
+
` ? g.push(gn) : g.push(S));
|
|
556
643
|
} else {
|
|
557
|
-
const
|
|
558
|
-
g.push(
|
|
644
|
+
const S = Number(v);
|
|
645
|
+
g.push(y[S]);
|
|
559
646
|
}
|
|
560
647
|
}
|
|
561
648
|
return g;
|
|
562
649
|
});
|
|
563
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
564
|
-
return
|
|
650
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
651
|
+
return N([
|
|
565
652
|
"`",
|
|
566
|
-
|
|
567
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
568
|
-
|
|
653
|
+
d,
|
|
654
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [N(u)] : Se([N(u)]),
|
|
655
|
+
m,
|
|
569
656
|
"`"
|
|
570
657
|
]);
|
|
571
|
-
const
|
|
572
|
-
return
|
|
658
|
+
const h = d.length ? Ie : $e, _ = m.length ? Ie : $e;
|
|
659
|
+
return N([
|
|
573
660
|
"`",
|
|
574
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
575
|
-
|
|
661
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, N(u)] : Se([h, N(u)]),
|
|
662
|
+
_,
|
|
576
663
|
"`"
|
|
577
664
|
]);
|
|
578
|
-
},
|
|
579
|
-
|
|
580
|
-
"bigquery",
|
|
581
|
-
"db2",
|
|
582
|
-
"db2i",
|
|
583
|
-
"hive",
|
|
584
|
-
"mariadb",
|
|
585
|
-
"mysql",
|
|
586
|
-
"n1ql",
|
|
587
|
-
"postgresql",
|
|
588
|
-
"plsql",
|
|
589
|
-
"redshift",
|
|
590
|
-
"singlestoredb",
|
|
591
|
-
"snowflake",
|
|
592
|
-
"spark",
|
|
593
|
-
"sqlite",
|
|
594
|
-
"transactsql",
|
|
595
|
-
"tsql",
|
|
596
|
-
"trino"
|
|
597
|
-
], ln = [
|
|
598
|
-
"bigquery",
|
|
599
|
-
"db2",
|
|
600
|
-
"hive",
|
|
601
|
-
"mariadb",
|
|
602
|
-
"mysql",
|
|
603
|
-
"postgresql",
|
|
604
|
-
"transactsql",
|
|
605
|
-
"flinksql",
|
|
606
|
-
"snowflake"
|
|
607
|
-
], un = I(je), mn = {
|
|
608
|
-
[un]: {
|
|
665
|
+
}, hn = ["sql"], bn = $(We), yn = {
|
|
666
|
+
[bn]: {
|
|
609
667
|
category: "Global",
|
|
610
668
|
type: "string",
|
|
611
669
|
array: !0,
|
|
612
|
-
|
|
613
|
-
default: [{ value: ["sql", "mysql", "mariadb", "postgresql"] }],
|
|
670
|
+
default: [{ value: [...hn] }],
|
|
614
671
|
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
|
|
615
672
|
}
|
|
616
|
-
},
|
|
673
|
+
}, vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
617
674
|
__proto__: null,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
options: mn
|
|
623
|
-
}, Symbol.toStringTag, { value: "Module" })), Fe = "embeddedTs", { line: $e, group: N, indent: Ie, softline: Se } = $, pn = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
|
|
675
|
+
embeddedLanguage: We,
|
|
676
|
+
embedder: fn,
|
|
677
|
+
options: yn
|
|
678
|
+
}, Symbol.toStringTag, { value: "Module" })), J = "embeddedTs", { line: De, group: F, indent: Oe, softline: Le } = I, En = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
624
679
|
e = {
|
|
625
680
|
...e,
|
|
626
|
-
...
|
|
681
|
+
...s
|
|
627
682
|
};
|
|
628
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
629
|
-
(
|
|
630
|
-
).join(""),
|
|
683
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
|
|
684
|
+
(p, g, { length: b }) => g === b - 1 ? p.value.cooked : p.value.cooked + i(g)
|
|
685
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
686
|
+
d.length,
|
|
687
|
+
-m.length || void 0
|
|
688
|
+
), y = D(r, n), f = await t(E, {
|
|
631
689
|
...e,
|
|
632
690
|
parser: e.embeddedTsParser ?? "typescript",
|
|
633
691
|
// set filepath to undefined to enable jsx auto detection:
|
|
634
692
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
635
693
|
filepath: void 0
|
|
636
|
-
}),
|
|
637
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
638
|
-
return
|
|
694
|
+
}), u = L(f, l, y);
|
|
695
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
696
|
+
return F([
|
|
639
697
|
"`",
|
|
640
|
-
|
|
641
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
642
|
-
|
|
698
|
+
d,
|
|
699
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [F(u)] : Oe([F(u)]),
|
|
700
|
+
m,
|
|
643
701
|
"`"
|
|
644
702
|
]);
|
|
645
|
-
const
|
|
646
|
-
return
|
|
703
|
+
const h = d.length ? De : Le, _ = m.length ? De : Le;
|
|
704
|
+
return F([
|
|
647
705
|
"`",
|
|
648
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
649
|
-
|
|
706
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, F(u)] : Oe([h, F(u)]),
|
|
707
|
+
_,
|
|
650
708
|
"`"
|
|
651
709
|
]);
|
|
652
|
-
},
|
|
653
|
-
[
|
|
710
|
+
}, _n = ["ts", "tsx", "cts", "mts", "typescript"], xn = Re(J), In = $(J), $n = {
|
|
711
|
+
[In]: {
|
|
654
712
|
category: "Global",
|
|
655
713
|
type: "string",
|
|
656
714
|
array: !0,
|
|
657
|
-
default: [{ value: [...
|
|
715
|
+
default: [{ value: [..._n] }],
|
|
658
716
|
description: "Specify embedded TS language parsers."
|
|
659
717
|
},
|
|
660
|
-
[
|
|
718
|
+
[xn]: {
|
|
661
719
|
category: "Global",
|
|
662
720
|
type: "string",
|
|
663
721
|
array: !1,
|
|
664
722
|
default: "typescript",
|
|
665
723
|
description: "Specify the embedded TS language parser."
|
|
666
724
|
}
|
|
667
|
-
},
|
|
725
|
+
}, Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
668
726
|
__proto__: null,
|
|
669
|
-
embeddedLanguage:
|
|
670
|
-
embedder:
|
|
671
|
-
options:
|
|
672
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
673
|
-
|
|
727
|
+
embeddedLanguage: J,
|
|
728
|
+
embedder: En,
|
|
729
|
+
options: $n
|
|
730
|
+
}, Symbol.toStringTag, { value: "Module" })), Y = "embeddedXml", { line: Te, group: A, indent: ke, softline: z } = I, Dn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
731
|
+
B("@prettier/plugin-xml", e, o), e = {
|
|
674
732
|
...e,
|
|
675
|
-
...
|
|
733
|
+
...s
|
|
676
734
|
};
|
|
677
|
-
const { node: a } = r, { createPlaceholder: i, placeholderRegex:
|
|
678
|
-
(
|
|
679
|
-
).join(""),
|
|
680
|
-
|
|
681
|
-
-
|
|
682
|
-
),
|
|
683
|
-
let
|
|
684
|
-
for (;
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
735
|
+
const { node: a } = r, { createPlaceholder: i, placeholderRegex: l } = O(), c = a.quasis.map(
|
|
736
|
+
(g, b, { length: x }) => b === x - 1 ? g.value.cooked : g.value.cooked + i(b)
|
|
737
|
+
).join(""), d = c.match(/^\s+/)?.[0] ?? "", m = c.match(/\s+$/)?.[0] ?? "", E = c.slice(
|
|
738
|
+
d.length,
|
|
739
|
+
-m.length || void 0
|
|
740
|
+
), y = D(r, n), f = [];
|
|
741
|
+
let u = 0;
|
|
742
|
+
for (; u !== void 0; ) {
|
|
743
|
+
const g = E.slice(u);
|
|
744
|
+
if (g.length === 0)
|
|
687
745
|
break;
|
|
688
|
-
|
|
746
|
+
u > 0 && e.xmlWhitespaceSensitivity !== "strict" && f.push(z), e.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
689
747
|
0,
|
|
690
748
|
e.__embeddedXmlFragmentRecoverIndex.length
|
|
691
749
|
);
|
|
692
|
-
let
|
|
750
|
+
let b = await t(g, {
|
|
693
751
|
...e,
|
|
694
|
-
parser:
|
|
752
|
+
parser: Y
|
|
695
753
|
});
|
|
696
|
-
const [
|
|
697
|
-
|
|
754
|
+
const [x, v] = e.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
755
|
+
x === void 0 ? u = void 0 : v === void 0 ? u += x : (b = g.slice(x, v + 1), u += v + 1), f.push(b);
|
|
698
756
|
}
|
|
699
|
-
const
|
|
700
|
-
if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
701
|
-
return
|
|
757
|
+
const h = L(f, l, y);
|
|
758
|
+
if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
759
|
+
return A([
|
|
702
760
|
"`",
|
|
703
|
-
|
|
704
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
705
|
-
|
|
761
|
+
d,
|
|
762
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [A(h)] : ke([A(h)]),
|
|
763
|
+
m,
|
|
706
764
|
"`"
|
|
707
765
|
]);
|
|
708
|
-
const
|
|
709
|
-
return
|
|
766
|
+
const _ = d.length ? Te : z, p = m.length ? Te : z;
|
|
767
|
+
return A([
|
|
710
768
|
"`",
|
|
711
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
712
|
-
|
|
769
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [_, A(h)] : ke([_, A(h)]),
|
|
770
|
+
p,
|
|
713
771
|
"`"
|
|
714
772
|
]);
|
|
715
|
-
},
|
|
773
|
+
}, On = [
|
|
716
774
|
"xml",
|
|
717
775
|
"xsd",
|
|
718
776
|
"ascx",
|
|
@@ -769,12 +827,12 @@ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
769
827
|
"xpdl",
|
|
770
828
|
"xul",
|
|
771
829
|
"xoml"
|
|
772
|
-
],
|
|
773
|
-
[
|
|
830
|
+
], Ln = $(Y), Tn = {
|
|
831
|
+
[Ln]: {
|
|
774
832
|
category: "Global",
|
|
775
833
|
type: "string",
|
|
776
834
|
array: !0,
|
|
777
|
-
default: [{ value: [...
|
|
835
|
+
default: [{ value: [...On] }],
|
|
778
836
|
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
|
|
779
837
|
},
|
|
780
838
|
/** @internal */
|
|
@@ -786,7 +844,7 @@ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
786
844
|
description: "This option is read only and used as a workaround to support xml fragments"
|
|
787
845
|
}
|
|
788
846
|
};
|
|
789
|
-
function
|
|
847
|
+
function kn(t) {
|
|
790
848
|
const n = {
|
|
791
849
|
loc: {
|
|
792
850
|
start: {
|
|
@@ -806,7 +864,7 @@ function In(t) {
|
|
|
806
864
|
);
|
|
807
865
|
return Object.assign(r, n), r;
|
|
808
866
|
}
|
|
809
|
-
function
|
|
867
|
+
function we(t) {
|
|
810
868
|
const n = {
|
|
811
869
|
loc: {
|
|
812
870
|
start: {
|
|
@@ -826,20 +884,20 @@ function Oe(t) {
|
|
|
826
884
|
);
|
|
827
885
|
return Object.assign(r, n), r;
|
|
828
886
|
}
|
|
829
|
-
const
|
|
887
|
+
const wn = {
|
|
830
888
|
async parse(t, n) {
|
|
831
|
-
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors:
|
|
889
|
+
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors: o, cst: s } = r(t);
|
|
832
890
|
if (e.length > 0) {
|
|
833
891
|
const a = e[0];
|
|
834
|
-
throw
|
|
892
|
+
throw kn(a);
|
|
835
893
|
}
|
|
836
|
-
if (
|
|
894
|
+
if (o.length > 0) {
|
|
837
895
|
let a = !1;
|
|
838
|
-
for (const i of
|
|
896
|
+
for (const i of o) {
|
|
839
897
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
840
898
|
i.name
|
|
841
899
|
))
|
|
842
|
-
throw
|
|
900
|
+
throw we(i);
|
|
843
901
|
if (i.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
844
902
|
a = !0;
|
|
845
903
|
continue;
|
|
@@ -867,11 +925,11 @@ const Sn = {
|
|
|
867
925
|
), a = !0;
|
|
868
926
|
break;
|
|
869
927
|
}
|
|
870
|
-
throw
|
|
928
|
+
throw we(i);
|
|
871
929
|
}
|
|
872
|
-
a &&
|
|
930
|
+
a && Ke(s);
|
|
873
931
|
}
|
|
874
|
-
return
|
|
932
|
+
return s;
|
|
875
933
|
},
|
|
876
934
|
astFormat: "xml",
|
|
877
935
|
locStart(t) {
|
|
@@ -881,97 +939,97 @@ const Sn = {
|
|
|
881
939
|
return t.location.endOffset ?? NaN;
|
|
882
940
|
}
|
|
883
941
|
};
|
|
884
|
-
function
|
|
942
|
+
function Ke(t) {
|
|
885
943
|
const n = t.children;
|
|
886
944
|
for (const r in n) {
|
|
887
945
|
const e = n[r] ?? [];
|
|
888
|
-
for (let
|
|
889
|
-
const
|
|
890
|
-
if (
|
|
891
|
-
if (Object.keys(
|
|
892
|
-
e.splice(
|
|
946
|
+
for (let o = e.length - 1; o >= 0; --o) {
|
|
947
|
+
const s = e[o];
|
|
948
|
+
if (Pn(s)) {
|
|
949
|
+
if (Object.keys(s.children).length === 0) {
|
|
950
|
+
e.splice(o, 1), e.length === 0 && delete n[r];
|
|
893
951
|
continue;
|
|
894
952
|
}
|
|
895
|
-
|
|
953
|
+
Ke(s);
|
|
896
954
|
}
|
|
897
955
|
}
|
|
898
956
|
}
|
|
899
957
|
}
|
|
900
|
-
function
|
|
958
|
+
function Pn(t) {
|
|
901
959
|
return "name" in t && "children" in t && "location" in t;
|
|
902
960
|
}
|
|
903
|
-
const
|
|
961
|
+
const jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
904
962
|
__proto__: null,
|
|
905
|
-
embeddedLanguage:
|
|
906
|
-
embedder:
|
|
907
|
-
options:
|
|
908
|
-
parser:
|
|
909
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
910
|
-
"./css/index.ts":
|
|
911
|
-
"./es/index.ts":
|
|
912
|
-
"./glsl/index.ts":
|
|
913
|
-
"./html/index.ts":
|
|
914
|
-
"./markdown/index.ts":
|
|
915
|
-
"./noop/index.ts":
|
|
916
|
-
"./php/index.ts":
|
|
917
|
-
"./ruby/index.ts":
|
|
918
|
-
"./sql/index.ts":
|
|
919
|
-
"./ts/index.ts":
|
|
920
|
-
"./xml/index.ts":
|
|
963
|
+
embeddedLanguage: Y,
|
|
964
|
+
embedder: Dn,
|
|
965
|
+
options: Tn,
|
|
966
|
+
parser: wn
|
|
967
|
+
}, Symbol.toStringTag, { value: "Module" })), Ge = [], ze = {}, qe = {}, He = {}, Mn = /* @__PURE__ */ Object.assign({
|
|
968
|
+
"./css/index.ts": _t,
|
|
969
|
+
"./es/index.ts": Ot,
|
|
970
|
+
"./glsl/index.ts": Pt,
|
|
971
|
+
"./html/index.ts": At,
|
|
972
|
+
"./markdown/index.ts": Kt,
|
|
973
|
+
"./noop/index.ts": qt,
|
|
974
|
+
"./php/index.ts": Vt,
|
|
975
|
+
"./ruby/index.ts": cn,
|
|
976
|
+
"./sql/index.ts": vn,
|
|
977
|
+
"./ts/index.ts": Sn,
|
|
978
|
+
"./xml/index.ts": jn
|
|
921
979
|
});
|
|
922
|
-
Object.values(
|
|
980
|
+
Object.values(Mn).forEach(
|
|
923
981
|
({ embeddedLanguage: t, parser: n, embedder: r, options: e }) => {
|
|
924
|
-
|
|
982
|
+
ht(Ge, t, X), n && (ze[t] = n), r && (qe[t] = r), Object.assign(He, e);
|
|
925
983
|
}
|
|
926
984
|
);
|
|
927
|
-
const
|
|
928
|
-
...
|
|
929
|
-
[
|
|
985
|
+
const Rn = "noEmbeddedIdentificationByComment", Nn = "noEmbeddedIdentificationByTag", Fn = "preserveEmbeddedExteriorWhitespaces", An = "noEmbeddedMultiLineIndentation", Cn = "embeddedOverrides", mr = {
|
|
986
|
+
...He,
|
|
987
|
+
[Rn]: {
|
|
930
988
|
category: "Global",
|
|
931
989
|
type: "string",
|
|
932
990
|
array: !0,
|
|
933
991
|
default: [{ value: [] }],
|
|
934
992
|
description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
|
|
935
993
|
},
|
|
936
|
-
[
|
|
994
|
+
[Nn]: {
|
|
937
995
|
category: "Global",
|
|
938
996
|
type: "string",
|
|
939
997
|
array: !0,
|
|
940
998
|
default: [{ value: [] }],
|
|
941
999
|
description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
|
|
942
1000
|
},
|
|
943
|
-
[
|
|
1001
|
+
[Fn]: {
|
|
944
1002
|
category: "Config",
|
|
945
1003
|
type: "string",
|
|
946
1004
|
array: !0,
|
|
947
1005
|
default: [{ value: [] }],
|
|
948
1006
|
description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
949
1007
|
},
|
|
950
|
-
[
|
|
1008
|
+
[An]: {
|
|
951
1009
|
category: "Global",
|
|
952
1010
|
type: "string",
|
|
953
1011
|
array: !0,
|
|
954
1012
|
default: [{ value: [] }],
|
|
955
1013
|
description: "This option turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
|
|
956
1014
|
},
|
|
957
|
-
[
|
|
1015
|
+
[Cn]: {
|
|
958
1016
|
category: "Global",
|
|
959
1017
|
type: "string",
|
|
960
1018
|
array: !1,
|
|
961
1019
|
default: void 0,
|
|
962
1020
|
description: "This option accepts option overrides for the specified identifiers. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
963
1021
|
}
|
|
964
|
-
},
|
|
1022
|
+
}, gr = {
|
|
965
1023
|
// parsers from internal
|
|
966
|
-
...Xe.parsers,
|
|
967
|
-
...Je.parsers,
|
|
968
|
-
...Ye.parsers,
|
|
969
1024
|
...Qe.parsers,
|
|
970
|
-
...
|
|
1025
|
+
...Ze.parsers,
|
|
1026
|
+
...et.parsers,
|
|
1027
|
+
...nt.parsers,
|
|
1028
|
+
...tt.parsers,
|
|
971
1029
|
// parsers from this plugin
|
|
972
|
-
...
|
|
1030
|
+
...ze
|
|
973
1031
|
};
|
|
974
|
-
var
|
|
1032
|
+
var Bn = {
|
|
975
1033
|
isEqual: !0,
|
|
976
1034
|
isMatchingKey: !0,
|
|
977
1035
|
isPromise: !0,
|
|
@@ -980,24 +1038,24 @@ var Mn = {
|
|
|
980
1038
|
onCacheChange: !0,
|
|
981
1039
|
onCacheHit: !0,
|
|
982
1040
|
transformKey: !0
|
|
983
|
-
},
|
|
1041
|
+
}, Wn = Array.prototype.slice;
|
|
984
1042
|
function W(t) {
|
|
985
1043
|
var n = t.length;
|
|
986
|
-
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] :
|
|
1044
|
+
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : Wn.call(t, 0) : [];
|
|
987
1045
|
}
|
|
988
|
-
function
|
|
1046
|
+
function Un(t) {
|
|
989
1047
|
var n = {};
|
|
990
1048
|
for (var r in t)
|
|
991
|
-
|
|
1049
|
+
Bn[r] || (n[r] = t[r]);
|
|
992
1050
|
return n;
|
|
993
1051
|
}
|
|
994
|
-
function
|
|
1052
|
+
function Kn(t) {
|
|
995
1053
|
return typeof t == "function" && t.isMemoized;
|
|
996
1054
|
}
|
|
997
|
-
function
|
|
1055
|
+
function Gn(t, n) {
|
|
998
1056
|
return t === n || t !== t && n !== n;
|
|
999
1057
|
}
|
|
1000
|
-
function
|
|
1058
|
+
function Pe(t, n) {
|
|
1001
1059
|
var r = {};
|
|
1002
1060
|
for (var e in t)
|
|
1003
1061
|
r[e] = t[e];
|
|
@@ -1005,7 +1063,7 @@ function Te(t, n) {
|
|
|
1005
1063
|
r[e] = n[e];
|
|
1006
1064
|
return r;
|
|
1007
1065
|
}
|
|
1008
|
-
var
|
|
1066
|
+
var zn = (
|
|
1009
1067
|
/** @class */
|
|
1010
1068
|
function() {
|
|
1011
1069
|
function t(n) {
|
|
@@ -1038,110 +1096,110 @@ var An = (
|
|
|
1038
1096
|
enumerable: !1,
|
|
1039
1097
|
configurable: !0
|
|
1040
1098
|
}), t.prototype._getKeyIndexFromMatchingKey = function(n) {
|
|
1041
|
-
var r = this.options, e = r.isMatchingKey,
|
|
1099
|
+
var r = this.options, e = r.isMatchingKey, o = r.maxSize, s = this.keys, a = s.length;
|
|
1042
1100
|
if (!a)
|
|
1043
1101
|
return -1;
|
|
1044
|
-
if (e(
|
|
1102
|
+
if (e(s[0], n))
|
|
1045
1103
|
return 0;
|
|
1046
|
-
if (
|
|
1104
|
+
if (o > 1) {
|
|
1047
1105
|
for (var i = 1; i < a; i++)
|
|
1048
|
-
if (e(
|
|
1106
|
+
if (e(s[i], n))
|
|
1049
1107
|
return i;
|
|
1050
1108
|
}
|
|
1051
1109
|
return -1;
|
|
1052
1110
|
}, t.prototype._getKeyIndexForMany = function(n) {
|
|
1053
|
-
var r = this.options.isEqual, e = this.keys,
|
|
1054
|
-
if (!
|
|
1111
|
+
var r = this.options.isEqual, e = this.keys, o = e.length;
|
|
1112
|
+
if (!o)
|
|
1055
1113
|
return -1;
|
|
1056
|
-
if (
|
|
1114
|
+
if (o === 1)
|
|
1057
1115
|
return this._getKeyIndexForSingle(n);
|
|
1058
|
-
var
|
|
1059
|
-
if (
|
|
1060
|
-
for (var
|
|
1061
|
-
if (a = e[
|
|
1062
|
-
for (i = 0; i <
|
|
1116
|
+
var s = n.length, a, i;
|
|
1117
|
+
if (s > 1) {
|
|
1118
|
+
for (var l = 0; l < o; l++)
|
|
1119
|
+
if (a = e[l], a.length === s) {
|
|
1120
|
+
for (i = 0; i < s && r(a[i], n[i]); i++)
|
|
1063
1121
|
;
|
|
1064
|
-
if (i ===
|
|
1065
|
-
return
|
|
1122
|
+
if (i === s)
|
|
1123
|
+
return l;
|
|
1066
1124
|
}
|
|
1067
1125
|
} else
|
|
1068
|
-
for (var
|
|
1069
|
-
if (a = e[
|
|
1070
|
-
return
|
|
1126
|
+
for (var l = 0; l < o; l++)
|
|
1127
|
+
if (a = e[l], a.length === s && r(a[0], n[0]))
|
|
1128
|
+
return l;
|
|
1071
1129
|
return -1;
|
|
1072
1130
|
}, t.prototype._getKeyIndexForSingle = function(n) {
|
|
1073
1131
|
var r = this.keys;
|
|
1074
1132
|
if (!r.length)
|
|
1075
1133
|
return -1;
|
|
1076
|
-
var e = r[0],
|
|
1077
|
-
if (n.length !==
|
|
1134
|
+
var e = r[0], o = e.length;
|
|
1135
|
+
if (n.length !== o)
|
|
1078
1136
|
return -1;
|
|
1079
|
-
var
|
|
1080
|
-
if (
|
|
1081
|
-
for (var a = 0; a <
|
|
1082
|
-
if (!
|
|
1137
|
+
var s = this.options.isEqual;
|
|
1138
|
+
if (o > 1) {
|
|
1139
|
+
for (var a = 0; a < o; a++)
|
|
1140
|
+
if (!s(e[a], n[a]))
|
|
1083
1141
|
return -1;
|
|
1084
1142
|
return 0;
|
|
1085
1143
|
}
|
|
1086
|
-
return
|
|
1144
|
+
return s(e[0], n[0]) ? 0 : -1;
|
|
1087
1145
|
}, t.prototype.orderByLru = function(n, r, e) {
|
|
1088
|
-
for (var
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
var
|
|
1092
|
-
a ===
|
|
1146
|
+
for (var o = this.keys, s = this.values, a = o.length, i = e; i--; )
|
|
1147
|
+
o[i + 1] = o[i], s[i + 1] = s[i];
|
|
1148
|
+
o[0] = n, s[0] = r;
|
|
1149
|
+
var l = this.options.maxSize;
|
|
1150
|
+
a === l && e === a ? (o.pop(), s.pop()) : e >= l && (o.length = s.length = l);
|
|
1093
1151
|
}, t.prototype.updateAsyncCache = function(n) {
|
|
1094
|
-
var r = this, e = this.options,
|
|
1095
|
-
this.values[0] = i.then(function(
|
|
1096
|
-
return r.shouldUpdateOnHit &&
|
|
1097
|
-
}, function(
|
|
1098
|
-
var
|
|
1099
|
-
throw
|
|
1152
|
+
var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, a = this.keys[0], i = this.values[0];
|
|
1153
|
+
this.values[0] = i.then(function(l) {
|
|
1154
|
+
return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n), l;
|
|
1155
|
+
}, function(l) {
|
|
1156
|
+
var c = r.getKeyIndex(a);
|
|
1157
|
+
throw c !== -1 && (r.keys.splice(c, 1), r.values.splice(c, 1)), l;
|
|
1100
1158
|
});
|
|
1101
1159
|
}, t;
|
|
1102
1160
|
}()
|
|
1103
1161
|
);
|
|
1104
|
-
function
|
|
1105
|
-
if (n === void 0 && (n = {}),
|
|
1106
|
-
return
|
|
1162
|
+
function Xe(t, n) {
|
|
1163
|
+
if (n === void 0 && (n = {}), Kn(t))
|
|
1164
|
+
return Xe(t.fn, Pe(t.options, n));
|
|
1107
1165
|
if (typeof t != "function")
|
|
1108
1166
|
throw new TypeError("You must pass a function to `memoize`.");
|
|
1109
|
-
var r = n.isEqual, e = r === void 0 ?
|
|
1167
|
+
var r = n.isEqual, e = r === void 0 ? Gn : r, o = n.isMatchingKey, s = n.isPromise, a = s === void 0 ? !1 : s, i = n.maxSize, l = i === void 0 ? 1 : i, c = n.onCacheAdd, d = n.onCacheChange, m = n.onCacheHit, E = n.transformKey, y = Pe({
|
|
1110
1168
|
isEqual: e,
|
|
1111
|
-
isMatchingKey:
|
|
1169
|
+
isMatchingKey: o,
|
|
1112
1170
|
isPromise: a,
|
|
1113
|
-
maxSize:
|
|
1114
|
-
onCacheAdd:
|
|
1115
|
-
onCacheChange:
|
|
1116
|
-
onCacheHit:
|
|
1117
|
-
transformKey:
|
|
1118
|
-
},
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1121
|
-
var
|
|
1122
|
-
if (
|
|
1123
|
-
|
|
1171
|
+
maxSize: l,
|
|
1172
|
+
onCacheAdd: c,
|
|
1173
|
+
onCacheChange: d,
|
|
1174
|
+
onCacheHit: m,
|
|
1175
|
+
transformKey: E
|
|
1176
|
+
}, Un(n)), f = new zn(y), u = f.keys, h = f.values, _ = f.canTransformKey, p = f.shouldCloneArguments, g = f.shouldUpdateOnAdd, b = f.shouldUpdateOnChange, x = f.shouldUpdateOnHit, v = function() {
|
|
1177
|
+
var S = p ? W(arguments) : arguments;
|
|
1178
|
+
_ && (S = E(S));
|
|
1179
|
+
var C = u.length ? f.getKeyIndex(S) : -1;
|
|
1180
|
+
if (C !== -1)
|
|
1181
|
+
x && m(f, y, v), C && (f.orderByLru(u[C], h[C], C), b && d(f, y, v));
|
|
1124
1182
|
else {
|
|
1125
|
-
var
|
|
1126
|
-
|
|
1183
|
+
var Ye = t.apply(this, arguments), Ve = p ? S : W(arguments);
|
|
1184
|
+
f.orderByLru(Ve, Ye, u.length), a && f.updateAsyncCache(v), g && c(f, y, v), b && d(f, y, v);
|
|
1127
1185
|
}
|
|
1128
|
-
return
|
|
1186
|
+
return h[0];
|
|
1129
1187
|
};
|
|
1130
|
-
return
|
|
1188
|
+
return v.cache = f, v.fn = t, v.isMemoized = !0, v.options = y, v;
|
|
1131
1189
|
}
|
|
1132
|
-
async function
|
|
1190
|
+
async function je(t) {
|
|
1133
1191
|
try {
|
|
1134
|
-
const n = await
|
|
1192
|
+
const n = await ot(t, { encoding: "utf-8" });
|
|
1135
1193
|
return JSON.parse(n);
|
|
1136
1194
|
} catch {
|
|
1137
1195
|
}
|
|
1138
1196
|
}
|
|
1139
|
-
const
|
|
1197
|
+
const qn = /* @__PURE__ */ new URL(
|
|
1140
1198
|
"data:text/javascript," + encodeURIComponent('import{pathToFileURL as r}from"node:url";import{parentPort as t,workerData as a}from"node:worker_threads";const s=async({absolutePath:o})=>{try{const e=await import(r(o).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};s(a);')
|
|
1141
1199
|
);
|
|
1142
|
-
async function
|
|
1200
|
+
async function Hn(t) {
|
|
1143
1201
|
return new Promise((n) => {
|
|
1144
|
-
const r = new
|
|
1202
|
+
const r = new dt(qn, {
|
|
1145
1203
|
workerData: {
|
|
1146
1204
|
absolutePath: t
|
|
1147
1205
|
}
|
|
@@ -1153,75 +1211,75 @@ async function Wn(t) {
|
|
|
1153
1211
|
});
|
|
1154
1212
|
});
|
|
1155
1213
|
}
|
|
1156
|
-
async function
|
|
1214
|
+
async function Xn(t) {
|
|
1157
1215
|
console.error(
|
|
1158
1216
|
"Ts module type embeddedOverrides has not been implemented yet."
|
|
1159
1217
|
);
|
|
1160
1218
|
}
|
|
1161
|
-
const
|
|
1219
|
+
const Jn = Xe(
|
|
1162
1220
|
async (t, n) => {
|
|
1163
|
-
if (
|
|
1221
|
+
if (st(t))
|
|
1164
1222
|
return t;
|
|
1165
|
-
const r = await
|
|
1223
|
+
const r = await lt(n);
|
|
1166
1224
|
let e;
|
|
1167
|
-
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e =
|
|
1225
|
+
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = it(r), at(e, t);
|
|
1168
1226
|
}
|
|
1169
|
-
),
|
|
1170
|
-
const r =
|
|
1227
|
+
), Yn = async (t, n) => {
|
|
1228
|
+
const r = Jn(
|
|
1171
1229
|
t,
|
|
1172
1230
|
n
|
|
1173
|
-
), e =
|
|
1231
|
+
), e = ct(t);
|
|
1174
1232
|
if (e === ".json") {
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
return
|
|
1178
|
-
console.error(`Failed to parse the json file: ${
|
|
1233
|
+
const o = await r, s = await je(o);
|
|
1234
|
+
if (s !== void 0)
|
|
1235
|
+
return s;
|
|
1236
|
+
console.error(`Failed to parse the json file: ${o}`);
|
|
1179
1237
|
return;
|
|
1180
1238
|
} else if (e === ".mjs" || e === ".cjs" || e === ".js") {
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
return
|
|
1184
|
-
console.error(`Failed to parse the js module file: ${
|
|
1239
|
+
const o = await r, s = await Hn(o);
|
|
1240
|
+
if (s !== void 0)
|
|
1241
|
+
return s;
|
|
1242
|
+
console.error(`Failed to parse the js module file: ${o}`);
|
|
1185
1243
|
return;
|
|
1186
1244
|
} else if (e === ".mts" || e === ".cts" || e === ".ts") {
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
return
|
|
1190
|
-
console.error(`Failed to parse the ts module file: ${
|
|
1245
|
+
const o = await r, s = await Xn();
|
|
1246
|
+
if (s !== void 0)
|
|
1247
|
+
return s;
|
|
1248
|
+
console.error(`Failed to parse the ts module file: ${o}`);
|
|
1191
1249
|
return;
|
|
1192
1250
|
} else if (e === "") {
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
return
|
|
1251
|
+
const o = await r, s = await je(o);
|
|
1252
|
+
if (s !== void 0)
|
|
1253
|
+
return s;
|
|
1196
1254
|
}
|
|
1197
1255
|
try {
|
|
1198
1256
|
return JSON.parse(t);
|
|
1199
1257
|
} catch {
|
|
1200
1258
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1201
1259
|
}
|
|
1202
|
-
},
|
|
1260
|
+
}, Vn = async (t, n, r) => {
|
|
1203
1261
|
if (t === void 0)
|
|
1204
1262
|
return;
|
|
1205
|
-
const e = await
|
|
1263
|
+
const e = await Yn(
|
|
1206
1264
|
t,
|
|
1207
1265
|
r
|
|
1208
1266
|
);
|
|
1209
1267
|
if (e !== void 0)
|
|
1210
1268
|
try {
|
|
1211
|
-
for (const { identifiers:
|
|
1212
|
-
if (
|
|
1213
|
-
return
|
|
1269
|
+
for (const { identifiers: o, options: s } of e)
|
|
1270
|
+
if (o.includes(n))
|
|
1271
|
+
return s;
|
|
1214
1272
|
} catch {
|
|
1215
1273
|
console.error("Error parsing embedded override options.");
|
|
1216
1274
|
}
|
|
1217
1275
|
};
|
|
1218
|
-
function
|
|
1276
|
+
function Qn({ node: t, parent: n }, r, e) {
|
|
1219
1277
|
if (r.length === 0 || t.type !== "TemplateLiteral")
|
|
1220
1278
|
return;
|
|
1221
|
-
const
|
|
1222
|
-
if (!
|
|
1279
|
+
const o = t.comments ?? n?.comments;
|
|
1280
|
+
if (!o)
|
|
1223
1281
|
return;
|
|
1224
|
-
const
|
|
1282
|
+
const s = o[o.length - 1];
|
|
1225
1283
|
if (!(![
|
|
1226
1284
|
"MultiLine",
|
|
1227
1285
|
// meriyah
|
|
@@ -1229,77 +1287,77 @@ function Gn({ node: t, parent: n }, r, e) {
|
|
|
1229
1287
|
// typescript, acorn, espree, flow
|
|
1230
1288
|
"CommentBlock"
|
|
1231
1289
|
// babel, babel-flow, babel-ts
|
|
1232
|
-
].includes(
|
|
1290
|
+
].includes(s.type) || !s.leading)) {
|
|
1233
1291
|
for (const a of r)
|
|
1234
|
-
if (` ${a} ` ===
|
|
1292
|
+
if (` ${a} ` === s.value && !e.includes(a))
|
|
1235
1293
|
return a;
|
|
1236
1294
|
}
|
|
1237
1295
|
}
|
|
1238
|
-
function
|
|
1296
|
+
function Zn({ node: t, parent: n }, r, e) {
|
|
1239
1297
|
if (r.length !== 0 && !(t.type !== "TemplateLiteral" || n?.type !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
|
|
1240
|
-
for (const
|
|
1241
|
-
if (n.tag.name ===
|
|
1242
|
-
return
|
|
1298
|
+
for (const o of r)
|
|
1299
|
+
if (n.tag.name === o && !e.includes(o))
|
|
1300
|
+
return o;
|
|
1243
1301
|
}
|
|
1244
1302
|
}
|
|
1245
|
-
const { estree:
|
|
1303
|
+
const { estree: Je } = rt, er = function(t, n) {
|
|
1246
1304
|
const { node: r } = t;
|
|
1247
1305
|
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: e } }) => e === null))
|
|
1248
1306
|
return null;
|
|
1249
|
-
for (const e of
|
|
1250
|
-
const
|
|
1251
|
-
if (!
|
|
1307
|
+
for (const e of Ge) {
|
|
1308
|
+
const o = n[$(e)];
|
|
1309
|
+
if (!o)
|
|
1252
1310
|
continue;
|
|
1253
|
-
const
|
|
1311
|
+
const s = Qn(
|
|
1254
1312
|
t,
|
|
1255
|
-
|
|
1313
|
+
o,
|
|
1256
1314
|
n.noEmbeddedIdentificationByComment ?? []
|
|
1257
|
-
) ??
|
|
1315
|
+
) ?? Zn(
|
|
1258
1316
|
t,
|
|
1259
|
-
|
|
1317
|
+
o,
|
|
1260
1318
|
n.noEmbeddedIdentificationByTag ?? []
|
|
1261
1319
|
);
|
|
1262
|
-
if (
|
|
1320
|
+
if (s === void 0)
|
|
1263
1321
|
continue;
|
|
1264
1322
|
const a = qe[e];
|
|
1265
1323
|
if (!a)
|
|
1266
1324
|
return null;
|
|
1267
1325
|
const i = t.node;
|
|
1268
|
-
return i.quasis.length === 1 && i.quasis[0].value.raw.trim() === "" ? "``" : async (
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1326
|
+
return i.quasis.length === 1 && i.quasis[0].value.raw.trim() === "" ? "``" : async (l, c, d, m) => {
|
|
1327
|
+
const E = await Vn(
|
|
1328
|
+
m.embeddedOverrides,
|
|
1329
|
+
s,
|
|
1330
|
+
m.filepath
|
|
1273
1331
|
);
|
|
1274
1332
|
try {
|
|
1275
|
-
const
|
|
1276
|
-
identifier:
|
|
1277
|
-
identifiers:
|
|
1278
|
-
embeddedOverrideOptions:
|
|
1333
|
+
const y = await a(l, c, d, m, {
|
|
1334
|
+
identifier: s,
|
|
1335
|
+
identifiers: o,
|
|
1336
|
+
embeddedOverrideOptions: E
|
|
1279
1337
|
});
|
|
1280
|
-
return
|
|
1281
|
-
{ embed: !0, ...
|
|
1282
|
-
|
|
1338
|
+
return I.label(
|
|
1339
|
+
{ embed: !0, ...y.label },
|
|
1340
|
+
y
|
|
1283
1341
|
);
|
|
1284
|
-
} catch (
|
|
1285
|
-
throw console.error(
|
|
1342
|
+
} catch (y) {
|
|
1343
|
+
throw console.error(y), y;
|
|
1286
1344
|
}
|
|
1287
1345
|
};
|
|
1288
1346
|
}
|
|
1289
|
-
return
|
|
1290
|
-
},
|
|
1347
|
+
return Je.embed?.(t, n) ?? null;
|
|
1348
|
+
}, pr = {
|
|
1291
1349
|
estree: {
|
|
1292
|
-
...
|
|
1293
|
-
embed:
|
|
1350
|
+
...Je,
|
|
1351
|
+
embed: er
|
|
1294
1352
|
}
|
|
1295
1353
|
};
|
|
1296
1354
|
export {
|
|
1297
1355
|
qe as embeddedEmbedders,
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1356
|
+
Ge as embeddedLanguages,
|
|
1357
|
+
He as embeddedOptions,
|
|
1358
|
+
ze as embeddedParsers,
|
|
1359
|
+
$ as makeIdentifiersOptionName,
|
|
1360
|
+
mr as options,
|
|
1361
|
+
gr as parsers,
|
|
1362
|
+
pr as printers
|
|
1305
1363
|
};
|