prettier-plugin-embed 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +736 -124
- package/dist/embedded/css/options.d.ts +36 -11
- package/dist/embedded/es/options.d.ts +36 -11
- package/dist/embedded/glsl/options.d.ts +36 -11
- package/dist/embedded/graphql/options.d.ts +36 -10
- package/dist/embedded/html/options.d.ts +36 -11
- package/dist/embedded/index.d.ts +2 -2
- package/dist/embedded/ini/options.d.ts +36 -10
- package/dist/embedded/java/options.d.ts +36 -5
- package/dist/embedded/json/options.d.ts +37 -11
- package/dist/embedded/jsonata/options.d.ts +36 -5
- package/dist/embedded/latex/options.d.ts +36 -10
- package/dist/embedded/markdown/options.d.ts +36 -11
- package/dist/embedded/nginx/options.d.ts +36 -5
- package/dist/embedded/noop/options.d.ts +29 -3
- package/dist/embedded/pegjs/options.d.ts +36 -5
- package/dist/embedded/php/options.d.ts +36 -11
- package/dist/embedded/prisma/options.d.ts +36 -5
- package/dist/embedded/properties/options.d.ts +36 -10
- package/dist/embedded/pug/options.d.ts +36 -5
- package/dist/embedded/register.d.ts +2 -2
- package/dist/embedded/ruby/options.d.ts +36 -10
- package/dist/embedded/sh/options.d.ts +36 -10
- package/dist/embedded/sql/options.d.ts +36 -11
- package/dist/embedded/toml/options.d.ts +36 -10
- package/dist/embedded/ts/options.d.ts +37 -12
- package/dist/embedded/types.d.ts +8 -2
- package/dist/embedded/utils.d.ts +3 -1
- package/dist/embedded/xml/options.d.ts +36 -11
- package/dist/embedded/yaml/options.d.ts +36 -10
- package/dist/index.js +1631 -1127
- package/dist/options.d.ts +509 -11
- package/dist/types.d.ts +36 -6
- package/dist/utils.d.ts +136 -5
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,187 +1,206 @@
|
|
|
1
|
-
import { builders as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { printers as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const {
|
|
13
|
-
function Pn(e, t) {
|
|
14
|
-
const { node: n } = e;
|
|
1
|
+
import { builders as T, utils as si } from "prettier/doc";
|
|
2
|
+
import Ei from "prettier/parser-babel";
|
|
3
|
+
import bi from "prettier/parser-espree";
|
|
4
|
+
import fi from "prettier/parser-flow";
|
|
5
|
+
import yi from "prettier/parser-meriyah";
|
|
6
|
+
import _i from "prettier/parser-typescript";
|
|
7
|
+
import { printers as $i } from "prettier/plugins/estree.mjs";
|
|
8
|
+
import { resolveConfigFile as vi } from "prettier";
|
|
9
|
+
import { builders as Di } from "prettier/doc.js";
|
|
10
|
+
const { group: Mi, indent: Ti, softline: qe, hardline: Ai, lineSuffixBoundary: Si } = T, { mapDoc: Li } = si;
|
|
11
|
+
function ki(e, t) {
|
|
12
|
+
const { node: i } = e;
|
|
15
13
|
let r = t();
|
|
16
|
-
return
|
|
14
|
+
return i?.comments?.length && (r = Mi([Ti([qe, r]), qe])), ["${", r, Si, "}"];
|
|
17
15
|
}
|
|
18
|
-
function
|
|
16
|
+
function S(e, t) {
|
|
19
17
|
return e.map(
|
|
20
|
-
(
|
|
18
|
+
(i) => ki(i, t),
|
|
21
19
|
"expressions"
|
|
22
20
|
);
|
|
23
21
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
26
|
-
if (typeof
|
|
27
|
-
return
|
|
28
|
-
const
|
|
29
|
-
for (let p = 0; p <
|
|
30
|
-
let
|
|
22
|
+
function A(e, t, i, r = !1) {
|
|
23
|
+
return Li(e, (a) => {
|
|
24
|
+
if (typeof a != "string")
|
|
25
|
+
return a;
|
|
26
|
+
const s = [], l = a.split(t);
|
|
27
|
+
for (let p = 0; p < l.length; p++) {
|
|
28
|
+
let E = l[p];
|
|
31
29
|
if (p % 2 === 0) {
|
|
32
|
-
if (!
|
|
30
|
+
if (!E)
|
|
33
31
|
continue;
|
|
34
|
-
if (
|
|
35
|
-
for (const
|
|
36
|
-
|
|
37
|
-
` ?
|
|
32
|
+
if (E = E.replaceAll(/([\\`]|\${)/g, "\\$1"), r)
|
|
33
|
+
for (const d of E.split(/(\n)/))
|
|
34
|
+
d === `
|
|
35
|
+
` ? s.push(Ai) : s.push(d);
|
|
38
36
|
else
|
|
39
|
-
|
|
37
|
+
s.push(E);
|
|
40
38
|
} else {
|
|
41
|
-
const
|
|
42
|
-
|
|
39
|
+
const d = Number(E);
|
|
40
|
+
s.push(i[d]);
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
|
-
return
|
|
43
|
+
return s;
|
|
46
44
|
});
|
|
47
45
|
}
|
|
48
|
-
function
|
|
46
|
+
function N(e, t, i) {
|
|
49
47
|
if (!(t.plugins?.some(
|
|
50
48
|
(r) => r.name?.match(
|
|
51
|
-
new RegExp(`(^|/)${
|
|
49
|
+
new RegExp(`(^|/)${Pe(e)}($|/)`)
|
|
52
50
|
) ?? !1
|
|
53
51
|
) ?? !1))
|
|
54
52
|
throw new Error(
|
|
55
|
-
`Cannot format embedded language identified by "${
|
|
53
|
+
`Cannot format embedded language identified by "${i}", because plugin "${e}" is not loaded.`
|
|
56
54
|
);
|
|
57
55
|
}
|
|
58
|
-
function
|
|
59
|
-
if (t ===
|
|
56
|
+
function Gi(e, t, i) {
|
|
57
|
+
if (t === i) {
|
|
60
58
|
e.unshift(t);
|
|
61
59
|
return;
|
|
62
60
|
}
|
|
63
|
-
let r = 0,
|
|
64
|
-
for (; r <
|
|
65
|
-
const
|
|
66
|
-
if (e[
|
|
61
|
+
let r = 0, n = e.length;
|
|
62
|
+
for (; r < n; ) {
|
|
63
|
+
const a = r + n >>> 1;
|
|
64
|
+
if (e[a] === i) {
|
|
67
65
|
e.push(t);
|
|
68
66
|
return;
|
|
69
67
|
}
|
|
70
|
-
e[
|
|
68
|
+
e[a] < t ? r = a + 1 : n = a;
|
|
71
69
|
}
|
|
72
70
|
e.splice(r, 0, t);
|
|
73
71
|
}
|
|
74
|
-
const
|
|
72
|
+
const he = (() => {
|
|
75
73
|
const e = [...Array(26).keys()].map((t) => String.fromCharCode(t + 97)).concat([...Array(10).keys()].map((t) => `${t}`));
|
|
76
74
|
return () => {
|
|
77
|
-
let
|
|
75
|
+
let i = "";
|
|
78
76
|
for (let r = 0; r < 16; ++r)
|
|
79
|
-
|
|
80
|
-
return
|
|
77
|
+
i += e[parseInt((Math.random() * e.length).toFixed(0), 10) % e.length];
|
|
78
|
+
return i;
|
|
81
79
|
};
|
|
82
80
|
})();
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
`${
|
|
81
|
+
function L(e = "p", t = "") {
|
|
82
|
+
const i = he(), r = he(), n = Pe(e), a = Pe(t), s = (p) => `${e}${i}${p}${r}${t}`, l = new RegExp(
|
|
83
|
+
`${n}${i}(\\d+)${r}${a}`,
|
|
86
84
|
"ig"
|
|
87
85
|
);
|
|
88
86
|
return {
|
|
89
|
-
createPlaceholder:
|
|
90
|
-
placeholderRegex:
|
|
87
|
+
createPlaceholder: s,
|
|
88
|
+
placeholderRegex: l
|
|
91
89
|
};
|
|
92
90
|
}
|
|
93
|
-
function
|
|
91
|
+
function Pe(e) {
|
|
94
92
|
return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
95
93
|
}
|
|
96
|
-
function
|
|
94
|
+
function v(e) {
|
|
97
95
|
return `${e}Identifiers`;
|
|
98
96
|
}
|
|
99
|
-
function
|
|
97
|
+
function M(e) {
|
|
98
|
+
return `${e}Comments`;
|
|
99
|
+
}
|
|
100
|
+
function D(e) {
|
|
101
|
+
return `${e}Tags`;
|
|
102
|
+
}
|
|
103
|
+
function Ni(e) {
|
|
100
104
|
return `${e}Plugin`;
|
|
101
105
|
}
|
|
102
|
-
function
|
|
106
|
+
function x(e) {
|
|
103
107
|
return `${e}Parser`;
|
|
104
108
|
}
|
|
105
|
-
const { line:
|
|
106
|
-
const
|
|
109
|
+
const { line: je, group: O, indent: Ue, softline: Re } = T, xi = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
110
|
+
const s = {
|
|
107
111
|
...r,
|
|
108
|
-
...
|
|
109
|
-
}, { node:
|
|
110
|
-
(m, g, { length:
|
|
111
|
-
).join(""),
|
|
112
|
-
|
|
112
|
+
...a
|
|
113
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L("@p"), d = l.quasis.map(
|
|
114
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
115
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
116
|
+
c.length,
|
|
113
117
|
-u.length || void 0
|
|
114
|
-
), b =
|
|
115
|
-
...
|
|
116
|
-
parser:
|
|
117
|
-
}),
|
|
118
|
-
if (
|
|
119
|
-
return
|
|
118
|
+
), b = S(i, t), _ = await e(f, {
|
|
119
|
+
...s,
|
|
120
|
+
parser: s.embeddedCssParser ?? "scss"
|
|
121
|
+
}), o = A(_, E, b);
|
|
122
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
123
|
+
return O([
|
|
120
124
|
"`",
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
c,
|
|
126
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [O(o)] : Ue([O(o)]),
|
|
123
127
|
u,
|
|
124
128
|
"`"
|
|
125
129
|
]);
|
|
126
|
-
const
|
|
127
|
-
return
|
|
130
|
+
const h = c.length ? je : Re, $ = u.length ? je : Re;
|
|
131
|
+
return O([
|
|
128
132
|
"`",
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, O(o)] : Ue([h, O(o)]),
|
|
134
|
+
$,
|
|
131
135
|
"`"
|
|
132
136
|
]);
|
|
133
|
-
},
|
|
134
|
-
[
|
|
137
|
+
}, re = "embeddedCss", Ii = ["css"], Oi = ["css", "less", "scss"], Pi = v(re), Ce = M(re), we = D(re), Bi = x(re), qi = {
|
|
138
|
+
[Pi]: {
|
|
135
139
|
category: "Embed",
|
|
136
140
|
type: "string",
|
|
137
141
|
array: !0,
|
|
138
|
-
default: [{ value: [...
|
|
139
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language."
|
|
142
|
+
default: [{ value: [...Ii] }],
|
|
143
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language.",
|
|
144
|
+
deprecated: `Please use \`${Ce}\` or \`${we}\`.`
|
|
140
145
|
},
|
|
141
|
-
[
|
|
146
|
+
[Ce]: {
|
|
147
|
+
category: "Embed",
|
|
148
|
+
type: "string",
|
|
149
|
+
array: !0,
|
|
150
|
+
default: [{ value: [] }],
|
|
151
|
+
description: "Block comments that make their subsequent template literals be identified as embedded CSS language."
|
|
152
|
+
},
|
|
153
|
+
[we]: {
|
|
154
|
+
category: "Embed",
|
|
155
|
+
type: "string",
|
|
156
|
+
array: !0,
|
|
157
|
+
default: [{ value: [] }],
|
|
158
|
+
description: "Tags that make their subsequent template literals be identified as embedded CSS language."
|
|
159
|
+
},
|
|
160
|
+
[Bi]: {
|
|
142
161
|
category: "Embed",
|
|
143
162
|
type: "choice",
|
|
144
163
|
default: "scss",
|
|
145
164
|
description: "The parser used to parse the embedded CSS language.",
|
|
146
|
-
choices:
|
|
165
|
+
choices: Oi.map((e) => ({
|
|
147
166
|
value: e,
|
|
148
167
|
description: `Use the "${e}" parser.`
|
|
149
168
|
}))
|
|
150
169
|
}
|
|
151
|
-
},
|
|
170
|
+
}, ji = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
152
171
|
__proto__: null,
|
|
153
|
-
embedder:
|
|
154
|
-
language:
|
|
155
|
-
options:
|
|
156
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
157
|
-
const
|
|
172
|
+
embedder: xi,
|
|
173
|
+
language: re,
|
|
174
|
+
options: qi
|
|
175
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Fe, group: P, indent: We, softline: ze } = T, Ui = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
176
|
+
const s = {
|
|
158
177
|
...r,
|
|
159
|
-
...
|
|
160
|
-
}, { node:
|
|
161
|
-
(m, g, { length:
|
|
162
|
-
).join(""),
|
|
163
|
-
|
|
178
|
+
...a
|
|
179
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
180
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
181
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
182
|
+
c.length,
|
|
164
183
|
-u.length || void 0
|
|
165
|
-
), b =
|
|
166
|
-
...
|
|
167
|
-
parser:
|
|
168
|
-
}),
|
|
169
|
-
if (
|
|
184
|
+
), b = S(i, t), _ = await e(f, {
|
|
185
|
+
...s,
|
|
186
|
+
parser: s.embeddedEsParser ?? "babel"
|
|
187
|
+
}), o = A(_, E, b);
|
|
188
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
170
189
|
return P([
|
|
171
190
|
"`",
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
c,
|
|
192
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [P(o)] : We([P(o)]),
|
|
174
193
|
u,
|
|
175
194
|
"`"
|
|
176
195
|
]);
|
|
177
|
-
const
|
|
196
|
+
const h = c.length ? Fe : ze, $ = u.length ? Fe : ze;
|
|
178
197
|
return P([
|
|
179
198
|
"`",
|
|
180
|
-
|
|
181
|
-
|
|
199
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, P(o)] : We([h, P(o)]),
|
|
200
|
+
$,
|
|
182
201
|
"`"
|
|
183
202
|
]);
|
|
184
|
-
},
|
|
203
|
+
}, oe = "embeddedEs", Ri = [
|
|
185
204
|
"js",
|
|
186
205
|
"jsx",
|
|
187
206
|
"es",
|
|
@@ -190,414 +209,534 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
190
209
|
"cjs",
|
|
191
210
|
"pac",
|
|
192
211
|
"javascript"
|
|
193
|
-
],
|
|
212
|
+
], Ci = [
|
|
194
213
|
"babel",
|
|
195
214
|
"babel-flow",
|
|
196
215
|
"acorn",
|
|
197
216
|
"espree",
|
|
198
217
|
"flow",
|
|
199
218
|
"meriyah"
|
|
200
|
-
],
|
|
201
|
-
[
|
|
219
|
+
], wi = v(oe), Ke = M(oe), Je = D(oe), Fi = x(oe), Wi = {
|
|
220
|
+
[wi]: {
|
|
202
221
|
category: "Embed",
|
|
203
222
|
type: "string",
|
|
204
223
|
array: !0,
|
|
205
|
-
default: [{ value: [...
|
|
206
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
224
|
+
default: [{ value: [...Ri] }],
|
|
225
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language.",
|
|
226
|
+
deprecated: `Please use \`${Ke}\` or \`${Je}\`.`
|
|
207
227
|
},
|
|
208
|
-
[
|
|
228
|
+
[Ke]: {
|
|
229
|
+
category: "Embed",
|
|
230
|
+
type: "string",
|
|
231
|
+
array: !0,
|
|
232
|
+
default: [{ value: [] }],
|
|
233
|
+
description: "Block comments that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
234
|
+
},
|
|
235
|
+
[Je]: {
|
|
236
|
+
category: "Embed",
|
|
237
|
+
type: "string",
|
|
238
|
+
array: !0,
|
|
239
|
+
default: [{ value: [] }],
|
|
240
|
+
description: "Tags that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
241
|
+
},
|
|
242
|
+
[Fi]: {
|
|
209
243
|
category: "Embed",
|
|
210
244
|
type: "choice",
|
|
211
245
|
default: "babel",
|
|
212
246
|
description: "The parser used to parse the embedded ECMASCript/JavaScript language.",
|
|
213
|
-
choices:
|
|
247
|
+
choices: Ci.map((e) => ({
|
|
214
248
|
value: e,
|
|
215
249
|
description: `Use the "${e}" parser.`
|
|
216
250
|
}))
|
|
217
251
|
}
|
|
218
|
-
},
|
|
252
|
+
}, zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
219
253
|
__proto__: null,
|
|
220
|
-
embedder:
|
|
221
|
-
language:
|
|
222
|
-
options:
|
|
223
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
224
|
-
|
|
225
|
-
const
|
|
254
|
+
embedder: Ui,
|
|
255
|
+
language: oe,
|
|
256
|
+
options: Wi
|
|
257
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: He, group: B, indent: Xe, softline: Qe } = T, Ki = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
258
|
+
N("prettier-plugin-glsl", r, n);
|
|
259
|
+
const s = {
|
|
226
260
|
...r,
|
|
227
|
-
...
|
|
228
|
-
}, { node:
|
|
229
|
-
(m, g, { length:
|
|
230
|
-
).join(""),
|
|
231
|
-
|
|
261
|
+
...a
|
|
262
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
263
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
264
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
265
|
+
c.length,
|
|
232
266
|
-u.length || void 0
|
|
233
|
-
), b =
|
|
234
|
-
...
|
|
267
|
+
), b = S(i, t), _ = await e(f, {
|
|
268
|
+
...s,
|
|
235
269
|
parser: "glsl-parser"
|
|
236
|
-
}),
|
|
237
|
-
if (
|
|
238
|
-
return
|
|
270
|
+
}), o = A(_, E, b);
|
|
271
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
272
|
+
return B([
|
|
239
273
|
"`",
|
|
240
|
-
|
|
241
|
-
|
|
274
|
+
c,
|
|
275
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [B(o)] : Xe([B(o)]),
|
|
242
276
|
u,
|
|
243
277
|
"`"
|
|
244
278
|
]);
|
|
245
|
-
const
|
|
246
|
-
return
|
|
279
|
+
const h = c.length ? He : Qe, $ = u.length ? He : Qe;
|
|
280
|
+
return B([
|
|
247
281
|
"`",
|
|
248
|
-
|
|
249
|
-
|
|
282
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, B(o)] : Xe([h, B(o)]),
|
|
283
|
+
$,
|
|
250
284
|
"`"
|
|
251
285
|
]);
|
|
252
|
-
},
|
|
253
|
-
[
|
|
286
|
+
}, be = "embeddedGlsl", Ji = ["glsl", "shader"], Hi = v(be), Ye = M(be), Ve = D(be), Xi = {
|
|
287
|
+
[Hi]: {
|
|
288
|
+
category: "Embed",
|
|
289
|
+
type: "string",
|
|
290
|
+
array: !0,
|
|
291
|
+
default: [{ value: [...Ji] }],
|
|
292
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin.",
|
|
293
|
+
deprecated: `Please use \`${Ye}\` or \`${Ve}\`.`
|
|
294
|
+
},
|
|
295
|
+
[Ye]: {
|
|
296
|
+
category: "Embed",
|
|
297
|
+
type: "string",
|
|
298
|
+
array: !0,
|
|
299
|
+
default: [{ value: [] }],
|
|
300
|
+
description: "Block comments that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
301
|
+
},
|
|
302
|
+
[Ve]: {
|
|
254
303
|
category: "Embed",
|
|
255
304
|
type: "string",
|
|
256
305
|
array: !0,
|
|
257
|
-
default: [{ value: [
|
|
258
|
-
description: "
|
|
306
|
+
default: [{ value: [] }],
|
|
307
|
+
description: "Tags that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
259
308
|
}
|
|
260
|
-
},
|
|
309
|
+
}, Qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
261
310
|
__proto__: null,
|
|
262
|
-
embedder:
|
|
263
|
-
language:
|
|
264
|
-
options:
|
|
265
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
266
|
-
const
|
|
311
|
+
embedder: Ki,
|
|
312
|
+
language: be,
|
|
313
|
+
options: Xi
|
|
314
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ze, group: q, indent: et, softline: tt } = T, Yi = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
315
|
+
const s = {
|
|
267
316
|
...r,
|
|
268
|
-
...
|
|
269
|
-
}, { node:
|
|
270
|
-
(m, g, { length:
|
|
271
|
-
).join(""),
|
|
272
|
-
|
|
317
|
+
...a
|
|
318
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
319
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
320
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
321
|
+
c.length,
|
|
273
322
|
-u.length || void 0
|
|
274
|
-
), b =
|
|
275
|
-
...
|
|
323
|
+
), b = S(i, t), _ = await e(f, {
|
|
324
|
+
...s,
|
|
276
325
|
parser: "graphql"
|
|
277
|
-
}),
|
|
278
|
-
if (
|
|
279
|
-
return
|
|
326
|
+
}), o = A(_, E, b);
|
|
327
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
328
|
+
return q([
|
|
280
329
|
"`",
|
|
281
|
-
|
|
282
|
-
|
|
330
|
+
c,
|
|
331
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [q(o)] : et([q(o)]),
|
|
283
332
|
u,
|
|
284
333
|
"`"
|
|
285
334
|
]);
|
|
286
|
-
const
|
|
287
|
-
return
|
|
335
|
+
const h = c.length ? Ze : tt, $ = u.length ? Ze : tt;
|
|
336
|
+
return q([
|
|
288
337
|
"`",
|
|
289
|
-
|
|
290
|
-
|
|
338
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, q(o)] : et([h, q(o)]),
|
|
339
|
+
$,
|
|
291
340
|
"`"
|
|
292
341
|
]);
|
|
293
|
-
},
|
|
294
|
-
[
|
|
342
|
+
}, fe = "embeddedGraphql", Vi = ["graphql", "gql"], Zi = v(fe), nt = M(fe), it = D(fe), es = {
|
|
343
|
+
[Zi]: {
|
|
344
|
+
category: "Embed",
|
|
345
|
+
type: "string",
|
|
346
|
+
array: !0,
|
|
347
|
+
default: [{ value: [...Vi] }],
|
|
348
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GraphQL language.",
|
|
349
|
+
deprecated: `Please use \`${nt}\` or \`${it}\`.`
|
|
350
|
+
},
|
|
351
|
+
[nt]: {
|
|
352
|
+
category: "Embed",
|
|
353
|
+
type: "string",
|
|
354
|
+
array: !0,
|
|
355
|
+
default: [{ value: [] }],
|
|
356
|
+
description: "Block comments that make their subsequent template literals be identified as embedded GraphQL language."
|
|
357
|
+
},
|
|
358
|
+
[it]: {
|
|
295
359
|
category: "Embed",
|
|
296
360
|
type: "string",
|
|
297
361
|
array: !0,
|
|
298
|
-
default: [{ value: [
|
|
299
|
-
description: "
|
|
362
|
+
default: [{ value: [] }],
|
|
363
|
+
description: "Tags that make their subsequent template literals be identified as embedded GraphQL language."
|
|
300
364
|
}
|
|
301
|
-
},
|
|
365
|
+
}, ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
302
366
|
__proto__: null,
|
|
303
|
-
embedder:
|
|
304
|
-
language:
|
|
305
|
-
options:
|
|
306
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
307
|
-
const
|
|
367
|
+
embedder: Yi,
|
|
368
|
+
language: fe,
|
|
369
|
+
options: es
|
|
370
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: st, group: j, indent: rt, softline: ot } = T, { mapDoc: ns } = si, is = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
371
|
+
const s = {
|
|
308
372
|
...r,
|
|
309
|
-
...
|
|
310
|
-
}, { node:
|
|
311
|
-
(m, g, { length:
|
|
312
|
-
).join(""),
|
|
313
|
-
|
|
373
|
+
...a
|
|
374
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
375
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
376
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
377
|
+
c.length,
|
|
314
378
|
-u.length || void 0
|
|
315
|
-
), b =
|
|
316
|
-
...
|
|
317
|
-
parser:
|
|
318
|
-
}),
|
|
379
|
+
), b = S(i, t), _ = await e(f, {
|
|
380
|
+
...s,
|
|
381
|
+
parser: s.embeddedHtmlParser ?? "html"
|
|
382
|
+
}), o = ns(_, (m) => {
|
|
319
383
|
if (typeof m != "string")
|
|
320
384
|
return m;
|
|
321
|
-
const g = [],
|
|
322
|
-
for (let
|
|
323
|
-
let
|
|
324
|
-
if (
|
|
325
|
-
if (!
|
|
385
|
+
const g = [], y = m.split(E);
|
|
386
|
+
for (let k = 0; k < y.length; k++) {
|
|
387
|
+
let G = y[k];
|
|
388
|
+
if (k % 2 === 0) {
|
|
389
|
+
if (!G)
|
|
326
390
|
continue;
|
|
327
|
-
|
|
391
|
+
G = G.replaceAll(/([\\`]|\${)/g, "\\$1"), s.__embeddedInHtml && (G = G.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(G);
|
|
328
392
|
} else {
|
|
329
|
-
const
|
|
330
|
-
g.push(b[
|
|
393
|
+
const I = Number(G);
|
|
394
|
+
g.push(b[I]);
|
|
331
395
|
}
|
|
332
396
|
}
|
|
333
397
|
return g;
|
|
334
398
|
});
|
|
335
|
-
if (
|
|
336
|
-
|
|
337
|
-
return
|
|
399
|
+
if (s.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
400
|
+
s.htmlWhitespaceSensitivity === "css" || s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
401
|
+
return j([
|
|
338
402
|
"`",
|
|
339
|
-
|
|
340
|
-
|
|
403
|
+
c,
|
|
404
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [j(o)] : rt([j(o)]),
|
|
341
405
|
u,
|
|
342
406
|
"`"
|
|
343
407
|
]);
|
|
344
|
-
const
|
|
345
|
-
return
|
|
408
|
+
const h = c.length ? st : ot, $ = u.length ? st : ot;
|
|
409
|
+
return j([
|
|
346
410
|
"`",
|
|
347
|
-
|
|
348
|
-
|
|
411
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, j(o)] : rt([h, j(o)]),
|
|
412
|
+
$,
|
|
349
413
|
"`"
|
|
350
414
|
]);
|
|
351
|
-
},
|
|
352
|
-
[
|
|
415
|
+
}, ae = "embeddedHtml", ss = ["html", "xhtml"], rs = ["html", "vue", "angular", "lwc"], os = v(ae), at = M(ae), dt = D(ae), as = x(ae), ds = {
|
|
416
|
+
[os]: {
|
|
353
417
|
category: "Embed",
|
|
354
418
|
type: "string",
|
|
355
419
|
array: !0,
|
|
356
|
-
default: [{ value: [...
|
|
357
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language."
|
|
420
|
+
default: [{ value: [...ss] }],
|
|
421
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language.",
|
|
422
|
+
deprecated: `Please use \`${at}\` or \`${dt}\`.`
|
|
358
423
|
},
|
|
359
|
-
[
|
|
424
|
+
[at]: {
|
|
425
|
+
category: "Embed",
|
|
426
|
+
type: "string",
|
|
427
|
+
array: !0,
|
|
428
|
+
default: [{ value: [] }],
|
|
429
|
+
description: "Block comments that make their subsequent template literals be identified as embedded HTML language."
|
|
430
|
+
},
|
|
431
|
+
[dt]: {
|
|
432
|
+
category: "Embed",
|
|
433
|
+
type: "string",
|
|
434
|
+
array: !0,
|
|
435
|
+
default: [{ value: [] }],
|
|
436
|
+
description: "Tags that make their subsequent template literals be identified as embedded HTML language."
|
|
437
|
+
},
|
|
438
|
+
[as]: {
|
|
360
439
|
category: "Embed",
|
|
361
440
|
type: "choice",
|
|
362
441
|
default: "html",
|
|
363
442
|
description: "The parser used to parse the embedded HTML language.",
|
|
364
|
-
choices:
|
|
443
|
+
choices: rs.map((e) => ({
|
|
365
444
|
value: e,
|
|
366
445
|
description: `Use the "${e}" parser.`
|
|
367
446
|
}))
|
|
368
447
|
}
|
|
369
|
-
},
|
|
448
|
+
}, ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
370
449
|
__proto__: null,
|
|
371
|
-
embedder:
|
|
372
|
-
language:
|
|
373
|
-
options:
|
|
374
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
375
|
-
|
|
376
|
-
const
|
|
450
|
+
embedder: is,
|
|
451
|
+
language: ae,
|
|
452
|
+
options: ds
|
|
453
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: lt, group: U, indent: ct, softline: ut } = T, cs = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
454
|
+
N("prettier-plugin-ini", r, n);
|
|
455
|
+
const s = {
|
|
377
456
|
...r,
|
|
378
|
-
...
|
|
379
|
-
}, { node:
|
|
380
|
-
(m, g, { length:
|
|
381
|
-
).join(""),
|
|
382
|
-
|
|
457
|
+
...a
|
|
458
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
459
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
460
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
461
|
+
c.length,
|
|
383
462
|
-u.length || void 0
|
|
384
|
-
), b =
|
|
385
|
-
...
|
|
463
|
+
), b = S(i, t), _ = await e(f, {
|
|
464
|
+
...s,
|
|
386
465
|
parser: "ini"
|
|
387
|
-
}),
|
|
388
|
-
if (
|
|
389
|
-
return
|
|
466
|
+
}), o = A(_, E, b);
|
|
467
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
468
|
+
return U([
|
|
390
469
|
"`",
|
|
391
|
-
|
|
392
|
-
|
|
470
|
+
c,
|
|
471
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [U(o)] : ct([U(o)]),
|
|
393
472
|
u,
|
|
394
473
|
"`"
|
|
395
474
|
]);
|
|
396
|
-
const
|
|
397
|
-
return
|
|
475
|
+
const h = c.length ? lt : ut, $ = u.length ? lt : ut;
|
|
476
|
+
return U([
|
|
398
477
|
"`",
|
|
399
|
-
|
|
400
|
-
|
|
478
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, U(o)] : ct([h, U(o)]),
|
|
479
|
+
$,
|
|
401
480
|
"`"
|
|
402
481
|
]);
|
|
403
|
-
},
|
|
404
|
-
[
|
|
482
|
+
}, ye = "embeddedIni", us = ["ini", "cfg", "pro"], ps = v(ye), pt = M(ye), gt = D(ye), gs = {
|
|
483
|
+
[ps]: {
|
|
484
|
+
category: "Embed",
|
|
485
|
+
type: "string",
|
|
486
|
+
array: !0,
|
|
487
|
+
default: [{ value: [...us] }],
|
|
488
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin.",
|
|
489
|
+
deprecated: `Please use \`${pt}\` or \`${gt}\`.`
|
|
490
|
+
},
|
|
491
|
+
[pt]: {
|
|
492
|
+
category: "Embed",
|
|
493
|
+
type: "string",
|
|
494
|
+
array: !0,
|
|
495
|
+
default: [{ value: [] }],
|
|
496
|
+
description: "Block comments that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
497
|
+
},
|
|
498
|
+
[gt]: {
|
|
405
499
|
category: "Embed",
|
|
406
500
|
type: "string",
|
|
407
501
|
array: !0,
|
|
408
|
-
default: [{ value: [
|
|
409
|
-
description: "
|
|
502
|
+
default: [{ value: [] }],
|
|
503
|
+
description: "Tags that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
410
504
|
}
|
|
411
|
-
},
|
|
505
|
+
}, ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
412
506
|
__proto__: null,
|
|
413
|
-
embedder:
|
|
414
|
-
language:
|
|
415
|
-
options:
|
|
416
|
-
}, Symbol.toStringTag, { value: "Module" })), { group:
|
|
417
|
-
|
|
418
|
-
const
|
|
507
|
+
embedder: cs,
|
|
508
|
+
language: ye,
|
|
509
|
+
options: gs
|
|
510
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: R, line: mt, softline: ht, indent: Et } = T, hs = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
511
|
+
N("prettier-plugin-java", r, n);
|
|
512
|
+
const s = {
|
|
419
513
|
...r,
|
|
420
|
-
...
|
|
421
|
-
}, { node:
|
|
422
|
-
(m, g, { length:
|
|
423
|
-
).join(""),
|
|
424
|
-
|
|
514
|
+
...a
|
|
515
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
516
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
517
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
518
|
+
c.length,
|
|
425
519
|
-u.length || void 0
|
|
426
|
-
), b =
|
|
427
|
-
...
|
|
520
|
+
), b = S(i, t), _ = await e(f, {
|
|
521
|
+
...s,
|
|
428
522
|
parser: "java"
|
|
429
|
-
}),
|
|
430
|
-
|
|
431
|
-
|
|
523
|
+
}), o = A(
|
|
524
|
+
_,
|
|
525
|
+
E,
|
|
432
526
|
b,
|
|
433
527
|
!0
|
|
434
528
|
);
|
|
435
|
-
if (
|
|
436
|
-
return
|
|
529
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
530
|
+
return R([
|
|
437
531
|
"`",
|
|
438
|
-
|
|
439
|
-
|
|
532
|
+
c,
|
|
533
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [R(o)] : Et([R(o)]),
|
|
440
534
|
u,
|
|
441
535
|
"`"
|
|
442
536
|
]);
|
|
443
|
-
const
|
|
444
|
-
return
|
|
537
|
+
const h = c.length ? mt : ht, $ = u.length ? mt : ht;
|
|
538
|
+
return R([
|
|
445
539
|
"`",
|
|
446
|
-
|
|
447
|
-
|
|
540
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, R(o)] : Et([h, R(o)]),
|
|
541
|
+
$,
|
|
448
542
|
"`"
|
|
449
543
|
]);
|
|
450
|
-
},
|
|
451
|
-
[
|
|
544
|
+
}, _e = "embeddedJava", Es = ["java"], bs = v(_e), bt = M(_e), ft = D(_e), fs = {
|
|
545
|
+
[bs]: {
|
|
452
546
|
category: "Embed",
|
|
453
547
|
type: "string",
|
|
454
548
|
array: !0,
|
|
455
|
-
default: [{ value: [...
|
|
456
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
549
|
+
default: [{ value: [...Es] }],
|
|
550
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin.",
|
|
551
|
+
deprecated: `Please use \`${bt}\` or \`${ft}\`.`
|
|
552
|
+
},
|
|
553
|
+
[bt]: {
|
|
554
|
+
category: "Embed",
|
|
555
|
+
type: "string",
|
|
556
|
+
array: !0,
|
|
557
|
+
default: [{ value: [] }],
|
|
558
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
559
|
+
},
|
|
560
|
+
[ft]: {
|
|
561
|
+
category: "Embed",
|
|
562
|
+
type: "string",
|
|
563
|
+
array: !0,
|
|
564
|
+
default: [{ value: [] }],
|
|
565
|
+
description: "Tags that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
457
566
|
}
|
|
458
|
-
},
|
|
567
|
+
}, ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
459
568
|
__proto__: null,
|
|
460
|
-
embedder:
|
|
461
|
-
language:
|
|
462
|
-
options:
|
|
463
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
464
|
-
const
|
|
569
|
+
embedder: hs,
|
|
570
|
+
language: _e,
|
|
571
|
+
options: fs
|
|
572
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: yt, group: C, indent: _t, softline: $t } = T, _s = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
573
|
+
const s = {
|
|
465
574
|
...r,
|
|
466
|
-
...
|
|
467
|
-
}, { node:
|
|
468
|
-
(m, g, { length:
|
|
469
|
-
).join(""),
|
|
470
|
-
|
|
575
|
+
...a
|
|
576
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = $s(), d = l.quasis.map(
|
|
577
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
578
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
579
|
+
c.length,
|
|
471
580
|
-u.length || void 0
|
|
472
|
-
), b =
|
|
473
|
-
...
|
|
474
|
-
parser:
|
|
475
|
-
}),
|
|
476
|
-
if (
|
|
477
|
-
return
|
|
581
|
+
), b = S(i, t), _ = await e(f, {
|
|
582
|
+
...s,
|
|
583
|
+
parser: s.embeddedJsonParser ?? "json"
|
|
584
|
+
}), o = A(_, E, b);
|
|
585
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
586
|
+
return C([
|
|
478
587
|
"`",
|
|
479
|
-
|
|
480
|
-
|
|
588
|
+
c,
|
|
589
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [C(o)] : _t([C(o)]),
|
|
481
590
|
u,
|
|
482
591
|
"`"
|
|
483
592
|
]);
|
|
484
|
-
const
|
|
485
|
-
return
|
|
593
|
+
const h = c.length ? yt : $t, $ = u.length ? yt : $t;
|
|
594
|
+
return C([
|
|
486
595
|
"`",
|
|
487
|
-
|
|
488
|
-
|
|
596
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, C(o)] : _t([h, C(o)]),
|
|
597
|
+
$,
|
|
489
598
|
"`"
|
|
490
599
|
]);
|
|
491
600
|
};
|
|
492
|
-
function
|
|
493
|
-
const e =
|
|
601
|
+
function $s() {
|
|
602
|
+
const e = he(), t = he(), i = (n) => `'0${e}${n}${t}'`, r = new RegExp(
|
|
494
603
|
`["']?0${e}(\\d+)${t}['"]?`,
|
|
495
604
|
"ig"
|
|
496
605
|
);
|
|
497
606
|
return {
|
|
498
|
-
createPlaceholder:
|
|
607
|
+
createPlaceholder: i,
|
|
499
608
|
placeholderRegex: r
|
|
500
609
|
};
|
|
501
610
|
}
|
|
502
|
-
const
|
|
503
|
-
[
|
|
611
|
+
const de = "embeddedJson", vs = ["json", "jsonl"], Ds = ["json", "json5", "jsonc", "json-stringify"], Ms = v(de), vt = M(de), Dt = D(de), Ts = x(de), As = {
|
|
612
|
+
[Ms]: {
|
|
504
613
|
category: "Embed",
|
|
505
614
|
type: "string",
|
|
506
615
|
array: !0,
|
|
507
|
-
default: [{ value: [...
|
|
508
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language."
|
|
616
|
+
default: [{ value: [...vs] }],
|
|
617
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language.",
|
|
618
|
+
deprecated: `Please use \`${vt}\` or \`${Dt}\`.`
|
|
509
619
|
},
|
|
510
|
-
[
|
|
620
|
+
[vt]: {
|
|
621
|
+
category: "Embed",
|
|
622
|
+
type: "string",
|
|
623
|
+
array: !0,
|
|
624
|
+
default: [{ value: [] }],
|
|
625
|
+
description: "Block comments that make their subsequent template literals be identified as embedded JSON language."
|
|
626
|
+
},
|
|
627
|
+
[Dt]: {
|
|
628
|
+
category: "Embed",
|
|
629
|
+
type: "string",
|
|
630
|
+
array: !0,
|
|
631
|
+
default: [{ value: [] }],
|
|
632
|
+
description: "Tags that make their subsequent template literals be identified as embedded JSON language."
|
|
633
|
+
},
|
|
634
|
+
[Ts]: {
|
|
511
635
|
category: "Embed",
|
|
512
636
|
type: "choice",
|
|
513
637
|
default: "json",
|
|
514
638
|
description: "The parser used to parse the embedded JSON language.",
|
|
515
|
-
choices:
|
|
639
|
+
choices: Ds.map((e) => ({
|
|
516
640
|
value: e,
|
|
517
641
|
description: `Use the "${e}" parser.`
|
|
518
642
|
}))
|
|
519
643
|
}
|
|
520
|
-
},
|
|
644
|
+
}, Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
521
645
|
__proto__: null,
|
|
522
|
-
embedder:
|
|
523
|
-
language:
|
|
524
|
-
options:
|
|
525
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
526
|
-
|
|
646
|
+
embedder: _s,
|
|
647
|
+
language: de,
|
|
648
|
+
options: As
|
|
649
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Mt, group: w, indent: Tt, softline: At } = T, Ls = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
650
|
+
N(
|
|
527
651
|
"@stedi/prettier-plugin-jsonata",
|
|
528
652
|
r,
|
|
529
|
-
|
|
653
|
+
n
|
|
530
654
|
);
|
|
531
|
-
const
|
|
655
|
+
const s = {
|
|
532
656
|
...r,
|
|
533
|
-
...
|
|
534
|
-
}, { node:
|
|
535
|
-
(m, g, { length:
|
|
536
|
-
).join(""),
|
|
537
|
-
|
|
657
|
+
...a
|
|
658
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L("$p"), d = l.quasis.map(
|
|
659
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
660
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
661
|
+
c.length,
|
|
538
662
|
-u.length || void 0
|
|
539
|
-
), b =
|
|
540
|
-
...
|
|
663
|
+
), b = S(i, t), _ = await e(f, {
|
|
664
|
+
...s,
|
|
541
665
|
parser: "JSONata"
|
|
542
|
-
}),
|
|
543
|
-
if (
|
|
544
|
-
return
|
|
666
|
+
}), o = A(_, E, b);
|
|
667
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
668
|
+
return w([
|
|
545
669
|
"`",
|
|
546
|
-
|
|
547
|
-
|
|
670
|
+
c,
|
|
671
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [w(o)] : Tt([w(o)]),
|
|
548
672
|
u,
|
|
549
673
|
"`"
|
|
550
674
|
]);
|
|
551
|
-
const
|
|
552
|
-
return
|
|
675
|
+
const h = c.length ? Mt : At, $ = u.length ? Mt : At;
|
|
676
|
+
return w([
|
|
553
677
|
"`",
|
|
554
|
-
|
|
555
|
-
|
|
678
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, w(o)] : Tt([h, w(o)]),
|
|
679
|
+
$,
|
|
556
680
|
"`"
|
|
557
681
|
]);
|
|
558
|
-
},
|
|
559
|
-
[
|
|
682
|
+
}, $e = "embeddedJsonata", ks = ["jsonata"], Gs = v($e), St = M($e), Lt = D($e), Ns = {
|
|
683
|
+
[Gs]: {
|
|
684
|
+
category: "Embed",
|
|
685
|
+
type: "string",
|
|
686
|
+
array: !0,
|
|
687
|
+
default: [{ value: [...ks] }],
|
|
688
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin.",
|
|
689
|
+
deprecated: `Please use \`${St}\` or \`${Lt}\`.`
|
|
690
|
+
},
|
|
691
|
+
[St]: {
|
|
692
|
+
category: "Embed",
|
|
693
|
+
type: "string",
|
|
694
|
+
array: !0,
|
|
695
|
+
default: [{ value: [] }],
|
|
696
|
+
description: "Block comments that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
697
|
+
},
|
|
698
|
+
[Lt]: {
|
|
560
699
|
category: "Embed",
|
|
561
700
|
type: "string",
|
|
562
701
|
array: !0,
|
|
563
|
-
default: [{ value: [
|
|
564
|
-
description: "
|
|
702
|
+
default: [{ value: [] }],
|
|
703
|
+
description: "Tags that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
565
704
|
}
|
|
566
|
-
},
|
|
705
|
+
}, xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
567
706
|
__proto__: null,
|
|
568
|
-
embedder:
|
|
569
|
-
language:
|
|
570
|
-
options:
|
|
571
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
572
|
-
|
|
573
|
-
const
|
|
707
|
+
embedder: Ls,
|
|
708
|
+
language: $e,
|
|
709
|
+
options: Ns
|
|
710
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: kt, group: F, indent: Gt, softline: Nt } = T, Is = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
711
|
+
N("prettier-plugin-latex", r, n);
|
|
712
|
+
const s = {
|
|
574
713
|
...r,
|
|
575
|
-
...
|
|
576
|
-
}, { node:
|
|
577
|
-
(m, g, { length:
|
|
578
|
-
).join(""),
|
|
579
|
-
|
|
714
|
+
...a
|
|
715
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
716
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
717
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
718
|
+
c.length,
|
|
580
719
|
-u.length || void 0
|
|
581
|
-
), b =
|
|
582
|
-
...
|
|
720
|
+
), b = S(i, t), _ = await e(f, {
|
|
721
|
+
...s,
|
|
583
722
|
parser: "latex-parser"
|
|
584
|
-
}),
|
|
585
|
-
if (
|
|
586
|
-
return
|
|
723
|
+
}), o = A(_, E, b);
|
|
724
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
725
|
+
return F([
|
|
587
726
|
"`",
|
|
588
|
-
|
|
589
|
-
|
|
727
|
+
c,
|
|
728
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [F(o)] : Gt([F(o)]),
|
|
590
729
|
u,
|
|
591
730
|
"`"
|
|
592
731
|
]);
|
|
593
|
-
const
|
|
594
|
-
return
|
|
732
|
+
const h = c.length ? kt : Nt, $ = u.length ? kt : Nt;
|
|
733
|
+
return F([
|
|
595
734
|
"`",
|
|
596
|
-
|
|
597
|
-
|
|
735
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, F(o)] : Gt([h, F(o)]),
|
|
736
|
+
$,
|
|
598
737
|
"`"
|
|
599
738
|
]);
|
|
600
|
-
},
|
|
739
|
+
}, ve = "embeddedLatex", Os = [
|
|
601
740
|
"latex",
|
|
602
741
|
"tex",
|
|
603
742
|
"aux",
|
|
@@ -606,747 +745,978 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
606
745
|
"bib",
|
|
607
746
|
"toc",
|
|
608
747
|
"sty"
|
|
609
|
-
],
|
|
610
|
-
[
|
|
748
|
+
], Ps = v(ve), xt = M(ve), It = D(ve), Bs = {
|
|
749
|
+
[Ps]: {
|
|
750
|
+
category: "Embed",
|
|
751
|
+
type: "string",
|
|
752
|
+
array: !0,
|
|
753
|
+
default: [{ value: [...Os] }],
|
|
754
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin.",
|
|
755
|
+
deprecated: `Please use \`${xt}\` or \`${It}\`.`
|
|
756
|
+
},
|
|
757
|
+
[xt]: {
|
|
611
758
|
category: "Embed",
|
|
612
759
|
type: "string",
|
|
613
760
|
array: !0,
|
|
614
|
-
default: [{ value: [
|
|
615
|
-
description: "
|
|
761
|
+
default: [{ value: [] }],
|
|
762
|
+
description: "Block comments that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
763
|
+
},
|
|
764
|
+
[It]: {
|
|
765
|
+
category: "Embed",
|
|
766
|
+
type: "string",
|
|
767
|
+
array: !0,
|
|
768
|
+
default: [{ value: [] }],
|
|
769
|
+
description: "Tags that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
616
770
|
}
|
|
617
|
-
},
|
|
771
|
+
}, qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
618
772
|
__proto__: null,
|
|
619
|
-
embedder:
|
|
620
|
-
language:
|
|
621
|
-
options:
|
|
622
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
623
|
-
const
|
|
773
|
+
embedder: Is,
|
|
774
|
+
language: ve,
|
|
775
|
+
options: Bs
|
|
776
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ot, group: W, indent: Pt, softline: Bt } = T, js = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
777
|
+
const s = {
|
|
624
778
|
...r,
|
|
625
|
-
...
|
|
626
|
-
}, { node:
|
|
627
|
-
(m, g, { length:
|
|
628
|
-
).join(""),
|
|
629
|
-
|
|
779
|
+
...a
|
|
780
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
781
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
782
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
783
|
+
c.length,
|
|
630
784
|
-u.length || void 0
|
|
631
|
-
), b =
|
|
632
|
-
...
|
|
633
|
-
parser:
|
|
785
|
+
), b = S(i, t), _ = await e(f, {
|
|
786
|
+
...s,
|
|
787
|
+
parser: s.embeddedMarkdownParser ?? "markdown",
|
|
634
788
|
__inJsTemplate: !0
|
|
635
|
-
}),
|
|
636
|
-
if (
|
|
637
|
-
return
|
|
789
|
+
}), o = A(_, E, b);
|
|
790
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
791
|
+
return W([
|
|
638
792
|
"`",
|
|
639
|
-
|
|
640
|
-
|
|
793
|
+
c,
|
|
794
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [W(o)] : Pt([W(o)]),
|
|
641
795
|
u,
|
|
642
796
|
"`"
|
|
643
797
|
]);
|
|
644
|
-
const
|
|
645
|
-
return
|
|
798
|
+
const h = c.length ? Ot : Bt, $ = u.length ? Ot : Bt;
|
|
799
|
+
return W([
|
|
646
800
|
"`",
|
|
647
|
-
|
|
648
|
-
|
|
801
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, W(o)] : Pt([h, W(o)]),
|
|
802
|
+
$,
|
|
649
803
|
"`"
|
|
650
804
|
]);
|
|
651
|
-
},
|
|
652
|
-
[
|
|
805
|
+
}, le = "embeddedMarkdown", Us = ["md", "markdown"], Rs = ["markdown", "mdx", "remark"], Cs = v(le), qt = M(le), jt = D(le), ws = x(le), Fs = {
|
|
806
|
+
[Cs]: {
|
|
807
|
+
category: "Embed",
|
|
808
|
+
type: "string",
|
|
809
|
+
array: !0,
|
|
810
|
+
default: [{ value: [...Us] }],
|
|
811
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language.",
|
|
812
|
+
deprecated: `Please use \`${qt}\` or \`${jt}\`.`
|
|
813
|
+
},
|
|
814
|
+
[qt]: {
|
|
653
815
|
category: "Embed",
|
|
654
816
|
type: "string",
|
|
655
817
|
array: !0,
|
|
656
|
-
default: [{ value: [
|
|
657
|
-
description: "
|
|
818
|
+
default: [{ value: [] }],
|
|
819
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Markdown language."
|
|
820
|
+
},
|
|
821
|
+
[jt]: {
|
|
822
|
+
category: "Embed",
|
|
823
|
+
type: "string",
|
|
824
|
+
array: !0,
|
|
825
|
+
default: [{ value: [] }],
|
|
826
|
+
description: "Tags that make their subsequent template literals be identified as embedded Markdown language."
|
|
658
827
|
},
|
|
659
|
-
[
|
|
828
|
+
[ws]: {
|
|
660
829
|
category: "Embed",
|
|
661
830
|
type: "choice",
|
|
662
831
|
default: "markdown",
|
|
663
832
|
description: "The parser used to parse the embedded Markdown language.",
|
|
664
|
-
choices:
|
|
833
|
+
choices: Rs.map((e) => ({
|
|
665
834
|
value: e,
|
|
666
835
|
description: `Use the "${e}" parser.`
|
|
667
836
|
}))
|
|
668
837
|
}
|
|
669
|
-
},
|
|
838
|
+
}, Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
670
839
|
__proto__: null,
|
|
671
|
-
embedder:
|
|
672
|
-
language:
|
|
673
|
-
options:
|
|
674
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
675
|
-
|
|
676
|
-
const
|
|
840
|
+
embedder: js,
|
|
841
|
+
language: le,
|
|
842
|
+
options: Fs
|
|
843
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ut, group: z, indent: Rt, softline: Ct } = T, zs = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
844
|
+
N("prettier-plugin-nginx", r, n);
|
|
845
|
+
const s = {
|
|
677
846
|
...r,
|
|
678
|
-
...
|
|
679
|
-
}, { node:
|
|
680
|
-
(m, g, { length:
|
|
681
|
-
).join(""),
|
|
682
|
-
|
|
847
|
+
...a
|
|
848
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
849
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
850
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
851
|
+
c.length,
|
|
683
852
|
-u.length || void 0
|
|
684
|
-
), b =
|
|
685
|
-
...
|
|
853
|
+
), b = S(i, t), _ = await e(f, {
|
|
854
|
+
...s,
|
|
686
855
|
parser: "nginx"
|
|
687
|
-
}),
|
|
688
|
-
if (
|
|
689
|
-
return
|
|
856
|
+
}), o = A(_, E, b);
|
|
857
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
858
|
+
return z([
|
|
690
859
|
"`",
|
|
691
|
-
|
|
692
|
-
|
|
860
|
+
c,
|
|
861
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [z(o)] : Rt([z(o)]),
|
|
693
862
|
u,
|
|
694
863
|
"`"
|
|
695
864
|
]);
|
|
696
|
-
const
|
|
697
|
-
return
|
|
865
|
+
const h = c.length ? Ut : Ct, $ = u.length ? Ut : Ct;
|
|
866
|
+
return z([
|
|
698
867
|
"`",
|
|
699
|
-
|
|
700
|
-
|
|
868
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, z(o)] : Rt([h, z(o)]),
|
|
869
|
+
$,
|
|
701
870
|
"`"
|
|
702
871
|
]);
|
|
703
|
-
},
|
|
704
|
-
[
|
|
872
|
+
}, De = "embeddedNginx", Ks = ["nginx"], Js = v(De), wt = M(De), Ft = D(De), Hs = {
|
|
873
|
+
[Js]: {
|
|
705
874
|
category: "Embed",
|
|
706
875
|
type: "string",
|
|
707
876
|
array: !0,
|
|
708
|
-
default: [{ value: [...
|
|
709
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
877
|
+
default: [{ value: [...Ks] }],
|
|
878
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin.",
|
|
879
|
+
deprecated: `Please use \`${wt}\` or \`${Ft}\`.`
|
|
880
|
+
},
|
|
881
|
+
[wt]: {
|
|
882
|
+
category: "Embed",
|
|
883
|
+
type: "string",
|
|
884
|
+
array: !0,
|
|
885
|
+
default: [{ value: [] }],
|
|
886
|
+
description: "Block comments that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
887
|
+
},
|
|
888
|
+
[Ft]: {
|
|
889
|
+
category: "Embed",
|
|
890
|
+
type: "string",
|
|
891
|
+
array: !0,
|
|
892
|
+
default: [{ value: [] }],
|
|
893
|
+
description: "Tags that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
710
894
|
}
|
|
711
|
-
},
|
|
895
|
+
}, Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
712
896
|
__proto__: null,
|
|
713
|
-
embedder:
|
|
714
|
-
language:
|
|
715
|
-
options:
|
|
716
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
717
|
-
[
|
|
897
|
+
embedder: zs,
|
|
898
|
+
language: De,
|
|
899
|
+
options: Hs
|
|
900
|
+
}, Symbol.toStringTag, { value: "Module" })), ce = "embeddedNoop", Qs = v(ce), Wt = M(ce), zt = D(ce), Ys = {
|
|
901
|
+
[Qs]: {
|
|
902
|
+
category: "Embed",
|
|
903
|
+
type: "string",
|
|
904
|
+
array: !0,
|
|
905
|
+
default: [{ value: [] }],
|
|
906
|
+
description: "Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted.",
|
|
907
|
+
deprecated: `Please use \`${Wt}\` or \`${zt}\`.`
|
|
908
|
+
},
|
|
909
|
+
[Wt]: {
|
|
910
|
+
category: "Embed",
|
|
911
|
+
type: "string",
|
|
912
|
+
array: !0,
|
|
913
|
+
default: [{ value: [] }],
|
|
914
|
+
description: "Block comments that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
915
|
+
},
|
|
916
|
+
[zt]: {
|
|
718
917
|
category: "Embed",
|
|
719
918
|
type: "string",
|
|
720
919
|
array: !0,
|
|
721
920
|
default: [{ value: [] }],
|
|
722
|
-
description: "
|
|
921
|
+
description: "Tags that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
723
922
|
}
|
|
724
|
-
},
|
|
923
|
+
}, Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
725
924
|
__proto__: null,
|
|
726
|
-
language:
|
|
727
|
-
options:
|
|
728
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
729
|
-
|
|
730
|
-
const
|
|
925
|
+
language: ce,
|
|
926
|
+
options: Ys
|
|
927
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Kt, group: K, indent: Jt, softline: Ht } = T, Zs = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
928
|
+
N("prettier-plugin-pegjs", r, n);
|
|
929
|
+
const s = {
|
|
731
930
|
...r,
|
|
732
|
-
...
|
|
733
|
-
}, { node:
|
|
734
|
-
(m, g, { length:
|
|
735
|
-
).join(""),
|
|
736
|
-
|
|
931
|
+
...a
|
|
932
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
933
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
934
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
935
|
+
c.length,
|
|
737
936
|
-u.length || void 0
|
|
738
|
-
), b =
|
|
739
|
-
...
|
|
937
|
+
), b = S(i, t), _ = await e(f, {
|
|
938
|
+
...s,
|
|
740
939
|
parser: "pegjs-parser"
|
|
741
|
-
}),
|
|
742
|
-
if (
|
|
743
|
-
return
|
|
940
|
+
}), o = A(_, E, b);
|
|
941
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
942
|
+
return K([
|
|
744
943
|
"`",
|
|
745
|
-
|
|
746
|
-
|
|
944
|
+
c,
|
|
945
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [K(o)] : Jt([K(o)]),
|
|
747
946
|
u,
|
|
748
947
|
"`"
|
|
749
948
|
]);
|
|
750
|
-
const
|
|
751
|
-
return
|
|
949
|
+
const h = c.length ? Kt : Ht, $ = u.length ? Kt : Ht;
|
|
950
|
+
return K([
|
|
752
951
|
"`",
|
|
753
|
-
|
|
754
|
-
|
|
952
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, K(o)] : Jt([h, K(o)]),
|
|
953
|
+
$,
|
|
755
954
|
"`"
|
|
756
955
|
]);
|
|
757
|
-
},
|
|
758
|
-
[
|
|
956
|
+
}, Me = "embeddedPegjs", er = ["pegjs", "peggy", "peg"], tr = v(Me), Xt = M(Me), Qt = D(Me), nr = {
|
|
957
|
+
[tr]: {
|
|
958
|
+
category: "Embed",
|
|
959
|
+
type: "string",
|
|
960
|
+
array: !0,
|
|
961
|
+
default: [{ value: [...er] }],
|
|
962
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin.",
|
|
963
|
+
deprecated: `Please use \`${Xt}\` or \`${Qt}\`.`
|
|
964
|
+
},
|
|
965
|
+
[Xt]: {
|
|
966
|
+
category: "Embed",
|
|
967
|
+
type: "string",
|
|
968
|
+
array: !0,
|
|
969
|
+
default: [{ value: [] }],
|
|
970
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
971
|
+
},
|
|
972
|
+
[Qt]: {
|
|
759
973
|
category: "Embed",
|
|
760
974
|
type: "string",
|
|
761
975
|
array: !0,
|
|
762
|
-
default: [{ value: [
|
|
763
|
-
description: "
|
|
976
|
+
default: [{ value: [] }],
|
|
977
|
+
description: "Tags that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
764
978
|
}
|
|
765
|
-
},
|
|
979
|
+
}, ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
766
980
|
__proto__: null,
|
|
767
|
-
embedder:
|
|
768
|
-
language:
|
|
769
|
-
options:
|
|
770
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
771
|
-
|
|
772
|
-
const
|
|
981
|
+
embedder: Zs,
|
|
982
|
+
language: Me,
|
|
983
|
+
options: nr
|
|
984
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Yt, group: J, indent: Vt, softline: Zt } = T, sr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
985
|
+
N("@prettier/plugin-php", r, n);
|
|
986
|
+
const s = {
|
|
773
987
|
...r,
|
|
774
|
-
...
|
|
775
|
-
}, { node:
|
|
776
|
-
(m, g, { length:
|
|
777
|
-
).join(""),
|
|
778
|
-
|
|
988
|
+
...a
|
|
989
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L("$p"), d = l.quasis.map(
|
|
990
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
991
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
992
|
+
c.length,
|
|
779
993
|
-u.length || void 0
|
|
780
|
-
), b =
|
|
781
|
-
...
|
|
994
|
+
), b = S(i, t), _ = await e(f, {
|
|
995
|
+
...s,
|
|
782
996
|
parser: "php"
|
|
783
|
-
}),
|
|
784
|
-
if (
|
|
785
|
-
return
|
|
997
|
+
}), o = A(_, E, b);
|
|
998
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
999
|
+
return J([
|
|
786
1000
|
"`",
|
|
787
|
-
|
|
788
|
-
|
|
1001
|
+
c,
|
|
1002
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [J(o)] : Vt([J(o)]),
|
|
789
1003
|
u,
|
|
790
1004
|
"`"
|
|
791
1005
|
]);
|
|
792
|
-
const
|
|
793
|
-
return
|
|
1006
|
+
const h = c.length ? Yt : Zt, $ = u.length ? Yt : Zt;
|
|
1007
|
+
return J([
|
|
794
1008
|
"`",
|
|
795
|
-
|
|
796
|
-
|
|
1009
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, J(o)] : Vt([h, J(o)]),
|
|
1010
|
+
$,
|
|
797
1011
|
"`"
|
|
798
1012
|
]);
|
|
799
|
-
},
|
|
800
|
-
[
|
|
1013
|
+
}, Te = "embeddedPhp", rr = ["php", "php5"], or = v(Te), en = M(Te), tn = D(Te), ar = {
|
|
1014
|
+
[or]: {
|
|
1015
|
+
category: "Embed",
|
|
1016
|
+
type: "string",
|
|
1017
|
+
array: !0,
|
|
1018
|
+
default: [{ value: [...rr] }],
|
|
1019
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin.",
|
|
1020
|
+
deprecated: `Please use \`${en}\` or \`${tn}\`.`
|
|
1021
|
+
},
|
|
1022
|
+
[en]: {
|
|
1023
|
+
category: "Embed",
|
|
1024
|
+
type: "string",
|
|
1025
|
+
array: !0,
|
|
1026
|
+
default: [{ value: [] }],
|
|
1027
|
+
description: "Block comments that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
1028
|
+
},
|
|
1029
|
+
[tn]: {
|
|
801
1030
|
category: "Embed",
|
|
802
1031
|
type: "string",
|
|
803
1032
|
array: !0,
|
|
804
|
-
default: [{ value: [
|
|
805
|
-
description: "
|
|
1033
|
+
default: [{ value: [] }],
|
|
1034
|
+
description: "Tags that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
806
1035
|
}
|
|
807
|
-
},
|
|
1036
|
+
}, dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
808
1037
|
__proto__: null,
|
|
809
|
-
embedder:
|
|
810
|
-
language:
|
|
811
|
-
options:
|
|
812
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
813
|
-
|
|
814
|
-
const
|
|
1038
|
+
embedder: sr,
|
|
1039
|
+
language: Te,
|
|
1040
|
+
options: ar
|
|
1041
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: nn, group: H, indent: sn, softline: rn } = T, lr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1042
|
+
N("prettier-plugin-prisma", r, n);
|
|
1043
|
+
const s = {
|
|
815
1044
|
...r,
|
|
816
|
-
...
|
|
817
|
-
}, { node:
|
|
818
|
-
(m, g, { length:
|
|
819
|
-
).join(""),
|
|
820
|
-
|
|
1045
|
+
...a
|
|
1046
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1047
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1048
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1049
|
+
c.length,
|
|
821
1050
|
-u.length || void 0
|
|
822
|
-
), b =
|
|
823
|
-
...
|
|
1051
|
+
), b = S(i, t), _ = await e(f, {
|
|
1052
|
+
...s,
|
|
824
1053
|
parser: "prisma-parse"
|
|
825
|
-
}),
|
|
826
|
-
if (
|
|
827
|
-
return
|
|
1054
|
+
}), o = A(_, E, b);
|
|
1055
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1056
|
+
return H([
|
|
828
1057
|
"`",
|
|
829
|
-
|
|
830
|
-
|
|
1058
|
+
c,
|
|
1059
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [H(o)] : sn([H(o)]),
|
|
831
1060
|
u,
|
|
832
1061
|
"`"
|
|
833
1062
|
]);
|
|
834
|
-
const
|
|
835
|
-
return
|
|
1063
|
+
const h = c.length ? nn : rn, $ = u.length ? nn : rn;
|
|
1064
|
+
return H([
|
|
836
1065
|
"`",
|
|
837
|
-
|
|
838
|
-
|
|
1066
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, H(o)] : sn([h, H(o)]),
|
|
1067
|
+
$,
|
|
839
1068
|
"`"
|
|
840
1069
|
]);
|
|
841
|
-
},
|
|
842
|
-
[
|
|
1070
|
+
}, Ae = "embeddedPrisma", cr = ["prisma"], ur = v(Ae), on = M(Ae), an = D(Ae), pr = {
|
|
1071
|
+
[ur]: {
|
|
1072
|
+
category: "Embed",
|
|
1073
|
+
type: "string",
|
|
1074
|
+
array: !0,
|
|
1075
|
+
default: [{ value: [...cr] }],
|
|
1076
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin.",
|
|
1077
|
+
deprecated: `Please use \`${on}\` or \`${an}\`.`
|
|
1078
|
+
},
|
|
1079
|
+
[on]: {
|
|
843
1080
|
category: "Embed",
|
|
844
1081
|
type: "string",
|
|
845
1082
|
array: !0,
|
|
846
|
-
default: [{ value: [
|
|
847
|
-
description: "
|
|
1083
|
+
default: [{ value: [] }],
|
|
1084
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
1085
|
+
},
|
|
1086
|
+
[an]: {
|
|
1087
|
+
category: "Embed",
|
|
1088
|
+
type: "string",
|
|
1089
|
+
array: !0,
|
|
1090
|
+
default: [{ value: [] }],
|
|
1091
|
+
description: "Tags that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
848
1092
|
}
|
|
849
|
-
},
|
|
1093
|
+
}, gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
850
1094
|
__proto__: null,
|
|
851
|
-
embedder:
|
|
852
|
-
language:
|
|
853
|
-
options:
|
|
854
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
855
|
-
|
|
856
|
-
const
|
|
1095
|
+
embedder: lr,
|
|
1096
|
+
language: Ae,
|
|
1097
|
+
options: pr
|
|
1098
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: dn, group: X, indent: ln, softline: cn } = T, mr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1099
|
+
N("prettier-plugin-properties", r, n);
|
|
1100
|
+
const s = {
|
|
857
1101
|
...r,
|
|
858
|
-
...
|
|
859
|
-
}, { node:
|
|
860
|
-
(m, g, { length:
|
|
861
|
-
).join(""),
|
|
862
|
-
|
|
1102
|
+
...a
|
|
1103
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1104
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1105
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1106
|
+
c.length,
|
|
863
1107
|
-u.length || void 0
|
|
864
|
-
), b =
|
|
865
|
-
...
|
|
1108
|
+
), b = S(i, t), _ = await e(f, {
|
|
1109
|
+
...s,
|
|
866
1110
|
parser: "dot-properties"
|
|
867
|
-
}),
|
|
868
|
-
if (
|
|
869
|
-
return
|
|
1111
|
+
}), o = A(_, E, b);
|
|
1112
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1113
|
+
return X([
|
|
870
1114
|
"`",
|
|
871
|
-
|
|
872
|
-
|
|
1115
|
+
c,
|
|
1116
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [X(o)] : ln([X(o)]),
|
|
873
1117
|
u,
|
|
874
1118
|
"`"
|
|
875
1119
|
]);
|
|
876
|
-
const
|
|
877
|
-
return
|
|
1120
|
+
const h = c.length ? dn : cn, $ = u.length ? dn : cn;
|
|
1121
|
+
return X([
|
|
878
1122
|
"`",
|
|
879
|
-
|
|
880
|
-
|
|
1123
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, X(o)] : ln([h, X(o)]),
|
|
1124
|
+
$,
|
|
881
1125
|
"`"
|
|
882
1126
|
]);
|
|
883
|
-
},
|
|
884
|
-
[
|
|
1127
|
+
}, Se = "embeddedProperties", hr = ["properties"], Er = v(Se), un = M(Se), pn = D(Se), br = {
|
|
1128
|
+
[Er]: {
|
|
1129
|
+
category: "Embed",
|
|
1130
|
+
type: "string",
|
|
1131
|
+
array: !0,
|
|
1132
|
+
default: [{ value: [...hr] }],
|
|
1133
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin.",
|
|
1134
|
+
deprecated: `Please use \`${un}\` or \`${pn}\`.`
|
|
1135
|
+
},
|
|
1136
|
+
[un]: {
|
|
1137
|
+
category: "Embed",
|
|
1138
|
+
type: "string",
|
|
1139
|
+
array: !0,
|
|
1140
|
+
default: [{ value: [] }],
|
|
1141
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
1142
|
+
},
|
|
1143
|
+
[pn]: {
|
|
885
1144
|
category: "Embed",
|
|
886
1145
|
type: "string",
|
|
887
1146
|
array: !0,
|
|
888
|
-
default: [{ value: [
|
|
889
|
-
description: "
|
|
1147
|
+
default: [{ value: [] }],
|
|
1148
|
+
description: "Tags that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
890
1149
|
}
|
|
891
|
-
},
|
|
1150
|
+
}, fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
892
1151
|
__proto__: null,
|
|
893
|
-
embedder:
|
|
894
|
-
language:
|
|
895
|
-
options:
|
|
896
|
-
}, Symbol.toStringTag, { value: "Module" })), { group:
|
|
897
|
-
|
|
898
|
-
const
|
|
1152
|
+
embedder: mr,
|
|
1153
|
+
language: Se,
|
|
1154
|
+
options: br
|
|
1155
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: Q, line: gn, softline: mn, indent: hn } = T, yr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1156
|
+
N("@prettier/plugin-pug", r, n);
|
|
1157
|
+
const s = {
|
|
899
1158
|
...r,
|
|
900
|
-
...
|
|
901
|
-
}, { node:
|
|
902
|
-
(m, g, { length:
|
|
903
|
-
).join(""),
|
|
904
|
-
|
|
1159
|
+
...a
|
|
1160
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1161
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1162
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1163
|
+
c.length,
|
|
905
1164
|
-u.length || void 0
|
|
906
|
-
), b =
|
|
907
|
-
...
|
|
1165
|
+
), b = S(i, t), _ = await e(f, {
|
|
1166
|
+
...s,
|
|
908
1167
|
parser: "pug"
|
|
909
|
-
}),
|
|
910
|
-
|
|
911
|
-
|
|
1168
|
+
}), o = A(
|
|
1169
|
+
_,
|
|
1170
|
+
E,
|
|
912
1171
|
b,
|
|
913
1172
|
!0
|
|
914
1173
|
);
|
|
915
|
-
if (
|
|
916
|
-
return
|
|
1174
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1175
|
+
return Q([
|
|
917
1176
|
"`",
|
|
918
|
-
|
|
919
|
-
|
|
1177
|
+
c,
|
|
1178
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [Q(o)] : hn([Q(o)]),
|
|
920
1179
|
u,
|
|
921
1180
|
"`"
|
|
922
1181
|
]);
|
|
923
|
-
const
|
|
924
|
-
return
|
|
1182
|
+
const h = c.length ? gn : mn, $ = u.length ? gn : mn;
|
|
1183
|
+
return Q([
|
|
925
1184
|
"`",
|
|
926
|
-
|
|
927
|
-
|
|
1185
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, Q(o)] : hn([h, Q(o)]),
|
|
1186
|
+
$,
|
|
928
1187
|
"`"
|
|
929
1188
|
]);
|
|
930
|
-
},
|
|
931
|
-
[
|
|
1189
|
+
}, Le = "embeddedPug", _r = ["pug", "jade"], $r = v(Le), En = M(Le), bn = D(Le), vr = {
|
|
1190
|
+
[$r]: {
|
|
1191
|
+
category: "Embed",
|
|
1192
|
+
type: "string",
|
|
1193
|
+
array: !0,
|
|
1194
|
+
default: [{ value: [..._r] }],
|
|
1195
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin.",
|
|
1196
|
+
deprecated: `Please use \`${En}\` or \`${bn}\`.`
|
|
1197
|
+
},
|
|
1198
|
+
[En]: {
|
|
1199
|
+
category: "Embed",
|
|
1200
|
+
type: "string",
|
|
1201
|
+
array: !0,
|
|
1202
|
+
default: [{ value: [] }],
|
|
1203
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1204
|
+
},
|
|
1205
|
+
[bn]: {
|
|
932
1206
|
category: "Embed",
|
|
933
1207
|
type: "string",
|
|
934
1208
|
array: !0,
|
|
935
|
-
default: [{ value: [
|
|
936
|
-
description: "
|
|
1209
|
+
default: [{ value: [] }],
|
|
1210
|
+
description: "Tags that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
937
1211
|
}
|
|
938
|
-
},
|
|
1212
|
+
}, Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
939
1213
|
__proto__: null,
|
|
940
|
-
embedder:
|
|
941
|
-
language:
|
|
942
|
-
options:
|
|
943
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
944
|
-
|
|
945
|
-
const
|
|
1214
|
+
embedder: yr,
|
|
1215
|
+
language: Le,
|
|
1216
|
+
options: vr
|
|
1217
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: fn, group: Y, indent: yn, softline: _n } = T, Mr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1218
|
+
N("@prettier/plugin-ruby", r, n);
|
|
1219
|
+
const s = {
|
|
946
1220
|
...r,
|
|
947
|
-
...
|
|
948
|
-
}, { node:
|
|
949
|
-
(m, g, { length:
|
|
950
|
-
).join(""),
|
|
951
|
-
|
|
1221
|
+
...a
|
|
1222
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1223
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1224
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1225
|
+
c.length,
|
|
952
1226
|
-u.length || void 0
|
|
953
|
-
), b =
|
|
954
|
-
...
|
|
955
|
-
parser:
|
|
956
|
-
}),
|
|
957
|
-
if (
|
|
958
|
-
return
|
|
1227
|
+
), b = S(i, t), _ = await e(f, {
|
|
1228
|
+
...s,
|
|
1229
|
+
parser: s.embeddedRubyParser ?? "ruby"
|
|
1230
|
+
}), o = A(_, E, b);
|
|
1231
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1232
|
+
return Y([
|
|
959
1233
|
"`",
|
|
960
|
-
|
|
961
|
-
|
|
1234
|
+
c,
|
|
1235
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [Y(o)] : yn([Y(o)]),
|
|
962
1236
|
u,
|
|
963
1237
|
"`"
|
|
964
1238
|
]);
|
|
965
|
-
const
|
|
966
|
-
return
|
|
1239
|
+
const h = c.length ? fn : _n, $ = u.length ? fn : _n;
|
|
1240
|
+
return Y([
|
|
967
1241
|
"`",
|
|
968
|
-
|
|
969
|
-
|
|
1242
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, Y(o)] : yn([h, Y(o)]),
|
|
1243
|
+
$,
|
|
970
1244
|
"`"
|
|
971
1245
|
]);
|
|
972
|
-
},
|
|
973
|
-
[
|
|
1246
|
+
}, ue = "embeddedRuby", Tr = ["ruby"], Ar = ["ruby", "rbs", "haml"], Sr = v(ue), $n = M(ue), vn = D(ue), Lr = x(ue), kr = {
|
|
1247
|
+
[Sr]: {
|
|
974
1248
|
category: "Embed",
|
|
975
1249
|
type: "string",
|
|
976
1250
|
array: !0,
|
|
977
|
-
default: [{ value: [...
|
|
978
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1251
|
+
default: [{ value: [...Tr] }],
|
|
1252
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1253
|
+
deprecated: `Please use \`${$n}\` or \`${vn}\`.`
|
|
979
1254
|
},
|
|
980
|
-
[
|
|
1255
|
+
[$n]: {
|
|
1256
|
+
category: "Embed",
|
|
1257
|
+
type: "string",
|
|
1258
|
+
array: !0,
|
|
1259
|
+
default: [{ value: [] }],
|
|
1260
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1261
|
+
},
|
|
1262
|
+
[vn]: {
|
|
1263
|
+
category: "Embed",
|
|
1264
|
+
type: "string",
|
|
1265
|
+
array: !0,
|
|
1266
|
+
default: [{ value: [] }],
|
|
1267
|
+
description: "Tags that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1268
|
+
},
|
|
1269
|
+
[Lr]: {
|
|
981
1270
|
category: "Embed",
|
|
982
1271
|
type: "choice",
|
|
983
1272
|
default: "ruby",
|
|
984
1273
|
description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
985
|
-
choices:
|
|
1274
|
+
choices: Ar.map((e) => ({
|
|
986
1275
|
value: e,
|
|
987
1276
|
description: `Use the "${e}" parser.`
|
|
988
1277
|
}))
|
|
989
1278
|
}
|
|
990
|
-
},
|
|
1279
|
+
}, Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
991
1280
|
__proto__: null,
|
|
992
|
-
embedder:
|
|
993
|
-
language:
|
|
994
|
-
options:
|
|
995
|
-
}, Symbol.toStringTag, { value: "Module" })), { group:
|
|
996
|
-
|
|
997
|
-
const
|
|
1281
|
+
embedder: Mr,
|
|
1282
|
+
language: ue,
|
|
1283
|
+
options: kr
|
|
1284
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: V, line: Dn, softline: Mn, indent: Tn } = T, Nr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1285
|
+
N("prettier-plugin-sh", r, n);
|
|
1286
|
+
const s = {
|
|
998
1287
|
...r,
|
|
999
|
-
...
|
|
1000
|
-
}, { node:
|
|
1001
|
-
(m, g, { length:
|
|
1002
|
-
).join(""),
|
|
1003
|
-
|
|
1288
|
+
...a
|
|
1289
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1290
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1291
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1292
|
+
c.length,
|
|
1004
1293
|
-u.length || void 0
|
|
1005
|
-
), b =
|
|
1006
|
-
...
|
|
1294
|
+
), b = S(i, t), _ = await e(f, {
|
|
1295
|
+
...s,
|
|
1007
1296
|
parser: "sh"
|
|
1008
|
-
}),
|
|
1009
|
-
|
|
1010
|
-
|
|
1297
|
+
}), o = A(
|
|
1298
|
+
_,
|
|
1299
|
+
E,
|
|
1011
1300
|
b,
|
|
1012
1301
|
!0
|
|
1013
1302
|
);
|
|
1014
|
-
if (
|
|
1015
|
-
return
|
|
1303
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1304
|
+
return V([
|
|
1016
1305
|
"`",
|
|
1017
|
-
|
|
1018
|
-
|
|
1306
|
+
c,
|
|
1307
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [V(o)] : Tn([V(o)]),
|
|
1019
1308
|
u,
|
|
1020
1309
|
"`"
|
|
1021
1310
|
]);
|
|
1022
|
-
const
|
|
1023
|
-
return
|
|
1311
|
+
const h = c.length ? Dn : Mn, $ = u.length ? Dn : Mn;
|
|
1312
|
+
return V([
|
|
1024
1313
|
"`",
|
|
1025
|
-
|
|
1026
|
-
|
|
1314
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, V(o)] : Tn([h, V(o)]),
|
|
1315
|
+
$,
|
|
1027
1316
|
"`"
|
|
1028
1317
|
]);
|
|
1029
|
-
},
|
|
1030
|
-
[
|
|
1318
|
+
}, ke = "embeddedSh", xr = ["sh"], Ir = v(ke), An = M(ke), Sn = D(ke), Or = {
|
|
1319
|
+
[Ir]: {
|
|
1320
|
+
category: "Embed",
|
|
1321
|
+
type: "string",
|
|
1322
|
+
array: !0,
|
|
1323
|
+
default: [{ value: [...xr] }],
|
|
1324
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin.",
|
|
1325
|
+
deprecated: `Please use \`${An}\` or \`${Sn}\`.`
|
|
1326
|
+
},
|
|
1327
|
+
[An]: {
|
|
1328
|
+
category: "Embed",
|
|
1329
|
+
type: "string",
|
|
1330
|
+
array: !0,
|
|
1331
|
+
default: [{ value: [] }],
|
|
1332
|
+
description: "Block comments that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1333
|
+
},
|
|
1334
|
+
[Sn]: {
|
|
1031
1335
|
category: "Embed",
|
|
1032
1336
|
type: "string",
|
|
1033
1337
|
array: !0,
|
|
1034
|
-
default: [{ value: [
|
|
1035
|
-
description: "
|
|
1338
|
+
default: [{ value: [] }],
|
|
1339
|
+
description: "Tags that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1036
1340
|
}
|
|
1037
|
-
},
|
|
1341
|
+
}, Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1038
1342
|
__proto__: null,
|
|
1039
|
-
embedder:
|
|
1040
|
-
language:
|
|
1041
|
-
options:
|
|
1343
|
+
embedder: Nr,
|
|
1344
|
+
language: ke,
|
|
1345
|
+
options: Or
|
|
1042
1346
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1043
|
-
function
|
|
1044
|
-
var
|
|
1347
|
+
function Ln(e, t) {
|
|
1348
|
+
var i = Object.keys(e);
|
|
1045
1349
|
if (Object.getOwnPropertySymbols) {
|
|
1046
1350
|
var r = Object.getOwnPropertySymbols(e);
|
|
1047
|
-
t && (r = r.filter(function(
|
|
1048
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
1049
|
-
})),
|
|
1351
|
+
t && (r = r.filter(function(n) {
|
|
1352
|
+
return Object.getOwnPropertyDescriptor(e, n).enumerable;
|
|
1353
|
+
})), i.push.apply(i, r);
|
|
1050
1354
|
}
|
|
1051
|
-
return
|
|
1355
|
+
return i;
|
|
1052
1356
|
}
|
|
1053
|
-
function
|
|
1357
|
+
function kn(e) {
|
|
1054
1358
|
for (var t = 1; t < arguments.length; t++) {
|
|
1055
|
-
var
|
|
1056
|
-
t % 2 ?
|
|
1057
|
-
|
|
1058
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
1059
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(
|
|
1359
|
+
var i = arguments[t] != null ? arguments[t] : {};
|
|
1360
|
+
t % 2 ? Ln(Object(i), !0).forEach(function(r) {
|
|
1361
|
+
Br(e, r, i[r]);
|
|
1362
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : Ln(Object(i)).forEach(function(r) {
|
|
1363
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(i, r));
|
|
1060
1364
|
});
|
|
1061
1365
|
}
|
|
1062
1366
|
return e;
|
|
1063
1367
|
}
|
|
1064
|
-
function
|
|
1065
|
-
return t =
|
|
1368
|
+
function Br(e, t, i) {
|
|
1369
|
+
return t = qr(t), t in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e;
|
|
1066
1370
|
}
|
|
1067
|
-
function
|
|
1068
|
-
var t =
|
|
1371
|
+
function qr(e) {
|
|
1372
|
+
var t = jr(e, "string");
|
|
1069
1373
|
return typeof t == "symbol" ? t : String(t);
|
|
1070
1374
|
}
|
|
1071
|
-
function
|
|
1375
|
+
function jr(e, t) {
|
|
1072
1376
|
if (typeof e != "object" || e === null)
|
|
1073
1377
|
return e;
|
|
1074
|
-
var
|
|
1075
|
-
if (
|
|
1076
|
-
var r =
|
|
1378
|
+
var i = e[Symbol.toPrimitive];
|
|
1379
|
+
if (i !== void 0) {
|
|
1380
|
+
var r = i.call(e, t || "default");
|
|
1077
1381
|
if (typeof r != "object")
|
|
1078
1382
|
return r;
|
|
1079
1383
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1080
1384
|
}
|
|
1081
1385
|
return (t === "string" ? String : Number)(e);
|
|
1082
1386
|
}
|
|
1083
|
-
const
|
|
1084
|
-
function
|
|
1085
|
-
return t.withOptions = (
|
|
1086
|
-
function t(
|
|
1087
|
-
const
|
|
1088
|
-
escapeSpecialCharacters:
|
|
1387
|
+
const Ur = ri({});
|
|
1388
|
+
function ri(e) {
|
|
1389
|
+
return t.withOptions = (i) => ri(kn(kn({}, e), i)), t;
|
|
1390
|
+
function t(i, ...r) {
|
|
1391
|
+
const n = typeof i == "string" ? [i] : i.raw, {
|
|
1392
|
+
escapeSpecialCharacters: a = Array.isArray(i)
|
|
1089
1393
|
} = e;
|
|
1090
|
-
let
|
|
1091
|
-
for (let
|
|
1092
|
-
let
|
|
1093
|
-
|
|
1394
|
+
let s = "";
|
|
1395
|
+
for (let E = 0; E < n.length; E++) {
|
|
1396
|
+
let d = n[E];
|
|
1397
|
+
a && (d = d.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), s += d, E < r.length && (s += r[E]);
|
|
1094
1398
|
}
|
|
1095
|
-
const
|
|
1399
|
+
const l = s.split(`
|
|
1096
1400
|
`);
|
|
1097
1401
|
let p = null;
|
|
1098
|
-
for (const
|
|
1099
|
-
const
|
|
1100
|
-
if (
|
|
1101
|
-
const
|
|
1102
|
-
p ? p = Math.min(p,
|
|
1402
|
+
for (const E of l) {
|
|
1403
|
+
const d = E.match(/^(\s+)\S+/);
|
|
1404
|
+
if (d) {
|
|
1405
|
+
const c = d[1].length;
|
|
1406
|
+
p ? p = Math.min(p, c) : p = c;
|
|
1103
1407
|
}
|
|
1104
1408
|
}
|
|
1105
1409
|
if (p !== null) {
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1410
|
+
const E = p;
|
|
1411
|
+
s = l.map((d) => d[0] === " " || d[0] === " " ? d.slice(E) : d).join(`
|
|
1108
1412
|
`);
|
|
1109
1413
|
}
|
|
1110
|
-
return
|
|
1414
|
+
return s.trim().replace(/\\n/g, `
|
|
1111
1415
|
`);
|
|
1112
1416
|
}
|
|
1113
1417
|
}
|
|
1114
|
-
const { group:
|
|
1115
|
-
const
|
|
1418
|
+
const { group: Z, line: Gn, softline: Nn, indent: xn } = T, Rr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1419
|
+
const s = {
|
|
1116
1420
|
...r,
|
|
1117
|
-
...
|
|
1118
|
-
},
|
|
1119
|
-
|
|
1120
|
-
const { node: p } =
|
|
1121
|
-
(m, g, { length:
|
|
1122
|
-
).join(""), u =
|
|
1421
|
+
...a
|
|
1422
|
+
}, l = s.embeddedSqlPlugin ?? "prettier-plugin-sql";
|
|
1423
|
+
N(l, s, n);
|
|
1424
|
+
const { node: p } = i, { createPlaceholder: E, placeholderRegex: d } = L(), c = p.quasis.map(
|
|
1425
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + E(g)
|
|
1426
|
+
).join(""), u = c.match(/^\s+/)?.[0] ?? "", f = c.match(/\s+$/)?.[0] ?? "", b = c.slice(
|
|
1123
1427
|
u.length,
|
|
1124
|
-
-
|
|
1125
|
-
),
|
|
1126
|
-
let
|
|
1127
|
-
if (
|
|
1428
|
+
-f.length || void 0
|
|
1429
|
+
), _ = S(i, t);
|
|
1430
|
+
let o;
|
|
1431
|
+
if (l === "prettier-plugin-sql-cst") {
|
|
1128
1432
|
const m = await e(b, {
|
|
1129
|
-
...
|
|
1130
|
-
parser:
|
|
1433
|
+
...s,
|
|
1434
|
+
parser: s.embeddedSqlParser ?? "sqlite"
|
|
1131
1435
|
});
|
|
1132
|
-
|
|
1436
|
+
o = A(m, d, _);
|
|
1133
1437
|
} else {
|
|
1134
|
-
const m = await e(
|
|
1135
|
-
...
|
|
1438
|
+
const m = await e(Ur(b), {
|
|
1439
|
+
...s,
|
|
1136
1440
|
parser: "sql"
|
|
1137
1441
|
});
|
|
1138
|
-
|
|
1442
|
+
o = A(
|
|
1139
1443
|
m,
|
|
1140
|
-
|
|
1141
|
-
|
|
1444
|
+
d,
|
|
1445
|
+
_,
|
|
1142
1446
|
!0
|
|
1143
1447
|
);
|
|
1144
1448
|
}
|
|
1145
|
-
if (
|
|
1146
|
-
return
|
|
1449
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1450
|
+
return Z([
|
|
1147
1451
|
"`",
|
|
1148
1452
|
u,
|
|
1149
|
-
|
|
1150
|
-
|
|
1453
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [Z(o)] : xn([Z(o)]),
|
|
1454
|
+
f,
|
|
1151
1455
|
"`"
|
|
1152
1456
|
]);
|
|
1153
|
-
const
|
|
1154
|
-
return
|
|
1457
|
+
const h = u.length ? Gn : Nn, $ = f.length ? Gn : Nn;
|
|
1458
|
+
return Z([
|
|
1155
1459
|
"`",
|
|
1156
|
-
|
|
1157
|
-
|
|
1460
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, Z(o)] : xn([h, Z(o)]),
|
|
1461
|
+
$,
|
|
1158
1462
|
"`"
|
|
1159
1463
|
]);
|
|
1160
|
-
}, se = "embeddedSql",
|
|
1464
|
+
}, se = "embeddedSql", Cr = ["sql"], wr = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], Fr = [
|
|
1161
1465
|
"sqlite",
|
|
1162
1466
|
"bigquery",
|
|
1163
1467
|
"mysql",
|
|
1164
1468
|
"mariadb",
|
|
1165
1469
|
"postgresql"
|
|
1166
|
-
],
|
|
1167
|
-
[
|
|
1470
|
+
], Wr = v(se), In = M(se), On = D(se), zr = Ni(se), Kr = x(se), Jr = {
|
|
1471
|
+
[Wr]: {
|
|
1168
1472
|
category: "Embed",
|
|
1169
1473
|
type: "string",
|
|
1170
1474
|
array: !0,
|
|
1171
|
-
default: [{ value: [...
|
|
1172
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1475
|
+
default: [{ value: [...Cr] }],
|
|
1476
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1477
|
+
deprecated: `Please use \`${In}\` or \`${On}\`.`
|
|
1478
|
+
},
|
|
1479
|
+
[In]: {
|
|
1480
|
+
category: "Embed",
|
|
1481
|
+
type: "string",
|
|
1482
|
+
array: !0,
|
|
1483
|
+
default: [{ value: [] }],
|
|
1484
|
+
description: "Block comments that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1485
|
+
},
|
|
1486
|
+
[On]: {
|
|
1487
|
+
category: "Embed",
|
|
1488
|
+
type: "string",
|
|
1489
|
+
array: !0,
|
|
1490
|
+
default: [{ value: [] }],
|
|
1491
|
+
description: "Tags that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1173
1492
|
},
|
|
1174
|
-
[
|
|
1493
|
+
[zr]: {
|
|
1175
1494
|
category: "Embed",
|
|
1176
1495
|
type: "choice",
|
|
1177
1496
|
default: "prettier-plugin-sql",
|
|
1178
1497
|
description: "The plugin used to format the embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1179
|
-
choices:
|
|
1498
|
+
choices: wr.map((e) => ({
|
|
1180
1499
|
value: e,
|
|
1181
1500
|
description: `Use the "${e}" plugin.`
|
|
1182
1501
|
}))
|
|
1183
1502
|
},
|
|
1184
|
-
[
|
|
1503
|
+
[Kr]: {
|
|
1185
1504
|
category: "Embed",
|
|
1186
1505
|
type: "choice",
|
|
1187
1506
|
default: "sqlite",
|
|
1188
1507
|
description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
|
|
1189
|
-
choices:
|
|
1508
|
+
choices: Fr.map((e) => ({
|
|
1190
1509
|
value: e,
|
|
1191
1510
|
description: `Use the "${e}" parser.`
|
|
1192
1511
|
}))
|
|
1193
1512
|
}
|
|
1194
|
-
},
|
|
1513
|
+
}, Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1195
1514
|
__proto__: null,
|
|
1196
|
-
embedder:
|
|
1515
|
+
embedder: Rr,
|
|
1197
1516
|
language: se,
|
|
1198
|
-
options:
|
|
1199
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1517
|
+
options: Jr
|
|
1518
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Pn, group: ee, indent: Bn, softline: qn } = T, Xr = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1519
|
+
N("prettier-plugin-toml", r, n);
|
|
1520
|
+
const s = {
|
|
1202
1521
|
...r,
|
|
1203
|
-
...
|
|
1204
|
-
}, { node:
|
|
1205
|
-
(m, g, { length:
|
|
1206
|
-
).join(""),
|
|
1207
|
-
|
|
1522
|
+
...a
|
|
1523
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1524
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1525
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1526
|
+
c.length,
|
|
1208
1527
|
-u.length || void 0
|
|
1209
|
-
), b =
|
|
1210
|
-
...
|
|
1528
|
+
), b = S(i, t), _ = await e(f, {
|
|
1529
|
+
...s,
|
|
1211
1530
|
parser: "toml"
|
|
1212
|
-
}),
|
|
1213
|
-
|
|
1214
|
-
|
|
1531
|
+
}), o = A(
|
|
1532
|
+
_,
|
|
1533
|
+
E,
|
|
1215
1534
|
b,
|
|
1216
1535
|
!0
|
|
1217
1536
|
);
|
|
1218
|
-
if (
|
|
1219
|
-
return
|
|
1537
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1538
|
+
return ee([
|
|
1220
1539
|
"`",
|
|
1221
|
-
|
|
1222
|
-
|
|
1540
|
+
c,
|
|
1541
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [ee(o)] : Bn([ee(o)]),
|
|
1223
1542
|
u,
|
|
1224
1543
|
"`"
|
|
1225
1544
|
]);
|
|
1226
|
-
const
|
|
1227
|
-
return
|
|
1545
|
+
const h = c.length ? Pn : qn, $ = u.length ? Pn : qn;
|
|
1546
|
+
return ee([
|
|
1228
1547
|
"`",
|
|
1229
|
-
|
|
1230
|
-
|
|
1548
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, ee(o)] : Bn([h, ee(o)]),
|
|
1549
|
+
$,
|
|
1231
1550
|
"`"
|
|
1232
1551
|
]);
|
|
1233
|
-
},
|
|
1234
|
-
[
|
|
1552
|
+
}, Ge = "embeddedToml", Qr = ["toml"], Yr = v(Ge), jn = M(Ge), Un = D(Ge), Vr = {
|
|
1553
|
+
[Yr]: {
|
|
1235
1554
|
category: "Embed",
|
|
1236
1555
|
type: "string",
|
|
1237
1556
|
array: !0,
|
|
1238
|
-
default: [{ value: [...
|
|
1239
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1557
|
+
default: [{ value: [...Qr] }],
|
|
1558
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin.",
|
|
1559
|
+
deprecated: `Please use \`${jn}\` or \`${Un}\`.`
|
|
1560
|
+
},
|
|
1561
|
+
[jn]: {
|
|
1562
|
+
category: "Embed",
|
|
1563
|
+
type: "string",
|
|
1564
|
+
array: !0,
|
|
1565
|
+
default: [{ value: [] }],
|
|
1566
|
+
description: "Block comments that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1567
|
+
},
|
|
1568
|
+
[Un]: {
|
|
1569
|
+
category: "Embed",
|
|
1570
|
+
type: "string",
|
|
1571
|
+
array: !0,
|
|
1572
|
+
default: [{ value: [] }],
|
|
1573
|
+
description: "Tags that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1240
1574
|
}
|
|
1241
|
-
},
|
|
1575
|
+
}, Zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1242
1576
|
__proto__: null,
|
|
1243
|
-
embedder:
|
|
1244
|
-
language:
|
|
1245
|
-
options:
|
|
1246
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
1247
|
-
const
|
|
1577
|
+
embedder: Xr,
|
|
1578
|
+
language: Ge,
|
|
1579
|
+
options: Vr
|
|
1580
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Rn, group: te, indent: Cn, softline: wn } = T, eo = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1581
|
+
const s = {
|
|
1248
1582
|
...r,
|
|
1249
|
-
...
|
|
1250
|
-
}, { node:
|
|
1251
|
-
(m, g, { length:
|
|
1252
|
-
).join(""),
|
|
1253
|
-
|
|
1583
|
+
...a
|
|
1584
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1585
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1586
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1587
|
+
c.length,
|
|
1254
1588
|
-u.length || void 0
|
|
1255
|
-
), b =
|
|
1256
|
-
...
|
|
1257
|
-
parser:
|
|
1589
|
+
), b = S(i, t), _ = await e(f, {
|
|
1590
|
+
...s,
|
|
1591
|
+
parser: s.embeddedTsParser ?? "typescript",
|
|
1258
1592
|
// set filepath to undefined to enable jsx auto detection:
|
|
1259
1593
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
1260
1594
|
filepath: void 0
|
|
1261
|
-
}),
|
|
1262
|
-
if (
|
|
1263
|
-
return
|
|
1595
|
+
}), o = A(_, E, b);
|
|
1596
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1597
|
+
return te([
|
|
1264
1598
|
"`",
|
|
1265
|
-
|
|
1266
|
-
|
|
1599
|
+
c,
|
|
1600
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [te(o)] : Cn([te(o)]),
|
|
1267
1601
|
u,
|
|
1268
1602
|
"`"
|
|
1269
1603
|
]);
|
|
1270
|
-
const
|
|
1271
|
-
return
|
|
1604
|
+
const h = c.length ? Rn : wn, $ = u.length ? Rn : wn;
|
|
1605
|
+
return te([
|
|
1272
1606
|
"`",
|
|
1273
|
-
|
|
1274
|
-
|
|
1607
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, te(o)] : Cn([h, te(o)]),
|
|
1608
|
+
$,
|
|
1275
1609
|
"`"
|
|
1276
1610
|
]);
|
|
1277
|
-
},
|
|
1278
|
-
|
|
1611
|
+
}, pe = "embeddedTs", to = [
|
|
1612
|
+
"ts",
|
|
1613
|
+
"tsx",
|
|
1614
|
+
"cts",
|
|
1615
|
+
"mts",
|
|
1616
|
+
"typescript"
|
|
1617
|
+
], no = ["typescript", "babel-ts"], io = v(pe), Fn = M(pe), Wn = D(pe), so = x(pe), ro = {
|
|
1618
|
+
[io]: {
|
|
1279
1619
|
category: "Embed",
|
|
1280
1620
|
type: "string",
|
|
1281
1621
|
array: !0,
|
|
1282
|
-
default: [{ value: [...
|
|
1283
|
-
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1622
|
+
default: [{ value: [...to] }],
|
|
1623
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.",
|
|
1624
|
+
deprecated: `Please use \`${Fn}\` or \`${Wn}\`.`
|
|
1284
1625
|
},
|
|
1285
|
-
[
|
|
1626
|
+
[Fn]: {
|
|
1627
|
+
category: "Embed",
|
|
1628
|
+
type: "string",
|
|
1629
|
+
array: !0,
|
|
1630
|
+
default: [{ value: [] }],
|
|
1631
|
+
description: "Block comments that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1632
|
+
},
|
|
1633
|
+
[Wn]: {
|
|
1634
|
+
category: "Embed",
|
|
1635
|
+
type: "string",
|
|
1636
|
+
array: !0,
|
|
1637
|
+
default: [{ value: [] }],
|
|
1638
|
+
description: "Tags that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1639
|
+
},
|
|
1640
|
+
[so]: {
|
|
1286
1641
|
category: "Embed",
|
|
1287
1642
|
type: "choice",
|
|
1288
1643
|
default: "typescript",
|
|
1289
1644
|
description: "The parser used to parse the embedded TypeScript language.",
|
|
1290
|
-
choices:
|
|
1645
|
+
choices: no.map((e) => ({
|
|
1291
1646
|
value: e,
|
|
1292
1647
|
description: `Use the "${e}" parser.`
|
|
1293
1648
|
}))
|
|
1294
1649
|
}
|
|
1295
|
-
},
|
|
1650
|
+
}, oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1296
1651
|
__proto__: null,
|
|
1297
|
-
embedder:
|
|
1298
|
-
language:
|
|
1299
|
-
options:
|
|
1300
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1301
|
-
|
|
1302
|
-
const
|
|
1652
|
+
embedder: eo,
|
|
1653
|
+
language: pe,
|
|
1654
|
+
options: ro
|
|
1655
|
+
}, Symbol.toStringTag, { value: "Module" })), ge = "embeddedXml", { line: zn, group: ne, indent: Kn, softline: xe } = T, ao = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1656
|
+
N("@prettier/plugin-xml", r, n);
|
|
1657
|
+
const s = {
|
|
1303
1658
|
...r,
|
|
1304
|
-
...
|
|
1305
|
-
}, { node:
|
|
1306
|
-
(g,
|
|
1307
|
-
).join(""),
|
|
1308
|
-
|
|
1659
|
+
...a
|
|
1660
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1661
|
+
(g, y, { length: k }) => y === k - 1 ? g.value.cooked : g.value.cooked + p(y)
|
|
1662
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1663
|
+
c.length,
|
|
1309
1664
|
-u.length || void 0
|
|
1310
|
-
), b =
|
|
1311
|
-
let
|
|
1312
|
-
for (;
|
|
1313
|
-
const g =
|
|
1665
|
+
), b = S(i, t), _ = [];
|
|
1666
|
+
let o = 0;
|
|
1667
|
+
for (; o !== void 0; ) {
|
|
1668
|
+
const g = f.slice(o);
|
|
1314
1669
|
if (g.length === 0)
|
|
1315
1670
|
break;
|
|
1316
|
-
|
|
1671
|
+
o > 0 && s.xmlWhitespaceSensitivity !== "strict" && _.push(xe), s.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1317
1672
|
0,
|
|
1318
|
-
|
|
1673
|
+
s.__embeddedXmlFragmentRecoverIndex.length
|
|
1319
1674
|
);
|
|
1320
|
-
let
|
|
1321
|
-
...
|
|
1322
|
-
parser:
|
|
1675
|
+
let y = await e(g, {
|
|
1676
|
+
...s,
|
|
1677
|
+
parser: ge
|
|
1323
1678
|
});
|
|
1324
|
-
const [
|
|
1325
|
-
|
|
1679
|
+
const [k, G] = s.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1680
|
+
k === void 0 ? o = void 0 : G === void 0 ? o += k : (y = g.slice(k, G + 1), o += G + 1), _.push(y);
|
|
1326
1681
|
}
|
|
1327
|
-
const
|
|
1328
|
-
if (
|
|
1329
|
-
return
|
|
1682
|
+
const h = A(_, E, b);
|
|
1683
|
+
if (s.xmlWhitespaceSensitivity === "strict" || s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1684
|
+
return ne([
|
|
1330
1685
|
"`",
|
|
1331
|
-
|
|
1332
|
-
|
|
1686
|
+
c,
|
|
1687
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [ne(h)] : Kn([ne(h)]),
|
|
1333
1688
|
u,
|
|
1334
1689
|
"`"
|
|
1335
1690
|
]);
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1691
|
+
const $ = c.length ? zn : xe, m = u.length ? zn : xe;
|
|
1692
|
+
return ne([
|
|
1338
1693
|
"`",
|
|
1339
|
-
|
|
1694
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [$, ne(h)] : Kn([$, ne(h)]),
|
|
1340
1695
|
m,
|
|
1341
1696
|
"`"
|
|
1342
1697
|
]);
|
|
1343
|
-
},
|
|
1344
|
-
[
|
|
1698
|
+
}, lo = ["xml", "opml", "rss", "svg"], co = v(ge), Jn = M(ge), Hn = D(ge), uo = {
|
|
1699
|
+
[co]: {
|
|
1700
|
+
category: "Embed",
|
|
1701
|
+
type: "string",
|
|
1702
|
+
array: !0,
|
|
1703
|
+
default: [{ value: [...lo] }],
|
|
1704
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin.",
|
|
1705
|
+
deprecated: `Please use \`${Jn}\` or \`${Hn}\`.`
|
|
1706
|
+
},
|
|
1707
|
+
[Jn]: {
|
|
1708
|
+
category: "Embed",
|
|
1709
|
+
type: "string",
|
|
1710
|
+
array: !0,
|
|
1711
|
+
default: [{ value: [] }],
|
|
1712
|
+
description: "Block comments that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1713
|
+
},
|
|
1714
|
+
[Hn]: {
|
|
1345
1715
|
category: "Embed",
|
|
1346
1716
|
type: "string",
|
|
1347
1717
|
array: !0,
|
|
1348
|
-
default: [{ value: [
|
|
1349
|
-
description: "
|
|
1718
|
+
default: [{ value: [] }],
|
|
1719
|
+
description: "Tags that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1350
1720
|
},
|
|
1351
1721
|
/**
|
|
1352
1722
|
* @internal
|
|
@@ -1359,7 +1729,7 @@ const { group: Q, line: $t, softline: It, indent: Dt } = $, zs = async (e, t, n,
|
|
|
1359
1729
|
description: "This option is read only and is used internally as a workaround to support xml fragments"
|
|
1360
1730
|
}
|
|
1361
1731
|
};
|
|
1362
|
-
function
|
|
1732
|
+
function po(e) {
|
|
1363
1733
|
const t = {
|
|
1364
1734
|
loc: {
|
|
1365
1735
|
start: {
|
|
@@ -1371,15 +1741,15 @@ function fr(e) {
|
|
|
1371
1741
|
column: e.column + e.length
|
|
1372
1742
|
}
|
|
1373
1743
|
}
|
|
1374
|
-
},
|
|
1744
|
+
}, i = new SyntaxError(
|
|
1375
1745
|
`${e.message} (${t.loc.start.line}:${t.loc.start.column})`,
|
|
1376
1746
|
{
|
|
1377
1747
|
cause: e
|
|
1378
1748
|
}
|
|
1379
1749
|
);
|
|
1380
|
-
return Object.assign(
|
|
1750
|
+
return Object.assign(i, t), i;
|
|
1381
1751
|
}
|
|
1382
|
-
function
|
|
1752
|
+
function Xn(e) {
|
|
1383
1753
|
const t = {
|
|
1384
1754
|
loc: {
|
|
1385
1755
|
start: {
|
|
@@ -1391,60 +1761,60 @@ function Pt(e) {
|
|
|
1391
1761
|
column: e.token.endColumn ?? NaN
|
|
1392
1762
|
}
|
|
1393
1763
|
}
|
|
1394
|
-
},
|
|
1764
|
+
}, i = new SyntaxError(
|
|
1395
1765
|
`${e.message} (${t.loc.start.line}:${t.loc.start.column})`,
|
|
1396
1766
|
{
|
|
1397
1767
|
cause: e
|
|
1398
1768
|
}
|
|
1399
1769
|
);
|
|
1400
|
-
return Object.assign(
|
|
1770
|
+
return Object.assign(i, t), i;
|
|
1401
1771
|
}
|
|
1402
|
-
const
|
|
1772
|
+
const go = {
|
|
1403
1773
|
async parse(e, t) {
|
|
1404
|
-
const { parse:
|
|
1774
|
+
const { parse: i } = await import("@xml-tools/parser"), { lexErrors: r, parseErrors: n, cst: a } = i(e);
|
|
1405
1775
|
if (r.length > 0) {
|
|
1406
|
-
const
|
|
1407
|
-
throw
|
|
1776
|
+
const s = r[0];
|
|
1777
|
+
throw po(s);
|
|
1408
1778
|
}
|
|
1409
|
-
if (
|
|
1410
|
-
let
|
|
1411
|
-
for (const
|
|
1779
|
+
if (n.length > 0) {
|
|
1780
|
+
let s = !1;
|
|
1781
|
+
for (const l of n) {
|
|
1412
1782
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
1413
|
-
|
|
1783
|
+
l.name
|
|
1414
1784
|
))
|
|
1415
|
-
throw
|
|
1416
|
-
if (
|
|
1417
|
-
|
|
1785
|
+
throw Xn(l);
|
|
1786
|
+
if (l.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1787
|
+
s = !0;
|
|
1418
1788
|
continue;
|
|
1419
1789
|
}
|
|
1420
1790
|
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
|
|
1421
|
-
|
|
1422
|
-
) || /Redundant input, expecting EOF but found: /.test(
|
|
1791
|
+
l.message
|
|
1792
|
+
) || /Redundant input, expecting EOF but found: /.test(l.message)) {
|
|
1423
1793
|
t.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1424
1794
|
0,
|
|
1425
1795
|
t.__embeddedXmlFragmentRecoverIndex.length,
|
|
1426
|
-
|
|
1796
|
+
l.token.startOffset
|
|
1427
1797
|
);
|
|
1428
1798
|
break;
|
|
1429
1799
|
}
|
|
1430
1800
|
if (/Expecting token of type --> OPEN <-- but found --> '[\s\S]+' <--/.test(
|
|
1431
|
-
|
|
1801
|
+
l.message
|
|
1432
1802
|
)) {
|
|
1433
|
-
if (
|
|
1803
|
+
if (l.token.endOffset === void 0 || Number.isNaN(l.token.endOffset))
|
|
1434
1804
|
break;
|
|
1435
1805
|
t.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1436
1806
|
0,
|
|
1437
1807
|
t.__embeddedXmlFragmentRecoverIndex.length,
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
),
|
|
1808
|
+
l.token.startOffset,
|
|
1809
|
+
l.token.endOffset
|
|
1810
|
+
), s = !0;
|
|
1441
1811
|
break;
|
|
1442
1812
|
}
|
|
1443
|
-
throw
|
|
1813
|
+
throw Xn(l);
|
|
1444
1814
|
}
|
|
1445
|
-
|
|
1815
|
+
s && oi(a);
|
|
1446
1816
|
}
|
|
1447
|
-
return
|
|
1817
|
+
return a;
|
|
1448
1818
|
},
|
|
1449
1819
|
astFormat: "xml",
|
|
1450
1820
|
locStart(e) {
|
|
@@ -1454,149 +1824,172 @@ const br = {
|
|
|
1454
1824
|
return e.location.endOffset ?? NaN;
|
|
1455
1825
|
}
|
|
1456
1826
|
};
|
|
1457
|
-
function
|
|
1827
|
+
function oi(e) {
|
|
1458
1828
|
const t = e.children;
|
|
1459
|
-
for (const
|
|
1460
|
-
const r = t[
|
|
1461
|
-
for (let
|
|
1462
|
-
const
|
|
1463
|
-
if (
|
|
1464
|
-
if (Object.keys(
|
|
1465
|
-
r.splice(
|
|
1829
|
+
for (const i in t) {
|
|
1830
|
+
const r = t[i] ?? [];
|
|
1831
|
+
for (let n = r.length - 1; n >= 0; --n) {
|
|
1832
|
+
const a = r[n];
|
|
1833
|
+
if (mo(a)) {
|
|
1834
|
+
if (Object.keys(a.children).length === 0) {
|
|
1835
|
+
r.splice(n, 1), r.length === 0 && delete t[i];
|
|
1466
1836
|
continue;
|
|
1467
1837
|
}
|
|
1468
|
-
|
|
1838
|
+
oi(a);
|
|
1469
1839
|
}
|
|
1470
1840
|
}
|
|
1471
1841
|
}
|
|
1472
1842
|
}
|
|
1473
|
-
function
|
|
1843
|
+
function mo(e) {
|
|
1474
1844
|
return "name" in e && "children" in e && "location" in e;
|
|
1475
1845
|
}
|
|
1476
|
-
const
|
|
1846
|
+
const ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1477
1847
|
__proto__: null,
|
|
1478
|
-
embedder:
|
|
1479
|
-
language:
|
|
1480
|
-
options:
|
|
1481
|
-
parser:
|
|
1482
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
1483
|
-
const
|
|
1848
|
+
embedder: ao,
|
|
1849
|
+
language: ge,
|
|
1850
|
+
options: uo,
|
|
1851
|
+
parser: go
|
|
1852
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Qn, group: ie, indent: Yn, softline: Vn } = T, Eo = async (e, t, i, r, { commentOrTag: n, embeddedOverrideOptions: a }) => {
|
|
1853
|
+
const s = {
|
|
1484
1854
|
...r,
|
|
1485
|
-
...
|
|
1486
|
-
}, { node:
|
|
1487
|
-
(m, g, { length:
|
|
1488
|
-
).join(""),
|
|
1489
|
-
|
|
1855
|
+
...a
|
|
1856
|
+
}, { node: l } = i, { createPlaceholder: p, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1857
|
+
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
1858
|
+
).join(""), c = d.match(/^\s+/)?.[0] ?? "", u = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1859
|
+
c.length,
|
|
1490
1860
|
-u.length || void 0
|
|
1491
|
-
), b =
|
|
1492
|
-
...
|
|
1861
|
+
), b = S(i, t), _ = await e(f, {
|
|
1862
|
+
...s,
|
|
1493
1863
|
parser: "yaml"
|
|
1494
|
-
}),
|
|
1495
|
-
if (
|
|
1496
|
-
return
|
|
1864
|
+
}), o = A(_, E, b);
|
|
1865
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(n))
|
|
1866
|
+
return ie([
|
|
1497
1867
|
"`",
|
|
1498
|
-
|
|
1499
|
-
|
|
1868
|
+
c,
|
|
1869
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [ie(o)] : Yn([ie(o)]),
|
|
1500
1870
|
u,
|
|
1501
1871
|
"`"
|
|
1502
1872
|
]);
|
|
1503
|
-
const
|
|
1504
|
-
return
|
|
1873
|
+
const h = c.length ? Qn : Vn, $ = u.length ? Qn : Vn;
|
|
1874
|
+
return ie([
|
|
1505
1875
|
"`",
|
|
1506
|
-
|
|
1507
|
-
|
|
1876
|
+
s.noEmbeddedMultiLineIndentation?.includes(n) ? [h, ie(o)] : Yn([h, ie(o)]),
|
|
1877
|
+
$,
|
|
1508
1878
|
"`"
|
|
1509
1879
|
]);
|
|
1510
|
-
},
|
|
1511
|
-
[
|
|
1880
|
+
}, Ne = "embeddedYaml", bo = ["yaml", "yml"], fo = v(Ne), Zn = M(Ne), ei = D(Ne), yo = {
|
|
1881
|
+
[fo]: {
|
|
1882
|
+
category: "Embed",
|
|
1883
|
+
type: "string",
|
|
1884
|
+
array: !0,
|
|
1885
|
+
default: [{ value: [...bo] }],
|
|
1886
|
+
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language.",
|
|
1887
|
+
deprecated: `Please use \`${Zn}\` or \`${ei}\`.`
|
|
1888
|
+
},
|
|
1889
|
+
[Zn]: {
|
|
1890
|
+
category: "Embed",
|
|
1891
|
+
type: "string",
|
|
1892
|
+
array: !0,
|
|
1893
|
+
default: [{ value: [] }],
|
|
1894
|
+
description: "Block comments that make their subsequent template literals be identified as embedded YAML language."
|
|
1895
|
+
},
|
|
1896
|
+
[ei]: {
|
|
1512
1897
|
category: "Embed",
|
|
1513
1898
|
type: "string",
|
|
1514
1899
|
array: !0,
|
|
1515
|
-
default: [{ value: [
|
|
1516
|
-
description: "
|
|
1900
|
+
default: [{ value: [] }],
|
|
1901
|
+
description: "Tags that make their subsequent template literals be identified as embedded YAML language."
|
|
1517
1902
|
}
|
|
1518
|
-
},
|
|
1903
|
+
}, _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1519
1904
|
__proto__: null,
|
|
1520
|
-
embedder:
|
|
1521
|
-
language:
|
|
1522
|
-
options:
|
|
1523
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1524
|
-
"./css/index.ts":
|
|
1525
|
-
"./es/index.ts":
|
|
1526
|
-
"./glsl/index.ts":
|
|
1527
|
-
"./graphql/index.ts":
|
|
1528
|
-
"./html/index.ts":
|
|
1529
|
-
"./ini/index.ts":
|
|
1530
|
-
"./java/index.ts":
|
|
1531
|
-
"./json/index.ts":
|
|
1532
|
-
"./jsonata/index.ts":
|
|
1533
|
-
"./latex/index.ts":
|
|
1534
|
-
"./markdown/index.ts":
|
|
1535
|
-
"./nginx/index.ts":
|
|
1536
|
-
"./noop/index.ts":
|
|
1537
|
-
"./pegjs/index.ts":
|
|
1538
|
-
"./php/index.ts":
|
|
1539
|
-
"./prisma/index.ts":
|
|
1540
|
-
"./properties/index.ts":
|
|
1541
|
-
"./pug/index.ts":
|
|
1542
|
-
"./ruby/index.ts":
|
|
1543
|
-
"./sh/index.ts":
|
|
1544
|
-
"./sql/index.ts":
|
|
1545
|
-
"./toml/index.ts":
|
|
1546
|
-
"./ts/index.ts":
|
|
1547
|
-
"./xml/index.ts":
|
|
1548
|
-
"./yaml/index.ts":
|
|
1905
|
+
embedder: Eo,
|
|
1906
|
+
language: Ne,
|
|
1907
|
+
options: yo
|
|
1908
|
+
}, Symbol.toStringTag, { value: "Module" })), me = [], ai = {}, di = {}, li = {}, $o = /* @__PURE__ */ Object.assign({
|
|
1909
|
+
"./css/index.ts": ji,
|
|
1910
|
+
"./es/index.ts": zi,
|
|
1911
|
+
"./glsl/index.ts": Qi,
|
|
1912
|
+
"./graphql/index.ts": ts,
|
|
1913
|
+
"./html/index.ts": ls,
|
|
1914
|
+
"./ini/index.ts": ms,
|
|
1915
|
+
"./java/index.ts": ys,
|
|
1916
|
+
"./json/index.ts": Ss,
|
|
1917
|
+
"./jsonata/index.ts": xs,
|
|
1918
|
+
"./latex/index.ts": qs,
|
|
1919
|
+
"./markdown/index.ts": Ws,
|
|
1920
|
+
"./nginx/index.ts": Xs,
|
|
1921
|
+
"./noop/index.ts": Vs,
|
|
1922
|
+
"./pegjs/index.ts": ir,
|
|
1923
|
+
"./php/index.ts": dr,
|
|
1924
|
+
"./prisma/index.ts": gr,
|
|
1925
|
+
"./properties/index.ts": fr,
|
|
1926
|
+
"./pug/index.ts": Dr,
|
|
1927
|
+
"./ruby/index.ts": Gr,
|
|
1928
|
+
"./sh/index.ts": Pr,
|
|
1929
|
+
"./sql/index.ts": Hr,
|
|
1930
|
+
"./toml/index.ts": Zr,
|
|
1931
|
+
"./ts/index.ts": oo,
|
|
1932
|
+
"./xml/index.ts": ho,
|
|
1933
|
+
"./yaml/index.ts": _o
|
|
1549
1934
|
});
|
|
1550
|
-
for (const { language: e, parser: t, embedder:
|
|
1551
|
-
|
|
1552
|
-
const
|
|
1553
|
-
...
|
|
1554
|
-
|
|
1935
|
+
for (const { language: e, parser: t, embedder: i, options: r } of Object.values($o))
|
|
1936
|
+
Gi(me, e, ce), t && (ai[e] = t), i && (di[e] = i), Object.assign(li, r);
|
|
1937
|
+
const vo = "noEmbeddedIdentificationByComment", Do = "noEmbeddedIdentificationByTag", Mo = "preserveEmbeddedExteriorWhitespaces", To = "noEmbeddedMultiLineIndentation", Ao = "embeddedOverrides", ra = {
|
|
1938
|
+
...li,
|
|
1939
|
+
/**
|
|
1940
|
+
* @deprecated Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore.
|
|
1941
|
+
*/
|
|
1942
|
+
[vo]: {
|
|
1555
1943
|
category: "Embed",
|
|
1556
1944
|
type: "string",
|
|
1557
1945
|
array: !0,
|
|
1558
1946
|
default: [{ value: [] }],
|
|
1559
|
-
description: "Turns off `` /*
|
|
1947
|
+
description: "Turns off `` /* comment */ `...` `` comment-based embedded language identification for the specified identifiers.",
|
|
1948
|
+
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1560
1949
|
},
|
|
1561
|
-
|
|
1950
|
+
/**
|
|
1951
|
+
* @deprecated Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore.
|
|
1952
|
+
*/
|
|
1953
|
+
[Do]: {
|
|
1562
1954
|
category: "Embed",
|
|
1563
1955
|
type: "string",
|
|
1564
1956
|
array: !0,
|
|
1565
1957
|
default: [{ value: [] }],
|
|
1566
|
-
description: "Turns off ``
|
|
1958
|
+
description: "Turns off `` tag`...` `` tag-based embedded language identification for the specified identifiers.",
|
|
1959
|
+
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1567
1960
|
},
|
|
1568
|
-
[
|
|
1961
|
+
[Mo]: {
|
|
1569
1962
|
category: "Embed",
|
|
1570
1963
|
type: "string",
|
|
1571
1964
|
array: !0,
|
|
1572
1965
|
default: [{ value: [] }],
|
|
1573
|
-
description: "Preserves leading and trailing whitespaces in the formatting results for the specified
|
|
1966
|
+
description: "Preserves leading and trailing whitespaces in the formatting results for the specified comments or tags."
|
|
1574
1967
|
},
|
|
1575
|
-
[
|
|
1968
|
+
[To]: {
|
|
1576
1969
|
category: "Embed",
|
|
1577
1970
|
type: "string",
|
|
1578
1971
|
array: !0,
|
|
1579
1972
|
default: [{ value: [] }],
|
|
1580
|
-
description: "Turns off auto indentation in the formatting results for the specified
|
|
1973
|
+
description: "Turns off auto indentation in the formatting results for the specified comments or tags when they are formatted to span multi lines."
|
|
1581
1974
|
},
|
|
1582
|
-
[
|
|
1975
|
+
[Ao]: {
|
|
1583
1976
|
category: "Embed",
|
|
1584
1977
|
type: "string",
|
|
1585
1978
|
array: !1,
|
|
1586
1979
|
default: void 0,
|
|
1587
|
-
description: "Option overrides for the specified
|
|
1980
|
+
description: "Option overrides for the specified comments or tags. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
1588
1981
|
}
|
|
1589
|
-
},
|
|
1982
|
+
}, So = {
|
|
1590
1983
|
// parsers from internal
|
|
1591
|
-
...
|
|
1592
|
-
...
|
|
1593
|
-
...
|
|
1594
|
-
...
|
|
1595
|
-
...
|
|
1984
|
+
...Ei.parsers,
|
|
1985
|
+
...bi.parsers,
|
|
1986
|
+
...fi.parsers,
|
|
1987
|
+
..._i.parsers,
|
|
1988
|
+
...yi.parsers,
|
|
1596
1989
|
// parsers from this plugin
|
|
1597
|
-
...
|
|
1990
|
+
...ai
|
|
1598
1991
|
};
|
|
1599
|
-
var
|
|
1992
|
+
var Lo = {
|
|
1600
1993
|
isEqual: !0,
|
|
1601
1994
|
isMatchingKey: !0,
|
|
1602
1995
|
isPromise: !0,
|
|
@@ -1605,38 +1998,38 @@ var Ar = {
|
|
|
1605
1998
|
onCacheChange: !0,
|
|
1606
1999
|
onCacheHit: !0,
|
|
1607
2000
|
transformKey: !0
|
|
1608
|
-
},
|
|
1609
|
-
function
|
|
2001
|
+
}, ko = Array.prototype.slice;
|
|
2002
|
+
function Ee(e) {
|
|
1610
2003
|
var t = e.length;
|
|
1611
|
-
return t ? t === 1 ? [e[0]] : t === 2 ? [e[0], e[1]] : t === 3 ? [e[0], e[1], e[2]] :
|
|
2004
|
+
return t ? t === 1 ? [e[0]] : t === 2 ? [e[0], e[1]] : t === 3 ? [e[0], e[1], e[2]] : ko.call(e, 0) : [];
|
|
1612
2005
|
}
|
|
1613
|
-
function
|
|
2006
|
+
function Go(e) {
|
|
1614
2007
|
var t = {};
|
|
1615
|
-
for (var
|
|
1616
|
-
|
|
2008
|
+
for (var i in e)
|
|
2009
|
+
Lo[i] || (t[i] = e[i]);
|
|
1617
2010
|
return t;
|
|
1618
2011
|
}
|
|
1619
|
-
function
|
|
2012
|
+
function No(e) {
|
|
1620
2013
|
return typeof e == "function" && e.isMemoized;
|
|
1621
2014
|
}
|
|
1622
|
-
function
|
|
2015
|
+
function xo(e, t) {
|
|
1623
2016
|
return e === t || e !== e && t !== t;
|
|
1624
2017
|
}
|
|
1625
|
-
function
|
|
1626
|
-
var
|
|
2018
|
+
function ti(e, t) {
|
|
2019
|
+
var i = {};
|
|
1627
2020
|
for (var r in e)
|
|
1628
|
-
|
|
2021
|
+
i[r] = e[r];
|
|
1629
2022
|
for (var r in t)
|
|
1630
|
-
|
|
1631
|
-
return
|
|
2023
|
+
i[r] = t[r];
|
|
2024
|
+
return i;
|
|
1632
2025
|
}
|
|
1633
|
-
var
|
|
2026
|
+
var Io = (
|
|
1634
2027
|
/** @class */
|
|
1635
2028
|
function() {
|
|
1636
2029
|
function e(t) {
|
|
1637
2030
|
this.keys = [], this.values = [], this.options = t;
|
|
1638
|
-
var
|
|
1639
|
-
|
|
2031
|
+
var i = typeof t.isMatchingKey == "function";
|
|
2032
|
+
i ? this.getKeyIndex = this._getKeyIndexFromMatchingKey : t.maxSize > 1 ? this.getKeyIndex = this._getKeyIndexForMany : this.getKeyIndex = this._getKeyIndexForSingle, this.canTransformKey = typeof t.transformKey == "function", this.shouldCloneArguments = this.canTransformKey || i, this.shouldUpdateOnAdd = typeof t.onCacheAdd == "function", this.shouldUpdateOnChange = typeof t.onCacheChange == "function", this.shouldUpdateOnHit = typeof t.onCacheHit == "function";
|
|
1640
2033
|
}
|
|
1641
2034
|
return Object.defineProperty(e.prototype, "size", {
|
|
1642
2035
|
/**
|
|
@@ -1655,201 +2048,277 @@ var Rr = (
|
|
|
1655
2048
|
*/
|
|
1656
2049
|
get: function() {
|
|
1657
2050
|
return {
|
|
1658
|
-
keys:
|
|
2051
|
+
keys: Ee(this.keys),
|
|
1659
2052
|
size: this.size,
|
|
1660
|
-
values:
|
|
2053
|
+
values: Ee(this.values)
|
|
1661
2054
|
};
|
|
1662
2055
|
},
|
|
1663
2056
|
enumerable: !1,
|
|
1664
2057
|
configurable: !0
|
|
1665
2058
|
}), e.prototype._getKeyIndexFromMatchingKey = function(t) {
|
|
1666
|
-
var
|
|
1667
|
-
if (!
|
|
2059
|
+
var i = this.options, r = i.isMatchingKey, n = i.maxSize, a = this.keys, s = a.length;
|
|
2060
|
+
if (!s)
|
|
1668
2061
|
return -1;
|
|
1669
|
-
if (r(
|
|
2062
|
+
if (r(a[0], t))
|
|
1670
2063
|
return 0;
|
|
1671
|
-
if (
|
|
1672
|
-
for (var
|
|
1673
|
-
if (r(
|
|
1674
|
-
return
|
|
2064
|
+
if (n > 1) {
|
|
2065
|
+
for (var l = 1; l < s; l++)
|
|
2066
|
+
if (r(a[l], t))
|
|
2067
|
+
return l;
|
|
1675
2068
|
}
|
|
1676
2069
|
return -1;
|
|
1677
2070
|
}, e.prototype._getKeyIndexForMany = function(t) {
|
|
1678
|
-
var
|
|
1679
|
-
if (!
|
|
2071
|
+
var i = this.options.isEqual, r = this.keys, n = r.length;
|
|
2072
|
+
if (!n)
|
|
1680
2073
|
return -1;
|
|
1681
|
-
if (
|
|
2074
|
+
if (n === 1)
|
|
1682
2075
|
return this._getKeyIndexForSingle(t);
|
|
1683
|
-
var
|
|
1684
|
-
if (
|
|
1685
|
-
for (var p = 0; p <
|
|
1686
|
-
if (
|
|
1687
|
-
for (
|
|
2076
|
+
var a = t.length, s, l;
|
|
2077
|
+
if (a > 1) {
|
|
2078
|
+
for (var p = 0; p < n; p++)
|
|
2079
|
+
if (s = r[p], s.length === a) {
|
|
2080
|
+
for (l = 0; l < a && i(s[l], t[l]); l++)
|
|
1688
2081
|
;
|
|
1689
|
-
if (
|
|
2082
|
+
if (l === a)
|
|
1690
2083
|
return p;
|
|
1691
2084
|
}
|
|
1692
2085
|
} else
|
|
1693
|
-
for (var p = 0; p <
|
|
1694
|
-
if (
|
|
2086
|
+
for (var p = 0; p < n; p++)
|
|
2087
|
+
if (s = r[p], s.length === a && i(s[0], t[0]))
|
|
1695
2088
|
return p;
|
|
1696
2089
|
return -1;
|
|
1697
2090
|
}, e.prototype._getKeyIndexForSingle = function(t) {
|
|
1698
|
-
var
|
|
1699
|
-
if (!
|
|
2091
|
+
var i = this.keys;
|
|
2092
|
+
if (!i.length)
|
|
1700
2093
|
return -1;
|
|
1701
|
-
var r =
|
|
1702
|
-
if (t.length !==
|
|
2094
|
+
var r = i[0], n = r.length;
|
|
2095
|
+
if (t.length !== n)
|
|
1703
2096
|
return -1;
|
|
1704
|
-
var
|
|
1705
|
-
if (
|
|
1706
|
-
for (var
|
|
1707
|
-
if (!
|
|
2097
|
+
var a = this.options.isEqual;
|
|
2098
|
+
if (n > 1) {
|
|
2099
|
+
for (var s = 0; s < n; s++)
|
|
2100
|
+
if (!a(r[s], t[s]))
|
|
1708
2101
|
return -1;
|
|
1709
2102
|
return 0;
|
|
1710
2103
|
}
|
|
1711
|
-
return
|
|
1712
|
-
}, e.prototype.orderByLru = function(t,
|
|
1713
|
-
for (var
|
|
1714
|
-
|
|
1715
|
-
|
|
2104
|
+
return a(r[0], t[0]) ? 0 : -1;
|
|
2105
|
+
}, e.prototype.orderByLru = function(t, i, r) {
|
|
2106
|
+
for (var n = this.keys, a = this.values, s = n.length, l = r; l--; )
|
|
2107
|
+
n[l + 1] = n[l], a[l + 1] = a[l];
|
|
2108
|
+
n[0] = t, a[0] = i;
|
|
1716
2109
|
var p = this.options.maxSize;
|
|
1717
|
-
|
|
2110
|
+
s === p && r === s ? (n.pop(), a.pop()) : r >= p && (n.length = a.length = p);
|
|
1718
2111
|
}, e.prototype.updateAsyncCache = function(t) {
|
|
1719
|
-
var
|
|
1720
|
-
this.values[0] =
|
|
1721
|
-
return
|
|
2112
|
+
var i = this, r = this.options, n = r.onCacheChange, a = r.onCacheHit, s = this.keys[0], l = this.values[0];
|
|
2113
|
+
this.values[0] = l.then(function(p) {
|
|
2114
|
+
return i.shouldUpdateOnHit && a(i, i.options, t), i.shouldUpdateOnChange && n(i, i.options, t), p;
|
|
1722
2115
|
}, function(p) {
|
|
1723
|
-
var
|
|
1724
|
-
throw
|
|
2116
|
+
var E = i.getKeyIndex(s);
|
|
2117
|
+
throw E !== -1 && (i.keys.splice(E, 1), i.values.splice(E, 1)), p;
|
|
1725
2118
|
});
|
|
1726
2119
|
}, e;
|
|
1727
2120
|
}()
|
|
1728
2121
|
);
|
|
1729
|
-
function
|
|
1730
|
-
if (t === void 0 && (t = {}),
|
|
1731
|
-
return
|
|
2122
|
+
function ci(e, t) {
|
|
2123
|
+
if (t === void 0 && (t = {}), No(e))
|
|
2124
|
+
return ci(e.fn, ti(e.options, t));
|
|
1732
2125
|
if (typeof e != "function")
|
|
1733
2126
|
throw new TypeError("You must pass a function to `memoize`.");
|
|
1734
|
-
var
|
|
2127
|
+
var i = t.isEqual, r = i === void 0 ? xo : i, n = t.isMatchingKey, a = t.isPromise, s = a === void 0 ? !1 : a, l = t.maxSize, p = l === void 0 ? 1 : l, E = t.onCacheAdd, d = t.onCacheChange, c = t.onCacheHit, u = t.transformKey, f = ti({
|
|
1735
2128
|
isEqual: r,
|
|
1736
|
-
isMatchingKey:
|
|
1737
|
-
isPromise:
|
|
2129
|
+
isMatchingKey: n,
|
|
2130
|
+
isPromise: s,
|
|
1738
2131
|
maxSize: p,
|
|
1739
|
-
onCacheAdd:
|
|
1740
|
-
onCacheChange:
|
|
1741
|
-
onCacheHit:
|
|
2132
|
+
onCacheAdd: E,
|
|
2133
|
+
onCacheChange: d,
|
|
2134
|
+
onCacheHit: c,
|
|
1742
2135
|
transformKey: u
|
|
1743
|
-
},
|
|
1744
|
-
var
|
|
1745
|
-
|
|
1746
|
-
var
|
|
1747
|
-
if (
|
|
1748
|
-
|
|
2136
|
+
}, Go(t)), b = new Io(f), _ = b.keys, o = b.values, h = b.canTransformKey, $ = b.shouldCloneArguments, m = b.shouldUpdateOnAdd, g = b.shouldUpdateOnChange, y = b.shouldUpdateOnHit, k = function() {
|
|
2137
|
+
var G = $ ? Ee(arguments) : arguments;
|
|
2138
|
+
h && (G = u(G));
|
|
2139
|
+
var I = _.length ? b.getKeyIndex(G) : -1;
|
|
2140
|
+
if (I !== -1)
|
|
2141
|
+
y && c(b, f, k), I && (b.orderByLru(_[I], o[I], I), g && d(b, f, k));
|
|
1749
2142
|
else {
|
|
1750
|
-
var
|
|
1751
|
-
b.orderByLru(
|
|
2143
|
+
var mi = e.apply(this, arguments), hi = $ ? G : Ee(arguments);
|
|
2144
|
+
b.orderByLru(hi, mi, _.length), s && b.updateAsyncCache(k), m && E(b, f, k), g && d(b, f, k);
|
|
1752
2145
|
}
|
|
1753
|
-
return
|
|
2146
|
+
return o[0];
|
|
1754
2147
|
};
|
|
1755
|
-
return
|
|
2148
|
+
return k.cache = b, k.fn = e, k.isMemoized = !0, k.options = f, k;
|
|
1756
2149
|
}
|
|
1757
|
-
|
|
2150
|
+
const Oo = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g, Po = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g, Be = {
|
|
2151
|
+
parse: (e) => {
|
|
2152
|
+
e = String(e);
|
|
2153
|
+
try {
|
|
2154
|
+
return JSON.parse(e);
|
|
2155
|
+
} catch {
|
|
2156
|
+
return JSON.parse(e.replace(Oo, "$1").replace(Po, "$1"));
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
}, { label: Bo } = Di;
|
|
2160
|
+
async function ni(e) {
|
|
1758
2161
|
try {
|
|
1759
|
-
const t = await
|
|
1760
|
-
return
|
|
2162
|
+
const { readFile: t } = await import("node:fs/promises"), i = await t(e, { encoding: "utf-8" });
|
|
2163
|
+
return Be.parse(i);
|
|
1761
2164
|
} catch {
|
|
1762
2165
|
}
|
|
1763
2166
|
}
|
|
1764
|
-
const
|
|
1765
|
-
`data:text/javascript,${encodeURIComponent('import{pathToFileURL as
|
|
2167
|
+
const qo = /* @__PURE__ */ new URL(
|
|
2168
|
+
`data:text/javascript,${encodeURIComponent('import{pathToFileURL as o}from"node:url";import{parentPort as t,workerData as a}from"node:worker_threads";const s=async({absolutePath:r})=>{try{const e=await import(o(r).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};s(a);')}`
|
|
2169
|
+
), jo = /* @__PURE__ */ new URL(
|
|
2170
|
+
`data:text/javascript,${encodeURIComponent('import{register as a}from"node:module";import{pathToFileURL as s}from"node:url";import{parentPort as t,workerData as i}from"node:worker_threads";const d=async({absolutePath:r,importMetaUrl:o})=>{a("tsx/esm",{parentURL:o,data:!0});try{const e=await import(s(r).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};d(i);')}`
|
|
1766
2171
|
);
|
|
1767
|
-
async function
|
|
1768
|
-
|
|
1769
|
-
|
|
2172
|
+
async function Uo(e) {
|
|
2173
|
+
const { Worker: t } = await import("node:worker_threads");
|
|
2174
|
+
return new Promise((i) => {
|
|
2175
|
+
const r = new t(qo, {
|
|
1770
2176
|
workerData: {
|
|
1771
2177
|
absolutePath: e
|
|
1772
2178
|
}
|
|
1773
2179
|
});
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
}),
|
|
1777
|
-
console.error(
|
|
2180
|
+
r.once("message", (n) => {
|
|
2181
|
+
i(n);
|
|
2182
|
+
}), r.once("error", (n) => {
|
|
2183
|
+
console.error(n), i(void 0);
|
|
1778
2184
|
});
|
|
1779
2185
|
});
|
|
1780
2186
|
}
|
|
1781
|
-
async function
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
2187
|
+
async function Ro(e) {
|
|
2188
|
+
const { Worker: t } = await import("node:worker_threads");
|
|
2189
|
+
return new Promise((i) => {
|
|
2190
|
+
const r = new t(jo, {
|
|
2191
|
+
workerData: {
|
|
2192
|
+
absolutePath: e,
|
|
2193
|
+
importMetaUrl: import.meta.url
|
|
2194
|
+
}
|
|
2195
|
+
});
|
|
2196
|
+
r.once("message", (n) => {
|
|
2197
|
+
i(n);
|
|
2198
|
+
}), r.once("error", (n) => {
|
|
2199
|
+
console.error(n), i(void 0);
|
|
2200
|
+
});
|
|
2201
|
+
});
|
|
1785
2202
|
}
|
|
1786
|
-
const
|
|
2203
|
+
const Co = ci(
|
|
1787
2204
|
async (e, t) => {
|
|
1788
|
-
|
|
2205
|
+
const { isAbsolute: i, dirname: r, resolve: n } = await import("node:path");
|
|
2206
|
+
if (i(e))
|
|
1789
2207
|
return e;
|
|
1790
|
-
const
|
|
1791
|
-
let
|
|
1792
|
-
return typeof
|
|
2208
|
+
const a = await vi(t);
|
|
2209
|
+
let s;
|
|
2210
|
+
return typeof a != "string" ? s = process.env.PWD ?? process.cwd() : s = r(a), n(s, e);
|
|
1793
2211
|
}
|
|
1794
|
-
),
|
|
1795
|
-
|
|
2212
|
+
), wo = async (e, t) => {
|
|
2213
|
+
let i;
|
|
2214
|
+
try {
|
|
2215
|
+
i = (await import("node:path")).extname(
|
|
2216
|
+
e
|
|
2217
|
+
);
|
|
2218
|
+
} catch {
|
|
2219
|
+
try {
|
|
2220
|
+
return Be.parse(e);
|
|
2221
|
+
} catch {
|
|
2222
|
+
console.error("Failed to parse embeddedOverrides as a json object");
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
const r = Co(
|
|
1796
2227
|
e,
|
|
1797
2228
|
t
|
|
1798
|
-
)
|
|
1799
|
-
if (
|
|
1800
|
-
const
|
|
1801
|
-
if (
|
|
1802
|
-
return
|
|
1803
|
-
console.error(`Failed to parse the json file: ${
|
|
2229
|
+
);
|
|
2230
|
+
if (i === ".json" || i === ".jsonc") {
|
|
2231
|
+
const n = await r, a = await ni(n);
|
|
2232
|
+
if (a !== void 0)
|
|
2233
|
+
return a;
|
|
2234
|
+
console.error(`Failed to parse the json file: ${n}`);
|
|
1804
2235
|
return;
|
|
1805
2236
|
}
|
|
1806
|
-
if (
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1809
|
-
return
|
|
1810
|
-
console.error(`Failed to parse the js module file: ${
|
|
2237
|
+
if (i === ".mjs" || i === ".cjs" || i === ".js") {
|
|
2238
|
+
const n = await r, a = await Uo(n);
|
|
2239
|
+
if (a !== void 0)
|
|
2240
|
+
return a;
|
|
2241
|
+
console.error(`Failed to parse the js module file: ${n}`);
|
|
1811
2242
|
return;
|
|
1812
2243
|
}
|
|
1813
|
-
if (
|
|
1814
|
-
const
|
|
1815
|
-
if (
|
|
1816
|
-
return
|
|
1817
|
-
console.error(`Failed to parse the ts module file: ${
|
|
2244
|
+
if (i === ".mts" || i === ".cts" || i === ".ts") {
|
|
2245
|
+
const n = await r, a = await Ro(n);
|
|
2246
|
+
if (a !== void 0)
|
|
2247
|
+
return a;
|
|
2248
|
+
console.error(`Failed to parse the ts module file: ${n}`);
|
|
1818
2249
|
return;
|
|
1819
2250
|
}
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1823
|
-
return
|
|
2251
|
+
if (i === "") {
|
|
2252
|
+
const n = await r, a = await ni(n);
|
|
2253
|
+
if (a !== void 0)
|
|
2254
|
+
return a;
|
|
1824
2255
|
}
|
|
1825
2256
|
try {
|
|
1826
|
-
return
|
|
2257
|
+
return Be.parse(e);
|
|
1827
2258
|
} catch {
|
|
1828
2259
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1829
2260
|
}
|
|
1830
|
-
}
|
|
2261
|
+
};
|
|
2262
|
+
async function Fo(e, {
|
|
2263
|
+
commentOrTag: t,
|
|
2264
|
+
kind: i,
|
|
2265
|
+
filepath: r
|
|
2266
|
+
}) {
|
|
1831
2267
|
if (e === void 0)
|
|
1832
2268
|
return;
|
|
1833
|
-
const
|
|
2269
|
+
const n = await wo(
|
|
1834
2270
|
e,
|
|
1835
|
-
|
|
2271
|
+
r
|
|
1836
2272
|
);
|
|
1837
|
-
if (
|
|
2273
|
+
if (n !== void 0)
|
|
2274
|
+
for (const {
|
|
2275
|
+
[`${i}s`]: a,
|
|
2276
|
+
identifiers: s,
|
|
2277
|
+
options: l
|
|
2278
|
+
} of n) {
|
|
2279
|
+
const p = a ?? [];
|
|
2280
|
+
if (p.length === 0 && s?.includes(t) || p.includes(t))
|
|
2281
|
+
return l;
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
const Wo = /* @__PURE__ */ (() => {
|
|
2285
|
+
const e = /* @__PURE__ */ new Set([
|
|
2286
|
+
"start",
|
|
2287
|
+
"end",
|
|
2288
|
+
"loc",
|
|
2289
|
+
"range",
|
|
2290
|
+
"filename",
|
|
2291
|
+
"typeAnnotation",
|
|
2292
|
+
"decorators"
|
|
2293
|
+
]);
|
|
2294
|
+
return (t, i, r) => {
|
|
2295
|
+
let n;
|
|
1838
2296
|
try {
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
2297
|
+
const s = r(`${i}\`\``);
|
|
2298
|
+
if (s instanceof Promise)
|
|
2299
|
+
throw new TypeError("Async parse function hasn't been supported yet.");
|
|
2300
|
+
n = s;
|
|
1842
2301
|
} catch {
|
|
1843
|
-
|
|
2302
|
+
return !1;
|
|
1844
2303
|
}
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
return
|
|
1849
|
-
|
|
1850
|
-
|
|
2304
|
+
if (n.type === "File" && (n = n.program), !(n.type === "Program" && n.body[0]?.type === "ExpressionStatement"))
|
|
2305
|
+
return !1;
|
|
2306
|
+
const a = n.body[0]?.expression;
|
|
2307
|
+
return a?.type !== "TaggedTemplateExpression" ? !1 : !!pi(
|
|
2308
|
+
t,
|
|
2309
|
+
a.tag,
|
|
2310
|
+
e
|
|
2311
|
+
);
|
|
2312
|
+
};
|
|
2313
|
+
})();
|
|
2314
|
+
function zo({
|
|
2315
|
+
node: e,
|
|
2316
|
+
parent: t
|
|
2317
|
+
}) {
|
|
2318
|
+
const i = e.comments ?? t?.comments;
|
|
2319
|
+
if (!i)
|
|
1851
2320
|
return;
|
|
1852
|
-
const
|
|
2321
|
+
const r = i[i.length - 1];
|
|
1853
2322
|
if (![
|
|
1854
2323
|
"MultiLine",
|
|
1855
2324
|
// meriyah
|
|
@@ -1857,127 +2326,162 @@ function Gr({ node: e, parent: t }, n, r) {
|
|
|
1857
2326
|
// typescript, acorn, espree, flow
|
|
1858
2327
|
"CommentBlock"
|
|
1859
2328
|
// babel, babel-flow, babel-ts
|
|
1860
|
-
].includes(
|
|
2329
|
+
].includes(r.type) || !r.leading)
|
|
1861
2330
|
return;
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
return d;
|
|
2331
|
+
const n = r.value;
|
|
2332
|
+
if (n.length > 1 && n.startsWith(" ") && n.endsWith(" "))
|
|
2333
|
+
return n.slice(1, -1);
|
|
1866
2334
|
}
|
|
1867
|
-
function
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
"start",
|
|
1873
|
-
"end",
|
|
1874
|
-
"loc",
|
|
1875
|
-
"range",
|
|
1876
|
-
"filename",
|
|
1877
|
-
"typeAnnotation",
|
|
1878
|
-
"decorators"
|
|
1879
|
-
]);
|
|
1880
|
-
for (const d of n)
|
|
1881
|
-
if (!c.includes(d))
|
|
1882
|
-
if (zr(d)) {
|
|
1883
|
-
if (t.tag.type === "Identifier" && t.tag.name === d)
|
|
1884
|
-
return d;
|
|
1885
|
-
} else {
|
|
1886
|
-
if (!s)
|
|
1887
|
-
return;
|
|
1888
|
-
let p;
|
|
1889
|
-
try {
|
|
1890
|
-
const a = Ft[r.parser].parse(
|
|
1891
|
-
`${d}\`\``,
|
|
1892
|
-
r
|
|
1893
|
-
);
|
|
1894
|
-
if (a instanceof Promise)
|
|
1895
|
-
throw new TypeError(
|
|
1896
|
-
"Async parse function hasn't been supported yet."
|
|
1897
|
-
);
|
|
1898
|
-
p = a;
|
|
1899
|
-
} catch {
|
|
1900
|
-
continue;
|
|
1901
|
-
}
|
|
1902
|
-
if (p.type === "File" && (p = p.program), !(p.type === "Program" && p.body[0]?.type === "ExpressionStatement"))
|
|
1903
|
-
continue;
|
|
1904
|
-
const h = p.body[0]?.expression;
|
|
1905
|
-
if (h?.type !== "TaggedTemplateExpression")
|
|
1906
|
-
continue;
|
|
1907
|
-
if (t.tag, h.tag, un(t.tag, h.tag, o))
|
|
1908
|
-
return d;
|
|
1909
|
-
}
|
|
2335
|
+
function Ko({
|
|
2336
|
+
parent: e
|
|
2337
|
+
}) {
|
|
2338
|
+
if (e?.type === "TaggedTemplateExpression")
|
|
2339
|
+
return e.tag.type === "Identifier" ? e.tag.name : e.tag;
|
|
1910
2340
|
}
|
|
1911
|
-
function
|
|
1912
|
-
|
|
2341
|
+
function Jo(e, t) {
|
|
2342
|
+
const i = /* @__PURE__ */ (() => {
|
|
2343
|
+
let r;
|
|
2344
|
+
return () => (r === void 0 && (r = !(e.noEmbeddedIdentificationByComment?.includes(t) ?? !1)), r);
|
|
2345
|
+
})();
|
|
2346
|
+
return function* (r) {
|
|
2347
|
+
const n = e[M(r)] ?? [];
|
|
2348
|
+
n.length === 0 && i() ? yield* e[v(r)] ?? [] : yield* n;
|
|
2349
|
+
};
|
|
1913
2350
|
}
|
|
1914
|
-
function
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
2351
|
+
function ii(e, t) {
|
|
2352
|
+
if (typeof t == "string") {
|
|
2353
|
+
const i = /* @__PURE__ */ (() => {
|
|
2354
|
+
let r;
|
|
2355
|
+
return () => (r === void 0 && (r = !(e.noEmbeddedIdentificationByTag?.includes(t) ?? !1)), r);
|
|
2356
|
+
})();
|
|
2357
|
+
return function* (r) {
|
|
2358
|
+
const n = e[D(r)] ?? [];
|
|
2359
|
+
n.length === 0 && i() ? yield* e[v(r)] ?? [] : yield* n;
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
return function* (i) {
|
|
2363
|
+
const r = e[D(i)] ?? [];
|
|
2364
|
+
if (r.length === 0) {
|
|
2365
|
+
const { noEmbeddedIdentificationByTag: n } = e;
|
|
2366
|
+
for (const a of e[v(i)] ?? [])
|
|
2367
|
+
n?.includes(a) || (yield a);
|
|
2368
|
+
} else
|
|
2369
|
+
yield* r;
|
|
2370
|
+
};
|
|
2371
|
+
}
|
|
2372
|
+
function Ie(e, t, i, r) {
|
|
2373
|
+
const n = di[e];
|
|
2374
|
+
if (!n)
|
|
2375
|
+
return null;
|
|
2376
|
+
const a = Fo(
|
|
2377
|
+
r.embeddedOverrides,
|
|
2378
|
+
{
|
|
2379
|
+
commentOrTag: t,
|
|
2380
|
+
kind: i,
|
|
2381
|
+
filepath: r.filepath
|
|
2382
|
+
}
|
|
2383
|
+
);
|
|
2384
|
+
return async (...s) => {
|
|
2385
|
+
try {
|
|
2386
|
+
const l = await n(...s, {
|
|
2387
|
+
commentOrTag: t,
|
|
2388
|
+
kind: i,
|
|
2389
|
+
embeddedOverrideOptions: await a
|
|
2390
|
+
});
|
|
2391
|
+
return Bo(
|
|
2392
|
+
{
|
|
2393
|
+
embed: !0,
|
|
2394
|
+
...l.label
|
|
2395
|
+
},
|
|
2396
|
+
l
|
|
2397
|
+
);
|
|
2398
|
+
} catch (l) {
|
|
2399
|
+
throw console.error(l), l;
|
|
2400
|
+
}
|
|
2401
|
+
};
|
|
2402
|
+
}
|
|
2403
|
+
function ui(e, t, i) {
|
|
2404
|
+
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ? Ho(e, t, i) : typeof e == "object" ? pi(e, t, i) : !1;
|
|
1920
2405
|
}
|
|
1921
|
-
function
|
|
2406
|
+
function Ho(e, t, i) {
|
|
1922
2407
|
const r = e.length;
|
|
1923
2408
|
if (r !== t.length)
|
|
1924
2409
|
return !1;
|
|
1925
|
-
for (let
|
|
1926
|
-
if (!
|
|
2410
|
+
for (let n = 0; n < r; n++)
|
|
2411
|
+
if (!ui(e[n], t[n], i))
|
|
1927
2412
|
return !1;
|
|
1928
2413
|
return !0;
|
|
1929
2414
|
}
|
|
1930
|
-
function
|
|
2415
|
+
function pi(e, t, i) {
|
|
1931
2416
|
for (const r of Object.keys(e))
|
|
1932
|
-
if (!
|
|
2417
|
+
if (!i?.has(r) && !(Object.prototype.hasOwnProperty.call(t, r) && ui(e[r], t[r], i)))
|
|
1933
2418
|
return !1;
|
|
1934
2419
|
return !0;
|
|
1935
2420
|
}
|
|
1936
|
-
const { estree:
|
|
1937
|
-
const { node:
|
|
1938
|
-
if (
|
|
2421
|
+
const { estree: gi } = $i, { embed: Oe } = gi, Xo = (e, t) => {
|
|
2422
|
+
const { node: i } = e;
|
|
2423
|
+
if (i.type !== "TemplateLiteral" || i.quasis.some(({ value: { cooked: a } }) => a === null))
|
|
1939
2424
|
return null;
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
)
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
2425
|
+
const r = zo(e);
|
|
2426
|
+
if (typeof r == "string") {
|
|
2427
|
+
const a = Jo(
|
|
2428
|
+
t,
|
|
2429
|
+
r
|
|
2430
|
+
);
|
|
2431
|
+
for (const s of me) {
|
|
2432
|
+
let l = !1;
|
|
2433
|
+
for (const p of a(
|
|
2434
|
+
s
|
|
2435
|
+
))
|
|
2436
|
+
if (r === p) {
|
|
2437
|
+
l = !0;
|
|
2438
|
+
break;
|
|
2439
|
+
}
|
|
2440
|
+
if (l)
|
|
2441
|
+
return Ie(s, r, "comment", t);
|
|
2442
|
+
}
|
|
2443
|
+
return Oe?.(e, t) ?? null;
|
|
2444
|
+
}
|
|
2445
|
+
const n = Ko(e);
|
|
2446
|
+
if (typeof n == "string") {
|
|
2447
|
+
const a = ii(t, n);
|
|
2448
|
+
for (const s of me) {
|
|
2449
|
+
let l = !1;
|
|
2450
|
+
for (const p of a(s))
|
|
2451
|
+
if (n === p) {
|
|
2452
|
+
l = !0;
|
|
2453
|
+
break;
|
|
2454
|
+
}
|
|
2455
|
+
if (l)
|
|
2456
|
+
return Ie(s, n, "tag", t);
|
|
2457
|
+
}
|
|
2458
|
+
return Oe?.(e, t) ?? null;
|
|
2459
|
+
}
|
|
2460
|
+
if (n !== void 0) {
|
|
2461
|
+
const a = (l) => So[t.parser].parse(
|
|
2462
|
+
l,
|
|
2463
|
+
t
|
|
2464
|
+
), s = ii(t);
|
|
2465
|
+
for (const l of me) {
|
|
2466
|
+
let p;
|
|
2467
|
+
for (const E of s(l))
|
|
2468
|
+
if (Wo(n, E, a)) {
|
|
2469
|
+
p = E;
|
|
2470
|
+
break;
|
|
2471
|
+
}
|
|
2472
|
+
if (p !== void 0)
|
|
2473
|
+
return Ie(l, p, "tag", t);
|
|
2474
|
+
}
|
|
1971
2475
|
}
|
|
1972
|
-
return
|
|
1973
|
-
},
|
|
2476
|
+
return Oe?.(e, t) ?? null;
|
|
2477
|
+
}, oa = {
|
|
1974
2478
|
estree: {
|
|
1975
|
-
...
|
|
1976
|
-
embed:
|
|
2479
|
+
...gi,
|
|
2480
|
+
embed: Xo
|
|
1977
2481
|
}
|
|
1978
2482
|
};
|
|
1979
2483
|
export {
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2484
|
+
ra as options,
|
|
2485
|
+
So as parsers,
|
|
2486
|
+
oa as printers
|
|
1983
2487
|
};
|