prettier-plugin-embed 0.4.4 → 0.4.5
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/embedded/json/options.d.ts +2 -2
- package/dist/embedded/register.d.ts +2 -2
- package/dist/index.js +660 -605
- package/dist/options.d.ts +2 -2
- package/dist/parsers.d.ts +1 -0
- package/dist/types.d.ts +16 -5
- package/dist/utils.d.ts +5 -5
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { utils as X, builders 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 { group:
|
|
13
|
-
function
|
|
1
|
+
import { utils as X, builders as D } from "prettier/doc";
|
|
2
|
+
import wt from "prettier/parser-babel";
|
|
3
|
+
import Bt from "prettier/parser-espree";
|
|
4
|
+
import Ut from "prettier/parser-flow";
|
|
5
|
+
import Ct from "prettier/parser-meriyah";
|
|
6
|
+
import Wt from "prettier/parser-typescript";
|
|
7
|
+
import { printers as Gt } from "prettier/plugins/estree.mjs";
|
|
8
|
+
import { readFile as qt } from "node:fs/promises";
|
|
9
|
+
import { isAbsolute as zt, dirname as Kt, resolve as Ht, extname as Jt } from "node:path";
|
|
10
|
+
import { Worker as Xt } from "node:worker_threads";
|
|
11
|
+
import { resolveConfigFile as Yt } from "prettier";
|
|
12
|
+
const { group: Qt, indent: Vt, softline: ce, lineSuffixBoundary: Zt } = D, { mapDoc: en } = X;
|
|
13
|
+
function tn(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 = Qt([Vt([ce, e]), ce])), ["${", e, Zt, "}"];
|
|
17
17
|
}
|
|
18
18
|
function x(t, n) {
|
|
19
19
|
return t.map(
|
|
20
|
-
(r) =>
|
|
20
|
+
(r) => tn(r, n),
|
|
21
21
|
"expressions"
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
function T(t, n, r) {
|
|
25
|
-
return
|
|
25
|
+
return en(t, (o) => {
|
|
26
26
|
if (typeof o != "string")
|
|
27
27
|
return o;
|
|
28
28
|
const s = [], l = o.split(n);
|
|
29
|
-
for (let
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
if (!
|
|
29
|
+
for (let c = 0; c < l.length; c++) {
|
|
30
|
+
let g = l[c];
|
|
31
|
+
if (c % 2 == 0) {
|
|
32
|
+
if (!g)
|
|
33
33
|
continue;
|
|
34
|
-
|
|
34
|
+
g = g.replaceAll(/([\\`]|\${)/g, "\\$1"), s.push(g);
|
|
35
35
|
} else {
|
|
36
|
-
const
|
|
37
|
-
s.push(r[
|
|
36
|
+
const a = Number(g);
|
|
37
|
+
s.push(r[a]);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
return s;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function A(t, n, r) {
|
|
44
44
|
if (!(n.plugins?.some(
|
|
45
45
|
(e) => e.name?.match(
|
|
46
46
|
new RegExp("(^|/)" + te(t) + "($|/)")
|
|
@@ -50,7 +50,7 @@ function M(t, n, r) {
|
|
|
50
50
|
`Cannot format embedded language identified by "${r}", because plugin "${t}" is not loaded.`
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function nn(t, n, r) {
|
|
54
54
|
if (n === r) {
|
|
55
55
|
t.unshift(n);
|
|
56
56
|
return;
|
|
@@ -76,13 +76,13 @@ const Y = (() => {
|
|
|
76
76
|
};
|
|
77
77
|
})();
|
|
78
78
|
function L(t = "p", n = "") {
|
|
79
|
-
const r = Y(), e = Y(), o = te(t), s = te(n), l = (
|
|
79
|
+
const r = Y(), e = Y(), o = te(t), s = te(n), l = (g) => `${t}${r}${g}${e}${n}`, c = new RegExp(
|
|
80
80
|
`${o}${r}(\\d+)${e}${s}`,
|
|
81
81
|
"ig"
|
|
82
82
|
);
|
|
83
83
|
return {
|
|
84
84
|
createPlaceholder: l,
|
|
85
|
-
placeholderRegex:
|
|
85
|
+
placeholderRegex: c
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
function te(t) {
|
|
@@ -91,84 +91,84 @@ function te(t) {
|
|
|
91
91
|
function S(t) {
|
|
92
92
|
return `${t}Identifiers`;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function rn(t) {
|
|
95
95
|
return `${t}Plugin`;
|
|
96
96
|
}
|
|
97
97
|
function V(t) {
|
|
98
98
|
return `${t}Parser`;
|
|
99
99
|
}
|
|
100
|
-
const { line: ae, group:
|
|
100
|
+
const { line: ae, group: P, indent: de, softline: le } = D, on = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
101
101
|
e = {
|
|
102
102
|
...e,
|
|
103
103
|
...s
|
|
104
104
|
};
|
|
105
|
-
const { node: l } = r, { createPlaceholder:
|
|
106
|
-
(m,
|
|
107
|
-
).join(""),
|
|
108
|
-
|
|
105
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L("@p"), a = l.quasis.map(
|
|
106
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
107
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
108
|
+
d.length,
|
|
109
109
|
-u.length || void 0
|
|
110
|
-
),
|
|
110
|
+
), E = x(r, n), b = await t(y, {
|
|
111
111
|
...e,
|
|
112
112
|
parser: "scss"
|
|
113
|
-
}), i = T(
|
|
113
|
+
}), i = T(b, g, E);
|
|
114
114
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
115
|
-
return
|
|
115
|
+
return P([
|
|
116
116
|
"`",
|
|
117
|
-
|
|
118
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
117
|
+
d,
|
|
118
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [P(i)] : de([P(i)]),
|
|
119
119
|
u,
|
|
120
120
|
"`"
|
|
121
121
|
]);
|
|
122
|
-
const
|
|
123
|
-
return
|
|
122
|
+
const f = d.length ? ae : le, v = u.length ? ae : le;
|
|
123
|
+
return P([
|
|
124
124
|
"`",
|
|
125
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
125
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, P(i)] : de([f, P(i)]),
|
|
126
126
|
v,
|
|
127
127
|
"`"
|
|
128
128
|
]);
|
|
129
|
-
},
|
|
130
|
-
[
|
|
129
|
+
}, pt = "embeddedCss", sn = ["css"], cn = S(pt), an = {
|
|
130
|
+
[cn]: {
|
|
131
131
|
category: "Embed",
|
|
132
132
|
type: "string",
|
|
133
133
|
array: !0,
|
|
134
|
-
default: [{ value: [...
|
|
134
|
+
default: [{ value: [...sn] }],
|
|
135
135
|
description: "Specify embedded CSS language identifiers."
|
|
136
136
|
}
|
|
137
|
-
},
|
|
137
|
+
}, dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
138
138
|
__proto__: null,
|
|
139
|
-
embedder:
|
|
140
|
-
language:
|
|
141
|
-
options:
|
|
142
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: ue, group:
|
|
139
|
+
embedder: on,
|
|
140
|
+
language: pt,
|
|
141
|
+
options: an
|
|
142
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ue, group: k, indent: ge, softline: pe } = D, ln = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
143
143
|
e = {
|
|
144
144
|
...e,
|
|
145
145
|
...s
|
|
146
146
|
};
|
|
147
|
-
const { node: l } = r, { createPlaceholder:
|
|
148
|
-
(m,
|
|
149
|
-
).join(""),
|
|
150
|
-
|
|
147
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
148
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
149
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
150
|
+
d.length,
|
|
151
151
|
-u.length || void 0
|
|
152
|
-
),
|
|
152
|
+
), E = x(r, n), b = await t(y, {
|
|
153
153
|
...e,
|
|
154
154
|
parser: e.embeddedEsParser ?? "babel"
|
|
155
|
-
}), i = T(
|
|
155
|
+
}), i = T(b, g, E);
|
|
156
156
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
157
|
-
return
|
|
157
|
+
return k([
|
|
158
158
|
"`",
|
|
159
|
-
|
|
160
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
159
|
+
d,
|
|
160
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [k(i)] : ge([k(i)]),
|
|
161
161
|
u,
|
|
162
162
|
"`"
|
|
163
163
|
]);
|
|
164
|
-
const
|
|
165
|
-
return
|
|
164
|
+
const f = d.length ? ue : pe, v = u.length ? ue : pe;
|
|
165
|
+
return k([
|
|
166
166
|
"`",
|
|
167
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
167
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, k(i)] : ge([f, k(i)]),
|
|
168
168
|
v,
|
|
169
169
|
"`"
|
|
170
170
|
]);
|
|
171
|
-
}, ne = "embeddedEs",
|
|
171
|
+
}, ne = "embeddedEs", un = [
|
|
172
172
|
"js",
|
|
173
173
|
"jsx",
|
|
174
174
|
"es",
|
|
@@ -177,252 +177,252 @@ const { line: ae, group: k, indent: de, softline: le } = I, tn = async (t, n, r,
|
|
|
177
177
|
"cjs",
|
|
178
178
|
"pac",
|
|
179
179
|
"javascript"
|
|
180
|
-
],
|
|
180
|
+
], gn = [
|
|
181
181
|
"babel",
|
|
182
182
|
"babel-flow",
|
|
183
183
|
"acorn",
|
|
184
184
|
"espree",
|
|
185
185
|
"flow",
|
|
186
186
|
"meriyah"
|
|
187
|
-
],
|
|
188
|
-
[
|
|
187
|
+
], pn = S(ne), mn = V(ne), fn = {
|
|
188
|
+
[pn]: {
|
|
189
189
|
category: "Embed",
|
|
190
190
|
type: "string",
|
|
191
191
|
array: !0,
|
|
192
|
-
default: [{ value: [...
|
|
192
|
+
default: [{ value: [...un] }],
|
|
193
193
|
description: "Specify embedded ES language identifiers."
|
|
194
194
|
},
|
|
195
|
-
[
|
|
195
|
+
[mn]: {
|
|
196
196
|
category: "Embed",
|
|
197
197
|
type: "choice",
|
|
198
198
|
default: "babel",
|
|
199
199
|
description: 'Specify the embedded ES language parser. Default is "babel".',
|
|
200
|
-
choices:
|
|
200
|
+
choices: gn.map((t) => ({
|
|
201
201
|
value: t,
|
|
202
202
|
description: `Use "${t}".`
|
|
203
203
|
}))
|
|
204
204
|
}
|
|
205
|
-
},
|
|
205
|
+
}, hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
206
206
|
__proto__: null,
|
|
207
|
-
embedder:
|
|
207
|
+
embedder: ln,
|
|
208
208
|
language: ne,
|
|
209
|
-
options:
|
|
210
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: me, group:
|
|
211
|
-
|
|
209
|
+
options: fn
|
|
210
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: me, group: N, indent: fe, softline: he } = D, bn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
211
|
+
A("prettier-plugin-glsl", e, o), e = {
|
|
212
212
|
...e,
|
|
213
213
|
...s
|
|
214
214
|
};
|
|
215
|
-
const { node: l } = r, { createPlaceholder:
|
|
216
|
-
(m,
|
|
217
|
-
).join(""),
|
|
218
|
-
|
|
215
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
216
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
217
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
218
|
+
d.length,
|
|
219
219
|
-u.length || void 0
|
|
220
|
-
),
|
|
220
|
+
), E = x(r, n), b = await t(y, {
|
|
221
221
|
...e,
|
|
222
222
|
parser: "glsl-parser"
|
|
223
|
-
}), i = T(
|
|
223
|
+
}), i = T(b, g, E);
|
|
224
224
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
225
|
-
return
|
|
225
|
+
return N([
|
|
226
226
|
"`",
|
|
227
|
-
|
|
228
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
227
|
+
d,
|
|
228
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [N(i)] : fe([N(i)]),
|
|
229
229
|
u,
|
|
230
230
|
"`"
|
|
231
231
|
]);
|
|
232
|
-
const
|
|
233
|
-
return
|
|
232
|
+
const f = d.length ? me : he, v = u.length ? me : he;
|
|
233
|
+
return N([
|
|
234
234
|
"`",
|
|
235
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
235
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, N(i)] : fe([f, N(i)]),
|
|
236
236
|
v,
|
|
237
237
|
"`"
|
|
238
238
|
]);
|
|
239
|
-
},
|
|
240
|
-
[
|
|
239
|
+
}, mt = "embeddedGlsl", En = ["glsl", "shader"], yn = S(mt), _n = {
|
|
240
|
+
[yn]: {
|
|
241
241
|
category: "Embed",
|
|
242
242
|
type: "string",
|
|
243
243
|
array: !0,
|
|
244
|
-
default: [{ value: [...
|
|
244
|
+
default: [{ value: [...En] }],
|
|
245
245
|
description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
|
|
246
246
|
}
|
|
247
|
-
},
|
|
247
|
+
}, vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
248
248
|
__proto__: null,
|
|
249
|
-
embedder:
|
|
250
|
-
language:
|
|
251
|
-
options:
|
|
252
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
249
|
+
embedder: bn,
|
|
250
|
+
language: mt,
|
|
251
|
+
options: _n
|
|
252
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: be, group: M, indent: Ee, softline: ye } = D, $n = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
253
253
|
e = {
|
|
254
254
|
...e,
|
|
255
255
|
...s
|
|
256
256
|
};
|
|
257
|
-
const { node: l } = r, { createPlaceholder:
|
|
258
|
-
(m,
|
|
259
|
-
).join(""),
|
|
260
|
-
|
|
257
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
258
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
259
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
260
|
+
d.length,
|
|
261
261
|
-u.length || void 0
|
|
262
|
-
),
|
|
262
|
+
), E = x(r, n), b = await t(y, {
|
|
263
263
|
...e,
|
|
264
264
|
parser: "graphql"
|
|
265
|
-
}), i = T(
|
|
265
|
+
}), i = T(b, g, E);
|
|
266
266
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
267
|
-
return
|
|
267
|
+
return M([
|
|
268
268
|
"`",
|
|
269
|
-
|
|
270
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
269
|
+
d,
|
|
270
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [M(i)] : Ee([M(i)]),
|
|
271
271
|
u,
|
|
272
272
|
"`"
|
|
273
273
|
]);
|
|
274
|
-
const
|
|
275
|
-
return
|
|
274
|
+
const f = d.length ? be : ye, v = u.length ? be : ye;
|
|
275
|
+
return M([
|
|
276
276
|
"`",
|
|
277
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
277
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, M(i)] : Ee([f, M(i)]),
|
|
278
278
|
v,
|
|
279
279
|
"`"
|
|
280
280
|
]);
|
|
281
|
-
},
|
|
282
|
-
[
|
|
281
|
+
}, ft = "embeddedGraphql", In = ["graphql", "gql"], Dn = S(ft), Sn = {
|
|
282
|
+
[Dn]: {
|
|
283
283
|
category: "Embed",
|
|
284
284
|
type: "string",
|
|
285
285
|
array: !0,
|
|
286
|
-
default: [{ value: [...
|
|
286
|
+
default: [{ value: [...In] }],
|
|
287
287
|
description: "Specify embedded GraphQL language identifiers."
|
|
288
288
|
}
|
|
289
|
-
},
|
|
289
|
+
}, xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
290
290
|
__proto__: null,
|
|
291
|
-
embedder:
|
|
292
|
-
language:
|
|
293
|
-
options:
|
|
294
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: _e, group: R, indent: ve, softline: $e } =
|
|
291
|
+
embedder: $n,
|
|
292
|
+
language: ft,
|
|
293
|
+
options: Sn
|
|
294
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: _e, group: R, indent: ve, softline: $e } = D, { mapDoc: Ln } = X, Tn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
295
295
|
e = {
|
|
296
296
|
...e,
|
|
297
297
|
...s
|
|
298
298
|
};
|
|
299
|
-
const { node: l } = r, { createPlaceholder:
|
|
300
|
-
(m,
|
|
301
|
-
).join(""),
|
|
302
|
-
|
|
299
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
300
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
301
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
302
|
+
d.length,
|
|
303
303
|
-u.length || void 0
|
|
304
|
-
),
|
|
304
|
+
), E = x(r, n), b = await t(y, {
|
|
305
305
|
...e,
|
|
306
306
|
parser: "html"
|
|
307
|
-
}), i =
|
|
307
|
+
}), i = Ln(b, (m) => {
|
|
308
308
|
if (typeof m != "string")
|
|
309
309
|
return m;
|
|
310
|
-
const
|
|
311
|
-
for (let $ = 0; $ <
|
|
312
|
-
let _ =
|
|
310
|
+
const p = [], h = m.split(g);
|
|
311
|
+
for (let $ = 0; $ < h.length; $++) {
|
|
312
|
+
let _ = h[$];
|
|
313
313
|
if ($ % 2 == 0) {
|
|
314
314
|
if (!_)
|
|
315
315
|
continue;
|
|
316
|
-
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (_ = _.replaceAll(/<\/(?=script\b)/gi, "<\\/")),
|
|
316
|
+
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (_ = _.replaceAll(/<\/(?=script\b)/gi, "<\\/")), p.push(_);
|
|
317
317
|
} else {
|
|
318
|
-
const
|
|
319
|
-
|
|
318
|
+
const I = Number(_);
|
|
319
|
+
p.push(E[I]);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
return
|
|
322
|
+
return p;
|
|
323
323
|
});
|
|
324
324
|
if (e.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
325
325
|
e.htmlWhitespaceSensitivity === "css" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
326
326
|
return R([
|
|
327
327
|
"`",
|
|
328
|
-
|
|
328
|
+
d,
|
|
329
329
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [R(i)] : ve([R(i)]),
|
|
330
330
|
u,
|
|
331
331
|
"`"
|
|
332
332
|
]);
|
|
333
|
-
const
|
|
333
|
+
const f = d.length ? _e : $e, v = u.length ? _e : $e;
|
|
334
334
|
return R([
|
|
335
335
|
"`",
|
|
336
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
336
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, R(i)] : ve([f, R(i)]),
|
|
337
337
|
v,
|
|
338
338
|
"`"
|
|
339
339
|
]);
|
|
340
|
-
}, ht = "embeddedHtml",
|
|
341
|
-
[
|
|
340
|
+
}, ht = "embeddedHtml", On = ["html", "xhtml"], An = S(ht), Pn = {
|
|
341
|
+
[An]: {
|
|
342
342
|
category: "Embed",
|
|
343
343
|
type: "string",
|
|
344
344
|
array: !0,
|
|
345
|
-
default: [{ value: [...
|
|
345
|
+
default: [{ value: [...On] }],
|
|
346
346
|
description: "Specify embedded HTML language identifiers."
|
|
347
347
|
}
|
|
348
|
-
},
|
|
348
|
+
}, kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
349
349
|
__proto__: null,
|
|
350
|
-
embedder:
|
|
350
|
+
embedder: Tn,
|
|
351
351
|
language: ht,
|
|
352
|
-
options:
|
|
353
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
354
|
-
|
|
352
|
+
options: Pn
|
|
353
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ie, group: F, indent: De, softline: Se } = D, Nn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
354
|
+
A("prettier-plugin-ini", e, o), e = {
|
|
355
355
|
...e,
|
|
356
356
|
...s
|
|
357
357
|
};
|
|
358
|
-
const { node: l } = r, { createPlaceholder:
|
|
359
|
-
(m,
|
|
360
|
-
).join(""),
|
|
361
|
-
|
|
358
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
359
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
360
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
361
|
+
d.length,
|
|
362
362
|
-u.length || void 0
|
|
363
|
-
),
|
|
363
|
+
), E = x(r, n), b = await t(y, {
|
|
364
364
|
...e,
|
|
365
365
|
parser: "ini"
|
|
366
|
-
}), i = T(
|
|
366
|
+
}), i = T(b, g, E);
|
|
367
367
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
368
|
-
return
|
|
368
|
+
return F([
|
|
369
369
|
"`",
|
|
370
|
-
|
|
371
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
370
|
+
d,
|
|
371
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [F(i)] : De([F(i)]),
|
|
372
372
|
u,
|
|
373
373
|
"`"
|
|
374
374
|
]);
|
|
375
|
-
const
|
|
376
|
-
return
|
|
375
|
+
const f = d.length ? Ie : Se, v = u.length ? Ie : Se;
|
|
376
|
+
return F([
|
|
377
377
|
"`",
|
|
378
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
378
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, F(i)] : De([f, F(i)]),
|
|
379
379
|
v,
|
|
380
380
|
"`"
|
|
381
381
|
]);
|
|
382
|
-
},
|
|
383
|
-
[
|
|
382
|
+
}, bt = "embeddedIni", Mn = ["ini", "cfg", "pro"], Rn = S(bt), Fn = {
|
|
383
|
+
[Rn]: {
|
|
384
384
|
category: "Embed",
|
|
385
385
|
type: "string",
|
|
386
386
|
array: !0,
|
|
387
|
-
default: [{ value: [...
|
|
387
|
+
default: [{ value: [...Mn] }],
|
|
388
388
|
description: 'Specify embedded INI language identifiers. This requires "prettier-plugin-ini".'
|
|
389
389
|
}
|
|
390
|
-
},
|
|
390
|
+
}, jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
391
391
|
__proto__: null,
|
|
392
|
-
embedder:
|
|
393
|
-
language:
|
|
394
|
-
options:
|
|
395
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: xe, group:
|
|
392
|
+
embedder: Nn,
|
|
393
|
+
language: bt,
|
|
394
|
+
options: Fn
|
|
395
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: xe, group: j, indent: Le, softline: Te } = D, wn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
396
396
|
e = {
|
|
397
397
|
...e,
|
|
398
398
|
...s
|
|
399
399
|
};
|
|
400
|
-
const { node: l } = r, { createPlaceholder:
|
|
401
|
-
(m,
|
|
402
|
-
).join(""),
|
|
403
|
-
|
|
400
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = Bn(), a = l.quasis.map(
|
|
401
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
402
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
403
|
+
d.length,
|
|
404
404
|
-u.length || void 0
|
|
405
|
-
),
|
|
405
|
+
), E = x(r, n), b = await t(y, {
|
|
406
406
|
...e,
|
|
407
407
|
parser: e.embeddedJsonParser ?? "json"
|
|
408
|
-
}), i = T(
|
|
408
|
+
}), i = T(b, g, E);
|
|
409
409
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
410
|
-
return
|
|
410
|
+
return j([
|
|
411
411
|
"`",
|
|
412
|
-
|
|
413
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
412
|
+
d,
|
|
413
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [j(i)] : Le([j(i)]),
|
|
414
414
|
u,
|
|
415
415
|
"`"
|
|
416
416
|
]);
|
|
417
|
-
const
|
|
418
|
-
return
|
|
417
|
+
const f = d.length ? xe : Te, v = u.length ? xe : Te;
|
|
418
|
+
return j([
|
|
419
419
|
"`",
|
|
420
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
420
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, j(i)] : Le([f, j(i)]),
|
|
421
421
|
v,
|
|
422
422
|
"`"
|
|
423
423
|
]);
|
|
424
424
|
};
|
|
425
|
-
function
|
|
425
|
+
function Bn() {
|
|
426
426
|
const t = Y(), n = Y(), r = (o) => `'0${t}${o}${n}'`, e = new RegExp(
|
|
427
427
|
`["']?0${t}(\\d+)${n}['"]?`,
|
|
428
428
|
"ig"
|
|
@@ -432,59 +432,59 @@ function jn() {
|
|
|
432
432
|
placeholderRegex: e
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
-
const re = "embeddedJson",
|
|
436
|
-
[
|
|
435
|
+
const re = "embeddedJson", Un = ["json", "jsonl"], Cn = ["json", "json5", "jsonc", "json-stringify"], Wn = V(re), Gn = S(re), qn = {
|
|
436
|
+
[Gn]: {
|
|
437
437
|
category: "Embed",
|
|
438
438
|
type: "string",
|
|
439
439
|
array: !0,
|
|
440
|
-
default: [{ value: [...
|
|
440
|
+
default: [{ value: [...Un] }],
|
|
441
441
|
description: "Specify embedded JSON language identifiers."
|
|
442
442
|
},
|
|
443
|
-
[
|
|
443
|
+
[Wn]: {
|
|
444
444
|
category: "Embed",
|
|
445
445
|
type: "choice",
|
|
446
446
|
default: "json",
|
|
447
447
|
description: 'Specify the embedded JSON language parser. Default is "json".',
|
|
448
|
-
choices:
|
|
448
|
+
choices: Cn.map((t) => ({
|
|
449
449
|
value: t,
|
|
450
450
|
description: `Use "${t}".`
|
|
451
451
|
}))
|
|
452
452
|
}
|
|
453
|
-
},
|
|
453
|
+
}, zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
454
454
|
__proto__: null,
|
|
455
|
-
embedder:
|
|
455
|
+
embedder: wn,
|
|
456
456
|
language: re,
|
|
457
|
-
options:
|
|
458
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Oe, group: w, indent:
|
|
459
|
-
|
|
457
|
+
options: qn
|
|
458
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Oe, group: w, indent: Ae, softline: Pe } = D, Kn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
459
|
+
A("prettier-plugin-latex", e, o), e = {
|
|
460
460
|
...e,
|
|
461
461
|
...s
|
|
462
462
|
};
|
|
463
|
-
const { node: l } = r, { createPlaceholder:
|
|
464
|
-
(m,
|
|
465
|
-
).join(""),
|
|
466
|
-
|
|
463
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
464
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
465
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
466
|
+
d.length,
|
|
467
467
|
-u.length || void 0
|
|
468
|
-
),
|
|
468
|
+
), E = x(r, n), b = await t(y, {
|
|
469
469
|
...e,
|
|
470
470
|
parser: "latex-parser"
|
|
471
|
-
}), i = T(
|
|
471
|
+
}), i = T(b, g, E);
|
|
472
472
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
473
473
|
return w([
|
|
474
474
|
"`",
|
|
475
|
-
|
|
476
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] :
|
|
475
|
+
d,
|
|
476
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] : Ae([w(i)]),
|
|
477
477
|
u,
|
|
478
478
|
"`"
|
|
479
479
|
]);
|
|
480
|
-
const
|
|
480
|
+
const f = d.length ? Oe : Pe, v = u.length ? Oe : Pe;
|
|
481
481
|
return w([
|
|
482
482
|
"`",
|
|
483
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
483
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, w(i)] : Ae([f, w(i)]),
|
|
484
484
|
v,
|
|
485
485
|
"`"
|
|
486
486
|
]);
|
|
487
|
-
}, Et = "embeddedLatex",
|
|
487
|
+
}, Et = "embeddedLatex", Hn = [
|
|
488
488
|
"latex",
|
|
489
489
|
"tex",
|
|
490
490
|
"aux",
|
|
@@ -493,269 +493,269 @@ const re = "embeddedJson", Fn = ["json", "jsonl"], wn = ["json", "json-stringify
|
|
|
493
493
|
"bib",
|
|
494
494
|
"toc",
|
|
495
495
|
"sty"
|
|
496
|
-
],
|
|
497
|
-
[
|
|
496
|
+
], Jn = S(Et), Xn = {
|
|
497
|
+
[Jn]: {
|
|
498
498
|
category: "Embed",
|
|
499
499
|
type: "string",
|
|
500
500
|
array: !0,
|
|
501
|
-
default: [{ value: [...
|
|
501
|
+
default: [{ value: [...Hn] }],
|
|
502
502
|
description: 'Specify embedded LaTeX language identifiers. This requires "prettier-plugin-latex".'
|
|
503
503
|
}
|
|
504
|
-
},
|
|
504
|
+
}, Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
505
505
|
__proto__: null,
|
|
506
|
-
embedder:
|
|
506
|
+
embedder: Kn,
|
|
507
507
|
language: Et,
|
|
508
|
-
options:
|
|
509
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
508
|
+
options: Xn
|
|
509
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ke, group: B, indent: Ne, softline: Me } = D, Qn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
510
510
|
e = {
|
|
511
511
|
...e,
|
|
512
512
|
...s
|
|
513
513
|
};
|
|
514
|
-
const { node: l } = r, { createPlaceholder:
|
|
515
|
-
(m,
|
|
516
|
-
).join(""),
|
|
517
|
-
|
|
514
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
515
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
516
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
517
|
+
d.length,
|
|
518
518
|
-u.length || void 0
|
|
519
|
-
),
|
|
519
|
+
), E = x(r, n), b = await t(y, {
|
|
520
520
|
...e,
|
|
521
521
|
parser: "markdown",
|
|
522
522
|
__inJsTemplate: !0
|
|
523
|
-
}), i = T(
|
|
523
|
+
}), i = T(b, g, E);
|
|
524
524
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
525
525
|
return B([
|
|
526
526
|
"`",
|
|
527
|
-
|
|
528
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] :
|
|
527
|
+
d,
|
|
528
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] : Ne([B(i)]),
|
|
529
529
|
u,
|
|
530
530
|
"`"
|
|
531
531
|
]);
|
|
532
|
-
const
|
|
532
|
+
const f = d.length ? ke : Me, v = u.length ? ke : Me;
|
|
533
533
|
return B([
|
|
534
534
|
"`",
|
|
535
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
535
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, B(i)] : Ne([f, B(i)]),
|
|
536
536
|
v,
|
|
537
537
|
"`"
|
|
538
538
|
]);
|
|
539
|
-
},
|
|
540
|
-
[
|
|
539
|
+
}, yt = "embeddedMarkdown", Vn = ["md", "markdown"], Zn = S(yt), er = {
|
|
540
|
+
[Zn]: {
|
|
541
541
|
category: "Embed",
|
|
542
542
|
type: "string",
|
|
543
543
|
array: !0,
|
|
544
|
-
default: [{ value: [...
|
|
544
|
+
default: [{ value: [...Vn] }],
|
|
545
545
|
description: "Specify embedded Markdown language identifiers."
|
|
546
546
|
}
|
|
547
|
-
},
|
|
547
|
+
}, tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
548
548
|
__proto__: null,
|
|
549
|
-
embedder:
|
|
550
|
-
language:
|
|
551
|
-
options:
|
|
552
|
-
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop",
|
|
553
|
-
[
|
|
549
|
+
embedder: Qn,
|
|
550
|
+
language: yt,
|
|
551
|
+
options: er
|
|
552
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop", nr = S(oe), rr = {
|
|
553
|
+
[nr]: {
|
|
554
554
|
category: "Embed",
|
|
555
555
|
type: "string",
|
|
556
556
|
array: !0,
|
|
557
557
|
default: [{ value: [] }],
|
|
558
558
|
description: "Specify embedded language identifiers that will not be formatted."
|
|
559
559
|
}
|
|
560
|
-
},
|
|
560
|
+
}, or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
561
561
|
__proto__: null,
|
|
562
562
|
language: oe,
|
|
563
|
-
options:
|
|
564
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Re, group: U, indent:
|
|
565
|
-
|
|
563
|
+
options: rr
|
|
564
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Re, group: U, indent: Fe, softline: je } = D, sr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
565
|
+
A("@prettier/plugin-php", e, o), e = {
|
|
566
566
|
...e,
|
|
567
567
|
...s
|
|
568
568
|
};
|
|
569
|
-
const { node: l } = r, { createPlaceholder:
|
|
570
|
-
(m,
|
|
571
|
-
).join(""),
|
|
572
|
-
|
|
569
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L("$p"), a = l.quasis.map(
|
|
570
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
571
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
572
|
+
d.length,
|
|
573
573
|
-u.length || void 0
|
|
574
|
-
),
|
|
574
|
+
), E = x(r, n), b = await t(y, {
|
|
575
575
|
...e,
|
|
576
576
|
parser: "php"
|
|
577
|
-
}), i = T(
|
|
577
|
+
}), i = T(b, g, E);
|
|
578
578
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
579
579
|
return U([
|
|
580
580
|
"`",
|
|
581
|
-
|
|
582
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] :
|
|
581
|
+
d,
|
|
582
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] : Fe([U(i)]),
|
|
583
583
|
u,
|
|
584
584
|
"`"
|
|
585
585
|
]);
|
|
586
|
-
const
|
|
586
|
+
const f = d.length ? Re : je, v = u.length ? Re : je;
|
|
587
587
|
return U([
|
|
588
588
|
"`",
|
|
589
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
589
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, U(i)] : Fe([f, U(i)]),
|
|
590
590
|
v,
|
|
591
591
|
"`"
|
|
592
592
|
]);
|
|
593
|
-
},
|
|
594
|
-
[
|
|
593
|
+
}, _t = "embeddedPhp", ir = ["php", "php5"], cr = S(_t), ar = {
|
|
594
|
+
[cr]: {
|
|
595
595
|
category: "Embed",
|
|
596
596
|
type: "string",
|
|
597
597
|
array: !0,
|
|
598
|
-
default: [{ value: [...
|
|
598
|
+
default: [{ value: [...ir] }],
|
|
599
599
|
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
|
|
600
600
|
}
|
|
601
|
-
},
|
|
601
|
+
}, dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
602
602
|
__proto__: null,
|
|
603
|
-
embedder:
|
|
604
|
-
language:
|
|
605
|
-
options:
|
|
606
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: we, group: C, indent: Be, softline: Ue } =
|
|
607
|
-
|
|
603
|
+
embedder: sr,
|
|
604
|
+
language: _t,
|
|
605
|
+
options: ar
|
|
606
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: we, group: C, indent: Be, softline: Ue } = D, lr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
607
|
+
A("prettier-plugin-properties", e, o), e = {
|
|
608
608
|
...e,
|
|
609
609
|
...s
|
|
610
610
|
};
|
|
611
|
-
const { node: l } = r, { createPlaceholder:
|
|
612
|
-
(m,
|
|
613
|
-
).join(""),
|
|
614
|
-
|
|
611
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
612
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
613
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
614
|
+
d.length,
|
|
615
615
|
-u.length || void 0
|
|
616
|
-
),
|
|
616
|
+
), E = x(r, n), b = await t(y, {
|
|
617
617
|
...e,
|
|
618
618
|
parser: "dot-properties"
|
|
619
|
-
}), i = T(
|
|
619
|
+
}), i = T(b, g, E);
|
|
620
620
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
621
621
|
return C([
|
|
622
622
|
"`",
|
|
623
|
-
|
|
623
|
+
d,
|
|
624
624
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [C(i)] : Be([C(i)]),
|
|
625
625
|
u,
|
|
626
626
|
"`"
|
|
627
627
|
]);
|
|
628
|
-
const
|
|
628
|
+
const f = d.length ? we : Ue, v = u.length ? we : Ue;
|
|
629
629
|
return C([
|
|
630
630
|
"`",
|
|
631
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
631
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, C(i)] : Be([f, C(i)]),
|
|
632
632
|
v,
|
|
633
633
|
"`"
|
|
634
634
|
]);
|
|
635
|
-
},
|
|
636
|
-
[
|
|
635
|
+
}, vt = "embeddedProperties", ur = ["properties"], gr = S(vt), pr = {
|
|
636
|
+
[gr]: {
|
|
637
637
|
category: "Embed",
|
|
638
638
|
type: "string",
|
|
639
639
|
array: !0,
|
|
640
|
-
default: [{ value: [...
|
|
640
|
+
default: [{ value: [...ur] }],
|
|
641
641
|
description: 'Specify embedded Java Properties language identifiers. This requires "prettier-plugin-properties".'
|
|
642
642
|
}
|
|
643
|
-
},
|
|
643
|
+
}, mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
644
644
|
__proto__: null,
|
|
645
|
-
embedder:
|
|
646
|
-
language:
|
|
647
|
-
options:
|
|
648
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ce, group: W, indent: We, softline: Ge } =
|
|
649
|
-
|
|
645
|
+
embedder: lr,
|
|
646
|
+
language: vt,
|
|
647
|
+
options: pr
|
|
648
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ce, group: W, indent: We, softline: Ge } = D, fr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
649
|
+
A("@prettier/plugin-ruby", e, o), e = {
|
|
650
650
|
...e,
|
|
651
651
|
...s
|
|
652
652
|
};
|
|
653
|
-
const { node: l } = r, { createPlaceholder:
|
|
654
|
-
(m,
|
|
655
|
-
).join(""),
|
|
656
|
-
|
|
653
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
654
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
655
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
656
|
+
d.length,
|
|
657
657
|
-u.length || void 0
|
|
658
|
-
),
|
|
658
|
+
), E = x(r, n), b = await t(y, {
|
|
659
659
|
...e,
|
|
660
660
|
parser: e.embeddedRubyParser ?? "ruby"
|
|
661
|
-
}), i = T(
|
|
661
|
+
}), i = T(b, g, E);
|
|
662
662
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
663
663
|
return W([
|
|
664
664
|
"`",
|
|
665
|
-
|
|
665
|
+
d,
|
|
666
666
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [W(i)] : We([W(i)]),
|
|
667
667
|
u,
|
|
668
668
|
"`"
|
|
669
669
|
]);
|
|
670
|
-
const
|
|
670
|
+
const f = d.length ? Ce : Ge, v = u.length ? Ce : Ge;
|
|
671
671
|
return W([
|
|
672
672
|
"`",
|
|
673
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
673
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, W(i)] : We([f, W(i)]),
|
|
674
674
|
v,
|
|
675
675
|
"`"
|
|
676
676
|
]);
|
|
677
|
-
},
|
|
678
|
-
[
|
|
677
|
+
}, $t = "embeddedRuby", hr = ["ruby"], br = ["ruby", "rbs", "haml"], Er = "embeddedRubyParser", yr = S($t), _r = {
|
|
678
|
+
[yr]: {
|
|
679
679
|
category: "Embed",
|
|
680
680
|
type: "string",
|
|
681
681
|
array: !0,
|
|
682
|
-
default: [{ value: [...
|
|
682
|
+
default: [{ value: [...hr] }],
|
|
683
683
|
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
|
|
684
684
|
},
|
|
685
|
-
[
|
|
685
|
+
[Er]: {
|
|
686
686
|
category: "Embed",
|
|
687
687
|
type: "choice",
|
|
688
688
|
default: "ruby",
|
|
689
689
|
description: 'Specify the embedded Ruby language parser. Default is "ruby".',
|
|
690
|
-
choices:
|
|
690
|
+
choices: br.map((t) => ({
|
|
691
691
|
value: t,
|
|
692
692
|
description: `Use "${t}".`
|
|
693
693
|
}))
|
|
694
694
|
}
|
|
695
|
-
},
|
|
695
|
+
}, vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
696
696
|
__proto__: null,
|
|
697
|
-
embedder:
|
|
698
|
-
language:
|
|
699
|
-
options:
|
|
700
|
-
}, Symbol.toStringTag, { value: "Module" })), { hardline:
|
|
697
|
+
embedder: fr,
|
|
698
|
+
language: $t,
|
|
699
|
+
options: _r
|
|
700
|
+
}, Symbol.toStringTag, { value: "Module" })), { hardline: $r, group: G, line: qe, softline: ze, indent: Ke } = D, { mapDoc: Ir } = X, Dr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
701
701
|
e = {
|
|
702
702
|
...e,
|
|
703
703
|
...s
|
|
704
704
|
};
|
|
705
|
-
const { node: l } = r, { createPlaceholder:
|
|
706
|
-
(m,
|
|
707
|
-
).join(""),
|
|
708
|
-
|
|
705
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
706
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
707
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
708
|
+
d.length,
|
|
709
709
|
-u.length || void 0
|
|
710
|
-
),
|
|
710
|
+
), E = x(r, n), b = await t(y, {
|
|
711
711
|
...e,
|
|
712
712
|
parser: "sh"
|
|
713
|
-
}), i =
|
|
713
|
+
}), i = Ir(b, (m) => {
|
|
714
714
|
if (typeof m != "string")
|
|
715
715
|
return m;
|
|
716
|
-
const
|
|
717
|
-
for (let $ = 0; $ <
|
|
718
|
-
let _ =
|
|
716
|
+
const p = [], h = m.split(g);
|
|
717
|
+
for (let $ = 0; $ < h.length; $++) {
|
|
718
|
+
let _ = h[$];
|
|
719
719
|
if ($ % 2 == 0) {
|
|
720
720
|
if (!_)
|
|
721
721
|
continue;
|
|
722
|
-
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((
|
|
723
|
-
` ?
|
|
722
|
+
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((I) => I === `
|
|
723
|
+
` ? p.push($r) : p.push(I));
|
|
724
724
|
} else {
|
|
725
|
-
const
|
|
726
|
-
|
|
725
|
+
const I = Number(_);
|
|
726
|
+
p.push(E[I]);
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
|
-
return
|
|
729
|
+
return p;
|
|
730
730
|
});
|
|
731
731
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
732
732
|
return G([
|
|
733
733
|
"`",
|
|
734
|
-
|
|
734
|
+
d,
|
|
735
735
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [G(i)] : Ke([G(i)]),
|
|
736
736
|
u,
|
|
737
737
|
"`"
|
|
738
738
|
]);
|
|
739
|
-
const
|
|
739
|
+
const f = d.length ? qe : ze, v = u.length ? qe : ze;
|
|
740
740
|
return G([
|
|
741
741
|
"`",
|
|
742
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
742
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, G(i)] : Ke([f, G(i)]),
|
|
743
743
|
v,
|
|
744
744
|
"`"
|
|
745
745
|
]);
|
|
746
|
-
},
|
|
747
|
-
[
|
|
746
|
+
}, It = "embeddedSh", Sr = ["sh"], xr = S(It), Lr = {
|
|
747
|
+
[xr]: {
|
|
748
748
|
category: "Embed",
|
|
749
749
|
type: "string",
|
|
750
750
|
array: !0,
|
|
751
|
-
default: [{ value: [
|
|
751
|
+
default: [{ value: [...Sr] }],
|
|
752
752
|
description: "Specify embedded Shell language identifiers."
|
|
753
753
|
}
|
|
754
|
-
},
|
|
754
|
+
}, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
755
755
|
__proto__: null,
|
|
756
|
-
embedder:
|
|
757
|
-
language:
|
|
758
|
-
options:
|
|
756
|
+
embedder: Dr,
|
|
757
|
+
language: It,
|
|
758
|
+
options: Lr
|
|
759
759
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
760
760
|
function He(t, n) {
|
|
761
761
|
var r = Object.keys(t);
|
|
@@ -771,21 +771,21 @@ function Je(t) {
|
|
|
771
771
|
for (var n = 1; n < arguments.length; n++) {
|
|
772
772
|
var r = arguments[n] != null ? arguments[n] : {};
|
|
773
773
|
n % 2 ? He(Object(r), !0).forEach(function(e) {
|
|
774
|
-
|
|
774
|
+
Or(t, e, r[e]);
|
|
775
775
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : He(Object(r)).forEach(function(e) {
|
|
776
776
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
777
777
|
});
|
|
778
778
|
}
|
|
779
779
|
return t;
|
|
780
780
|
}
|
|
781
|
-
function
|
|
782
|
-
return n =
|
|
781
|
+
function Or(t, n, r) {
|
|
782
|
+
return n = Ar(n), n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
|
|
783
783
|
}
|
|
784
|
-
function
|
|
785
|
-
var n =
|
|
784
|
+
function Ar(t) {
|
|
785
|
+
var n = Pr(t, "string");
|
|
786
786
|
return typeof n == "symbol" ? n : String(n);
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function Pr(t, n) {
|
|
789
789
|
if (typeof t != "object" || t === null)
|
|
790
790
|
return t;
|
|
791
791
|
var r = t[Symbol.toPrimitive];
|
|
@@ -797,7 +797,7 @@ function Tr(t, n) {
|
|
|
797
797
|
}
|
|
798
798
|
return (n === "string" ? String : Number)(t);
|
|
799
799
|
}
|
|
800
|
-
const
|
|
800
|
+
const kr = Dt({});
|
|
801
801
|
function Dt(t) {
|
|
802
802
|
return n.withOptions = (r) => Dt(Je(Je({}, t), r)), n;
|
|
803
803
|
function n(r, ...e) {
|
|
@@ -805,73 +805,73 @@ function Dt(t) {
|
|
|
805
805
|
escapeSpecialCharacters: s = Array.isArray(r)
|
|
806
806
|
} = t;
|
|
807
807
|
let l = "";
|
|
808
|
-
for (let
|
|
809
|
-
let
|
|
810
|
-
s && (
|
|
808
|
+
for (let a = 0; a < o.length; a++) {
|
|
809
|
+
let d = o[a];
|
|
810
|
+
s && (d = d.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), l += d, a < e.length && (l += e[a]);
|
|
811
811
|
}
|
|
812
|
-
const
|
|
812
|
+
const c = l.split(`
|
|
813
813
|
`);
|
|
814
|
-
let
|
|
815
|
-
for (const
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
const u =
|
|
819
|
-
|
|
814
|
+
let g = null;
|
|
815
|
+
for (const a of c) {
|
|
816
|
+
const d = a.match(/^(\s+)\S+/);
|
|
817
|
+
if (d) {
|
|
818
|
+
const u = d[1].length;
|
|
819
|
+
g ? g = Math.min(g, u) : g = u;
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
if (
|
|
823
|
-
const
|
|
824
|
-
l =
|
|
822
|
+
if (g !== null) {
|
|
823
|
+
const a = g;
|
|
824
|
+
l = c.map((d) => d[0] === " " || d[0] === " " ? d.slice(a) : d).join(`
|
|
825
825
|
`);
|
|
826
826
|
}
|
|
827
827
|
return l.trim().replace(/\\n/g, `
|
|
828
828
|
`);
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
|
-
const { hardline:
|
|
831
|
+
const { hardline: Nr, group: q, line: Xe, softline: Ye, indent: Qe } = D, { mapDoc: Mr } = X, Rr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
832
832
|
e = {
|
|
833
833
|
...e,
|
|
834
834
|
...s
|
|
835
835
|
};
|
|
836
836
|
const l = e.embeddedSqlPlugin ?? "prettier-plugin-sql";
|
|
837
|
-
|
|
838
|
-
const { node:
|
|
839
|
-
(m,
|
|
840
|
-
).join(""), u =
|
|
837
|
+
A(l, e, o);
|
|
838
|
+
const { node: c } = r, { createPlaceholder: g, placeholderRegex: a } = L(), d = c.quasis.map(
|
|
839
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + g(p)
|
|
840
|
+
).join(""), u = d.match(/^\s+/)?.[0] ?? "", y = d.match(/\s+$/)?.[0] ?? "", E = d.slice(
|
|
841
841
|
u.length,
|
|
842
842
|
-y.length || void 0
|
|
843
|
-
),
|
|
843
|
+
), b = x(r, n);
|
|
844
844
|
let i;
|
|
845
845
|
if (l === "prettier-plugin-sql-cst") {
|
|
846
|
-
const m = await t(
|
|
846
|
+
const m = await t(E, {
|
|
847
847
|
...e,
|
|
848
848
|
parser: e.embeddedSqlParser ?? "sqlite"
|
|
849
849
|
});
|
|
850
|
-
i = T(m,
|
|
850
|
+
i = T(m, a, b);
|
|
851
851
|
} else {
|
|
852
|
-
const m = await t(
|
|
852
|
+
const m = await t(kr(E), {
|
|
853
853
|
...e,
|
|
854
854
|
parser: "sql"
|
|
855
855
|
});
|
|
856
|
-
i =
|
|
857
|
-
if (typeof
|
|
858
|
-
return
|
|
859
|
-
const
|
|
856
|
+
i = Mr(m, (p) => {
|
|
857
|
+
if (typeof p != "string")
|
|
858
|
+
return p;
|
|
859
|
+
const h = [], $ = p.split(a);
|
|
860
860
|
for (let _ = 0; _ < $.length; _++) {
|
|
861
|
-
let
|
|
861
|
+
let I = $[_];
|
|
862
862
|
if (_ % 2 == 0) {
|
|
863
|
-
if (!
|
|
863
|
+
if (!I)
|
|
864
864
|
continue;
|
|
865
|
-
|
|
865
|
+
I = I.replaceAll(/([\\`]|\${)/g, "\\$1"), I.split(/(\n)/).forEach(
|
|
866
866
|
(O) => O === `
|
|
867
|
-
` ?
|
|
867
|
+
` ? h.push(Nr) : h.push(O)
|
|
868
868
|
);
|
|
869
869
|
} else {
|
|
870
|
-
const O = Number(
|
|
871
|
-
|
|
870
|
+
const O = Number(I);
|
|
871
|
+
h.push(b[O]);
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
return
|
|
874
|
+
return h;
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
877
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
@@ -882,215 +882,215 @@ const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapD
|
|
|
882
882
|
y,
|
|
883
883
|
"`"
|
|
884
884
|
]);
|
|
885
|
-
const
|
|
885
|
+
const f = u.length ? Xe : Ye, v = y.length ? Xe : Ye;
|
|
886
886
|
return q([
|
|
887
887
|
"`",
|
|
888
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
888
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, q(i)] : Qe([f, q(i)]),
|
|
889
889
|
v,
|
|
890
890
|
"`"
|
|
891
891
|
]);
|
|
892
|
-
}, Z = "embeddedSql",
|
|
892
|
+
}, Z = "embeddedSql", Fr = ["sql"], jr = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], wr = [
|
|
893
893
|
"sqlite",
|
|
894
894
|
"bigquery",
|
|
895
895
|
"mysql",
|
|
896
896
|
"mariadb",
|
|
897
897
|
"postgresql"
|
|
898
|
-
],
|
|
899
|
-
[
|
|
898
|
+
], Br = S(Z), Ur = rn(Z), Cr = V(Z), Wr = {
|
|
899
|
+
[Br]: {
|
|
900
900
|
category: "Embed",
|
|
901
901
|
type: "string",
|
|
902
902
|
array: !0,
|
|
903
|
-
default: [{ value: [...
|
|
903
|
+
default: [{ value: [...Fr] }],
|
|
904
904
|
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql" or "prettier-plugin-sql-cst".'
|
|
905
905
|
},
|
|
906
|
-
[
|
|
906
|
+
[Ur]: {
|
|
907
907
|
category: "Embed",
|
|
908
908
|
type: "choice",
|
|
909
909
|
default: "prettier-plugin-sql",
|
|
910
910
|
description: 'Specify the Prettier plugin for parsing and formatting SQL. Default is "prettier-plugin-sql"',
|
|
911
|
-
choices:
|
|
911
|
+
choices: jr.map((t) => ({
|
|
912
912
|
value: t,
|
|
913
913
|
description: `Use "${t}".`
|
|
914
914
|
}))
|
|
915
915
|
},
|
|
916
|
-
[
|
|
916
|
+
[Cr]: {
|
|
917
917
|
category: "Embed",
|
|
918
918
|
type: "choice",
|
|
919
919
|
default: "sqlite",
|
|
920
920
|
description: 'Specify the embedded SQL language parser. Default is "sqlite". This option is only for "prettier-plugin-sql-cst".',
|
|
921
|
-
choices:
|
|
921
|
+
choices: wr.map((t) => ({
|
|
922
922
|
value: t,
|
|
923
923
|
description: `Use "${t}" parser.`
|
|
924
924
|
}))
|
|
925
925
|
}
|
|
926
|
-
},
|
|
926
|
+
}, Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
927
927
|
__proto__: null,
|
|
928
|
-
embedder:
|
|
928
|
+
embedder: Rr,
|
|
929
929
|
language: Z,
|
|
930
|
-
options:
|
|
931
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ve, group: z, indent: Ze, softline: et, hardline:
|
|
932
|
-
|
|
930
|
+
options: Wr
|
|
931
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ve, group: z, indent: Ze, softline: et, hardline: qr } = D, { mapDoc: zr } = X, Kr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
932
|
+
A("prettier-plugin-toml", e, o), e = {
|
|
933
933
|
...e,
|
|
934
934
|
...s
|
|
935
935
|
};
|
|
936
|
-
const { node: l } = r, { createPlaceholder:
|
|
937
|
-
(m,
|
|
938
|
-
).join(""),
|
|
939
|
-
|
|
936
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
937
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
938
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
939
|
+
d.length,
|
|
940
940
|
-u.length || void 0
|
|
941
|
-
),
|
|
941
|
+
), E = x(r, n), b = await t(y, {
|
|
942
942
|
...e,
|
|
943
943
|
parser: "toml"
|
|
944
|
-
}), i =
|
|
944
|
+
}), i = zr(b, (m) => {
|
|
945
945
|
if (typeof m != "string")
|
|
946
946
|
return m;
|
|
947
|
-
const
|
|
948
|
-
for (let $ = 0; $ <
|
|
949
|
-
let _ =
|
|
947
|
+
const p = [], h = m.split(g);
|
|
948
|
+
for (let $ = 0; $ < h.length; $++) {
|
|
949
|
+
let _ = h[$];
|
|
950
950
|
if ($ % 2 == 0) {
|
|
951
951
|
if (!_)
|
|
952
952
|
continue;
|
|
953
|
-
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((
|
|
954
|
-
` ?
|
|
953
|
+
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((I) => I === `
|
|
954
|
+
` ? p.push(qr) : p.push(I));
|
|
955
955
|
} else {
|
|
956
|
-
const
|
|
957
|
-
|
|
956
|
+
const I = Number(_);
|
|
957
|
+
p.push(E[I]);
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
return
|
|
960
|
+
return p;
|
|
961
961
|
});
|
|
962
962
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
963
963
|
return z([
|
|
964
964
|
"`",
|
|
965
|
-
|
|
965
|
+
d,
|
|
966
966
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [z(i)] : Ze([z(i)]),
|
|
967
967
|
u,
|
|
968
968
|
"`"
|
|
969
969
|
]);
|
|
970
|
-
const
|
|
970
|
+
const f = d.length ? Ve : et, v = u.length ? Ve : et;
|
|
971
971
|
return z([
|
|
972
972
|
"`",
|
|
973
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
973
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, z(i)] : Ze([f, z(i)]),
|
|
974
974
|
v,
|
|
975
975
|
"`"
|
|
976
976
|
]);
|
|
977
|
-
},
|
|
978
|
-
[
|
|
977
|
+
}, St = "embeddedToml", Hr = ["toml"], Jr = S(St), Xr = {
|
|
978
|
+
[Jr]: {
|
|
979
979
|
category: "Embed",
|
|
980
980
|
type: "string",
|
|
981
981
|
array: !0,
|
|
982
|
-
default: [{ value: [...
|
|
982
|
+
default: [{ value: [...Hr] }],
|
|
983
983
|
description: 'Specify embedded TOML language identifiers. This requires "prettier-plugin-toml".'
|
|
984
984
|
}
|
|
985
|
-
},
|
|
985
|
+
}, Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
986
986
|
__proto__: null,
|
|
987
|
-
embedder:
|
|
988
|
-
language:
|
|
989
|
-
options:
|
|
990
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: tt, group: K, indent: nt, softline: rt } =
|
|
987
|
+
embedder: Kr,
|
|
988
|
+
language: St,
|
|
989
|
+
options: Xr
|
|
990
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: tt, group: K, indent: nt, softline: rt } = D, Qr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
991
991
|
e = {
|
|
992
992
|
...e,
|
|
993
993
|
...s
|
|
994
994
|
};
|
|
995
|
-
const { node: l } = r, { createPlaceholder:
|
|
996
|
-
(m,
|
|
997
|
-
).join(""),
|
|
998
|
-
|
|
995
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
996
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
997
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
998
|
+
d.length,
|
|
999
999
|
-u.length || void 0
|
|
1000
|
-
),
|
|
1000
|
+
), E = x(r, n), b = await t(y, {
|
|
1001
1001
|
...e,
|
|
1002
1002
|
parser: e.embeddedTsParser ?? "typescript",
|
|
1003
1003
|
// set filepath to undefined to enable jsx auto detection:
|
|
1004
1004
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
1005
1005
|
filepath: void 0
|
|
1006
|
-
}), i = T(
|
|
1006
|
+
}), i = T(b, g, E);
|
|
1007
1007
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1008
1008
|
return K([
|
|
1009
1009
|
"`",
|
|
1010
|
-
|
|
1010
|
+
d,
|
|
1011
1011
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [K(i)] : nt([K(i)]),
|
|
1012
1012
|
u,
|
|
1013
1013
|
"`"
|
|
1014
1014
|
]);
|
|
1015
|
-
const
|
|
1015
|
+
const f = d.length ? tt : rt, v = u.length ? tt : rt;
|
|
1016
1016
|
return K([
|
|
1017
1017
|
"`",
|
|
1018
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
1018
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, K(i)] : nt([f, K(i)]),
|
|
1019
1019
|
v,
|
|
1020
1020
|
"`"
|
|
1021
1021
|
]);
|
|
1022
|
-
}, se = "embeddedTs",
|
|
1023
|
-
[
|
|
1022
|
+
}, se = "embeddedTs", Vr = ["ts", "tsx", "cts", "mts", "typescript"], Zr = ["typescript", "babel-ts"], eo = V(se), to = S(se), no = {
|
|
1023
|
+
[to]: {
|
|
1024
1024
|
category: "Embed",
|
|
1025
1025
|
type: "string",
|
|
1026
1026
|
array: !0,
|
|
1027
|
-
default: [{ value: [...
|
|
1027
|
+
default: [{ value: [...Vr] }],
|
|
1028
1028
|
description: "Specify embedded TS language parsers."
|
|
1029
1029
|
},
|
|
1030
|
-
[
|
|
1030
|
+
[eo]: {
|
|
1031
1031
|
category: "Embed",
|
|
1032
1032
|
type: "choice",
|
|
1033
1033
|
default: "typescript",
|
|
1034
1034
|
description: 'Specify the embedded TS language parser. Default is "typescript".',
|
|
1035
|
-
choices:
|
|
1035
|
+
choices: Zr.map((t) => ({
|
|
1036
1036
|
value: t,
|
|
1037
1037
|
description: `Use "${t}".`
|
|
1038
1038
|
}))
|
|
1039
1039
|
}
|
|
1040
|
-
},
|
|
1040
|
+
}, ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1041
1041
|
__proto__: null,
|
|
1042
|
-
embedder:
|
|
1042
|
+
embedder: Qr,
|
|
1043
1043
|
language: se,
|
|
1044
|
-
options:
|
|
1045
|
-
}, Symbol.toStringTag, { value: "Module" })), ie = "embeddedXml", { line: ot, group: H, indent: st, softline: ee } =
|
|
1046
|
-
|
|
1044
|
+
options: no
|
|
1045
|
+
}, Symbol.toStringTag, { value: "Module" })), ie = "embeddedXml", { line: ot, group: H, indent: st, softline: ee } = D, oo = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
1046
|
+
A("@prettier/plugin-xml", e, o), e = {
|
|
1047
1047
|
...e,
|
|
1048
1048
|
...s
|
|
1049
1049
|
};
|
|
1050
|
-
const { node: l } = r, { createPlaceholder:
|
|
1051
|
-
(
|
|
1052
|
-
).join(""),
|
|
1053
|
-
|
|
1050
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
1051
|
+
(p, h, { length: $ }) => h === $ - 1 ? p.value.cooked : p.value.cooked + c(h)
|
|
1052
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
1053
|
+
d.length,
|
|
1054
1054
|
-u.length || void 0
|
|
1055
|
-
),
|
|
1055
|
+
), E = x(r, n), b = [];
|
|
1056
1056
|
let i = 0;
|
|
1057
1057
|
for (; i !== void 0; ) {
|
|
1058
|
-
const
|
|
1059
|
-
if (
|
|
1058
|
+
const p = y.slice(i);
|
|
1059
|
+
if (p.length === 0)
|
|
1060
1060
|
break;
|
|
1061
|
-
i > 0 && e.xmlWhitespaceSensitivity !== "strict" &&
|
|
1061
|
+
i > 0 && e.xmlWhitespaceSensitivity !== "strict" && b.push(ee), e.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1062
1062
|
0,
|
|
1063
1063
|
e.__embeddedXmlFragmentRecoverIndex.length
|
|
1064
1064
|
);
|
|
1065
|
-
let
|
|
1065
|
+
let h = await t(p, {
|
|
1066
1066
|
...e,
|
|
1067
1067
|
parser: ie
|
|
1068
1068
|
});
|
|
1069
1069
|
const [$, _] = e.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1070
|
-
$ === void 0 ? i = void 0 : _ === void 0 ? i += $ : (
|
|
1070
|
+
$ === void 0 ? i = void 0 : _ === void 0 ? i += $ : (h = p.slice($, _ + 1), i += _ + 1), b.push(h);
|
|
1071
1071
|
}
|
|
1072
|
-
const
|
|
1072
|
+
const f = T(b, g, E);
|
|
1073
1073
|
if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1074
1074
|
return H([
|
|
1075
1075
|
"`",
|
|
1076
|
-
|
|
1077
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(
|
|
1076
|
+
d,
|
|
1077
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(f)] : st([H(f)]),
|
|
1078
1078
|
u,
|
|
1079
1079
|
"`"
|
|
1080
1080
|
]);
|
|
1081
|
-
const v =
|
|
1081
|
+
const v = d.length ? ot : ee, m = u.length ? ot : ee;
|
|
1082
1082
|
return H([
|
|
1083
1083
|
"`",
|
|
1084
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(
|
|
1084
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(f)] : st([v, H(f)]),
|
|
1085
1085
|
m,
|
|
1086
1086
|
"`"
|
|
1087
1087
|
]);
|
|
1088
|
-
},
|
|
1089
|
-
[
|
|
1088
|
+
}, so = ["xml", "opml", "rss", "svg"], io = S(ie), co = {
|
|
1089
|
+
[io]: {
|
|
1090
1090
|
category: "Embed",
|
|
1091
1091
|
type: "string",
|
|
1092
1092
|
array: !0,
|
|
1093
|
-
default: [{ value: [...
|
|
1093
|
+
default: [{ value: [...so] }],
|
|
1094
1094
|
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
|
|
1095
1095
|
},
|
|
1096
1096
|
/**
|
|
@@ -1104,7 +1104,7 @@ const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapD
|
|
|
1104
1104
|
description: "This option is read only and used as a workaround to support xml fragments"
|
|
1105
1105
|
}
|
|
1106
1106
|
};
|
|
1107
|
-
function
|
|
1107
|
+
function ao(t) {
|
|
1108
1108
|
const n = {
|
|
1109
1109
|
loc: {
|
|
1110
1110
|
start: {
|
|
@@ -1144,50 +1144,50 @@ function it(t) {
|
|
|
1144
1144
|
);
|
|
1145
1145
|
return Object.assign(r, n), r;
|
|
1146
1146
|
}
|
|
1147
|
-
const
|
|
1147
|
+
const lo = {
|
|
1148
1148
|
async parse(t, n) {
|
|
1149
1149
|
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors: o, cst: s } = r(t);
|
|
1150
1150
|
if (e.length > 0) {
|
|
1151
1151
|
const l = e[0];
|
|
1152
|
-
throw
|
|
1152
|
+
throw ao(l);
|
|
1153
1153
|
}
|
|
1154
1154
|
if (o.length > 0) {
|
|
1155
1155
|
let l = !1;
|
|
1156
|
-
for (const
|
|
1156
|
+
for (const c of o) {
|
|
1157
1157
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
1158
|
-
|
|
1158
|
+
c.name
|
|
1159
1159
|
))
|
|
1160
|
-
throw it(
|
|
1161
|
-
if (
|
|
1160
|
+
throw it(c);
|
|
1161
|
+
if (c.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1162
1162
|
l = !0;
|
|
1163
1163
|
continue;
|
|
1164
1164
|
}
|
|
1165
1165
|
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
|
|
1166
|
-
|
|
1167
|
-
) || /Redundant input, expecting EOF but found: /.test(
|
|
1166
|
+
c.message
|
|
1167
|
+
) || /Redundant input, expecting EOF but found: /.test(c.message)) {
|
|
1168
1168
|
n.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1169
1169
|
0,
|
|
1170
1170
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
1171
|
-
|
|
1171
|
+
c.token.startOffset
|
|
1172
1172
|
);
|
|
1173
1173
|
break;
|
|
1174
1174
|
}
|
|
1175
1175
|
if (/Expecting token of type --> OPEN <-- but found --> '[\s\S]+' <--/.test(
|
|
1176
|
-
|
|
1176
|
+
c.message
|
|
1177
1177
|
)) {
|
|
1178
|
-
if (
|
|
1178
|
+
if (c.token.endOffset === void 0 || Number.isNaN(c.token.endOffset))
|
|
1179
1179
|
break;
|
|
1180
1180
|
n.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1181
1181
|
0,
|
|
1182
1182
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
1183
|
-
|
|
1184
|
-
|
|
1183
|
+
c.token.startOffset,
|
|
1184
|
+
c.token.endOffset
|
|
1185
1185
|
), l = !0;
|
|
1186
1186
|
break;
|
|
1187
1187
|
}
|
|
1188
|
-
throw it(
|
|
1188
|
+
throw it(c);
|
|
1189
1189
|
}
|
|
1190
|
-
l &&
|
|
1190
|
+
l && xt(s);
|
|
1191
1191
|
}
|
|
1192
1192
|
return s;
|
|
1193
1193
|
},
|
|
@@ -1199,145 +1199,145 @@ const io = {
|
|
|
1199
1199
|
return t.location.endOffset ?? NaN;
|
|
1200
1200
|
}
|
|
1201
1201
|
};
|
|
1202
|
-
function
|
|
1202
|
+
function xt(t) {
|
|
1203
1203
|
const n = t.children;
|
|
1204
1204
|
for (const r in n) {
|
|
1205
1205
|
const e = n[r] ?? [];
|
|
1206
1206
|
for (let o = e.length - 1; o >= 0; --o) {
|
|
1207
1207
|
const s = e[o];
|
|
1208
|
-
if (
|
|
1208
|
+
if (uo(s)) {
|
|
1209
1209
|
if (Object.keys(s.children).length === 0) {
|
|
1210
1210
|
e.splice(o, 1), e.length === 0 && delete n[r];
|
|
1211
1211
|
continue;
|
|
1212
1212
|
}
|
|
1213
|
-
|
|
1213
|
+
xt(s);
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1218
|
+
function uo(t) {
|
|
1219
1219
|
return "name" in t && "children" in t && "location" in t;
|
|
1220
1220
|
}
|
|
1221
|
-
const
|
|
1221
|
+
const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1222
1222
|
__proto__: null,
|
|
1223
|
-
embedder:
|
|
1223
|
+
embedder: oo,
|
|
1224
1224
|
language: ie,
|
|
1225
|
-
options:
|
|
1226
|
-
parser:
|
|
1227
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: ct, group: J, indent: at, softline: dt } =
|
|
1225
|
+
options: co,
|
|
1226
|
+
parser: lo
|
|
1227
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ct, group: J, indent: at, softline: dt } = D, po = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
1228
1228
|
e = {
|
|
1229
1229
|
...e,
|
|
1230
1230
|
...s
|
|
1231
1231
|
};
|
|
1232
|
-
const { node: l } = r, { createPlaceholder:
|
|
1233
|
-
(m,
|
|
1234
|
-
).join(""),
|
|
1235
|
-
|
|
1232
|
+
const { node: l } = r, { createPlaceholder: c, placeholderRegex: g } = L(), a = l.quasis.map(
|
|
1233
|
+
(m, p, { length: h }) => p === h - 1 ? m.value.cooked : m.value.cooked + c(p)
|
|
1234
|
+
).join(""), d = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", y = a.slice(
|
|
1235
|
+
d.length,
|
|
1236
1236
|
-u.length || void 0
|
|
1237
|
-
),
|
|
1237
|
+
), E = x(r, n), b = await t(y, {
|
|
1238
1238
|
...e,
|
|
1239
1239
|
parser: "yaml"
|
|
1240
|
-
}), i = T(
|
|
1240
|
+
}), i = T(b, g, E);
|
|
1241
1241
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1242
1242
|
return J([
|
|
1243
1243
|
"`",
|
|
1244
|
-
|
|
1244
|
+
d,
|
|
1245
1245
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [J(i)] : at([J(i)]),
|
|
1246
1246
|
u,
|
|
1247
1247
|
"`"
|
|
1248
1248
|
]);
|
|
1249
|
-
const
|
|
1249
|
+
const f = d.length ? ct : dt, v = u.length ? ct : dt;
|
|
1250
1250
|
return J([
|
|
1251
1251
|
"`",
|
|
1252
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
1252
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, J(i)] : at([f, J(i)]),
|
|
1253
1253
|
v,
|
|
1254
1254
|
"`"
|
|
1255
1255
|
]);
|
|
1256
|
-
},
|
|
1257
|
-
[
|
|
1256
|
+
}, Lt = "embeddedYaml", mo = ["yaml", "yml"], fo = S(Lt), ho = {
|
|
1257
|
+
[fo]: {
|
|
1258
1258
|
category: "Embed",
|
|
1259
1259
|
type: "string",
|
|
1260
1260
|
array: !0,
|
|
1261
|
-
default: [{ value: [...
|
|
1261
|
+
default: [{ value: [...mo] }],
|
|
1262
1262
|
description: "Specify embedded YAML language identifiers."
|
|
1263
1263
|
}
|
|
1264
|
-
},
|
|
1264
|
+
}, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1265
1265
|
__proto__: null,
|
|
1266
|
-
embedder:
|
|
1267
|
-
language:
|
|
1268
|
-
options:
|
|
1269
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1270
|
-
"./css/index.ts":
|
|
1271
|
-
"./es/index.ts":
|
|
1272
|
-
"./glsl/index.ts":
|
|
1273
|
-
"./graphql/index.ts":
|
|
1274
|
-
"./html/index.ts":
|
|
1275
|
-
"./ini/index.ts":
|
|
1276
|
-
"./json/index.ts":
|
|
1277
|
-
"./latex/index.ts":
|
|
1278
|
-
"./markdown/index.ts":
|
|
1279
|
-
"./noop/index.ts":
|
|
1280
|
-
"./php/index.ts":
|
|
1281
|
-
"./properties/index.ts":
|
|
1282
|
-
"./ruby/index.ts":
|
|
1283
|
-
"./sh/index.ts":
|
|
1284
|
-
"./sql/index.ts":
|
|
1285
|
-
"./toml/index.ts":
|
|
1286
|
-
"./ts/index.ts":
|
|
1287
|
-
"./xml/index.ts":
|
|
1288
|
-
"./yaml/index.ts":
|
|
1266
|
+
embedder: po,
|
|
1267
|
+
language: Lt,
|
|
1268
|
+
options: ho
|
|
1269
|
+
}, Symbol.toStringTag, { value: "Module" })), Tt = [], Ot = {}, At = {}, Pt = {}, Eo = /* @__PURE__ */ Object.assign({
|
|
1270
|
+
"./css/index.ts": dn,
|
|
1271
|
+
"./es/index.ts": hn,
|
|
1272
|
+
"./glsl/index.ts": vn,
|
|
1273
|
+
"./graphql/index.ts": xn,
|
|
1274
|
+
"./html/index.ts": kn,
|
|
1275
|
+
"./ini/index.ts": jn,
|
|
1276
|
+
"./json/index.ts": zn,
|
|
1277
|
+
"./latex/index.ts": Yn,
|
|
1278
|
+
"./markdown/index.ts": tr,
|
|
1279
|
+
"./noop/index.ts": or,
|
|
1280
|
+
"./php/index.ts": dr,
|
|
1281
|
+
"./properties/index.ts": mr,
|
|
1282
|
+
"./ruby/index.ts": vr,
|
|
1283
|
+
"./sh/index.ts": Tr,
|
|
1284
|
+
"./sql/index.ts": Gr,
|
|
1285
|
+
"./toml/index.ts": Yr,
|
|
1286
|
+
"./ts/index.ts": ro,
|
|
1287
|
+
"./xml/index.ts": go,
|
|
1288
|
+
"./yaml/index.ts": bo
|
|
1289
1289
|
});
|
|
1290
|
-
Object.values(
|
|
1291
|
-
|
|
1290
|
+
Object.values(Eo).forEach(({ language: t, parser: n, embedder: r, options: e }) => {
|
|
1291
|
+
nn(Tt, t, oe), n && (Ot[t] = n), r && (At[t] = r), Object.assign(Pt, e);
|
|
1292
1292
|
});
|
|
1293
|
-
const
|
|
1294
|
-
...
|
|
1295
|
-
[
|
|
1293
|
+
const yo = "noEmbeddedIdentificationByComment", _o = "noEmbeddedIdentificationByTag", vo = "preserveEmbeddedExteriorWhitespaces", $o = "noEmbeddedMultiLineIndentation", Io = "embeddedOverrides", Vo = {
|
|
1294
|
+
...Pt,
|
|
1295
|
+
[yo]: {
|
|
1296
1296
|
category: "Embed",
|
|
1297
1297
|
type: "string",
|
|
1298
1298
|
array: !0,
|
|
1299
1299
|
default: [{ value: [] }],
|
|
1300
1300
|
description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
|
|
1301
1301
|
},
|
|
1302
|
-
[
|
|
1302
|
+
[_o]: {
|
|
1303
1303
|
category: "Embed",
|
|
1304
1304
|
type: "string",
|
|
1305
1305
|
array: !0,
|
|
1306
1306
|
default: [{ value: [] }],
|
|
1307
1307
|
description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
|
|
1308
1308
|
},
|
|
1309
|
-
[
|
|
1310
|
-
category: "
|
|
1309
|
+
[vo]: {
|
|
1310
|
+
category: "Embed",
|
|
1311
1311
|
type: "string",
|
|
1312
1312
|
array: !0,
|
|
1313
1313
|
default: [{ value: [] }],
|
|
1314
1314
|
description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
1315
1315
|
},
|
|
1316
|
-
[
|
|
1316
|
+
[$o]: {
|
|
1317
1317
|
category: "Embed",
|
|
1318
1318
|
type: "string",
|
|
1319
1319
|
array: !0,
|
|
1320
1320
|
default: [{ value: [] }],
|
|
1321
1321
|
description: "This option turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
|
|
1322
1322
|
},
|
|
1323
|
-
[
|
|
1323
|
+
[Io]: {
|
|
1324
1324
|
category: "Embed",
|
|
1325
1325
|
type: "string",
|
|
1326
1326
|
array: !1,
|
|
1327
1327
|
default: void 0,
|
|
1328
1328
|
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."
|
|
1329
1329
|
}
|
|
1330
|
-
},
|
|
1330
|
+
}, lt = {
|
|
1331
1331
|
// parsers from internal
|
|
1332
|
-
...Rt.parsers,
|
|
1333
|
-
...jt.parsers,
|
|
1334
|
-
...Ft.parsers,
|
|
1335
|
-
...Bt.parsers,
|
|
1336
1332
|
...wt.parsers,
|
|
1333
|
+
...Bt.parsers,
|
|
1334
|
+
...Ut.parsers,
|
|
1335
|
+
...Wt.parsers,
|
|
1336
|
+
...Ct.parsers,
|
|
1337
1337
|
// parsers from this plugin
|
|
1338
|
-
...
|
|
1338
|
+
...Ot
|
|
1339
1339
|
};
|
|
1340
|
-
var
|
|
1340
|
+
var Do = {
|
|
1341
1341
|
isEqual: !0,
|
|
1342
1342
|
isMatchingKey: !0,
|
|
1343
1343
|
isPromise: !0,
|
|
@@ -1346,24 +1346,24 @@ var vo = {
|
|
|
1346
1346
|
onCacheChange: !0,
|
|
1347
1347
|
onCacheHit: !0,
|
|
1348
1348
|
transformKey: !0
|
|
1349
|
-
},
|
|
1349
|
+
}, So = Array.prototype.slice;
|
|
1350
1350
|
function Q(t) {
|
|
1351
1351
|
var n = t.length;
|
|
1352
|
-
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] :
|
|
1352
|
+
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : So.call(t, 0) : [];
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function xo(t) {
|
|
1355
1355
|
var n = {};
|
|
1356
1356
|
for (var r in t)
|
|
1357
|
-
|
|
1357
|
+
Do[r] || (n[r] = t[r]);
|
|
1358
1358
|
return n;
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function Lo(t) {
|
|
1361
1361
|
return typeof t == "function" && t.isMemoized;
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function To(t, n) {
|
|
1364
1364
|
return t === n || t !== t && n !== n;
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function ut(t, n) {
|
|
1367
1367
|
var r = {};
|
|
1368
1368
|
for (var e in t)
|
|
1369
1369
|
r[e] = t[e];
|
|
@@ -1371,7 +1371,7 @@ function lt(t, n) {
|
|
|
1371
1371
|
r[e] = n[e];
|
|
1372
1372
|
return r;
|
|
1373
1373
|
}
|
|
1374
|
-
var
|
|
1374
|
+
var Oo = (
|
|
1375
1375
|
/** @class */
|
|
1376
1376
|
function() {
|
|
1377
1377
|
function t(n) {
|
|
@@ -1410,9 +1410,9 @@ var xo = (
|
|
|
1410
1410
|
if (e(s[0], n))
|
|
1411
1411
|
return 0;
|
|
1412
1412
|
if (o > 1) {
|
|
1413
|
-
for (var
|
|
1414
|
-
if (e(s[
|
|
1415
|
-
return
|
|
1413
|
+
for (var c = 1; c < l; c++)
|
|
1414
|
+
if (e(s[c], n))
|
|
1415
|
+
return c;
|
|
1416
1416
|
}
|
|
1417
1417
|
return -1;
|
|
1418
1418
|
}, t.prototype._getKeyIndexForMany = function(n) {
|
|
@@ -1421,19 +1421,19 @@ var xo = (
|
|
|
1421
1421
|
return -1;
|
|
1422
1422
|
if (o === 1)
|
|
1423
1423
|
return this._getKeyIndexForSingle(n);
|
|
1424
|
-
var s = n.length, l,
|
|
1424
|
+
var s = n.length, l, c;
|
|
1425
1425
|
if (s > 1) {
|
|
1426
|
-
for (var
|
|
1427
|
-
if (l = e[
|
|
1428
|
-
for (
|
|
1426
|
+
for (var g = 0; g < o; g++)
|
|
1427
|
+
if (l = e[g], l.length === s) {
|
|
1428
|
+
for (c = 0; c < s && r(l[c], n[c]); c++)
|
|
1429
1429
|
;
|
|
1430
|
-
if (
|
|
1431
|
-
return
|
|
1430
|
+
if (c === s)
|
|
1431
|
+
return g;
|
|
1432
1432
|
}
|
|
1433
1433
|
} else
|
|
1434
|
-
for (var
|
|
1435
|
-
if (l = e[
|
|
1436
|
-
return
|
|
1434
|
+
for (var g = 0; g < o; g++)
|
|
1435
|
+
if (l = e[g], l.length === s && r(l[0], n[0]))
|
|
1436
|
+
return g;
|
|
1437
1437
|
return -1;
|
|
1438
1438
|
}, t.prototype._getKeyIndexForSingle = function(n) {
|
|
1439
1439
|
var r = this.keys;
|
|
@@ -1451,63 +1451,63 @@ var xo = (
|
|
|
1451
1451
|
}
|
|
1452
1452
|
return s(e[0], n[0]) ? 0 : -1;
|
|
1453
1453
|
}, t.prototype.orderByLru = function(n, r, e) {
|
|
1454
|
-
for (var o = this.keys, s = this.values, l = o.length,
|
|
1455
|
-
o[
|
|
1454
|
+
for (var o = this.keys, s = this.values, l = o.length, c = e; c--; )
|
|
1455
|
+
o[c + 1] = o[c], s[c + 1] = s[c];
|
|
1456
1456
|
o[0] = n, s[0] = r;
|
|
1457
|
-
var
|
|
1458
|
-
l ===
|
|
1457
|
+
var g = this.options.maxSize;
|
|
1458
|
+
l === g && e === l ? (o.pop(), s.pop()) : e >= g && (o.length = s.length = g);
|
|
1459
1459
|
}, t.prototype.updateAsyncCache = function(n) {
|
|
1460
|
-
var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, l = this.keys[0],
|
|
1461
|
-
this.values[0] =
|
|
1462
|
-
return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n),
|
|
1463
|
-
}, function(
|
|
1464
|
-
var
|
|
1465
|
-
throw
|
|
1460
|
+
var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, l = this.keys[0], c = this.values[0];
|
|
1461
|
+
this.values[0] = c.then(function(g) {
|
|
1462
|
+
return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n), g;
|
|
1463
|
+
}, function(g) {
|
|
1464
|
+
var a = r.getKeyIndex(l);
|
|
1465
|
+
throw a !== -1 && (r.keys.splice(a, 1), r.values.splice(a, 1)), g;
|
|
1466
1466
|
});
|
|
1467
1467
|
}, t;
|
|
1468
1468
|
}()
|
|
1469
1469
|
);
|
|
1470
1470
|
function kt(t, n) {
|
|
1471
|
-
if (n === void 0 && (n = {}),
|
|
1472
|
-
return kt(t.fn,
|
|
1471
|
+
if (n === void 0 && (n = {}), Lo(t))
|
|
1472
|
+
return kt(t.fn, ut(t.options, n));
|
|
1473
1473
|
if (typeof t != "function")
|
|
1474
1474
|
throw new TypeError("You must pass a function to `memoize`.");
|
|
1475
|
-
var r = n.isEqual, e = r === void 0 ?
|
|
1475
|
+
var r = n.isEqual, e = r === void 0 ? To : r, o = n.isMatchingKey, s = n.isPromise, l = s === void 0 ? !1 : s, c = n.maxSize, g = c === void 0 ? 1 : c, a = n.onCacheAdd, d = n.onCacheChange, u = n.onCacheHit, y = n.transformKey, E = ut({
|
|
1476
1476
|
isEqual: e,
|
|
1477
1477
|
isMatchingKey: o,
|
|
1478
1478
|
isPromise: l,
|
|
1479
|
-
maxSize:
|
|
1480
|
-
onCacheAdd:
|
|
1481
|
-
onCacheChange:
|
|
1479
|
+
maxSize: g,
|
|
1480
|
+
onCacheAdd: a,
|
|
1481
|
+
onCacheChange: d,
|
|
1482
1482
|
onCacheHit: u,
|
|
1483
1483
|
transformKey: y
|
|
1484
|
-
},
|
|
1485
|
-
var
|
|
1486
|
-
v && (
|
|
1487
|
-
var O = i.length ?
|
|
1484
|
+
}, xo(n)), b = new Oo(E), i = b.keys, f = b.values, v = b.canTransformKey, m = b.shouldCloneArguments, p = b.shouldUpdateOnAdd, h = b.shouldUpdateOnChange, $ = b.shouldUpdateOnHit, _ = function() {
|
|
1485
|
+
var I = m ? Q(arguments) : arguments;
|
|
1486
|
+
v && (I = y(I));
|
|
1487
|
+
var O = i.length ? b.getKeyIndex(I) : -1;
|
|
1488
1488
|
if (O !== -1)
|
|
1489
|
-
$ && u(
|
|
1489
|
+
$ && u(b, E, _), O && (b.orderByLru(i[O], f[O], O), h && d(b, E, _));
|
|
1490
1490
|
else {
|
|
1491
|
-
var
|
|
1492
|
-
|
|
1491
|
+
var Ft = t.apply(this, arguments), jt = m ? I : Q(arguments);
|
|
1492
|
+
b.orderByLru(jt, Ft, i.length), l && b.updateAsyncCache(_), p && a(b, E, _), h && d(b, E, _);
|
|
1493
1493
|
}
|
|
1494
|
-
return
|
|
1494
|
+
return f[0];
|
|
1495
1495
|
};
|
|
1496
|
-
return _.cache =
|
|
1496
|
+
return _.cache = b, _.fn = t, _.isMemoized = !0, _.options = E, _;
|
|
1497
1497
|
}
|
|
1498
|
-
async function
|
|
1498
|
+
async function gt(t) {
|
|
1499
1499
|
try {
|
|
1500
|
-
const n = await
|
|
1500
|
+
const n = await qt(t, { encoding: "utf-8" });
|
|
1501
1501
|
return JSON.parse(n);
|
|
1502
1502
|
} catch {
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
|
-
const
|
|
1505
|
+
const Ao = /* @__PURE__ */ new URL(
|
|
1506
1506
|
"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);')
|
|
1507
1507
|
);
|
|
1508
|
-
async function
|
|
1508
|
+
async function Po(t) {
|
|
1509
1509
|
return new Promise((n) => {
|
|
1510
|
-
const r = new
|
|
1510
|
+
const r = new Xt(Ao, {
|
|
1511
1511
|
workerData: {
|
|
1512
1512
|
absolutePath: t
|
|
1513
1513
|
}
|
|
@@ -1519,44 +1519,44 @@ async function To(t) {
|
|
|
1519
1519
|
});
|
|
1520
1520
|
});
|
|
1521
1521
|
}
|
|
1522
|
-
async function
|
|
1522
|
+
async function ko(t) {
|
|
1523
1523
|
console.error(
|
|
1524
1524
|
"Ts module type embeddedOverrides has not been implemented yet."
|
|
1525
1525
|
);
|
|
1526
1526
|
}
|
|
1527
|
-
const
|
|
1527
|
+
const No = kt(
|
|
1528
1528
|
async (t, n) => {
|
|
1529
|
-
if (
|
|
1529
|
+
if (zt(t))
|
|
1530
1530
|
return t;
|
|
1531
|
-
const r = await
|
|
1531
|
+
const r = await Yt(n);
|
|
1532
1532
|
let e;
|
|
1533
|
-
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e =
|
|
1533
|
+
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = Kt(r), Ht(e, t);
|
|
1534
1534
|
}
|
|
1535
|
-
),
|
|
1536
|
-
const r =
|
|
1535
|
+
), Mo = async (t, n) => {
|
|
1536
|
+
const r = No(
|
|
1537
1537
|
t,
|
|
1538
1538
|
n
|
|
1539
|
-
), e =
|
|
1539
|
+
), e = Jt(t);
|
|
1540
1540
|
if (e === ".json") {
|
|
1541
|
-
const o = await r, s = await
|
|
1541
|
+
const o = await r, s = await gt(o);
|
|
1542
1542
|
if (s !== void 0)
|
|
1543
1543
|
return s;
|
|
1544
1544
|
console.error(`Failed to parse the json file: ${o}`);
|
|
1545
1545
|
return;
|
|
1546
1546
|
} else if (e === ".mjs" || e === ".cjs" || e === ".js") {
|
|
1547
|
-
const o = await r, s = await
|
|
1547
|
+
const o = await r, s = await Po(o);
|
|
1548
1548
|
if (s !== void 0)
|
|
1549
1549
|
return s;
|
|
1550
1550
|
console.error(`Failed to parse the js module file: ${o}`);
|
|
1551
1551
|
return;
|
|
1552
1552
|
} else if (e === ".mts" || e === ".cts" || e === ".ts") {
|
|
1553
|
-
const o = await r, s = await
|
|
1553
|
+
const o = await r, s = await ko();
|
|
1554
1554
|
if (s !== void 0)
|
|
1555
1555
|
return s;
|
|
1556
1556
|
console.error(`Failed to parse the ts module file: ${o}`);
|
|
1557
1557
|
return;
|
|
1558
1558
|
} else if (e === "") {
|
|
1559
|
-
const o = await r, s = await
|
|
1559
|
+
const o = await r, s = await gt(o);
|
|
1560
1560
|
if (s !== void 0)
|
|
1561
1561
|
return s;
|
|
1562
1562
|
}
|
|
@@ -1565,10 +1565,10 @@ const Mo = kt(
|
|
|
1565
1565
|
} catch {
|
|
1566
1566
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1567
1567
|
}
|
|
1568
|
-
},
|
|
1568
|
+
}, Ro = async (t, n, r) => {
|
|
1569
1569
|
if (t === void 0)
|
|
1570
1570
|
return;
|
|
1571
|
-
const e = await
|
|
1571
|
+
const e = await Mo(
|
|
1572
1572
|
t,
|
|
1573
1573
|
r
|
|
1574
1574
|
);
|
|
@@ -1581,91 +1581,146 @@ const Mo = kt(
|
|
|
1581
1581
|
console.error("Error parsing embedded override options.");
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
|
-
function
|
|
1584
|
+
function Fo({ node: t, parent: n }, r, e) {
|
|
1585
1585
|
if (r.length === 0 || t.type !== "TemplateLiteral")
|
|
1586
1586
|
return;
|
|
1587
1587
|
const o = t.comments ?? n?.comments;
|
|
1588
1588
|
if (!o)
|
|
1589
1589
|
return;
|
|
1590
1590
|
const s = o[o.length - 1];
|
|
1591
|
-
if (!
|
|
1591
|
+
if (![
|
|
1592
1592
|
"MultiLine",
|
|
1593
1593
|
// meriyah
|
|
1594
1594
|
"Block",
|
|
1595
1595
|
// typescript, acorn, espree, flow
|
|
1596
1596
|
"CommentBlock"
|
|
1597
1597
|
// babel, babel-flow, babel-ts
|
|
1598
|
-
].includes(s.type) || !s.leading)
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1598
|
+
].includes(s.type) || !s.leading)
|
|
1599
|
+
return;
|
|
1600
|
+
const l = e.noEmbeddedIdentificationByComment ?? [];
|
|
1601
|
+
for (const c of r)
|
|
1602
|
+
if (!l.includes(c) && ` ${c} ` === s.value)
|
|
1603
|
+
return c;
|
|
1603
1604
|
}
|
|
1604
|
-
function
|
|
1605
|
-
if (r.length
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1605
|
+
function jo({ node: t, parent: n }, r, e) {
|
|
1606
|
+
if (r.length === 0 || t.type !== "TemplateLiteral" || n?.type !== "TaggedTemplateExpression")
|
|
1607
|
+
return;
|
|
1608
|
+
e.parser;
|
|
1609
|
+
const o = e.parser in lt, s = e.noEmbeddedIdentificationByTag ?? [], l = /* @__PURE__ */ new Set([
|
|
1610
|
+
"start",
|
|
1611
|
+
"end",
|
|
1612
|
+
"loc",
|
|
1613
|
+
"range",
|
|
1614
|
+
"filename",
|
|
1615
|
+
"typeAnnotation",
|
|
1616
|
+
"decorators"
|
|
1617
|
+
]);
|
|
1618
|
+
for (const c of r)
|
|
1619
|
+
if (!s.includes(c))
|
|
1620
|
+
if (wo(c)) {
|
|
1621
|
+
if (n.tag.type === "Identifier" && n.tag.name === c)
|
|
1622
|
+
return c;
|
|
1623
|
+
} else {
|
|
1624
|
+
if (!o)
|
|
1625
|
+
return;
|
|
1626
|
+
let g;
|
|
1627
|
+
try {
|
|
1628
|
+
const d = lt[e.parser].parse(
|
|
1629
|
+
`${c}\`\``,
|
|
1630
|
+
e
|
|
1631
|
+
);
|
|
1632
|
+
if (d instanceof Promise)
|
|
1633
|
+
throw new TypeError(
|
|
1634
|
+
"Async parse function hasn't been supported yet."
|
|
1635
|
+
);
|
|
1636
|
+
g = d;
|
|
1637
|
+
} catch {
|
|
1638
|
+
continue;
|
|
1639
|
+
}
|
|
1640
|
+
if (g.type === "File" && (g = g.program), !(g.type === "Program" && g.body[0]?.type === "ExpressionStatement"))
|
|
1641
|
+
continue;
|
|
1642
|
+
const a = g.body[0]?.expression;
|
|
1643
|
+
if (a?.type !== "TaggedTemplateExpression")
|
|
1644
|
+
continue;
|
|
1645
|
+
if (n.tag, a.tag, Mt(n.tag, a.tag, l))
|
|
1646
|
+
return c;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
function wo(t) {
|
|
1650
|
+
return /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(t);
|
|
1610
1651
|
}
|
|
1611
|
-
|
|
1652
|
+
function Nt(t, n, r = /* @__PURE__ */ new Set()) {
|
|
1653
|
+
return Object.is(t, n) ? !0 : Array.isArray(t) ? Bo(t, n, r) : typeof t == "object" ? Mt(
|
|
1654
|
+
t,
|
|
1655
|
+
n,
|
|
1656
|
+
r
|
|
1657
|
+
) : !1;
|
|
1658
|
+
}
|
|
1659
|
+
function Bo(t, n, r = /* @__PURE__ */ new Set()) {
|
|
1660
|
+
const e = t.length;
|
|
1661
|
+
if (e != n.length)
|
|
1662
|
+
return !1;
|
|
1663
|
+
for (let o = 0; o < e; o++)
|
|
1664
|
+
if (!Nt(t[o], n[o], r))
|
|
1665
|
+
return !1;
|
|
1666
|
+
return !0;
|
|
1667
|
+
}
|
|
1668
|
+
function Mt(t, n, r = /* @__PURE__ */ new Set()) {
|
|
1669
|
+
for (const e of Object.keys(t))
|
|
1670
|
+
if (!r.has(e) && !(Object.prototype.hasOwnProperty.call(n, e) && Nt(t[e], n[e], r)))
|
|
1671
|
+
return !1;
|
|
1672
|
+
return !0;
|
|
1673
|
+
}
|
|
1674
|
+
const { estree: Rt } = Gt, Uo = function(t, n) {
|
|
1612
1675
|
const { node: r } = t;
|
|
1613
1676
|
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: e } }) => e === null))
|
|
1614
1677
|
return null;
|
|
1615
|
-
for (const e of
|
|
1678
|
+
for (const e of Tt) {
|
|
1616
1679
|
const o = n[S(e)];
|
|
1617
1680
|
if (!o)
|
|
1618
1681
|
continue;
|
|
1619
|
-
const s =
|
|
1620
|
-
t,
|
|
1621
|
-
o,
|
|
1622
|
-
n.noEmbeddedIdentificationByComment ?? []
|
|
1623
|
-
) ?? Po(
|
|
1624
|
-
t,
|
|
1625
|
-
o,
|
|
1626
|
-
n.noEmbeddedIdentificationByTag ?? []
|
|
1627
|
-
);
|
|
1682
|
+
const s = Fo(t, o, n) ?? jo(t, o, n);
|
|
1628
1683
|
if (s === void 0)
|
|
1629
1684
|
continue;
|
|
1630
|
-
const l =
|
|
1685
|
+
const l = At[e];
|
|
1631
1686
|
if (!l)
|
|
1632
1687
|
return null;
|
|
1633
|
-
const
|
|
1634
|
-
return
|
|
1635
|
-
const y = await
|
|
1688
|
+
const c = t.node;
|
|
1689
|
+
return c.quasis.length === 1 && c.quasis[0]?.value.raw.trim() === "" ? "``" : async (g, a, d, u) => {
|
|
1690
|
+
const y = await Ro(
|
|
1636
1691
|
u.embeddedOverrides,
|
|
1637
1692
|
s,
|
|
1638
1693
|
u.filepath
|
|
1639
1694
|
);
|
|
1640
1695
|
try {
|
|
1641
|
-
const
|
|
1696
|
+
const E = await l(g, a, d, u, {
|
|
1642
1697
|
identifier: s,
|
|
1643
1698
|
identifiers: o,
|
|
1644
1699
|
embeddedOverrideOptions: y
|
|
1645
1700
|
});
|
|
1646
|
-
return
|
|
1647
|
-
{ embed: !0, ...
|
|
1648
|
-
|
|
1701
|
+
return D.label(
|
|
1702
|
+
{ embed: !0, ...E.label },
|
|
1703
|
+
E
|
|
1649
1704
|
);
|
|
1650
|
-
} catch (
|
|
1651
|
-
throw console.error(
|
|
1705
|
+
} catch (E) {
|
|
1706
|
+
throw console.error(E), E;
|
|
1652
1707
|
}
|
|
1653
1708
|
};
|
|
1654
1709
|
}
|
|
1655
|
-
return
|
|
1656
|
-
},
|
|
1710
|
+
return Rt.embed?.(t, n) ?? null;
|
|
1711
|
+
}, Zo = {
|
|
1657
1712
|
estree: {
|
|
1658
|
-
...
|
|
1659
|
-
embed:
|
|
1713
|
+
...Rt,
|
|
1714
|
+
embed: Uo
|
|
1660
1715
|
}
|
|
1661
1716
|
};
|
|
1662
1717
|
export {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1718
|
+
At as embeddedEmbedders,
|
|
1719
|
+
Tt as embeddedLanguages,
|
|
1720
|
+
Pt as embeddedOptions,
|
|
1721
|
+
Ot as embeddedParsers,
|
|
1667
1722
|
S as makeIdentifiersOptionName,
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1723
|
+
Vo as options,
|
|
1724
|
+
lt as parsers,
|
|
1725
|
+
Zo as printers
|
|
1671
1726
|
};
|