prettier-plugin-embed 0.4.3 → 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/index.js +665 -607
- 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,311 +177,314 @@ 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
|
|
426
|
-
const t = Y(), n = Y(), r = (o) => `'0${t}${o}${n}'`, e = new RegExp(
|
|
425
|
+
function Bn() {
|
|
426
|
+
const t = Y(), n = Y(), r = (o) => `'0${t}${o}${n}'`, e = new RegExp(
|
|
427
|
+
`["']?0${t}(\\d+)${n}['"]?`,
|
|
428
|
+
"ig"
|
|
429
|
+
);
|
|
427
430
|
return {
|
|
428
431
|
createPlaceholder: r,
|
|
429
432
|
placeholderRegex: e
|
|
430
433
|
};
|
|
431
434
|
}
|
|
432
|
-
const re = "embeddedJson",
|
|
433
|
-
[
|
|
435
|
+
const re = "embeddedJson", Un = ["json", "jsonl"], Cn = ["json", "json5", "jsonc", "json-stringify"], Wn = V(re), Gn = S(re), qn = {
|
|
436
|
+
[Gn]: {
|
|
434
437
|
category: "Embed",
|
|
435
438
|
type: "string",
|
|
436
439
|
array: !0,
|
|
437
|
-
default: [{ value: [...
|
|
440
|
+
default: [{ value: [...Un] }],
|
|
438
441
|
description: "Specify embedded JSON language identifiers."
|
|
439
442
|
},
|
|
440
|
-
[
|
|
443
|
+
[Wn]: {
|
|
441
444
|
category: "Embed",
|
|
442
445
|
type: "choice",
|
|
443
446
|
default: "json",
|
|
444
447
|
description: 'Specify the embedded JSON language parser. Default is "json".',
|
|
445
|
-
choices:
|
|
448
|
+
choices: Cn.map((t) => ({
|
|
446
449
|
value: t,
|
|
447
450
|
description: `Use "${t}".`
|
|
448
451
|
}))
|
|
449
452
|
}
|
|
450
|
-
},
|
|
453
|
+
}, zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
451
454
|
__proto__: null,
|
|
452
|
-
embedder:
|
|
455
|
+
embedder: wn,
|
|
453
456
|
language: re,
|
|
454
|
-
options:
|
|
455
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Oe, group: w, indent:
|
|
456
|
-
|
|
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 = {
|
|
457
460
|
...e,
|
|
458
461
|
...s
|
|
459
462
|
};
|
|
460
|
-
const { node: l } = r, { createPlaceholder:
|
|
461
|
-
(m,
|
|
462
|
-
).join(""),
|
|
463
|
-
|
|
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,
|
|
464
467
|
-u.length || void 0
|
|
465
|
-
),
|
|
468
|
+
), E = x(r, n), b = await t(y, {
|
|
466
469
|
...e,
|
|
467
470
|
parser: "latex-parser"
|
|
468
|
-
}), i = T(
|
|
471
|
+
}), i = T(b, g, E);
|
|
469
472
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
470
473
|
return w([
|
|
471
474
|
"`",
|
|
472
|
-
|
|
473
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] :
|
|
475
|
+
d,
|
|
476
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] : Ae([w(i)]),
|
|
474
477
|
u,
|
|
475
478
|
"`"
|
|
476
479
|
]);
|
|
477
|
-
const
|
|
480
|
+
const f = d.length ? Oe : Pe, v = u.length ? Oe : Pe;
|
|
478
481
|
return w([
|
|
479
482
|
"`",
|
|
480
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
483
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, w(i)] : Ae([f, w(i)]),
|
|
481
484
|
v,
|
|
482
485
|
"`"
|
|
483
486
|
]);
|
|
484
|
-
}, Et = "embeddedLatex",
|
|
487
|
+
}, Et = "embeddedLatex", Hn = [
|
|
485
488
|
"latex",
|
|
486
489
|
"tex",
|
|
487
490
|
"aux",
|
|
@@ -490,269 +493,269 @@ const re = "embeddedJson", Fn = ["json", "jsonl"], wn = ["json", "json-stringify
|
|
|
490
493
|
"bib",
|
|
491
494
|
"toc",
|
|
492
495
|
"sty"
|
|
493
|
-
],
|
|
494
|
-
[
|
|
496
|
+
], Jn = S(Et), Xn = {
|
|
497
|
+
[Jn]: {
|
|
495
498
|
category: "Embed",
|
|
496
499
|
type: "string",
|
|
497
500
|
array: !0,
|
|
498
|
-
default: [{ value: [...
|
|
501
|
+
default: [{ value: [...Hn] }],
|
|
499
502
|
description: 'Specify embedded LaTeX language identifiers. This requires "prettier-plugin-latex".'
|
|
500
503
|
}
|
|
501
|
-
},
|
|
504
|
+
}, Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
502
505
|
__proto__: null,
|
|
503
|
-
embedder:
|
|
506
|
+
embedder: Kn,
|
|
504
507
|
language: Et,
|
|
505
|
-
options:
|
|
506
|
-
}, 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 }) => {
|
|
507
510
|
e = {
|
|
508
511
|
...e,
|
|
509
512
|
...s
|
|
510
513
|
};
|
|
511
|
-
const { node: l } = r, { createPlaceholder:
|
|
512
|
-
(m,
|
|
513
|
-
).join(""),
|
|
514
|
-
|
|
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,
|
|
515
518
|
-u.length || void 0
|
|
516
|
-
),
|
|
519
|
+
), E = x(r, n), b = await t(y, {
|
|
517
520
|
...e,
|
|
518
521
|
parser: "markdown",
|
|
519
522
|
__inJsTemplate: !0
|
|
520
|
-
}), i = T(
|
|
523
|
+
}), i = T(b, g, E);
|
|
521
524
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
522
525
|
return B([
|
|
523
526
|
"`",
|
|
524
|
-
|
|
525
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] :
|
|
527
|
+
d,
|
|
528
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] : Ne([B(i)]),
|
|
526
529
|
u,
|
|
527
530
|
"`"
|
|
528
531
|
]);
|
|
529
|
-
const
|
|
532
|
+
const f = d.length ? ke : Me, v = u.length ? ke : Me;
|
|
530
533
|
return B([
|
|
531
534
|
"`",
|
|
532
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
535
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, B(i)] : Ne([f, B(i)]),
|
|
533
536
|
v,
|
|
534
537
|
"`"
|
|
535
538
|
]);
|
|
536
|
-
},
|
|
537
|
-
[
|
|
539
|
+
}, yt = "embeddedMarkdown", Vn = ["md", "markdown"], Zn = S(yt), er = {
|
|
540
|
+
[Zn]: {
|
|
538
541
|
category: "Embed",
|
|
539
542
|
type: "string",
|
|
540
543
|
array: !0,
|
|
541
|
-
default: [{ value: [...
|
|
544
|
+
default: [{ value: [...Vn] }],
|
|
542
545
|
description: "Specify embedded Markdown language identifiers."
|
|
543
546
|
}
|
|
544
|
-
},
|
|
547
|
+
}, tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
545
548
|
__proto__: null,
|
|
546
|
-
embedder:
|
|
547
|
-
language:
|
|
548
|
-
options:
|
|
549
|
-
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop",
|
|
550
|
-
[
|
|
549
|
+
embedder: Qn,
|
|
550
|
+
language: yt,
|
|
551
|
+
options: er
|
|
552
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop", nr = S(oe), rr = {
|
|
553
|
+
[nr]: {
|
|
551
554
|
category: "Embed",
|
|
552
555
|
type: "string",
|
|
553
556
|
array: !0,
|
|
554
557
|
default: [{ value: [] }],
|
|
555
558
|
description: "Specify embedded language identifiers that will not be formatted."
|
|
556
559
|
}
|
|
557
|
-
},
|
|
560
|
+
}, or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
558
561
|
__proto__: null,
|
|
559
562
|
language: oe,
|
|
560
|
-
options:
|
|
561
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Re, group: U, indent:
|
|
562
|
-
|
|
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 = {
|
|
563
566
|
...e,
|
|
564
567
|
...s
|
|
565
568
|
};
|
|
566
|
-
const { node: l } = r, { createPlaceholder:
|
|
567
|
-
(m,
|
|
568
|
-
).join(""),
|
|
569
|
-
|
|
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,
|
|
570
573
|
-u.length || void 0
|
|
571
|
-
),
|
|
574
|
+
), E = x(r, n), b = await t(y, {
|
|
572
575
|
...e,
|
|
573
576
|
parser: "php"
|
|
574
|
-
}), i = T(
|
|
577
|
+
}), i = T(b, g, E);
|
|
575
578
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
576
579
|
return U([
|
|
577
580
|
"`",
|
|
578
|
-
|
|
579
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] :
|
|
581
|
+
d,
|
|
582
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] : Fe([U(i)]),
|
|
580
583
|
u,
|
|
581
584
|
"`"
|
|
582
585
|
]);
|
|
583
|
-
const
|
|
586
|
+
const f = d.length ? Re : je, v = u.length ? Re : je;
|
|
584
587
|
return U([
|
|
585
588
|
"`",
|
|
586
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
589
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, U(i)] : Fe([f, U(i)]),
|
|
587
590
|
v,
|
|
588
591
|
"`"
|
|
589
592
|
]);
|
|
590
|
-
},
|
|
591
|
-
[
|
|
593
|
+
}, _t = "embeddedPhp", ir = ["php", "php5"], cr = S(_t), ar = {
|
|
594
|
+
[cr]: {
|
|
592
595
|
category: "Embed",
|
|
593
596
|
type: "string",
|
|
594
597
|
array: !0,
|
|
595
|
-
default: [{ value: [...
|
|
598
|
+
default: [{ value: [...ir] }],
|
|
596
599
|
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
|
|
597
600
|
}
|
|
598
|
-
},
|
|
601
|
+
}, dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
599
602
|
__proto__: null,
|
|
600
|
-
embedder:
|
|
601
|
-
language:
|
|
602
|
-
options:
|
|
603
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: we, group: C, indent: Be, softline: Ue } =
|
|
604
|
-
|
|
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 = {
|
|
605
608
|
...e,
|
|
606
609
|
...s
|
|
607
610
|
};
|
|
608
|
-
const { node: l } = r, { createPlaceholder:
|
|
609
|
-
(m,
|
|
610
|
-
).join(""),
|
|
611
|
-
|
|
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,
|
|
612
615
|
-u.length || void 0
|
|
613
|
-
),
|
|
616
|
+
), E = x(r, n), b = await t(y, {
|
|
614
617
|
...e,
|
|
615
618
|
parser: "dot-properties"
|
|
616
|
-
}), i = T(
|
|
619
|
+
}), i = T(b, g, E);
|
|
617
620
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
618
621
|
return C([
|
|
619
622
|
"`",
|
|
620
|
-
|
|
623
|
+
d,
|
|
621
624
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [C(i)] : Be([C(i)]),
|
|
622
625
|
u,
|
|
623
626
|
"`"
|
|
624
627
|
]);
|
|
625
|
-
const
|
|
628
|
+
const f = d.length ? we : Ue, v = u.length ? we : Ue;
|
|
626
629
|
return C([
|
|
627
630
|
"`",
|
|
628
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
631
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, C(i)] : Be([f, C(i)]),
|
|
629
632
|
v,
|
|
630
633
|
"`"
|
|
631
634
|
]);
|
|
632
|
-
},
|
|
633
|
-
[
|
|
635
|
+
}, vt = "embeddedProperties", ur = ["properties"], gr = S(vt), pr = {
|
|
636
|
+
[gr]: {
|
|
634
637
|
category: "Embed",
|
|
635
638
|
type: "string",
|
|
636
639
|
array: !0,
|
|
637
|
-
default: [{ value: [...
|
|
640
|
+
default: [{ value: [...ur] }],
|
|
638
641
|
description: 'Specify embedded Java Properties language identifiers. This requires "prettier-plugin-properties".'
|
|
639
642
|
}
|
|
640
|
-
},
|
|
643
|
+
}, mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
641
644
|
__proto__: null,
|
|
642
|
-
embedder:
|
|
643
|
-
language:
|
|
644
|
-
options:
|
|
645
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ce, group: W, indent: We, softline: Ge } =
|
|
646
|
-
|
|
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 = {
|
|
647
650
|
...e,
|
|
648
651
|
...s
|
|
649
652
|
};
|
|
650
|
-
const { node: l } = r, { createPlaceholder:
|
|
651
|
-
(m,
|
|
652
|
-
).join(""),
|
|
653
|
-
|
|
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,
|
|
654
657
|
-u.length || void 0
|
|
655
|
-
),
|
|
658
|
+
), E = x(r, n), b = await t(y, {
|
|
656
659
|
...e,
|
|
657
660
|
parser: e.embeddedRubyParser ?? "ruby"
|
|
658
|
-
}), i = T(
|
|
661
|
+
}), i = T(b, g, E);
|
|
659
662
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
660
663
|
return W([
|
|
661
664
|
"`",
|
|
662
|
-
|
|
665
|
+
d,
|
|
663
666
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [W(i)] : We([W(i)]),
|
|
664
667
|
u,
|
|
665
668
|
"`"
|
|
666
669
|
]);
|
|
667
|
-
const
|
|
670
|
+
const f = d.length ? Ce : Ge, v = u.length ? Ce : Ge;
|
|
668
671
|
return W([
|
|
669
672
|
"`",
|
|
670
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
673
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, W(i)] : We([f, W(i)]),
|
|
671
674
|
v,
|
|
672
675
|
"`"
|
|
673
676
|
]);
|
|
674
|
-
},
|
|
675
|
-
[
|
|
677
|
+
}, $t = "embeddedRuby", hr = ["ruby"], br = ["ruby", "rbs", "haml"], Er = "embeddedRubyParser", yr = S($t), _r = {
|
|
678
|
+
[yr]: {
|
|
676
679
|
category: "Embed",
|
|
677
680
|
type: "string",
|
|
678
681
|
array: !0,
|
|
679
|
-
default: [{ value: [...
|
|
682
|
+
default: [{ value: [...hr] }],
|
|
680
683
|
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
|
|
681
684
|
},
|
|
682
|
-
[
|
|
685
|
+
[Er]: {
|
|
683
686
|
category: "Embed",
|
|
684
687
|
type: "choice",
|
|
685
688
|
default: "ruby",
|
|
686
689
|
description: 'Specify the embedded Ruby language parser. Default is "ruby".',
|
|
687
|
-
choices:
|
|
690
|
+
choices: br.map((t) => ({
|
|
688
691
|
value: t,
|
|
689
692
|
description: `Use "${t}".`
|
|
690
693
|
}))
|
|
691
694
|
}
|
|
692
|
-
},
|
|
695
|
+
}, vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
693
696
|
__proto__: null,
|
|
694
|
-
embedder:
|
|
695
|
-
language:
|
|
696
|
-
options:
|
|
697
|
-
}, 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 }) => {
|
|
698
701
|
e = {
|
|
699
702
|
...e,
|
|
700
703
|
...s
|
|
701
704
|
};
|
|
702
|
-
const { node: l } = r, { createPlaceholder:
|
|
703
|
-
(m,
|
|
704
|
-
).join(""),
|
|
705
|
-
|
|
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,
|
|
706
709
|
-u.length || void 0
|
|
707
|
-
),
|
|
710
|
+
), E = x(r, n), b = await t(y, {
|
|
708
711
|
...e,
|
|
709
712
|
parser: "sh"
|
|
710
|
-
}), i =
|
|
713
|
+
}), i = Ir(b, (m) => {
|
|
711
714
|
if (typeof m != "string")
|
|
712
715
|
return m;
|
|
713
|
-
const
|
|
714
|
-
for (let $ = 0; $ <
|
|
715
|
-
let _ =
|
|
716
|
+
const p = [], h = m.split(g);
|
|
717
|
+
for (let $ = 0; $ < h.length; $++) {
|
|
718
|
+
let _ = h[$];
|
|
716
719
|
if ($ % 2 == 0) {
|
|
717
720
|
if (!_)
|
|
718
721
|
continue;
|
|
719
|
-
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((
|
|
720
|
-
` ?
|
|
722
|
+
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((I) => I === `
|
|
723
|
+
` ? p.push($r) : p.push(I));
|
|
721
724
|
} else {
|
|
722
|
-
const
|
|
723
|
-
|
|
725
|
+
const I = Number(_);
|
|
726
|
+
p.push(E[I]);
|
|
724
727
|
}
|
|
725
728
|
}
|
|
726
|
-
return
|
|
729
|
+
return p;
|
|
727
730
|
});
|
|
728
731
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
729
732
|
return G([
|
|
730
733
|
"`",
|
|
731
|
-
|
|
734
|
+
d,
|
|
732
735
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [G(i)] : Ke([G(i)]),
|
|
733
736
|
u,
|
|
734
737
|
"`"
|
|
735
738
|
]);
|
|
736
|
-
const
|
|
739
|
+
const f = d.length ? qe : ze, v = u.length ? qe : ze;
|
|
737
740
|
return G([
|
|
738
741
|
"`",
|
|
739
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
742
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, G(i)] : Ke([f, G(i)]),
|
|
740
743
|
v,
|
|
741
744
|
"`"
|
|
742
745
|
]);
|
|
743
|
-
},
|
|
744
|
-
[
|
|
746
|
+
}, It = "embeddedSh", Sr = ["sh"], xr = S(It), Lr = {
|
|
747
|
+
[xr]: {
|
|
745
748
|
category: "Embed",
|
|
746
749
|
type: "string",
|
|
747
750
|
array: !0,
|
|
748
|
-
default: [{ value: [
|
|
751
|
+
default: [{ value: [...Sr] }],
|
|
749
752
|
description: "Specify embedded Shell language identifiers."
|
|
750
753
|
}
|
|
751
|
-
},
|
|
754
|
+
}, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
752
755
|
__proto__: null,
|
|
753
|
-
embedder:
|
|
754
|
-
language:
|
|
755
|
-
options:
|
|
756
|
+
embedder: Dr,
|
|
757
|
+
language: It,
|
|
758
|
+
options: Lr
|
|
756
759
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
757
760
|
function He(t, n) {
|
|
758
761
|
var r = Object.keys(t);
|
|
@@ -768,21 +771,21 @@ function Je(t) {
|
|
|
768
771
|
for (var n = 1; n < arguments.length; n++) {
|
|
769
772
|
var r = arguments[n] != null ? arguments[n] : {};
|
|
770
773
|
n % 2 ? He(Object(r), !0).forEach(function(e) {
|
|
771
|
-
|
|
774
|
+
Or(t, e, r[e]);
|
|
772
775
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : He(Object(r)).forEach(function(e) {
|
|
773
776
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
774
777
|
});
|
|
775
778
|
}
|
|
776
779
|
return t;
|
|
777
780
|
}
|
|
778
|
-
function
|
|
779
|
-
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;
|
|
780
783
|
}
|
|
781
|
-
function
|
|
782
|
-
var n =
|
|
784
|
+
function Ar(t) {
|
|
785
|
+
var n = Pr(t, "string");
|
|
783
786
|
return typeof n == "symbol" ? n : String(n);
|
|
784
787
|
}
|
|
785
|
-
function
|
|
788
|
+
function Pr(t, n) {
|
|
786
789
|
if (typeof t != "object" || t === null)
|
|
787
790
|
return t;
|
|
788
791
|
var r = t[Symbol.toPrimitive];
|
|
@@ -794,7 +797,7 @@ function Tr(t, n) {
|
|
|
794
797
|
}
|
|
795
798
|
return (n === "string" ? String : Number)(t);
|
|
796
799
|
}
|
|
797
|
-
const
|
|
800
|
+
const kr = Dt({});
|
|
798
801
|
function Dt(t) {
|
|
799
802
|
return n.withOptions = (r) => Dt(Je(Je({}, t), r)), n;
|
|
800
803
|
function n(r, ...e) {
|
|
@@ -802,73 +805,73 @@ function Dt(t) {
|
|
|
802
805
|
escapeSpecialCharacters: s = Array.isArray(r)
|
|
803
806
|
} = t;
|
|
804
807
|
let l = "";
|
|
805
|
-
for (let
|
|
806
|
-
let
|
|
807
|
-
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]);
|
|
808
811
|
}
|
|
809
|
-
const
|
|
812
|
+
const c = l.split(`
|
|
810
813
|
`);
|
|
811
|
-
let
|
|
812
|
-
for (const
|
|
813
|
-
const
|
|
814
|
-
if (
|
|
815
|
-
const u =
|
|
816
|
-
|
|
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;
|
|
817
820
|
}
|
|
818
821
|
}
|
|
819
|
-
if (
|
|
820
|
-
const
|
|
821
|
-
l =
|
|
822
|
+
if (g !== null) {
|
|
823
|
+
const a = g;
|
|
824
|
+
l = c.map((d) => d[0] === " " || d[0] === " " ? d.slice(a) : d).join(`
|
|
822
825
|
`);
|
|
823
826
|
}
|
|
824
827
|
return l.trim().replace(/\\n/g, `
|
|
825
828
|
`);
|
|
826
829
|
}
|
|
827
830
|
}
|
|
828
|
-
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 }) => {
|
|
829
832
|
e = {
|
|
830
833
|
...e,
|
|
831
834
|
...s
|
|
832
835
|
};
|
|
833
836
|
const l = e.embeddedSqlPlugin ?? "prettier-plugin-sql";
|
|
834
|
-
|
|
835
|
-
const { node:
|
|
836
|
-
(m,
|
|
837
|
-
).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(
|
|
838
841
|
u.length,
|
|
839
842
|
-y.length || void 0
|
|
840
|
-
),
|
|
843
|
+
), b = x(r, n);
|
|
841
844
|
let i;
|
|
842
845
|
if (l === "prettier-plugin-sql-cst") {
|
|
843
|
-
const m = await t(
|
|
846
|
+
const m = await t(E, {
|
|
844
847
|
...e,
|
|
845
848
|
parser: e.embeddedSqlParser ?? "sqlite"
|
|
846
849
|
});
|
|
847
|
-
i = T(m,
|
|
850
|
+
i = T(m, a, b);
|
|
848
851
|
} else {
|
|
849
|
-
const m = await t(
|
|
852
|
+
const m = await t(kr(E), {
|
|
850
853
|
...e,
|
|
851
854
|
parser: "sql"
|
|
852
855
|
});
|
|
853
|
-
i =
|
|
854
|
-
if (typeof
|
|
855
|
-
return
|
|
856
|
-
const
|
|
856
|
+
i = Mr(m, (p) => {
|
|
857
|
+
if (typeof p != "string")
|
|
858
|
+
return p;
|
|
859
|
+
const h = [], $ = p.split(a);
|
|
857
860
|
for (let _ = 0; _ < $.length; _++) {
|
|
858
|
-
let
|
|
861
|
+
let I = $[_];
|
|
859
862
|
if (_ % 2 == 0) {
|
|
860
|
-
if (!
|
|
863
|
+
if (!I)
|
|
861
864
|
continue;
|
|
862
|
-
|
|
865
|
+
I = I.replaceAll(/([\\`]|\${)/g, "\\$1"), I.split(/(\n)/).forEach(
|
|
863
866
|
(O) => O === `
|
|
864
|
-
` ?
|
|
867
|
+
` ? h.push(Nr) : h.push(O)
|
|
865
868
|
);
|
|
866
869
|
} else {
|
|
867
|
-
const O = Number(
|
|
868
|
-
|
|
870
|
+
const O = Number(I);
|
|
871
|
+
h.push(b[O]);
|
|
869
872
|
}
|
|
870
873
|
}
|
|
871
|
-
return
|
|
874
|
+
return h;
|
|
872
875
|
});
|
|
873
876
|
}
|
|
874
877
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
@@ -879,215 +882,215 @@ const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapD
|
|
|
879
882
|
y,
|
|
880
883
|
"`"
|
|
881
884
|
]);
|
|
882
|
-
const
|
|
885
|
+
const f = u.length ? Xe : Ye, v = y.length ? Xe : Ye;
|
|
883
886
|
return q([
|
|
884
887
|
"`",
|
|
885
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
888
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, q(i)] : Qe([f, q(i)]),
|
|
886
889
|
v,
|
|
887
890
|
"`"
|
|
888
891
|
]);
|
|
889
|
-
}, Z = "embeddedSql",
|
|
892
|
+
}, Z = "embeddedSql", Fr = ["sql"], jr = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], wr = [
|
|
890
893
|
"sqlite",
|
|
891
894
|
"bigquery",
|
|
892
895
|
"mysql",
|
|
893
896
|
"mariadb",
|
|
894
897
|
"postgresql"
|
|
895
|
-
],
|
|
896
|
-
[
|
|
898
|
+
], Br = S(Z), Ur = rn(Z), Cr = V(Z), Wr = {
|
|
899
|
+
[Br]: {
|
|
897
900
|
category: "Embed",
|
|
898
901
|
type: "string",
|
|
899
902
|
array: !0,
|
|
900
|
-
default: [{ value: [...
|
|
903
|
+
default: [{ value: [...Fr] }],
|
|
901
904
|
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql" or "prettier-plugin-sql-cst".'
|
|
902
905
|
},
|
|
903
|
-
[
|
|
906
|
+
[Ur]: {
|
|
904
907
|
category: "Embed",
|
|
905
908
|
type: "choice",
|
|
906
909
|
default: "prettier-plugin-sql",
|
|
907
910
|
description: 'Specify the Prettier plugin for parsing and formatting SQL. Default is "prettier-plugin-sql"',
|
|
908
|
-
choices:
|
|
911
|
+
choices: jr.map((t) => ({
|
|
909
912
|
value: t,
|
|
910
913
|
description: `Use "${t}".`
|
|
911
914
|
}))
|
|
912
915
|
},
|
|
913
|
-
[
|
|
916
|
+
[Cr]: {
|
|
914
917
|
category: "Embed",
|
|
915
918
|
type: "choice",
|
|
916
919
|
default: "sqlite",
|
|
917
920
|
description: 'Specify the embedded SQL language parser. Default is "sqlite". This option is only for "prettier-plugin-sql-cst".',
|
|
918
|
-
choices:
|
|
921
|
+
choices: wr.map((t) => ({
|
|
919
922
|
value: t,
|
|
920
923
|
description: `Use "${t}" parser.`
|
|
921
924
|
}))
|
|
922
925
|
}
|
|
923
|
-
},
|
|
926
|
+
}, Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
924
927
|
__proto__: null,
|
|
925
|
-
embedder:
|
|
928
|
+
embedder: Rr,
|
|
926
929
|
language: Z,
|
|
927
|
-
options:
|
|
928
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ve, group: z, indent: Ze, softline: et, hardline:
|
|
929
|
-
|
|
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 = {
|
|
930
933
|
...e,
|
|
931
934
|
...s
|
|
932
935
|
};
|
|
933
|
-
const { node: l } = r, { createPlaceholder:
|
|
934
|
-
(m,
|
|
935
|
-
).join(""),
|
|
936
|
-
|
|
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,
|
|
937
940
|
-u.length || void 0
|
|
938
|
-
),
|
|
941
|
+
), E = x(r, n), b = await t(y, {
|
|
939
942
|
...e,
|
|
940
943
|
parser: "toml"
|
|
941
|
-
}), i =
|
|
944
|
+
}), i = zr(b, (m) => {
|
|
942
945
|
if (typeof m != "string")
|
|
943
946
|
return m;
|
|
944
|
-
const
|
|
945
|
-
for (let $ = 0; $ <
|
|
946
|
-
let _ =
|
|
947
|
+
const p = [], h = m.split(g);
|
|
948
|
+
for (let $ = 0; $ < h.length; $++) {
|
|
949
|
+
let _ = h[$];
|
|
947
950
|
if ($ % 2 == 0) {
|
|
948
951
|
if (!_)
|
|
949
952
|
continue;
|
|
950
|
-
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((
|
|
951
|
-
` ?
|
|
953
|
+
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((I) => I === `
|
|
954
|
+
` ? p.push(qr) : p.push(I));
|
|
952
955
|
} else {
|
|
953
|
-
const
|
|
954
|
-
|
|
956
|
+
const I = Number(_);
|
|
957
|
+
p.push(E[I]);
|
|
955
958
|
}
|
|
956
959
|
}
|
|
957
|
-
return
|
|
960
|
+
return p;
|
|
958
961
|
});
|
|
959
962
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
960
963
|
return z([
|
|
961
964
|
"`",
|
|
962
|
-
|
|
965
|
+
d,
|
|
963
966
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [z(i)] : Ze([z(i)]),
|
|
964
967
|
u,
|
|
965
968
|
"`"
|
|
966
969
|
]);
|
|
967
|
-
const
|
|
970
|
+
const f = d.length ? Ve : et, v = u.length ? Ve : et;
|
|
968
971
|
return z([
|
|
969
972
|
"`",
|
|
970
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
973
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, z(i)] : Ze([f, z(i)]),
|
|
971
974
|
v,
|
|
972
975
|
"`"
|
|
973
976
|
]);
|
|
974
|
-
},
|
|
975
|
-
[
|
|
977
|
+
}, St = "embeddedToml", Hr = ["toml"], Jr = S(St), Xr = {
|
|
978
|
+
[Jr]: {
|
|
976
979
|
category: "Embed",
|
|
977
980
|
type: "string",
|
|
978
981
|
array: !0,
|
|
979
|
-
default: [{ value: [...
|
|
982
|
+
default: [{ value: [...Hr] }],
|
|
980
983
|
description: 'Specify embedded TOML language identifiers. This requires "prettier-plugin-toml".'
|
|
981
984
|
}
|
|
982
|
-
},
|
|
985
|
+
}, Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
983
986
|
__proto__: null,
|
|
984
|
-
embedder:
|
|
985
|
-
language:
|
|
986
|
-
options:
|
|
987
|
-
}, 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 }) => {
|
|
988
991
|
e = {
|
|
989
992
|
...e,
|
|
990
993
|
...s
|
|
991
994
|
};
|
|
992
|
-
const { node: l } = r, { createPlaceholder:
|
|
993
|
-
(m,
|
|
994
|
-
).join(""),
|
|
995
|
-
|
|
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,
|
|
996
999
|
-u.length || void 0
|
|
997
|
-
),
|
|
1000
|
+
), E = x(r, n), b = await t(y, {
|
|
998
1001
|
...e,
|
|
999
1002
|
parser: e.embeddedTsParser ?? "typescript",
|
|
1000
1003
|
// set filepath to undefined to enable jsx auto detection:
|
|
1001
1004
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
1002
1005
|
filepath: void 0
|
|
1003
|
-
}), i = T(
|
|
1006
|
+
}), i = T(b, g, E);
|
|
1004
1007
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1005
1008
|
return K([
|
|
1006
1009
|
"`",
|
|
1007
|
-
|
|
1010
|
+
d,
|
|
1008
1011
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [K(i)] : nt([K(i)]),
|
|
1009
1012
|
u,
|
|
1010
1013
|
"`"
|
|
1011
1014
|
]);
|
|
1012
|
-
const
|
|
1015
|
+
const f = d.length ? tt : rt, v = u.length ? tt : rt;
|
|
1013
1016
|
return K([
|
|
1014
1017
|
"`",
|
|
1015
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
1018
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, K(i)] : nt([f, K(i)]),
|
|
1016
1019
|
v,
|
|
1017
1020
|
"`"
|
|
1018
1021
|
]);
|
|
1019
|
-
}, se = "embeddedTs",
|
|
1020
|
-
[
|
|
1022
|
+
}, se = "embeddedTs", Vr = ["ts", "tsx", "cts", "mts", "typescript"], Zr = ["typescript", "babel-ts"], eo = V(se), to = S(se), no = {
|
|
1023
|
+
[to]: {
|
|
1021
1024
|
category: "Embed",
|
|
1022
1025
|
type: "string",
|
|
1023
1026
|
array: !0,
|
|
1024
|
-
default: [{ value: [...
|
|
1027
|
+
default: [{ value: [...Vr] }],
|
|
1025
1028
|
description: "Specify embedded TS language parsers."
|
|
1026
1029
|
},
|
|
1027
|
-
[
|
|
1030
|
+
[eo]: {
|
|
1028
1031
|
category: "Embed",
|
|
1029
1032
|
type: "choice",
|
|
1030
1033
|
default: "typescript",
|
|
1031
1034
|
description: 'Specify the embedded TS language parser. Default is "typescript".',
|
|
1032
|
-
choices:
|
|
1035
|
+
choices: Zr.map((t) => ({
|
|
1033
1036
|
value: t,
|
|
1034
1037
|
description: `Use "${t}".`
|
|
1035
1038
|
}))
|
|
1036
1039
|
}
|
|
1037
|
-
},
|
|
1040
|
+
}, ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1038
1041
|
__proto__: null,
|
|
1039
|
-
embedder:
|
|
1042
|
+
embedder: Qr,
|
|
1040
1043
|
language: se,
|
|
1041
|
-
options:
|
|
1042
|
-
}, Symbol.toStringTag, { value: "Module" })), ie = "embeddedXml", { line: ot, group: H, indent: st, softline: ee } =
|
|
1043
|
-
|
|
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 = {
|
|
1044
1047
|
...e,
|
|
1045
1048
|
...s
|
|
1046
1049
|
};
|
|
1047
|
-
const { node: l } = r, { createPlaceholder:
|
|
1048
|
-
(
|
|
1049
|
-
).join(""),
|
|
1050
|
-
|
|
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,
|
|
1051
1054
|
-u.length || void 0
|
|
1052
|
-
),
|
|
1055
|
+
), E = x(r, n), b = [];
|
|
1053
1056
|
let i = 0;
|
|
1054
1057
|
for (; i !== void 0; ) {
|
|
1055
|
-
const
|
|
1056
|
-
if (
|
|
1058
|
+
const p = y.slice(i);
|
|
1059
|
+
if (p.length === 0)
|
|
1057
1060
|
break;
|
|
1058
|
-
i > 0 && e.xmlWhitespaceSensitivity !== "strict" &&
|
|
1061
|
+
i > 0 && e.xmlWhitespaceSensitivity !== "strict" && b.push(ee), e.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1059
1062
|
0,
|
|
1060
1063
|
e.__embeddedXmlFragmentRecoverIndex.length
|
|
1061
1064
|
);
|
|
1062
|
-
let
|
|
1065
|
+
let h = await t(p, {
|
|
1063
1066
|
...e,
|
|
1064
1067
|
parser: ie
|
|
1065
1068
|
});
|
|
1066
1069
|
const [$, _] = e.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1067
|
-
$ === 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);
|
|
1068
1071
|
}
|
|
1069
|
-
const
|
|
1072
|
+
const f = T(b, g, E);
|
|
1070
1073
|
if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1071
1074
|
return H([
|
|
1072
1075
|
"`",
|
|
1073
|
-
|
|
1074
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(
|
|
1076
|
+
d,
|
|
1077
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(f)] : st([H(f)]),
|
|
1075
1078
|
u,
|
|
1076
1079
|
"`"
|
|
1077
1080
|
]);
|
|
1078
|
-
const v =
|
|
1081
|
+
const v = d.length ? ot : ee, m = u.length ? ot : ee;
|
|
1079
1082
|
return H([
|
|
1080
1083
|
"`",
|
|
1081
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(
|
|
1084
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(f)] : st([v, H(f)]),
|
|
1082
1085
|
m,
|
|
1083
1086
|
"`"
|
|
1084
1087
|
]);
|
|
1085
|
-
},
|
|
1086
|
-
[
|
|
1088
|
+
}, so = ["xml", "opml", "rss", "svg"], io = S(ie), co = {
|
|
1089
|
+
[io]: {
|
|
1087
1090
|
category: "Embed",
|
|
1088
1091
|
type: "string",
|
|
1089
1092
|
array: !0,
|
|
1090
|
-
default: [{ value: [...
|
|
1093
|
+
default: [{ value: [...so] }],
|
|
1091
1094
|
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
|
|
1092
1095
|
},
|
|
1093
1096
|
/**
|
|
@@ -1101,7 +1104,7 @@ const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapD
|
|
|
1101
1104
|
description: "This option is read only and used as a workaround to support xml fragments"
|
|
1102
1105
|
}
|
|
1103
1106
|
};
|
|
1104
|
-
function
|
|
1107
|
+
function ao(t) {
|
|
1105
1108
|
const n = {
|
|
1106
1109
|
loc: {
|
|
1107
1110
|
start: {
|
|
@@ -1141,50 +1144,50 @@ function it(t) {
|
|
|
1141
1144
|
);
|
|
1142
1145
|
return Object.assign(r, n), r;
|
|
1143
1146
|
}
|
|
1144
|
-
const
|
|
1147
|
+
const lo = {
|
|
1145
1148
|
async parse(t, n) {
|
|
1146
1149
|
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors: o, cst: s } = r(t);
|
|
1147
1150
|
if (e.length > 0) {
|
|
1148
1151
|
const l = e[0];
|
|
1149
|
-
throw
|
|
1152
|
+
throw ao(l);
|
|
1150
1153
|
}
|
|
1151
1154
|
if (o.length > 0) {
|
|
1152
1155
|
let l = !1;
|
|
1153
|
-
for (const
|
|
1156
|
+
for (const c of o) {
|
|
1154
1157
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
1155
|
-
|
|
1158
|
+
c.name
|
|
1156
1159
|
))
|
|
1157
|
-
throw it(
|
|
1158
|
-
if (
|
|
1160
|
+
throw it(c);
|
|
1161
|
+
if (c.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1159
1162
|
l = !0;
|
|
1160
1163
|
continue;
|
|
1161
1164
|
}
|
|
1162
1165
|
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
|
|
1163
|
-
|
|
1164
|
-
) || /Redundant input, expecting EOF but found: /.test(
|
|
1166
|
+
c.message
|
|
1167
|
+
) || /Redundant input, expecting EOF but found: /.test(c.message)) {
|
|
1165
1168
|
n.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1166
1169
|
0,
|
|
1167
1170
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
1168
|
-
|
|
1171
|
+
c.token.startOffset
|
|
1169
1172
|
);
|
|
1170
1173
|
break;
|
|
1171
1174
|
}
|
|
1172
1175
|
if (/Expecting token of type --> OPEN <-- but found --> '[\s\S]+' <--/.test(
|
|
1173
|
-
|
|
1176
|
+
c.message
|
|
1174
1177
|
)) {
|
|
1175
|
-
if (
|
|
1178
|
+
if (c.token.endOffset === void 0 || Number.isNaN(c.token.endOffset))
|
|
1176
1179
|
break;
|
|
1177
1180
|
n.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1178
1181
|
0,
|
|
1179
1182
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
1180
|
-
|
|
1181
|
-
|
|
1183
|
+
c.token.startOffset,
|
|
1184
|
+
c.token.endOffset
|
|
1182
1185
|
), l = !0;
|
|
1183
1186
|
break;
|
|
1184
1187
|
}
|
|
1185
|
-
throw it(
|
|
1188
|
+
throw it(c);
|
|
1186
1189
|
}
|
|
1187
|
-
l &&
|
|
1190
|
+
l && xt(s);
|
|
1188
1191
|
}
|
|
1189
1192
|
return s;
|
|
1190
1193
|
},
|
|
@@ -1196,145 +1199,145 @@ const io = {
|
|
|
1196
1199
|
return t.location.endOffset ?? NaN;
|
|
1197
1200
|
}
|
|
1198
1201
|
};
|
|
1199
|
-
function
|
|
1202
|
+
function xt(t) {
|
|
1200
1203
|
const n = t.children;
|
|
1201
1204
|
for (const r in n) {
|
|
1202
1205
|
const e = n[r] ?? [];
|
|
1203
1206
|
for (let o = e.length - 1; o >= 0; --o) {
|
|
1204
1207
|
const s = e[o];
|
|
1205
|
-
if (
|
|
1208
|
+
if (uo(s)) {
|
|
1206
1209
|
if (Object.keys(s.children).length === 0) {
|
|
1207
1210
|
e.splice(o, 1), e.length === 0 && delete n[r];
|
|
1208
1211
|
continue;
|
|
1209
1212
|
}
|
|
1210
|
-
|
|
1213
|
+
xt(s);
|
|
1211
1214
|
}
|
|
1212
1215
|
}
|
|
1213
1216
|
}
|
|
1214
1217
|
}
|
|
1215
|
-
function
|
|
1218
|
+
function uo(t) {
|
|
1216
1219
|
return "name" in t && "children" in t && "location" in t;
|
|
1217
1220
|
}
|
|
1218
|
-
const
|
|
1221
|
+
const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1219
1222
|
__proto__: null,
|
|
1220
|
-
embedder:
|
|
1223
|
+
embedder: oo,
|
|
1221
1224
|
language: ie,
|
|
1222
|
-
options:
|
|
1223
|
-
parser:
|
|
1224
|
-
}, 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 }) => {
|
|
1225
1228
|
e = {
|
|
1226
1229
|
...e,
|
|
1227
1230
|
...s
|
|
1228
1231
|
};
|
|
1229
|
-
const { node: l } = r, { createPlaceholder:
|
|
1230
|
-
(m,
|
|
1231
|
-
).join(""),
|
|
1232
|
-
|
|
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,
|
|
1233
1236
|
-u.length || void 0
|
|
1234
|
-
),
|
|
1237
|
+
), E = x(r, n), b = await t(y, {
|
|
1235
1238
|
...e,
|
|
1236
1239
|
parser: "yaml"
|
|
1237
|
-
}), i = T(
|
|
1240
|
+
}), i = T(b, g, E);
|
|
1238
1241
|
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1239
1242
|
return J([
|
|
1240
1243
|
"`",
|
|
1241
|
-
|
|
1244
|
+
d,
|
|
1242
1245
|
e.noEmbeddedMultiLineIndentation?.includes(o) ? [J(i)] : at([J(i)]),
|
|
1243
1246
|
u,
|
|
1244
1247
|
"`"
|
|
1245
1248
|
]);
|
|
1246
|
-
const
|
|
1249
|
+
const f = d.length ? ct : dt, v = u.length ? ct : dt;
|
|
1247
1250
|
return J([
|
|
1248
1251
|
"`",
|
|
1249
|
-
e.noEmbeddedMultiLineIndentation?.includes(o) ? [
|
|
1252
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [f, J(i)] : at([f, J(i)]),
|
|
1250
1253
|
v,
|
|
1251
1254
|
"`"
|
|
1252
1255
|
]);
|
|
1253
|
-
},
|
|
1254
|
-
[
|
|
1256
|
+
}, Lt = "embeddedYaml", mo = ["yaml", "yml"], fo = S(Lt), ho = {
|
|
1257
|
+
[fo]: {
|
|
1255
1258
|
category: "Embed",
|
|
1256
1259
|
type: "string",
|
|
1257
1260
|
array: !0,
|
|
1258
|
-
default: [{ value: [...
|
|
1261
|
+
default: [{ value: [...mo] }],
|
|
1259
1262
|
description: "Specify embedded YAML language identifiers."
|
|
1260
1263
|
}
|
|
1261
|
-
},
|
|
1264
|
+
}, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1262
1265
|
__proto__: null,
|
|
1263
|
-
embedder:
|
|
1264
|
-
language:
|
|
1265
|
-
options:
|
|
1266
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1267
|
-
"./css/index.ts":
|
|
1268
|
-
"./es/index.ts":
|
|
1269
|
-
"./glsl/index.ts":
|
|
1270
|
-
"./graphql/index.ts":
|
|
1271
|
-
"./html/index.ts":
|
|
1272
|
-
"./ini/index.ts":
|
|
1273
|
-
"./json/index.ts":
|
|
1274
|
-
"./latex/index.ts":
|
|
1275
|
-
"./markdown/index.ts":
|
|
1276
|
-
"./noop/index.ts":
|
|
1277
|
-
"./php/index.ts":
|
|
1278
|
-
"./properties/index.ts":
|
|
1279
|
-
"./ruby/index.ts":
|
|
1280
|
-
"./sh/index.ts":
|
|
1281
|
-
"./sql/index.ts":
|
|
1282
|
-
"./toml/index.ts":
|
|
1283
|
-
"./ts/index.ts":
|
|
1284
|
-
"./xml/index.ts":
|
|
1285
|
-
"./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
|
|
1286
1289
|
});
|
|
1287
|
-
Object.values(
|
|
1288
|
-
|
|
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);
|
|
1289
1292
|
});
|
|
1290
|
-
const
|
|
1291
|
-
...
|
|
1292
|
-
[
|
|
1293
|
+
const yo = "noEmbeddedIdentificationByComment", _o = "noEmbeddedIdentificationByTag", vo = "preserveEmbeddedExteriorWhitespaces", $o = "noEmbeddedMultiLineIndentation", Io = "embeddedOverrides", Vo = {
|
|
1294
|
+
...Pt,
|
|
1295
|
+
[yo]: {
|
|
1293
1296
|
category: "Embed",
|
|
1294
1297
|
type: "string",
|
|
1295
1298
|
array: !0,
|
|
1296
1299
|
default: [{ value: [] }],
|
|
1297
1300
|
description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
|
|
1298
1301
|
},
|
|
1299
|
-
[
|
|
1302
|
+
[_o]: {
|
|
1300
1303
|
category: "Embed",
|
|
1301
1304
|
type: "string",
|
|
1302
1305
|
array: !0,
|
|
1303
1306
|
default: [{ value: [] }],
|
|
1304
1307
|
description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
|
|
1305
1308
|
},
|
|
1306
|
-
[
|
|
1307
|
-
category: "
|
|
1309
|
+
[vo]: {
|
|
1310
|
+
category: "Embed",
|
|
1308
1311
|
type: "string",
|
|
1309
1312
|
array: !0,
|
|
1310
1313
|
default: [{ value: [] }],
|
|
1311
1314
|
description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
1312
1315
|
},
|
|
1313
|
-
[
|
|
1316
|
+
[$o]: {
|
|
1314
1317
|
category: "Embed",
|
|
1315
1318
|
type: "string",
|
|
1316
1319
|
array: !0,
|
|
1317
1320
|
default: [{ value: [] }],
|
|
1318
1321
|
description: "This option turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
|
|
1319
1322
|
},
|
|
1320
|
-
[
|
|
1323
|
+
[Io]: {
|
|
1321
1324
|
category: "Embed",
|
|
1322
1325
|
type: "string",
|
|
1323
1326
|
array: !1,
|
|
1324
1327
|
default: void 0,
|
|
1325
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."
|
|
1326
1329
|
}
|
|
1327
|
-
},
|
|
1330
|
+
}, lt = {
|
|
1328
1331
|
// parsers from internal
|
|
1329
|
-
...Rt.parsers,
|
|
1330
|
-
...jt.parsers,
|
|
1331
|
-
...Ft.parsers,
|
|
1332
|
-
...Bt.parsers,
|
|
1333
1332
|
...wt.parsers,
|
|
1333
|
+
...Bt.parsers,
|
|
1334
|
+
...Ut.parsers,
|
|
1335
|
+
...Wt.parsers,
|
|
1336
|
+
...Ct.parsers,
|
|
1334
1337
|
// parsers from this plugin
|
|
1335
|
-
...
|
|
1338
|
+
...Ot
|
|
1336
1339
|
};
|
|
1337
|
-
var
|
|
1340
|
+
var Do = {
|
|
1338
1341
|
isEqual: !0,
|
|
1339
1342
|
isMatchingKey: !0,
|
|
1340
1343
|
isPromise: !0,
|
|
@@ -1343,24 +1346,24 @@ var vo = {
|
|
|
1343
1346
|
onCacheChange: !0,
|
|
1344
1347
|
onCacheHit: !0,
|
|
1345
1348
|
transformKey: !0
|
|
1346
|
-
},
|
|
1349
|
+
}, So = Array.prototype.slice;
|
|
1347
1350
|
function Q(t) {
|
|
1348
1351
|
var n = t.length;
|
|
1349
|
-
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) : [];
|
|
1350
1353
|
}
|
|
1351
|
-
function
|
|
1354
|
+
function xo(t) {
|
|
1352
1355
|
var n = {};
|
|
1353
1356
|
for (var r in t)
|
|
1354
|
-
|
|
1357
|
+
Do[r] || (n[r] = t[r]);
|
|
1355
1358
|
return n;
|
|
1356
1359
|
}
|
|
1357
|
-
function
|
|
1360
|
+
function Lo(t) {
|
|
1358
1361
|
return typeof t == "function" && t.isMemoized;
|
|
1359
1362
|
}
|
|
1360
|
-
function
|
|
1363
|
+
function To(t, n) {
|
|
1361
1364
|
return t === n || t !== t && n !== n;
|
|
1362
1365
|
}
|
|
1363
|
-
function
|
|
1366
|
+
function ut(t, n) {
|
|
1364
1367
|
var r = {};
|
|
1365
1368
|
for (var e in t)
|
|
1366
1369
|
r[e] = t[e];
|
|
@@ -1368,7 +1371,7 @@ function lt(t, n) {
|
|
|
1368
1371
|
r[e] = n[e];
|
|
1369
1372
|
return r;
|
|
1370
1373
|
}
|
|
1371
|
-
var
|
|
1374
|
+
var Oo = (
|
|
1372
1375
|
/** @class */
|
|
1373
1376
|
function() {
|
|
1374
1377
|
function t(n) {
|
|
@@ -1407,9 +1410,9 @@ var xo = (
|
|
|
1407
1410
|
if (e(s[0], n))
|
|
1408
1411
|
return 0;
|
|
1409
1412
|
if (o > 1) {
|
|
1410
|
-
for (var
|
|
1411
|
-
if (e(s[
|
|
1412
|
-
return
|
|
1413
|
+
for (var c = 1; c < l; c++)
|
|
1414
|
+
if (e(s[c], n))
|
|
1415
|
+
return c;
|
|
1413
1416
|
}
|
|
1414
1417
|
return -1;
|
|
1415
1418
|
}, t.prototype._getKeyIndexForMany = function(n) {
|
|
@@ -1418,19 +1421,19 @@ var xo = (
|
|
|
1418
1421
|
return -1;
|
|
1419
1422
|
if (o === 1)
|
|
1420
1423
|
return this._getKeyIndexForSingle(n);
|
|
1421
|
-
var s = n.length, l,
|
|
1424
|
+
var s = n.length, l, c;
|
|
1422
1425
|
if (s > 1) {
|
|
1423
|
-
for (var
|
|
1424
|
-
if (l = e[
|
|
1425
|
-
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++)
|
|
1426
1429
|
;
|
|
1427
|
-
if (
|
|
1428
|
-
return
|
|
1430
|
+
if (c === s)
|
|
1431
|
+
return g;
|
|
1429
1432
|
}
|
|
1430
1433
|
} else
|
|
1431
|
-
for (var
|
|
1432
|
-
if (l = e[
|
|
1433
|
-
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;
|
|
1434
1437
|
return -1;
|
|
1435
1438
|
}, t.prototype._getKeyIndexForSingle = function(n) {
|
|
1436
1439
|
var r = this.keys;
|
|
@@ -1448,63 +1451,63 @@ var xo = (
|
|
|
1448
1451
|
}
|
|
1449
1452
|
return s(e[0], n[0]) ? 0 : -1;
|
|
1450
1453
|
}, t.prototype.orderByLru = function(n, r, e) {
|
|
1451
|
-
for (var o = this.keys, s = this.values, l = o.length,
|
|
1452
|
-
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];
|
|
1453
1456
|
o[0] = n, s[0] = r;
|
|
1454
|
-
var
|
|
1455
|
-
l ===
|
|
1457
|
+
var g = this.options.maxSize;
|
|
1458
|
+
l === g && e === l ? (o.pop(), s.pop()) : e >= g && (o.length = s.length = g);
|
|
1456
1459
|
}, t.prototype.updateAsyncCache = function(n) {
|
|
1457
|
-
var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, l = this.keys[0],
|
|
1458
|
-
this.values[0] =
|
|
1459
|
-
return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n),
|
|
1460
|
-
}, function(
|
|
1461
|
-
var
|
|
1462
|
-
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;
|
|
1463
1466
|
});
|
|
1464
1467
|
}, t;
|
|
1465
1468
|
}()
|
|
1466
1469
|
);
|
|
1467
1470
|
function kt(t, n) {
|
|
1468
|
-
if (n === void 0 && (n = {}),
|
|
1469
|
-
return kt(t.fn,
|
|
1471
|
+
if (n === void 0 && (n = {}), Lo(t))
|
|
1472
|
+
return kt(t.fn, ut(t.options, n));
|
|
1470
1473
|
if (typeof t != "function")
|
|
1471
1474
|
throw new TypeError("You must pass a function to `memoize`.");
|
|
1472
|
-
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({
|
|
1473
1476
|
isEqual: e,
|
|
1474
1477
|
isMatchingKey: o,
|
|
1475
1478
|
isPromise: l,
|
|
1476
|
-
maxSize:
|
|
1477
|
-
onCacheAdd:
|
|
1478
|
-
onCacheChange:
|
|
1479
|
+
maxSize: g,
|
|
1480
|
+
onCacheAdd: a,
|
|
1481
|
+
onCacheChange: d,
|
|
1479
1482
|
onCacheHit: u,
|
|
1480
1483
|
transformKey: y
|
|
1481
|
-
},
|
|
1482
|
-
var
|
|
1483
|
-
v && (
|
|
1484
|
-
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;
|
|
1485
1488
|
if (O !== -1)
|
|
1486
|
-
$ && u(
|
|
1489
|
+
$ && u(b, E, _), O && (b.orderByLru(i[O], f[O], O), h && d(b, E, _));
|
|
1487
1490
|
else {
|
|
1488
|
-
var
|
|
1489
|
-
|
|
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, _);
|
|
1490
1493
|
}
|
|
1491
|
-
return
|
|
1494
|
+
return f[0];
|
|
1492
1495
|
};
|
|
1493
|
-
return _.cache =
|
|
1496
|
+
return _.cache = b, _.fn = t, _.isMemoized = !0, _.options = E, _;
|
|
1494
1497
|
}
|
|
1495
|
-
async function
|
|
1498
|
+
async function gt(t) {
|
|
1496
1499
|
try {
|
|
1497
|
-
const n = await
|
|
1500
|
+
const n = await qt(t, { encoding: "utf-8" });
|
|
1498
1501
|
return JSON.parse(n);
|
|
1499
1502
|
} catch {
|
|
1500
1503
|
}
|
|
1501
1504
|
}
|
|
1502
|
-
const
|
|
1505
|
+
const Ao = /* @__PURE__ */ new URL(
|
|
1503
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);')
|
|
1504
1507
|
);
|
|
1505
|
-
async function
|
|
1508
|
+
async function Po(t) {
|
|
1506
1509
|
return new Promise((n) => {
|
|
1507
|
-
const r = new
|
|
1510
|
+
const r = new Xt(Ao, {
|
|
1508
1511
|
workerData: {
|
|
1509
1512
|
absolutePath: t
|
|
1510
1513
|
}
|
|
@@ -1516,44 +1519,44 @@ async function To(t) {
|
|
|
1516
1519
|
});
|
|
1517
1520
|
});
|
|
1518
1521
|
}
|
|
1519
|
-
async function
|
|
1522
|
+
async function ko(t) {
|
|
1520
1523
|
console.error(
|
|
1521
1524
|
"Ts module type embeddedOverrides has not been implemented yet."
|
|
1522
1525
|
);
|
|
1523
1526
|
}
|
|
1524
|
-
const
|
|
1527
|
+
const No = kt(
|
|
1525
1528
|
async (t, n) => {
|
|
1526
|
-
if (
|
|
1529
|
+
if (zt(t))
|
|
1527
1530
|
return t;
|
|
1528
|
-
const r = await
|
|
1531
|
+
const r = await Yt(n);
|
|
1529
1532
|
let e;
|
|
1530
|
-
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);
|
|
1531
1534
|
}
|
|
1532
|
-
),
|
|
1533
|
-
const r =
|
|
1535
|
+
), Mo = async (t, n) => {
|
|
1536
|
+
const r = No(
|
|
1534
1537
|
t,
|
|
1535
1538
|
n
|
|
1536
|
-
), e =
|
|
1539
|
+
), e = Jt(t);
|
|
1537
1540
|
if (e === ".json") {
|
|
1538
|
-
const o = await r, s = await
|
|
1541
|
+
const o = await r, s = await gt(o);
|
|
1539
1542
|
if (s !== void 0)
|
|
1540
1543
|
return s;
|
|
1541
1544
|
console.error(`Failed to parse the json file: ${o}`);
|
|
1542
1545
|
return;
|
|
1543
1546
|
} else if (e === ".mjs" || e === ".cjs" || e === ".js") {
|
|
1544
|
-
const o = await r, s = await
|
|
1547
|
+
const o = await r, s = await Po(o);
|
|
1545
1548
|
if (s !== void 0)
|
|
1546
1549
|
return s;
|
|
1547
1550
|
console.error(`Failed to parse the js module file: ${o}`);
|
|
1548
1551
|
return;
|
|
1549
1552
|
} else if (e === ".mts" || e === ".cts" || e === ".ts") {
|
|
1550
|
-
const o = await r, s = await
|
|
1553
|
+
const o = await r, s = await ko();
|
|
1551
1554
|
if (s !== void 0)
|
|
1552
1555
|
return s;
|
|
1553
1556
|
console.error(`Failed to parse the ts module file: ${o}`);
|
|
1554
1557
|
return;
|
|
1555
1558
|
} else if (e === "") {
|
|
1556
|
-
const o = await r, s = await
|
|
1559
|
+
const o = await r, s = await gt(o);
|
|
1557
1560
|
if (s !== void 0)
|
|
1558
1561
|
return s;
|
|
1559
1562
|
}
|
|
@@ -1562,10 +1565,10 @@ const Mo = kt(
|
|
|
1562
1565
|
} catch {
|
|
1563
1566
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1564
1567
|
}
|
|
1565
|
-
},
|
|
1568
|
+
}, Ro = async (t, n, r) => {
|
|
1566
1569
|
if (t === void 0)
|
|
1567
1570
|
return;
|
|
1568
|
-
const e = await
|
|
1571
|
+
const e = await Mo(
|
|
1569
1572
|
t,
|
|
1570
1573
|
r
|
|
1571
1574
|
);
|
|
@@ -1578,91 +1581,146 @@ const Mo = kt(
|
|
|
1578
1581
|
console.error("Error parsing embedded override options.");
|
|
1579
1582
|
}
|
|
1580
1583
|
};
|
|
1581
|
-
function
|
|
1584
|
+
function Fo({ node: t, parent: n }, r, e) {
|
|
1582
1585
|
if (r.length === 0 || t.type !== "TemplateLiteral")
|
|
1583
1586
|
return;
|
|
1584
1587
|
const o = t.comments ?? n?.comments;
|
|
1585
1588
|
if (!o)
|
|
1586
1589
|
return;
|
|
1587
1590
|
const s = o[o.length - 1];
|
|
1588
|
-
if (!
|
|
1591
|
+
if (![
|
|
1589
1592
|
"MultiLine",
|
|
1590
1593
|
// meriyah
|
|
1591
1594
|
"Block",
|
|
1592
1595
|
// typescript, acorn, espree, flow
|
|
1593
1596
|
"CommentBlock"
|
|
1594
1597
|
// babel, babel-flow, babel-ts
|
|
1595
|
-
].includes(s.type) || !s.leading)
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
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;
|
|
1600
1604
|
}
|
|
1601
|
-
function
|
|
1602
|
-
if (r.length
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
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);
|
|
1607
1651
|
}
|
|
1608
|
-
|
|
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) {
|
|
1609
1675
|
const { node: r } = t;
|
|
1610
1676
|
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: e } }) => e === null))
|
|
1611
1677
|
return null;
|
|
1612
|
-
for (const e of
|
|
1678
|
+
for (const e of Tt) {
|
|
1613
1679
|
const o = n[S(e)];
|
|
1614
1680
|
if (!o)
|
|
1615
1681
|
continue;
|
|
1616
|
-
const s =
|
|
1617
|
-
t,
|
|
1618
|
-
o,
|
|
1619
|
-
n.noEmbeddedIdentificationByComment ?? []
|
|
1620
|
-
) ?? Po(
|
|
1621
|
-
t,
|
|
1622
|
-
o,
|
|
1623
|
-
n.noEmbeddedIdentificationByTag ?? []
|
|
1624
|
-
);
|
|
1682
|
+
const s = Fo(t, o, n) ?? jo(t, o, n);
|
|
1625
1683
|
if (s === void 0)
|
|
1626
1684
|
continue;
|
|
1627
|
-
const l =
|
|
1685
|
+
const l = At[e];
|
|
1628
1686
|
if (!l)
|
|
1629
1687
|
return null;
|
|
1630
|
-
const
|
|
1631
|
-
return
|
|
1632
|
-
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(
|
|
1633
1691
|
u.embeddedOverrides,
|
|
1634
1692
|
s,
|
|
1635
1693
|
u.filepath
|
|
1636
1694
|
);
|
|
1637
1695
|
try {
|
|
1638
|
-
const
|
|
1696
|
+
const E = await l(g, a, d, u, {
|
|
1639
1697
|
identifier: s,
|
|
1640
1698
|
identifiers: o,
|
|
1641
1699
|
embeddedOverrideOptions: y
|
|
1642
1700
|
});
|
|
1643
|
-
return
|
|
1644
|
-
{ embed: !0, ...
|
|
1645
|
-
|
|
1701
|
+
return D.label(
|
|
1702
|
+
{ embed: !0, ...E.label },
|
|
1703
|
+
E
|
|
1646
1704
|
);
|
|
1647
|
-
} catch (
|
|
1648
|
-
throw console.error(
|
|
1705
|
+
} catch (E) {
|
|
1706
|
+
throw console.error(E), E;
|
|
1649
1707
|
}
|
|
1650
1708
|
};
|
|
1651
1709
|
}
|
|
1652
|
-
return
|
|
1653
|
-
},
|
|
1710
|
+
return Rt.embed?.(t, n) ?? null;
|
|
1711
|
+
}, Zo = {
|
|
1654
1712
|
estree: {
|
|
1655
|
-
...
|
|
1656
|
-
embed:
|
|
1713
|
+
...Rt,
|
|
1714
|
+
embed: Uo
|
|
1657
1715
|
}
|
|
1658
1716
|
};
|
|
1659
1717
|
export {
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1718
|
+
At as embeddedEmbedders,
|
|
1719
|
+
Tt as embeddedLanguages,
|
|
1720
|
+
Pt as embeddedOptions,
|
|
1721
|
+
Ot as embeddedParsers,
|
|
1664
1722
|
S as makeIdentifiersOptionName,
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1723
|
+
Vo as options,
|
|
1724
|
+
lt as parsers,
|
|
1725
|
+
Zo as printers
|
|
1668
1726
|
};
|