prettier-plugin-embed 0.6.0 → 0.7.0
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 +362 -51
- package/dist/embedded/astro/embedder.d.ts +7 -0
- package/dist/embedded/astro/index.d.ts +3 -0
- package/dist/embedded/astro/language.d.ts +6 -0
- package/dist/embedded/astro/options.d.ts +40 -0
- package/dist/embedded/create-embedder.d.ts +14 -0
- package/dist/embedded/css/embedder.d.ts +1 -6
- package/dist/embedded/dockerfile/embedder.d.ts +7 -0
- package/dist/embedded/dockerfile/index.d.ts +3 -0
- package/dist/embedded/dockerfile/language.d.ts +6 -0
- package/dist/embedded/dockerfile/options.d.ts +40 -0
- package/dist/embedded/es/embedder.d.ts +1 -6
- package/dist/embedded/gherkin/embedder.d.ts +7 -0
- package/dist/embedded/gherkin/index.d.ts +3 -0
- package/dist/embedded/gherkin/language.d.ts +6 -0
- package/dist/embedded/gherkin/options.d.ts +40 -0
- package/dist/embedded/glsl/embedder.d.ts +1 -6
- package/dist/embedded/go-template/embedder.d.ts +7 -0
- package/dist/embedded/go-template/index.d.ts +3 -0
- package/dist/embedded/go-template/language.d.ts +6 -0
- package/dist/embedded/go-template/options.d.ts +40 -0
- package/dist/embedded/graphql/embedder.d.ts +1 -6
- package/dist/embedded/handlebars/embedder.d.ts +7 -0
- package/dist/embedded/handlebars/index.d.ts +3 -0
- package/dist/embedded/handlebars/language.d.ts +6 -0
- package/dist/embedded/handlebars/options.d.ts +40 -0
- package/dist/embedded/html/embedder.d.ts +1 -6
- package/dist/embedded/hugo/embedder.d.ts +7 -0
- package/dist/embedded/hugo/index.d.ts +3 -0
- package/dist/embedded/hugo/language.d.ts +6 -0
- package/dist/embedded/hugo/options.d.ts +40 -0
- package/dist/embedded/ini/embedder.d.ts +1 -6
- package/dist/embedded/java/embedder.d.ts +1 -6
- package/dist/embedded/jinja/embedder.d.ts +7 -0
- package/dist/embedded/jinja/index.d.ts +3 -0
- package/dist/embedded/jinja/language.d.ts +6 -0
- package/dist/embedded/jinja/options.d.ts +40 -0
- package/dist/embedded/jsonata/embedder.d.ts +1 -6
- package/dist/embedded/jte/embedder.d.ts +7 -0
- package/dist/embedded/jte/index.d.ts +3 -0
- package/dist/embedded/jte/language.d.ts +6 -0
- package/dist/embedded/jte/options.d.ts +40 -0
- package/dist/embedded/latex/embedder.d.ts +1 -6
- package/dist/embedded/liquid/embedder.d.ts +7 -0
- package/dist/embedded/liquid/index.d.ts +3 -0
- package/dist/embedded/liquid/language.d.ts +6 -0
- package/dist/embedded/liquid/options.d.ts +40 -0
- package/dist/embedded/marko/embedder.d.ts +7 -0
- package/dist/embedded/marko/index.d.ts +3 -0
- package/dist/embedded/marko/language.d.ts +6 -0
- package/dist/embedded/marko/options.d.ts +40 -0
- package/dist/embedded/motoko/embedder.d.ts +7 -0
- package/dist/embedded/motoko/index.d.ts +3 -0
- package/dist/embedded/motoko/language.d.ts +6 -0
- package/dist/embedded/motoko/options.d.ts +40 -0
- package/dist/embedded/mustache/embedder.d.ts +7 -0
- package/dist/embedded/mustache/index.d.ts +3 -0
- package/dist/embedded/mustache/language.d.ts +6 -0
- package/dist/embedded/mustache/options.d.ts +40 -0
- package/dist/embedded/nginx/embedder.d.ts +1 -6
- package/dist/embedded/nunjucks/embedder.d.ts +7 -0
- package/dist/embedded/nunjucks/index.d.ts +3 -0
- package/dist/embedded/nunjucks/language.d.ts +6 -0
- package/dist/embedded/nunjucks/options.d.ts +40 -0
- package/dist/embedded/pegjs/embedder.d.ts +1 -6
- package/dist/embedded/php/embedder.d.ts +1 -6
- package/dist/embedded/powershell/embedder.d.ts +7 -0
- package/dist/embedded/powershell/index.d.ts +3 -0
- package/dist/embedded/powershell/language.d.ts +6 -0
- package/dist/embedded/powershell/options.d.ts +40 -0
- package/dist/embedded/prisma/embedder.d.ts +1 -6
- package/dist/embedded/properties/embedder.d.ts +1 -6
- package/dist/embedded/pug/embedder.d.ts +1 -6
- package/dist/embedded/register.d.ts +42 -25
- package/dist/embedded/ruby/embedder.d.ts +1 -6
- package/dist/embedded/sh/embedder.d.ts +1 -6
- package/dist/embedded/solidity/embedder.d.ts +7 -0
- package/dist/embedded/solidity/index.d.ts +3 -0
- package/dist/embedded/solidity/language.d.ts +6 -0
- package/dist/embedded/solidity/options.d.ts +58 -0
- package/dist/embedded/svelte/embedder.d.ts +7 -0
- package/dist/embedded/svelte/index.d.ts +3 -0
- package/dist/embedded/svelte/language.d.ts +6 -0
- package/dist/embedded/svelte/options.d.ts +40 -0
- package/dist/embedded/toml/embedder.d.ts +1 -6
- package/dist/embedded/ts/embedder.d.ts +1 -6
- package/dist/embedded/utils.d.ts +1 -1
- package/dist/embedded/xquery/embedder.d.ts +7 -0
- package/dist/embedded/xquery/index.d.ts +3 -0
- package/dist/embedded/xquery/language.d.ts +6 -0
- package/dist/embedded/xquery/options.d.ts +55 -0
- package/dist/index.js +1118 -807
- package/dist/options.d.ts +335 -0
- package/package.json +18 -1
package/dist/index.js
CHANGED
|
@@ -17,8 +17,95 @@ var f = Object.defineProperty, p = (e, t) => {
|
|
|
17
17
|
enumerable: !0
|
|
18
18
|
});
|
|
19
19
|
return t || f(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
20
|
-
}
|
|
21
|
-
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region node_modules/.pnpm/dedent@1.7.2/node_modules/dedent/dist/dedent.mjs
|
|
23
|
+
function m(e, t) {
|
|
24
|
+
var n = Object.keys(e);
|
|
25
|
+
if (Object.getOwnPropertySymbols) {
|
|
26
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
27
|
+
t && (r = r.filter(function(t) {
|
|
28
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
29
|
+
})), n.push.apply(n, r);
|
|
30
|
+
}
|
|
31
|
+
return n;
|
|
32
|
+
}
|
|
33
|
+
function h(e) {
|
|
34
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
35
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
36
|
+
t % 2 ? m(Object(n), !0).forEach(function(t) {
|
|
37
|
+
ee(e, t, n[t]);
|
|
38
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : m(Object(n)).forEach(function(t) {
|
|
39
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return e;
|
|
43
|
+
}
|
|
44
|
+
function ee(e, t, n) {
|
|
45
|
+
return t = te(t), t in e ? Object.defineProperty(e, t, {
|
|
46
|
+
value: n,
|
|
47
|
+
enumerable: !0,
|
|
48
|
+
configurable: !0,
|
|
49
|
+
writable: !0
|
|
50
|
+
}) : e[t] = n, e;
|
|
51
|
+
}
|
|
52
|
+
function te(e) {
|
|
53
|
+
var t = ne(e, "string");
|
|
54
|
+
return typeof t == "symbol" ? t : String(t);
|
|
55
|
+
}
|
|
56
|
+
function ne(e, t) {
|
|
57
|
+
if (typeof e != "object" || !e) return e;
|
|
58
|
+
var n = e[Symbol.toPrimitive];
|
|
59
|
+
if (n !== void 0) {
|
|
60
|
+
var r = n.call(e, t || "default");
|
|
61
|
+
if (typeof r != "object") return r;
|
|
62
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
63
|
+
}
|
|
64
|
+
return (t === "string" ? String : Number)(e);
|
|
65
|
+
}
|
|
66
|
+
var re = ie({});
|
|
67
|
+
function ie(e) {
|
|
68
|
+
return t.withOptions = (t) => ie(h(h({}, e), t)), t;
|
|
69
|
+
function t(t, ...n) {
|
|
70
|
+
let r = typeof t == "string" ? [t] : t.raw, { alignValues: i = !1, escapeSpecialCharacters: a = Array.isArray(t), trimWhitespace: o = !0 } = e, s = "";
|
|
71
|
+
for (let e = 0; e < r.length; e++) {
|
|
72
|
+
let t = r[e];
|
|
73
|
+
if (a && (t = t.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), s += t, e < n.length) {
|
|
74
|
+
let t = i ? ae(n[e], s) : n[e];
|
|
75
|
+
s += t;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
let c = s.split("\n"), l = null;
|
|
79
|
+
for (let e of c) {
|
|
80
|
+
let t = e.match(/^(\s+)\S+/);
|
|
81
|
+
if (t) {
|
|
82
|
+
let e = t[1].length;
|
|
83
|
+
l = l ? Math.min(l, e) : e;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (l !== null) {
|
|
87
|
+
let e = l;
|
|
88
|
+
s = c.map((t) => t[0] === " " || t[0] === " " ? t.slice(e) : t).join("\n");
|
|
89
|
+
}
|
|
90
|
+
return o && (s = s.trim()), a && (s = s.replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\v/g, "\v").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\0/g, "\0").replace(/\\x([\da-fA-F]{2})/g, (e, t) => String.fromCharCode(parseInt(t, 16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g, (e, t) => String.fromCodePoint(parseInt(t, 16))).replace(/\\u([\da-fA-F]{4})/g, (e, t) => String.fromCharCode(parseInt(t, 16)))), typeof Bun < "u" && (s = s.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g, (e, t, n) => {
|
|
91
|
+
let r = t ?? n ?? "";
|
|
92
|
+
return String.fromCodePoint(parseInt(r, 16));
|
|
93
|
+
})), s;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function ae(e, t) {
|
|
97
|
+
if (typeof e != "string" || !e.includes("\n")) return e;
|
|
98
|
+
let n = t.slice(t.lastIndexOf("\n") + 1).match(/^(\s+)/);
|
|
99
|
+
if (n) {
|
|
100
|
+
let t = n[1];
|
|
101
|
+
return e.replace(/\n/g, `\n${t}`);
|
|
102
|
+
}
|
|
103
|
+
return e;
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/embedded/utils.ts
|
|
107
|
+
var { group: g, indent: _, line: oe, softline: v, lineSuffixBoundary: se, addAlignmentToDoc: ce, align: le, hardline: ue } = e, { mapDoc: de, replaceEndOfLine: fe } = t;
|
|
108
|
+
function y(e, t) {
|
|
22
109
|
let n = e.quasis.map((e, n, { length: r }) => n === r - 1 ? e.value.cooked : e.value.cooked + t(n)).join(""), r = n.match(/^\s+/)?.[0] ?? "", i = n.match(/\s+$/)?.[0] ?? "";
|
|
23
110
|
return {
|
|
24
111
|
trimmedText: n.slice(r.length, -i.length || void 0),
|
|
@@ -26,42 +113,42 @@ function _(e, t) {
|
|
|
26
113
|
trailingWhitespaces: i
|
|
27
114
|
};
|
|
28
115
|
}
|
|
29
|
-
function
|
|
30
|
-
let o = a || t.preserveEmbeddedExteriorWhitespaces?.includes(n), s = t.noEmbeddedMultiLineIndentation?.includes(n), c =
|
|
31
|
-
if (o) return
|
|
116
|
+
function b(e, t, n, r, i, a = !1) {
|
|
117
|
+
let o = a || t.preserveEmbeddedExteriorWhitespaces?.includes(n), s = t.noEmbeddedMultiLineIndentation?.includes(n), c = g(e);
|
|
118
|
+
if (o) return g([
|
|
32
119
|
"`",
|
|
33
120
|
r,
|
|
34
|
-
s ? c :
|
|
121
|
+
s ? c : _([c]),
|
|
35
122
|
i,
|
|
36
123
|
"`"
|
|
37
124
|
]);
|
|
38
|
-
let l = r.length ?
|
|
39
|
-
return
|
|
125
|
+
let l = r.length ? oe : v, u = i.length ? oe : v;
|
|
126
|
+
return g([
|
|
40
127
|
"`",
|
|
41
|
-
s ? [l, c] :
|
|
128
|
+
s ? [l, c] : _([l, c]),
|
|
42
129
|
u,
|
|
43
130
|
"`"
|
|
44
131
|
]);
|
|
45
132
|
}
|
|
46
|
-
function
|
|
133
|
+
function pe(e, t) {
|
|
47
134
|
let n = 0;
|
|
48
135
|
for (let r of e) r === " " ? n = n + t - n % t : n++;
|
|
49
136
|
return n;
|
|
50
137
|
}
|
|
51
|
-
function
|
|
138
|
+
function me(e, t) {
|
|
52
139
|
let n = e.lastIndexOf("\n"), r = e.slice(n + 1), i = /^[\t ]*/.exec(r)[0];
|
|
53
|
-
return
|
|
140
|
+
return pe(i, t);
|
|
54
141
|
}
|
|
55
|
-
function
|
|
142
|
+
function he(e, t, n) {
|
|
56
143
|
let r = t, i = e.quasis[r].value.raw;
|
|
57
144
|
if (i.includes("\n")) return {
|
|
58
|
-
indentSize:
|
|
145
|
+
indentSize: me(i, n),
|
|
59
146
|
previousQuasiText: i
|
|
60
147
|
};
|
|
61
148
|
for (; r-- > 0;) {
|
|
62
149
|
let t = e.quasis[r].value.raw;
|
|
63
150
|
if (t.includes("\n")) return {
|
|
64
|
-
indentSize:
|
|
151
|
+
indentSize: me(t, n),
|
|
65
152
|
previousQuasiText: i
|
|
66
153
|
};
|
|
67
154
|
}
|
|
@@ -70,55 +157,59 @@ function le(e, t, n) {
|
|
|
70
157
|
previousQuasiText: i
|
|
71
158
|
};
|
|
72
159
|
}
|
|
73
|
-
function
|
|
160
|
+
function ge(e, t, n, r, i, a = !0) {
|
|
74
161
|
let { node: o } = e, s = t();
|
|
75
|
-
if (o?.comments?.length && (s =
|
|
162
|
+
if (o?.comments?.length && (s = g([_([v, s]), v])), !a) return g([
|
|
76
163
|
"${",
|
|
77
164
|
s,
|
|
78
|
-
|
|
165
|
+
se,
|
|
79
166
|
"}"
|
|
80
167
|
]);
|
|
81
|
-
let { indentSize: c, previousQuasiText: l } =
|
|
82
|
-
return u = c === 0 && l.endsWith("\n") ?
|
|
168
|
+
let { indentSize: c, previousQuasiText: l } = he(n, r, i), u = s;
|
|
169
|
+
return u = c === 0 && l.endsWith("\n") ? le(-Infinity, u) : ce(u, c, i), g([
|
|
83
170
|
"${",
|
|
84
171
|
u,
|
|
85
|
-
|
|
172
|
+
se,
|
|
86
173
|
"}"
|
|
87
174
|
]);
|
|
88
175
|
}
|
|
89
|
-
function
|
|
176
|
+
function x(e, t, n, r = !0) {
|
|
90
177
|
let i = n?.tabWidth ?? 2, a = e.node;
|
|
91
|
-
return e.map((e, n) =>
|
|
178
|
+
return e.map((e, n) => ge(e, t, a, n, i, r), "expressions");
|
|
92
179
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
180
|
+
function S(e, t, n, r = !1, i, a, o = !1) {
|
|
181
|
+
let s = n.length ? /* @__PURE__ */ new Set() : void 0, c = de(e, (e) => {
|
|
95
182
|
if (typeof e != "string") return e;
|
|
96
|
-
let
|
|
97
|
-
for (let e = 0; e <
|
|
98
|
-
let t =
|
|
183
|
+
let c = [], l = e.split(t), u = "";
|
|
184
|
+
for (let e = 0; e < l.length; e++) {
|
|
185
|
+
let t = l[e];
|
|
99
186
|
if (e % 2 == 0) {
|
|
100
187
|
if (e === 0 || t.includes("\n")) {
|
|
101
188
|
let e = t.slice(t.lastIndexOf("\n") + 1);
|
|
102
|
-
|
|
189
|
+
u = /^[\t ]*/.exec(e)[0];
|
|
103
190
|
}
|
|
104
191
|
if (!t) continue;
|
|
105
|
-
if (t = t.replaceAll(/([\\`]|\${)/g, "\\$1"), r === "literalline")
|
|
106
|
-
else if (r === "hardline") for (let e of t.split(/(\n)/)) e === "\n" ?
|
|
107
|
-
else
|
|
192
|
+
if (t = t.replaceAll(/([\\`]|\${)/g, "\\$1"), o && (t = t.replaceAll(/<\/(?=script\b)/gi, "<\\/")), r === "literalline") c.push(fe(t));
|
|
193
|
+
else if (r === "hardline") for (let e of t.split(/(\n)/)) e === "\n" ? c.push(ue) : c.push(e);
|
|
194
|
+
else c.push(t);
|
|
108
195
|
} else {
|
|
109
|
-
let r = Number(t)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
196
|
+
let r = Number(t);
|
|
197
|
+
s?.add(r);
|
|
198
|
+
let o = l[e - 1];
|
|
199
|
+
if (i?.has(r) && !/\n[\t ]*$/.test(o)) {
|
|
200
|
+
let e = c.at(-1);
|
|
201
|
+
typeof e == "string" && (c[c.length - 1] = e.replace(/[\t ]+$/, "")), c.push(ue), a !== void 0 && c.push(u);
|
|
113
202
|
}
|
|
114
|
-
let
|
|
115
|
-
|
|
203
|
+
let d = n[r];
|
|
204
|
+
c.push(a === void 0 ? d : le(pe(u, a), d));
|
|
116
205
|
}
|
|
117
206
|
}
|
|
118
|
-
return
|
|
207
|
+
return c;
|
|
119
208
|
});
|
|
209
|
+
if (n.some((e, t) => !s.has(t))) throw Error("The embedded formatter changed an expression placeholder.");
|
|
210
|
+
return c;
|
|
120
211
|
}
|
|
121
|
-
function
|
|
212
|
+
function _e(e, t, n) {
|
|
122
213
|
if (t === n) {
|
|
123
214
|
e.unshift(t);
|
|
124
215
|
return;
|
|
@@ -134,7 +225,7 @@ function de(e, t, n) {
|
|
|
134
225
|
}
|
|
135
226
|
e.splice(r, 0, t);
|
|
136
227
|
}
|
|
137
|
-
var
|
|
228
|
+
var C = (() => {
|
|
138
229
|
let e = [...Array(26).keys()].map((e) => String.fromCharCode(e + 97)).concat([...Array(10).keys()].map((e) => `${e}`));
|
|
139
230
|
return () => {
|
|
140
231
|
let t = "";
|
|
@@ -142,91 +233,143 @@ var x = (() => {
|
|
|
142
233
|
return t;
|
|
143
234
|
};
|
|
144
235
|
})();
|
|
145
|
-
function
|
|
146
|
-
let n =
|
|
236
|
+
function w(e = "p", t = "") {
|
|
237
|
+
let n = C(), r = C(), i = ve(e), a = ve(t);
|
|
147
238
|
return {
|
|
148
239
|
createPlaceholder: (i) => `${e}${n}${i}${r}${t}`,
|
|
149
240
|
placeholderRegex: RegExp(`${i}${n}(\\d+)${r}${a}`, "ig")
|
|
150
241
|
};
|
|
151
242
|
}
|
|
152
|
-
function
|
|
243
|
+
function ve(e) {
|
|
153
244
|
return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
154
245
|
}
|
|
155
|
-
function
|
|
246
|
+
function T(e) {
|
|
156
247
|
return `${e}Identifiers`;
|
|
157
248
|
}
|
|
158
|
-
function
|
|
249
|
+
function E(e) {
|
|
159
250
|
return `${e}Comments`;
|
|
160
251
|
}
|
|
161
|
-
function
|
|
252
|
+
function D(e) {
|
|
162
253
|
return `${e}Tags`;
|
|
163
254
|
}
|
|
164
|
-
function
|
|
255
|
+
function ye(e) {
|
|
165
256
|
return `${e}Plugin`;
|
|
166
257
|
}
|
|
167
|
-
function
|
|
258
|
+
function O(e) {
|
|
168
259
|
return `${e}Parser`;
|
|
169
260
|
}
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
261
|
+
var k = "9ff2b366e8ca4c97b9aed1a29b5b94ed";
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/embedded/create-embedder.ts
|
|
264
|
+
function A({ parser: e, parserOption: t, parserOptions: n, markup: r = !1, newlineHandling: i = !1, dedentContent: a = !1, placeholderPrefix: o = "p", transformDoc: s }) {
|
|
265
|
+
return async (c, l, u, d, { commentOrTag: f, embeddedOverrideOptions: p }) => {
|
|
266
|
+
let m = {
|
|
267
|
+
...d,
|
|
268
|
+
...p
|
|
269
|
+
}, { createPlaceholder: h, placeholderRegex: ee } = w(o), { trimmedText: te, leadingWhitespaces: ne, trailingWhitespaces: ie } = y(u.node, h), ae = x(u, l, m, !1), g = t ? m[t] : void 0, _ = await c(a ? re(te) : te, {
|
|
270
|
+
...m,
|
|
271
|
+
...n,
|
|
272
|
+
parser: g ?? e
|
|
273
|
+
});
|
|
274
|
+
return b(S(s ? s(_) : _, ee, ae, i, void 0, m.tabWidth, !!m.__embeddedInHtml), m, f, ne, ie, r && (m.htmlWhitespaceSensitivity === "strict" || m.htmlWhitespaceSensitivity === "css"));
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/embedded/astro/embedder.ts
|
|
279
|
+
var be = A({
|
|
280
|
+
parser: "astro",
|
|
281
|
+
markup: !0
|
|
282
|
+
}), xe = "embeddedAstro", Se = ["astro"], Ce = E(xe), we = D(xe), Te = {
|
|
283
|
+
[Ce]: {
|
|
284
|
+
category: "Embed",
|
|
285
|
+
type: "string",
|
|
286
|
+
array: !0,
|
|
287
|
+
default: [{ value: [...Se] }],
|
|
288
|
+
description: "Block comments that identify embedded Astro in template literals. Requires the `prettier-plugin-astro` plugin."
|
|
289
|
+
},
|
|
290
|
+
[we]: {
|
|
291
|
+
category: "Embed",
|
|
292
|
+
type: "string",
|
|
293
|
+
array: !0,
|
|
294
|
+
default: [{ value: [...Se] }],
|
|
295
|
+
description: "Tags that identify embedded Astro in template literals. Requires the `prettier-plugin-astro` plugin."
|
|
296
|
+
}
|
|
297
|
+
}, Ee = /* @__PURE__ */ p({
|
|
298
|
+
embedder: () => be,
|
|
299
|
+
language: () => xe,
|
|
300
|
+
options: () => Te
|
|
301
|
+
}), De = A({
|
|
302
|
+
parser: "scss",
|
|
303
|
+
parserOption: "embeddedCssParser",
|
|
304
|
+
placeholderPrefix: "@prettier-placeholder",
|
|
305
|
+
newlineHandling: "literalline"
|
|
306
|
+
}), j = "embeddedCss", Oe = ["css"], ke = [
|
|
180
307
|
"css",
|
|
181
308
|
"less",
|
|
182
309
|
"scss"
|
|
183
|
-
],
|
|
184
|
-
[
|
|
310
|
+
], Ae = T(j), je = E(j), Me = D(j), Ne = O(j), Pe = {
|
|
311
|
+
[Ae]: {
|
|
185
312
|
category: "Embed",
|
|
186
313
|
type: "string",
|
|
187
314
|
array: !0,
|
|
188
|
-
default: [{ value: [...
|
|
315
|
+
default: [{ value: [...Oe] }],
|
|
189
316
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language.",
|
|
190
|
-
deprecated: `Please use \`${
|
|
317
|
+
deprecated: `Please use \`${je}\` or \`${Me}\`.`
|
|
191
318
|
},
|
|
192
|
-
[
|
|
319
|
+
[je]: {
|
|
193
320
|
category: "Embed",
|
|
194
321
|
type: "string",
|
|
195
322
|
array: !0,
|
|
196
|
-
default: [{ value: [
|
|
323
|
+
default: [{ value: [k] }],
|
|
197
324
|
description: "Block comments that make their subsequent template literals be identified as embedded CSS language."
|
|
198
325
|
},
|
|
199
|
-
[
|
|
326
|
+
[Me]: {
|
|
200
327
|
category: "Embed",
|
|
201
328
|
type: "string",
|
|
202
329
|
array: !0,
|
|
203
|
-
default: [{ value: [
|
|
330
|
+
default: [{ value: [k] }],
|
|
204
331
|
description: "Tags that make their subsequent template literals be identified as embedded CSS language."
|
|
205
332
|
},
|
|
206
|
-
[
|
|
333
|
+
[Ne]: {
|
|
207
334
|
category: "Embed",
|
|
208
335
|
type: "choice",
|
|
209
336
|
default: "scss",
|
|
210
337
|
description: "The parser used to parse the embedded CSS language.",
|
|
211
|
-
choices:
|
|
338
|
+
choices: ke.map((e) => ({
|
|
212
339
|
value: e,
|
|
213
340
|
description: `Use the "${e}" parser.`
|
|
214
341
|
}))
|
|
215
342
|
}
|
|
216
|
-
},
|
|
217
|
-
embedder: () =>
|
|
218
|
-
language: () =>
|
|
219
|
-
options: () =>
|
|
220
|
-
}),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
343
|
+
}, Fe = /* @__PURE__ */ p({
|
|
344
|
+
embedder: () => De,
|
|
345
|
+
language: () => j,
|
|
346
|
+
options: () => Pe
|
|
347
|
+
}), Ie = A({
|
|
348
|
+
parser: "dockerfile",
|
|
349
|
+
newlineHandling: "hardline"
|
|
350
|
+
}), Le = "embeddedDockerfile", Re = ["dockerfile", "containerfile"], ze = E(Le), Be = D(Le), Ve = {
|
|
351
|
+
[ze]: {
|
|
352
|
+
category: "Embed",
|
|
353
|
+
type: "string",
|
|
354
|
+
array: !0,
|
|
355
|
+
default: [{ value: [...Re] }],
|
|
356
|
+
description: "Block comments that identify embedded Dockerfile in template literals. Requires the `prettier-plugin-sh` plugin."
|
|
357
|
+
},
|
|
358
|
+
[Be]: {
|
|
359
|
+
category: "Embed",
|
|
360
|
+
type: "string",
|
|
361
|
+
array: !0,
|
|
362
|
+
default: [{ value: [...Re] }],
|
|
363
|
+
description: "Tags that identify embedded Dockerfile in template literals. Requires the `prettier-plugin-sh` plugin."
|
|
364
|
+
}
|
|
365
|
+
}, He = /* @__PURE__ */ p({
|
|
366
|
+
embedder: () => Ie,
|
|
367
|
+
language: () => Le,
|
|
368
|
+
options: () => Ve
|
|
369
|
+
}), Ue = A({
|
|
370
|
+
parser: "babel",
|
|
371
|
+
parserOption: "embeddedEsParser"
|
|
372
|
+
}), M = "embeddedEs", We = [
|
|
230
373
|
"js",
|
|
231
374
|
"jsx",
|
|
232
375
|
"es",
|
|
@@ -235,275 +378,336 @@ var D = "9ff2b366e8ca4c97b9aed1a29b5b94ed", me = async (e, t, n, r, { commentOrT
|
|
|
235
378
|
"cjs",
|
|
236
379
|
"pac",
|
|
237
380
|
"javascript"
|
|
238
|
-
],
|
|
381
|
+
], Ge = [
|
|
239
382
|
"babel",
|
|
240
383
|
"babel-flow",
|
|
241
384
|
"acorn",
|
|
242
385
|
"espree",
|
|
243
386
|
"flow",
|
|
244
387
|
"meriyah"
|
|
245
|
-
],
|
|
246
|
-
[
|
|
388
|
+
], Ke = T(M), qe = E(M), Je = D(M), Ye = O(M), Xe = {
|
|
389
|
+
[Ke]: {
|
|
247
390
|
category: "Embed",
|
|
248
391
|
type: "string",
|
|
249
392
|
array: !0,
|
|
250
|
-
default: [{ value: [...
|
|
393
|
+
default: [{ value: [...We] }],
|
|
251
394
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language.",
|
|
252
|
-
deprecated: `Please use \`${
|
|
395
|
+
deprecated: `Please use \`${qe}\` or \`${Je}\`.`
|
|
253
396
|
},
|
|
254
|
-
[
|
|
397
|
+
[qe]: {
|
|
255
398
|
category: "Embed",
|
|
256
399
|
type: "string",
|
|
257
400
|
array: !0,
|
|
258
|
-
default: [{ value: [
|
|
401
|
+
default: [{ value: [k] }],
|
|
259
402
|
description: "Block comments that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
260
403
|
},
|
|
261
|
-
[
|
|
404
|
+
[Je]: {
|
|
262
405
|
category: "Embed",
|
|
263
406
|
type: "string",
|
|
264
407
|
array: !0,
|
|
265
|
-
default: [{ value: [
|
|
408
|
+
default: [{ value: [k] }],
|
|
266
409
|
description: "Tags that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
267
410
|
},
|
|
268
|
-
[
|
|
411
|
+
[Ye]: {
|
|
269
412
|
category: "Embed",
|
|
270
413
|
type: "choice",
|
|
271
414
|
default: "babel",
|
|
272
415
|
description: "The parser used to parse the embedded ECMASCript/JavaScript language.",
|
|
273
|
-
choices:
|
|
416
|
+
choices: Ge.map((e) => ({
|
|
274
417
|
value: e,
|
|
275
418
|
description: `Use the "${e}" parser.`
|
|
276
419
|
}))
|
|
277
420
|
}
|
|
278
|
-
},
|
|
279
|
-
embedder: () =>
|
|
280
|
-
language: () =>
|
|
281
|
-
options: () =>
|
|
282
|
-
}),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
421
|
+
}, Ze = /* @__PURE__ */ p({
|
|
422
|
+
embedder: () => Ue,
|
|
423
|
+
language: () => M,
|
|
424
|
+
options: () => Xe
|
|
425
|
+
}), Qe = A({ parser: "gherkin" }), $e = "embeddedGherkin", et = ["gherkin", "feature"], tt = E($e), nt = D($e), rt = {
|
|
426
|
+
[tt]: {
|
|
427
|
+
category: "Embed",
|
|
428
|
+
type: "string",
|
|
429
|
+
array: !0,
|
|
430
|
+
default: [{ value: [...et] }],
|
|
431
|
+
description: "Block comments that identify embedded Gherkin in template literals. Requires the `prettier-plugin-gherkin` plugin."
|
|
432
|
+
},
|
|
433
|
+
[nt]: {
|
|
434
|
+
category: "Embed",
|
|
435
|
+
type: "string",
|
|
436
|
+
array: !0,
|
|
437
|
+
default: [{ value: [...et] }],
|
|
438
|
+
description: "Tags that identify embedded Gherkin in template literals. Requires the `prettier-plugin-gherkin` plugin."
|
|
439
|
+
}
|
|
440
|
+
}, it = /* @__PURE__ */ p({
|
|
441
|
+
embedder: () => Qe,
|
|
442
|
+
language: () => $e,
|
|
443
|
+
options: () => rt
|
|
444
|
+
}), at = A({ parser: "glsl-parser" }), ot = "embeddedGlsl", st = ["glsl", "shader"], ct = T(ot), lt = E(ot), ut = D(ot), dt = {
|
|
445
|
+
[ct]: {
|
|
293
446
|
category: "Embed",
|
|
294
447
|
type: "string",
|
|
295
448
|
array: !0,
|
|
296
|
-
default: [{ value: [...
|
|
449
|
+
default: [{ value: [...st] }],
|
|
297
450
|
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.",
|
|
298
|
-
deprecated: `Please use \`${
|
|
451
|
+
deprecated: `Please use \`${lt}\` or \`${ut}\`.`
|
|
299
452
|
},
|
|
300
|
-
[
|
|
453
|
+
[lt]: {
|
|
301
454
|
category: "Embed",
|
|
302
455
|
type: "string",
|
|
303
456
|
array: !0,
|
|
304
|
-
default: [{ value: [
|
|
457
|
+
default: [{ value: [k] }],
|
|
305
458
|
description: "Block comments that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
306
459
|
},
|
|
307
|
-
[
|
|
460
|
+
[ut]: {
|
|
308
461
|
category: "Embed",
|
|
309
462
|
type: "string",
|
|
310
463
|
array: !0,
|
|
311
|
-
default: [{ value: [
|
|
464
|
+
default: [{ value: [k] }],
|
|
312
465
|
description: "Tags that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
313
466
|
}
|
|
314
|
-
},
|
|
315
|
-
embedder: () =>
|
|
316
|
-
language: () =>
|
|
317
|
-
options: () =>
|
|
318
|
-
}),
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
467
|
+
}, ft = /* @__PURE__ */ p({
|
|
468
|
+
embedder: () => at,
|
|
469
|
+
language: () => ot,
|
|
470
|
+
options: () => dt
|
|
471
|
+
}), pt = A({
|
|
472
|
+
parser: "go-template",
|
|
473
|
+
markup: !0
|
|
474
|
+
}), mt = "embeddedGoTemplate", ht = ["goTemplate", "gotmpl"], gt = E(mt), _t = D(mt), vt = {
|
|
475
|
+
[gt]: {
|
|
476
|
+
category: "Embed",
|
|
477
|
+
type: "string",
|
|
478
|
+
array: !0,
|
|
479
|
+
default: [{ value: [...ht] }],
|
|
480
|
+
description: "Block comments that identify embedded Go Template in template literals. Requires the `@htnabe/prettier-plugin-go-template` plugin."
|
|
481
|
+
},
|
|
482
|
+
[_t]: {
|
|
483
|
+
category: "Embed",
|
|
484
|
+
type: "string",
|
|
485
|
+
array: !0,
|
|
486
|
+
default: [{ value: [...ht] }],
|
|
487
|
+
description: "Tags that identify embedded Go Template in template literals. Requires the `@htnabe/prettier-plugin-go-template` plugin."
|
|
488
|
+
}
|
|
489
|
+
}, yt = /* @__PURE__ */ p({
|
|
490
|
+
embedder: () => pt,
|
|
491
|
+
language: () => mt,
|
|
492
|
+
options: () => vt
|
|
493
|
+
}), bt = A({ parser: "graphql" }), xt = "embeddedGraphql", St = ["graphql", "gql"], Ct = T(xt), wt = E(xt), Tt = D(xt), Et = {
|
|
494
|
+
[Ct]: {
|
|
329
495
|
category: "Embed",
|
|
330
496
|
type: "string",
|
|
331
497
|
array: !0,
|
|
332
|
-
default: [{ value: [...
|
|
498
|
+
default: [{ value: [...St] }],
|
|
333
499
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GraphQL language.",
|
|
334
|
-
deprecated: `Please use \`${
|
|
500
|
+
deprecated: `Please use \`${wt}\` or \`${Tt}\`.`
|
|
335
501
|
},
|
|
336
|
-
[
|
|
502
|
+
[wt]: {
|
|
337
503
|
category: "Embed",
|
|
338
504
|
type: "string",
|
|
339
505
|
array: !0,
|
|
340
|
-
default: [{ value: [
|
|
506
|
+
default: [{ value: [k] }],
|
|
341
507
|
description: "Block comments that make their subsequent template literals be identified as embedded GraphQL language."
|
|
342
508
|
},
|
|
343
|
-
[
|
|
509
|
+
[Tt]: {
|
|
344
510
|
category: "Embed",
|
|
345
511
|
type: "string",
|
|
346
512
|
array: !0,
|
|
347
|
-
default: [{ value: [
|
|
513
|
+
default: [{ value: [k] }],
|
|
348
514
|
description: "Tags that make their subsequent template literals be identified as embedded GraphQL language."
|
|
349
515
|
}
|
|
350
|
-
},
|
|
351
|
-
embedder: () =>
|
|
352
|
-
language: () =>
|
|
353
|
-
options: () =>
|
|
354
|
-
}),
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
516
|
+
}, Dt = /* @__PURE__ */ p({
|
|
517
|
+
embedder: () => bt,
|
|
518
|
+
language: () => xt,
|
|
519
|
+
options: () => Et
|
|
520
|
+
}), Ot = A({
|
|
521
|
+
parser: "handlebars",
|
|
522
|
+
markup: !0
|
|
523
|
+
}), kt = "embeddedHandlebars", At = ["handlebars", "hbs"], jt = E(kt), Mt = D(kt), Nt = {
|
|
524
|
+
[jt]: {
|
|
525
|
+
category: "Embed",
|
|
526
|
+
type: "string",
|
|
527
|
+
array: !0,
|
|
528
|
+
default: [{ value: [...At] }],
|
|
529
|
+
description: "Block comments that identify embedded Handlebars in template literals. Requires the `@poliklot/prettier-plugin-handlebars` plugin."
|
|
530
|
+
},
|
|
531
|
+
[Mt]: {
|
|
532
|
+
category: "Embed",
|
|
533
|
+
type: "string",
|
|
534
|
+
array: !0,
|
|
535
|
+
default: [{ value: [...At] }],
|
|
536
|
+
description: "Tags that identify embedded Handlebars in template literals. Requires the `@poliklot/prettier-plugin-handlebars` plugin."
|
|
537
|
+
}
|
|
538
|
+
}, Pt = /* @__PURE__ */ p({
|
|
539
|
+
embedder: () => Ot,
|
|
540
|
+
language: () => kt,
|
|
541
|
+
options: () => Nt
|
|
542
|
+
}), Ft = A({
|
|
543
|
+
parser: "html",
|
|
544
|
+
parserOption: "embeddedHtmlParser",
|
|
545
|
+
markup: !0
|
|
546
|
+
}), N = "embeddedHtml", It = ["html", "xhtml"], Lt = [
|
|
378
547
|
"html",
|
|
379
548
|
"vue",
|
|
380
549
|
"angular",
|
|
381
550
|
"lwc"
|
|
382
|
-
],
|
|
383
|
-
[
|
|
551
|
+
], Rt = T(N), zt = E(N), Bt = D(N), Vt = O(N), Ht = {
|
|
552
|
+
[Rt]: {
|
|
384
553
|
category: "Embed",
|
|
385
554
|
type: "string",
|
|
386
555
|
array: !0,
|
|
387
|
-
default: [{ value: [...
|
|
556
|
+
default: [{ value: [...It] }],
|
|
388
557
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language.",
|
|
389
|
-
deprecated: `Please use \`${
|
|
558
|
+
deprecated: `Please use \`${zt}\` or \`${Bt}\`.`
|
|
390
559
|
},
|
|
391
|
-
[
|
|
560
|
+
[zt]: {
|
|
392
561
|
category: "Embed",
|
|
393
562
|
type: "string",
|
|
394
563
|
array: !0,
|
|
395
|
-
default: [{ value: [
|
|
564
|
+
default: [{ value: [k] }],
|
|
396
565
|
description: "Block comments that make their subsequent template literals be identified as embedded HTML language."
|
|
397
566
|
},
|
|
398
|
-
[
|
|
567
|
+
[Bt]: {
|
|
399
568
|
category: "Embed",
|
|
400
569
|
type: "string",
|
|
401
570
|
array: !0,
|
|
402
|
-
default: [{ value: [
|
|
571
|
+
default: [{ value: [k] }],
|
|
403
572
|
description: "Tags that make their subsequent template literals be identified as embedded HTML language."
|
|
404
573
|
},
|
|
405
|
-
[
|
|
574
|
+
[Vt]: {
|
|
406
575
|
category: "Embed",
|
|
407
576
|
type: "choice",
|
|
408
577
|
default: "html",
|
|
409
578
|
description: "The parser used to parse the embedded HTML language.",
|
|
410
|
-
choices:
|
|
579
|
+
choices: Lt.map((e) => ({
|
|
411
580
|
value: e,
|
|
412
581
|
description: `Use the "${e}" parser.`
|
|
413
582
|
}))
|
|
414
583
|
}
|
|
415
|
-
},
|
|
416
|
-
embedder: () =>
|
|
417
|
-
language: () =>
|
|
418
|
-
options: () =>
|
|
419
|
-
}),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
584
|
+
}, Ut = /* @__PURE__ */ p({
|
|
585
|
+
embedder: () => Ft,
|
|
586
|
+
language: () => N,
|
|
587
|
+
options: () => Ht
|
|
588
|
+
}), Wt = A({
|
|
589
|
+
parser: "hugo-post",
|
|
590
|
+
newlineHandling: "hardline",
|
|
591
|
+
dedentContent: !0
|
|
592
|
+
}), Gt = "embeddedHugo", Kt = ["hugo", "hugoPost"], qt = E(Gt), Jt = D(Gt), Yt = {
|
|
593
|
+
[qt]: {
|
|
594
|
+
category: "Embed",
|
|
595
|
+
type: "string",
|
|
596
|
+
array: !0,
|
|
597
|
+
default: [{ value: [...Kt] }],
|
|
598
|
+
description: "Block comments that identify embedded Hugo in template literals. Requires the `@htnabe/prettier-plugin-hugo-post` plugin."
|
|
599
|
+
},
|
|
600
|
+
[Jt]: {
|
|
601
|
+
category: "Embed",
|
|
602
|
+
type: "string",
|
|
603
|
+
array: !0,
|
|
604
|
+
default: [{ value: [...Kt] }],
|
|
605
|
+
description: "Tags that identify embedded Hugo in template literals. Requires the `@htnabe/prettier-plugin-hugo-post` plugin."
|
|
606
|
+
}
|
|
607
|
+
}, Xt = /* @__PURE__ */ p({
|
|
608
|
+
embedder: () => Wt,
|
|
609
|
+
language: () => Gt,
|
|
610
|
+
options: () => Yt
|
|
611
|
+
}), Zt = A({ parser: "ini" }), P = "embeddedIni", Qt = [
|
|
429
612
|
"ini",
|
|
430
613
|
"cfg",
|
|
431
614
|
"pro"
|
|
432
|
-
],
|
|
433
|
-
[
|
|
615
|
+
], $t = T(P), en = E(P), tn = D(P), nn = {
|
|
616
|
+
[$t]: {
|
|
434
617
|
category: "Embed",
|
|
435
618
|
type: "string",
|
|
436
619
|
array: !0,
|
|
437
|
-
default: [{ value: [...
|
|
620
|
+
default: [{ value: [...Qt] }],
|
|
438
621
|
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.",
|
|
439
|
-
deprecated: `Please use \`${
|
|
622
|
+
deprecated: `Please use \`${en}\` or \`${tn}\`.`
|
|
440
623
|
},
|
|
441
|
-
[
|
|
624
|
+
[en]: {
|
|
442
625
|
category: "Embed",
|
|
443
626
|
type: "string",
|
|
444
627
|
array: !0,
|
|
445
|
-
default: [{ value: [
|
|
628
|
+
default: [{ value: [k] }],
|
|
446
629
|
description: "Block comments that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
447
630
|
},
|
|
448
|
-
[
|
|
631
|
+
[tn]: {
|
|
449
632
|
category: "Embed",
|
|
450
633
|
type: "string",
|
|
451
634
|
array: !0,
|
|
452
|
-
default: [{ value: [
|
|
635
|
+
default: [{ value: [k] }],
|
|
453
636
|
description: "Tags that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
454
637
|
}
|
|
455
|
-
},
|
|
456
|
-
embedder: () =>
|
|
457
|
-
language: () =>
|
|
458
|
-
options: () =>
|
|
459
|
-
}),
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return v(b(await e(u, {
|
|
465
|
-
...o,
|
|
466
|
-
parser: "java"
|
|
467
|
-
}), l, p, "hardline"), o, i, d, f);
|
|
468
|
-
}, P = "embeddedJava", ut = ["java"], dt = C(P), ft = w(P), pt = T(P), mt = {
|
|
469
|
-
[dt]: {
|
|
638
|
+
}, rn = /* @__PURE__ */ p({
|
|
639
|
+
embedder: () => Zt,
|
|
640
|
+
language: () => P,
|
|
641
|
+
options: () => nn
|
|
642
|
+
}), an = A({
|
|
643
|
+
parser: "java",
|
|
644
|
+
newlineHandling: "hardline"
|
|
645
|
+
}), F = "embeddedJava", on = ["java"], sn = T(F), cn = E(F), ln = D(F), un = {
|
|
646
|
+
[sn]: {
|
|
470
647
|
category: "Embed",
|
|
471
648
|
type: "string",
|
|
472
649
|
array: !0,
|
|
473
|
-
default: [{ value: [...
|
|
650
|
+
default: [{ value: [...on] }],
|
|
474
651
|
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.",
|
|
475
|
-
deprecated: `Please use \`${
|
|
652
|
+
deprecated: `Please use \`${cn}\` or \`${ln}\`.`
|
|
476
653
|
},
|
|
477
|
-
[
|
|
654
|
+
[cn]: {
|
|
478
655
|
category: "Embed",
|
|
479
656
|
type: "string",
|
|
480
657
|
array: !0,
|
|
481
|
-
default: [{ value: [
|
|
658
|
+
default: [{ value: [k] }],
|
|
482
659
|
description: "Block comments that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
483
660
|
},
|
|
484
|
-
[
|
|
661
|
+
[ln]: {
|
|
485
662
|
category: "Embed",
|
|
486
663
|
type: "string",
|
|
487
664
|
array: !0,
|
|
488
|
-
default: [{ value: [
|
|
665
|
+
default: [{ value: [k] }],
|
|
489
666
|
description: "Tags that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
490
667
|
}
|
|
491
|
-
},
|
|
492
|
-
embedder: () =>
|
|
493
|
-
language: () =>
|
|
494
|
-
options: () =>
|
|
495
|
-
}),
|
|
668
|
+
}, dn = /* @__PURE__ */ p({
|
|
669
|
+
embedder: () => an,
|
|
670
|
+
language: () => F,
|
|
671
|
+
options: () => un
|
|
672
|
+
}), fn = A({
|
|
673
|
+
parser: "jinja-template",
|
|
674
|
+
markup: !0,
|
|
675
|
+
dedentContent: !0
|
|
676
|
+
}), pn = "embeddedJinja", mn = [
|
|
677
|
+
"jinja",
|
|
678
|
+
"jinja2",
|
|
679
|
+
"j2"
|
|
680
|
+
], hn = E(pn), gn = D(pn), _n = {
|
|
681
|
+
[hn]: {
|
|
682
|
+
category: "Embed",
|
|
683
|
+
type: "string",
|
|
684
|
+
array: !0,
|
|
685
|
+
default: [{ value: [...mn] }],
|
|
686
|
+
description: "Block comments that identify embedded Jinja in template literals. Requires the `prettier-plugin-jinja-template` plugin."
|
|
687
|
+
},
|
|
688
|
+
[gn]: {
|
|
689
|
+
category: "Embed",
|
|
690
|
+
type: "string",
|
|
691
|
+
array: !0,
|
|
692
|
+
default: [{ value: [...mn] }],
|
|
693
|
+
description: "Tags that identify embedded Jinja in template literals. Requires the `prettier-plugin-jinja-template` plugin."
|
|
694
|
+
}
|
|
695
|
+
}, vn = /* @__PURE__ */ p({
|
|
696
|
+
embedder: () => fn,
|
|
697
|
+
language: () => pn,
|
|
698
|
+
options: () => _n
|
|
699
|
+
}), yn = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
496
700
|
let o = {
|
|
497
701
|
...r,
|
|
498
702
|
...a
|
|
499
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } =
|
|
500
|
-
return
|
|
703
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = bn(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = y(s, c), p = x(n, t);
|
|
704
|
+
return b(S(await e(u, {
|
|
501
705
|
...o,
|
|
502
706
|
parser: o.embeddedJsonParser ?? "json"
|
|
503
707
|
}), l, p), o, i, d, f);
|
|
504
708
|
};
|
|
505
|
-
function
|
|
506
|
-
let e =
|
|
709
|
+
function bn() {
|
|
710
|
+
let e = C(), t = C();
|
|
507
711
|
return {
|
|
508
712
|
createPlaceholder: (n) => `'0${e}${n}${t}'`,
|
|
509
713
|
placeholderRegex: RegExp(`["']?0${e}(\\d+)${t}['"]?`, "ig")
|
|
@@ -511,94 +715,101 @@ function _t() {
|
|
|
511
715
|
}
|
|
512
716
|
//#endregion
|
|
513
717
|
//#region src/embedded/json/language.ts
|
|
514
|
-
var
|
|
718
|
+
var I = "embeddedJson", xn = ["json", "jsonl"], Sn = [
|
|
515
719
|
"json",
|
|
516
720
|
"json5",
|
|
517
721
|
"jsonc",
|
|
518
722
|
"json-stringify"
|
|
519
|
-
],
|
|
520
|
-
[
|
|
723
|
+
], Cn = T(I), wn = E(I), Tn = D(I), En = O(I), Dn = {
|
|
724
|
+
[Cn]: {
|
|
521
725
|
category: "Embed",
|
|
522
726
|
type: "string",
|
|
523
727
|
array: !0,
|
|
524
|
-
default: [{ value: [...
|
|
728
|
+
default: [{ value: [...xn] }],
|
|
525
729
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language.",
|
|
526
|
-
deprecated: `Please use \`${
|
|
730
|
+
deprecated: `Please use \`${wn}\` or \`${Tn}\`.`
|
|
527
731
|
},
|
|
528
|
-
[
|
|
732
|
+
[wn]: {
|
|
529
733
|
category: "Embed",
|
|
530
734
|
type: "string",
|
|
531
735
|
array: !0,
|
|
532
|
-
default: [{ value: [
|
|
736
|
+
default: [{ value: [k] }],
|
|
533
737
|
description: "Block comments that make their subsequent template literals be identified as embedded JSON language."
|
|
534
738
|
},
|
|
535
|
-
[
|
|
739
|
+
[Tn]: {
|
|
536
740
|
category: "Embed",
|
|
537
741
|
type: "string",
|
|
538
742
|
array: !0,
|
|
539
|
-
default: [{ value: [
|
|
743
|
+
default: [{ value: [k] }],
|
|
540
744
|
description: "Tags that make their subsequent template literals be identified as embedded JSON language."
|
|
541
745
|
},
|
|
542
|
-
[
|
|
746
|
+
[En]: {
|
|
543
747
|
category: "Embed",
|
|
544
748
|
type: "choice",
|
|
545
749
|
default: "json",
|
|
546
750
|
description: "The parser used to parse the embedded JSON language.",
|
|
547
|
-
choices:
|
|
751
|
+
choices: Sn.map((e) => ({
|
|
548
752
|
value: e,
|
|
549
753
|
description: `Use the "${e}" parser.`
|
|
550
754
|
}))
|
|
551
755
|
}
|
|
552
|
-
},
|
|
553
|
-
embedder: () =>
|
|
554
|
-
language: () =>
|
|
555
|
-
options: () =>
|
|
556
|
-
}),
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
return v(b(await e(u, {
|
|
562
|
-
...o,
|
|
563
|
-
parser: "JSONata"
|
|
564
|
-
}), l, p), o, i, d, f);
|
|
565
|
-
}, I = "embeddedJsonata", Dt = ["jsonata"], Ot = C(I), kt = w(I), At = T(I), jt = {
|
|
566
|
-
[Ot]: {
|
|
756
|
+
}, On = /* @__PURE__ */ p({
|
|
757
|
+
embedder: () => yn,
|
|
758
|
+
language: () => I,
|
|
759
|
+
options: () => Dn
|
|
760
|
+
}), kn = A({
|
|
761
|
+
parser: "JSONata",
|
|
762
|
+
placeholderPrefix: "$p"
|
|
763
|
+
}), L = "embeddedJsonata", An = ["jsonata"], jn = T(L), Mn = E(L), Nn = D(L), Pn = {
|
|
764
|
+
[jn]: {
|
|
567
765
|
category: "Embed",
|
|
568
766
|
type: "string",
|
|
569
767
|
array: !0,
|
|
570
|
-
default: [{ value: [...
|
|
768
|
+
default: [{ value: [...An] }],
|
|
571
769
|
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.",
|
|
572
|
-
deprecated: `Please use \`${
|
|
770
|
+
deprecated: `Please use \`${Mn}\` or \`${Nn}\`.`
|
|
573
771
|
},
|
|
574
|
-
[
|
|
772
|
+
[Mn]: {
|
|
575
773
|
category: "Embed",
|
|
576
774
|
type: "string",
|
|
577
775
|
array: !0,
|
|
578
|
-
default: [{ value: [
|
|
776
|
+
default: [{ value: [k] }],
|
|
579
777
|
description: "Block comments that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
580
778
|
},
|
|
581
|
-
[
|
|
779
|
+
[Nn]: {
|
|
582
780
|
category: "Embed",
|
|
583
781
|
type: "string",
|
|
584
782
|
array: !0,
|
|
585
|
-
default: [{ value: [
|
|
783
|
+
default: [{ value: [k] }],
|
|
586
784
|
description: "Tags that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
587
785
|
}
|
|
588
|
-
},
|
|
589
|
-
embedder: () =>
|
|
590
|
-
language: () =>
|
|
591
|
-
options: () =>
|
|
592
|
-
}),
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
786
|
+
}, Fn = /* @__PURE__ */ p({
|
|
787
|
+
embedder: () => kn,
|
|
788
|
+
language: () => L,
|
|
789
|
+
options: () => Pn
|
|
790
|
+
}), In = A({
|
|
791
|
+
parser: "jte",
|
|
792
|
+
markup: !0
|
|
793
|
+
}), Ln = "embeddedJte", Rn = ["jte"], zn = E(Ln), Bn = D(Ln), Vn = {
|
|
794
|
+
[zn]: {
|
|
795
|
+
category: "Embed",
|
|
796
|
+
type: "string",
|
|
797
|
+
array: !0,
|
|
798
|
+
default: [{ value: [...Rn] }],
|
|
799
|
+
description: "Block comments that identify embedded JTE in template literals. Requires the `prettier-plugin-jte` plugin."
|
|
800
|
+
},
|
|
801
|
+
[Bn]: {
|
|
802
|
+
category: "Embed",
|
|
803
|
+
type: "string",
|
|
804
|
+
array: !0,
|
|
805
|
+
default: [{ value: [...Rn] }],
|
|
806
|
+
description: "Tags that identify embedded JTE in template literals. Requires the `prettier-plugin-jte` plugin."
|
|
807
|
+
}
|
|
808
|
+
}, Hn = /* @__PURE__ */ p({
|
|
809
|
+
embedder: () => In,
|
|
810
|
+
language: () => Ln,
|
|
811
|
+
options: () => Vn
|
|
812
|
+
}), Un = A({ parser: "latex-parser" }), R = "embeddedLatex", Wn = [
|
|
602
813
|
"latex",
|
|
603
814
|
"tex",
|
|
604
815
|
"aux",
|
|
@@ -607,723 +818,771 @@ var F = "embeddedJson", vt = ["json", "jsonl"], yt = [
|
|
|
607
818
|
"bib",
|
|
608
819
|
"toc",
|
|
609
820
|
"sty"
|
|
610
|
-
],
|
|
611
|
-
[
|
|
821
|
+
], Gn = T(R), Kn = E(R), qn = D(R), Jn = {
|
|
822
|
+
[Gn]: {
|
|
612
823
|
category: "Embed",
|
|
613
824
|
type: "string",
|
|
614
825
|
array: !0,
|
|
615
|
-
default: [{ value: [...
|
|
826
|
+
default: [{ value: [...Wn] }],
|
|
616
827
|
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.",
|
|
617
|
-
deprecated: `Please use \`${
|
|
828
|
+
deprecated: `Please use \`${Kn}\` or \`${qn}\`.`
|
|
618
829
|
},
|
|
619
|
-
[
|
|
830
|
+
[Kn]: {
|
|
620
831
|
category: "Embed",
|
|
621
832
|
type: "string",
|
|
622
833
|
array: !0,
|
|
623
|
-
default: [{ value: [
|
|
834
|
+
default: [{ value: [k] }],
|
|
624
835
|
description: "Block comments that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
625
836
|
},
|
|
626
|
-
[
|
|
837
|
+
[qn]: {
|
|
627
838
|
category: "Embed",
|
|
628
839
|
type: "string",
|
|
629
840
|
array: !0,
|
|
630
|
-
default: [{ value: [
|
|
841
|
+
default: [{ value: [k] }],
|
|
631
842
|
description: "Tags that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
632
843
|
}
|
|
633
|
-
},
|
|
634
|
-
embedder: () =>
|
|
635
|
-
language: () =>
|
|
636
|
-
options: () =>
|
|
637
|
-
})
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
Ht(e, t, n[t]);
|
|
655
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Bt(Object(n)).forEach(function(t) {
|
|
656
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
return e;
|
|
660
|
-
}
|
|
661
|
-
function Ht(e, t, n) {
|
|
662
|
-
return t = Ut(t), t in e ? Object.defineProperty(e, t, {
|
|
663
|
-
value: n,
|
|
664
|
-
enumerable: !0,
|
|
665
|
-
configurable: !0,
|
|
666
|
-
writable: !0
|
|
667
|
-
}) : e[t] = n, e;
|
|
668
|
-
}
|
|
669
|
-
function Ut(e) {
|
|
670
|
-
var t = Wt(e, "string");
|
|
671
|
-
return typeof t == "symbol" ? t : String(t);
|
|
672
|
-
}
|
|
673
|
-
function Wt(e, t) {
|
|
674
|
-
if (typeof e != "object" || !e) return e;
|
|
675
|
-
var n = e[Symbol.toPrimitive];
|
|
676
|
-
if (n !== void 0) {
|
|
677
|
-
var r = n.call(e, t || "default");
|
|
678
|
-
if (typeof r != "object") return r;
|
|
679
|
-
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
680
|
-
}
|
|
681
|
-
return (t === "string" ? String : Number)(e);
|
|
682
|
-
}
|
|
683
|
-
var Gt = Kt({});
|
|
684
|
-
function Kt(e) {
|
|
685
|
-
return t.withOptions = (t) => Kt(Vt(Vt({}, e), t)), t;
|
|
686
|
-
function t(t, ...n) {
|
|
687
|
-
let r = typeof t == "string" ? [t] : t.raw, { alignValues: i = !1, escapeSpecialCharacters: a = Array.isArray(t), trimWhitespace: o = !0 } = e, s = "";
|
|
688
|
-
for (let e = 0; e < r.length; e++) {
|
|
689
|
-
let t = r[e];
|
|
690
|
-
if (a && (t = t.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), s += t, e < n.length) {
|
|
691
|
-
let t = i ? qt(n[e], s) : n[e];
|
|
692
|
-
s += t;
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
let c = s.split("\n"), l = null;
|
|
696
|
-
for (let e of c) {
|
|
697
|
-
let t = e.match(/^(\s+)\S+/);
|
|
698
|
-
if (t) {
|
|
699
|
-
let e = t[1].length;
|
|
700
|
-
l = l ? Math.min(l, e) : e;
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
if (l !== null) {
|
|
704
|
-
let e = l;
|
|
705
|
-
s = c.map((t) => t[0] === " " || t[0] === " " ? t.slice(e) : t).join("\n");
|
|
706
|
-
}
|
|
707
|
-
return o && (s = s.trim()), a && (s = s.replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\v/g, "\v").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\0/g, "\0").replace(/\\x([\da-fA-F]{2})/g, (e, t) => String.fromCharCode(parseInt(t, 16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g, (e, t) => String.fromCodePoint(parseInt(t, 16))).replace(/\\u([\da-fA-F]{4})/g, (e, t) => String.fromCharCode(parseInt(t, 16)))), typeof Bun < "u" && (s = s.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g, (e, t, n) => {
|
|
708
|
-
let r = t ?? n ?? "";
|
|
709
|
-
return String.fromCodePoint(parseInt(r, 16));
|
|
710
|
-
})), s;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
function qt(e, t) {
|
|
714
|
-
if (typeof e != "string" || !e.includes("\n")) return e;
|
|
715
|
-
let n = t.slice(t.lastIndexOf("\n") + 1).match(/^(\s+)/);
|
|
716
|
-
if (n) {
|
|
717
|
-
let t = n[1];
|
|
718
|
-
return e.replace(/\n/g, `\n${t}`);
|
|
844
|
+
}, Yn = /* @__PURE__ */ p({
|
|
845
|
+
embedder: () => Un,
|
|
846
|
+
language: () => R,
|
|
847
|
+
options: () => Jn
|
|
848
|
+
}), Xn = A({
|
|
849
|
+
parser: "liquid-html",
|
|
850
|
+
markup: !0
|
|
851
|
+
}), Zn = "embeddedLiquid", Qn = ["liquid"], $n = E(Zn), er = D(Zn), tr = {
|
|
852
|
+
[$n]: {
|
|
853
|
+
category: "Embed",
|
|
854
|
+
type: "string",
|
|
855
|
+
array: !0,
|
|
856
|
+
default: [{ value: [...Qn] }],
|
|
857
|
+
description: "Block comments that identify embedded Liquid in template literals. Requires the `@shopify/prettier-plugin-liquid` plugin."
|
|
858
|
+
},
|
|
859
|
+
[er]: {
|
|
860
|
+
category: "Embed",
|
|
861
|
+
type: "string",
|
|
862
|
+
array: !0,
|
|
863
|
+
default: [{ value: [...Qn] }],
|
|
864
|
+
description: "Tags that identify embedded Liquid in template literals. Requires the `@shopify/prettier-plugin-liquid` plugin."
|
|
719
865
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
866
|
+
}, nr = /* @__PURE__ */ p({
|
|
867
|
+
embedder: () => Xn,
|
|
868
|
+
language: () => Zn,
|
|
869
|
+
options: () => tr
|
|
870
|
+
}), { line: rr, group: z, indent: ir, softline: ar, dedentToRoot: or, literalline: sr } = e, cr = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
725
871
|
let o = {
|
|
726
872
|
...r,
|
|
727
873
|
...a
|
|
728
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } =
|
|
874
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = w(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = y(s, c), p = x(n, t), m = S(await e(re(u), {
|
|
729
875
|
...o,
|
|
730
876
|
parser: o.embeddedMarkdownParser ?? "markdown",
|
|
731
877
|
__inJsTemplate: !0
|
|
732
878
|
}), l, p, "hardline");
|
|
733
|
-
if (o.preserveEmbeddedExteriorWhitespaces?.includes(i)) return
|
|
879
|
+
if (o.preserveEmbeddedExteriorWhitespaces?.includes(i)) return z([
|
|
734
880
|
"`",
|
|
735
881
|
d,
|
|
736
|
-
o.noEmbeddedMultiLineIndentation?.includes(i) ?
|
|
882
|
+
o.noEmbeddedMultiLineIndentation?.includes(i) ? or(z(m)) : ir([z(m)]),
|
|
737
883
|
f,
|
|
738
884
|
"`"
|
|
739
885
|
]);
|
|
740
|
-
let h = d.length ?
|
|
886
|
+
let h = d.length ? rr : ar, ee = f.length ? rr : ar;
|
|
741
887
|
return o.noEmbeddedMultiLineIndentation?.includes(i) ? [
|
|
742
888
|
"`",
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
889
|
+
sr,
|
|
890
|
+
or(m),
|
|
891
|
+
ar,
|
|
746
892
|
"`"
|
|
747
|
-
] :
|
|
893
|
+
] : z([
|
|
748
894
|
"`",
|
|
749
|
-
|
|
895
|
+
ir([h, z(m)]),
|
|
750
896
|
ee,
|
|
751
897
|
"`"
|
|
752
898
|
]);
|
|
753
|
-
},
|
|
899
|
+
}, B = "embeddedMarkdown", lr = ["md", "markdown"], ur = [
|
|
754
900
|
"markdown",
|
|
755
901
|
"mdx",
|
|
756
902
|
"remark"
|
|
757
|
-
],
|
|
758
|
-
[
|
|
903
|
+
], dr = T(B), fr = E(B), pr = D(B), mr = O(B), hr = {
|
|
904
|
+
[dr]: {
|
|
759
905
|
category: "Embed",
|
|
760
906
|
type: "string",
|
|
761
907
|
array: !0,
|
|
762
|
-
default: [{ value: [...
|
|
908
|
+
default: [{ value: [...lr] }],
|
|
763
909
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language.",
|
|
764
|
-
deprecated: `Please use \`${
|
|
910
|
+
deprecated: `Please use \`${fr}\` or \`${pr}\`.`
|
|
765
911
|
},
|
|
766
|
-
[
|
|
912
|
+
[fr]: {
|
|
767
913
|
category: "Embed",
|
|
768
914
|
type: "string",
|
|
769
915
|
array: !0,
|
|
770
|
-
default: [{ value: [
|
|
916
|
+
default: [{ value: [k] }],
|
|
771
917
|
description: "Block comments that make their subsequent template literals be identified as embedded Markdown language."
|
|
772
918
|
},
|
|
773
|
-
[
|
|
919
|
+
[pr]: {
|
|
774
920
|
category: "Embed",
|
|
775
921
|
type: "string",
|
|
776
922
|
array: !0,
|
|
777
|
-
default: [{ value: [
|
|
923
|
+
default: [{ value: [k] }],
|
|
778
924
|
description: "Tags that make their subsequent template literals be identified as embedded Markdown language."
|
|
779
925
|
},
|
|
780
|
-
[
|
|
926
|
+
[mr]: {
|
|
781
927
|
category: "Embed",
|
|
782
928
|
type: "choice",
|
|
783
929
|
default: "markdown",
|
|
784
930
|
description: "The parser used to parse the embedded Markdown language.",
|
|
785
|
-
choices:
|
|
931
|
+
choices: ur.map((e) => ({
|
|
786
932
|
value: e,
|
|
787
933
|
description: `Use the "${e}" parser.`
|
|
788
934
|
}))
|
|
789
935
|
}
|
|
790
|
-
},
|
|
791
|
-
embedder: () =>
|
|
792
|
-
language: () =>
|
|
793
|
-
options: () =>
|
|
794
|
-
}),
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
936
|
+
}, gr = /* @__PURE__ */ p({
|
|
937
|
+
embedder: () => cr,
|
|
938
|
+
language: () => B,
|
|
939
|
+
options: () => hr
|
|
940
|
+
}), _r = A({
|
|
941
|
+
parser: "marko",
|
|
942
|
+
markup: !0
|
|
943
|
+
}), vr = "embeddedMarko", yr = ["marko"], br = E(vr), xr = D(vr), Sr = {
|
|
944
|
+
[br]: {
|
|
945
|
+
category: "Embed",
|
|
946
|
+
type: "string",
|
|
947
|
+
array: !0,
|
|
948
|
+
default: [{ value: [...yr] }],
|
|
949
|
+
description: "Block comments that identify embedded Marko in template literals. Requires the `prettier-plugin-marko` plugin."
|
|
950
|
+
},
|
|
951
|
+
[xr]: {
|
|
952
|
+
category: "Embed",
|
|
953
|
+
type: "string",
|
|
954
|
+
array: !0,
|
|
955
|
+
default: [{ value: [...yr] }],
|
|
956
|
+
description: "Tags that identify embedded Marko in template literals. Requires the `prettier-plugin-marko` plugin."
|
|
957
|
+
}
|
|
958
|
+
}, Cr = /* @__PURE__ */ p({
|
|
959
|
+
embedder: () => _r,
|
|
960
|
+
language: () => vr,
|
|
961
|
+
options: () => Sr
|
|
962
|
+
}), wr = A({
|
|
963
|
+
parser: "motoko-tt-parse",
|
|
964
|
+
transformDoc: Tr
|
|
965
|
+
});
|
|
966
|
+
function Tr(e) {
|
|
967
|
+
if (!Array.isArray(e)) return e;
|
|
968
|
+
let t = e.at(-1);
|
|
969
|
+
return t && !Array.isArray(t) && typeof t == "object" && t.type === "line" && t.hard && t.literal ? e.slice(0, -1) : e;
|
|
970
|
+
}
|
|
971
|
+
//#endregion
|
|
972
|
+
//#region src/embedded/motoko/language.ts
|
|
973
|
+
var Er = "embeddedMotoko", Dr = ["motoko", "mo"], Or = E(Er), kr = D(Er), Ar = {
|
|
974
|
+
[Or]: {
|
|
975
|
+
category: "Embed",
|
|
976
|
+
type: "string",
|
|
977
|
+
array: !0,
|
|
978
|
+
default: [{ value: [...Dr] }],
|
|
979
|
+
description: "Block comments that identify embedded Motoko in template literals. Requires the `prettier-plugin-motoko` plugin."
|
|
980
|
+
},
|
|
981
|
+
[kr]: {
|
|
982
|
+
category: "Embed",
|
|
983
|
+
type: "string",
|
|
984
|
+
array: !0,
|
|
985
|
+
default: [{ value: [...Dr] }],
|
|
986
|
+
description: "Tags that identify embedded Motoko in template literals. Requires the `prettier-plugin-motoko` plugin."
|
|
987
|
+
}
|
|
988
|
+
}, jr = /* @__PURE__ */ p({
|
|
989
|
+
embedder: () => wr,
|
|
990
|
+
language: () => Er,
|
|
991
|
+
options: () => Ar
|
|
992
|
+
}), Mr = A({
|
|
993
|
+
parser: "mustache",
|
|
994
|
+
markup: !0
|
|
995
|
+
}), Nr = "embeddedMustache", Pr = ["mustache"], Fr = E(Nr), Ir = D(Nr), Lr = {
|
|
996
|
+
[Fr]: {
|
|
997
|
+
category: "Embed",
|
|
998
|
+
type: "string",
|
|
999
|
+
array: !0,
|
|
1000
|
+
default: [{ value: [...Pr] }],
|
|
1001
|
+
description: "Block comments that identify embedded Mustache in template literals. Requires the `prettier-plugin-mustache` plugin."
|
|
1002
|
+
},
|
|
1003
|
+
[Ir]: {
|
|
805
1004
|
category: "Embed",
|
|
806
1005
|
type: "string",
|
|
807
1006
|
array: !0,
|
|
808
|
-
default: [{ value: [...
|
|
1007
|
+
default: [{ value: [...Pr] }],
|
|
1008
|
+
description: "Tags that identify embedded Mustache in template literals. Requires the `prettier-plugin-mustache` plugin."
|
|
1009
|
+
}
|
|
1010
|
+
}, Rr = /* @__PURE__ */ p({
|
|
1011
|
+
embedder: () => Mr,
|
|
1012
|
+
language: () => Nr,
|
|
1013
|
+
options: () => Lr
|
|
1014
|
+
}), zr = A({ parser: "nginx" }), V = "embeddedNginx", Br = ["nginx"], Vr = T(V), Hr = E(V), Ur = D(V), Wr = {
|
|
1015
|
+
[Vr]: {
|
|
1016
|
+
category: "Embed",
|
|
1017
|
+
type: "string",
|
|
1018
|
+
array: !0,
|
|
1019
|
+
default: [{ value: [...Br] }],
|
|
809
1020
|
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.",
|
|
810
|
-
deprecated: `Please use \`${
|
|
1021
|
+
deprecated: `Please use \`${Hr}\` or \`${Ur}\`.`
|
|
811
1022
|
},
|
|
812
|
-
[
|
|
1023
|
+
[Hr]: {
|
|
813
1024
|
category: "Embed",
|
|
814
1025
|
type: "string",
|
|
815
1026
|
array: !0,
|
|
816
|
-
default: [{ value: [
|
|
1027
|
+
default: [{ value: [k] }],
|
|
817
1028
|
description: "Block comments that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
818
1029
|
},
|
|
819
|
-
[
|
|
1030
|
+
[Ur]: {
|
|
820
1031
|
category: "Embed",
|
|
821
1032
|
type: "string",
|
|
822
1033
|
array: !0,
|
|
823
|
-
default: [{ value: [
|
|
1034
|
+
default: [{ value: [k] }],
|
|
824
1035
|
description: "Tags that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
825
1036
|
}
|
|
826
|
-
},
|
|
827
|
-
embedder: () =>
|
|
828
|
-
language: () =>
|
|
829
|
-
options: () =>
|
|
830
|
-
}),
|
|
831
|
-
[
|
|
1037
|
+
}, Gr = /* @__PURE__ */ p({
|
|
1038
|
+
embedder: () => zr,
|
|
1039
|
+
language: () => V,
|
|
1040
|
+
options: () => Wr
|
|
1041
|
+
}), H = "embeddedNoop", Kr = T(H), qr = E(H), Jr = D(H), Yr = {
|
|
1042
|
+
[Kr]: {
|
|
832
1043
|
category: "Embed",
|
|
833
1044
|
type: "string",
|
|
834
1045
|
array: !0,
|
|
835
1046
|
default: [{ value: [] }],
|
|
836
1047
|
description: "Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted.",
|
|
837
|
-
deprecated: `Please use \`${
|
|
1048
|
+
deprecated: `Please use \`${qr}\` or \`${Jr}\`.`
|
|
838
1049
|
},
|
|
839
|
-
[
|
|
1050
|
+
[qr]: {
|
|
840
1051
|
category: "Embed",
|
|
841
1052
|
type: "string",
|
|
842
1053
|
array: !0,
|
|
843
|
-
default: [{ value: [
|
|
1054
|
+
default: [{ value: [k] }],
|
|
844
1055
|
description: "Block comments that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
845
1056
|
},
|
|
846
|
-
[
|
|
1057
|
+
[Jr]: {
|
|
847
1058
|
category: "Embed",
|
|
848
1059
|
type: "string",
|
|
849
1060
|
array: !0,
|
|
850
|
-
default: [{ value: [
|
|
1061
|
+
default: [{ value: [k] }],
|
|
851
1062
|
description: "Tags that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
852
1063
|
}
|
|
853
|
-
},
|
|
854
|
-
language: () =>
|
|
855
|
-
options: () =>
|
|
856
|
-
}),
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1064
|
+
}, Xr = /* @__PURE__ */ p({
|
|
1065
|
+
language: () => H,
|
|
1066
|
+
options: () => Yr
|
|
1067
|
+
}), Zr = A({
|
|
1068
|
+
parser: "nunjucks",
|
|
1069
|
+
markup: !0
|
|
1070
|
+
}), Qr = "embeddedNunjucks", $r = ["nunjucks", "njk"], ei = E(Qr), ti = D(Qr), ni = {
|
|
1071
|
+
[ei]: {
|
|
1072
|
+
category: "Embed",
|
|
1073
|
+
type: "string",
|
|
1074
|
+
array: !0,
|
|
1075
|
+
default: [{ value: [...$r] }],
|
|
1076
|
+
description: "Block comments that identify embedded Nunjucks in template literals. Requires the `prettier-plugin-nunjucks` plugin."
|
|
1077
|
+
},
|
|
1078
|
+
[ti]: {
|
|
1079
|
+
category: "Embed",
|
|
1080
|
+
type: "string",
|
|
1081
|
+
array: !0,
|
|
1082
|
+
default: [{ value: [...$r] }],
|
|
1083
|
+
description: "Tags that identify embedded Nunjucks in template literals. Requires the `prettier-plugin-nunjucks` plugin."
|
|
1084
|
+
}
|
|
1085
|
+
}, ri = /* @__PURE__ */ p({
|
|
1086
|
+
embedder: () => Zr,
|
|
1087
|
+
language: () => Qr,
|
|
1088
|
+
options: () => ni
|
|
1089
|
+
}), ii = A({ parser: "pegjs-parser" }), U = "embeddedPegjs", ai = [
|
|
866
1090
|
"pegjs",
|
|
867
1091
|
"peggy",
|
|
868
1092
|
"peg"
|
|
869
|
-
],
|
|
870
|
-
[
|
|
1093
|
+
], oi = T(U), si = E(U), ci = D(U), li = {
|
|
1094
|
+
[oi]: {
|
|
871
1095
|
category: "Embed",
|
|
872
1096
|
type: "string",
|
|
873
1097
|
array: !0,
|
|
874
|
-
default: [{ value: [...
|
|
1098
|
+
default: [{ value: [...ai] }],
|
|
875
1099
|
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.",
|
|
876
|
-
deprecated: `Please use \`${
|
|
1100
|
+
deprecated: `Please use \`${si}\` or \`${ci}\`.`
|
|
877
1101
|
},
|
|
878
|
-
[
|
|
1102
|
+
[si]: {
|
|
879
1103
|
category: "Embed",
|
|
880
1104
|
type: "string",
|
|
881
1105
|
array: !0,
|
|
882
|
-
default: [{ value: [
|
|
1106
|
+
default: [{ value: [k] }],
|
|
883
1107
|
description: "Block comments that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
884
1108
|
},
|
|
885
|
-
[
|
|
1109
|
+
[ci]: {
|
|
886
1110
|
category: "Embed",
|
|
887
1111
|
type: "string",
|
|
888
1112
|
array: !0,
|
|
889
|
-
default: [{ value: [
|
|
1113
|
+
default: [{ value: [k] }],
|
|
890
1114
|
description: "Tags that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
891
1115
|
}
|
|
892
|
-
},
|
|
893
|
-
embedder: () =>
|
|
894
|
-
language: () =>
|
|
895
|
-
options: () =>
|
|
896
|
-
}),
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
return v(b(await e(u, {
|
|
902
|
-
...o,
|
|
903
|
-
parser: "php"
|
|
904
|
-
}), l, p), o, i, d, f);
|
|
905
|
-
}, U = "embeddedPhp", kn = ["php", "php5"], An = C(U), jn = w(U), Mn = T(U), Nn = {
|
|
906
|
-
[An]: {
|
|
1116
|
+
}, ui = /* @__PURE__ */ p({
|
|
1117
|
+
embedder: () => ii,
|
|
1118
|
+
language: () => U,
|
|
1119
|
+
options: () => li
|
|
1120
|
+
}), di = A({
|
|
1121
|
+
parser: "php",
|
|
1122
|
+
placeholderPrefix: "$p"
|
|
1123
|
+
}), W = "embeddedPhp", fi = ["php", "php5"], pi = T(W), mi = E(W), hi = D(W), gi = {
|
|
1124
|
+
[pi]: {
|
|
907
1125
|
category: "Embed",
|
|
908
1126
|
type: "string",
|
|
909
1127
|
array: !0,
|
|
910
|
-
default: [{ value: [...
|
|
1128
|
+
default: [{ value: [...fi] }],
|
|
911
1129
|
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.",
|
|
912
|
-
deprecated: `Please use \`${
|
|
1130
|
+
deprecated: `Please use \`${mi}\` or \`${hi}\`.`
|
|
913
1131
|
},
|
|
914
|
-
[
|
|
1132
|
+
[mi]: {
|
|
915
1133
|
category: "Embed",
|
|
916
1134
|
type: "string",
|
|
917
1135
|
array: !0,
|
|
918
|
-
default: [{ value: [
|
|
1136
|
+
default: [{ value: [k] }],
|
|
919
1137
|
description: "Block comments that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
920
1138
|
},
|
|
921
|
-
[
|
|
1139
|
+
[hi]: {
|
|
922
1140
|
category: "Embed",
|
|
923
1141
|
type: "string",
|
|
924
1142
|
array: !0,
|
|
925
|
-
default: [{ value: [
|
|
1143
|
+
default: [{ value: [k] }],
|
|
926
1144
|
description: "Tags that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
927
1145
|
}
|
|
928
|
-
},
|
|
929
|
-
embedder: () =>
|
|
930
|
-
language: () =>
|
|
931
|
-
options: () =>
|
|
932
|
-
}),
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
return v(b(await e(u, {
|
|
938
|
-
...o,
|
|
939
|
-
parser: "prisma-parse"
|
|
940
|
-
}), l, p, "hardline"), o, i, d, f);
|
|
941
|
-
}, W = "embeddedPrisma", In = ["prisma"], Ln = C(W), Rn = w(W), zn = T(W), Bn = {
|
|
942
|
-
[Ln]: {
|
|
1146
|
+
}, _i = /* @__PURE__ */ p({
|
|
1147
|
+
embedder: () => di,
|
|
1148
|
+
language: () => W,
|
|
1149
|
+
options: () => gi
|
|
1150
|
+
}), vi = A({
|
|
1151
|
+
parser: "powershell",
|
|
1152
|
+
newlineHandling: "hardline"
|
|
1153
|
+
}), yi = "embeddedPowerShell", bi = ["powershell", "ps1"], xi = E(yi), Si = D(yi), Ci = {
|
|
1154
|
+
[xi]: {
|
|
943
1155
|
category: "Embed",
|
|
944
1156
|
type: "string",
|
|
945
1157
|
array: !0,
|
|
946
|
-
default: [{ value: [...
|
|
1158
|
+
default: [{ value: [...bi] }],
|
|
1159
|
+
description: "Block comments that identify embedded PowerShell in template literals. Requires the `prettier-plugin-powershell` plugin."
|
|
1160
|
+
},
|
|
1161
|
+
[Si]: {
|
|
1162
|
+
category: "Embed",
|
|
1163
|
+
type: "string",
|
|
1164
|
+
array: !0,
|
|
1165
|
+
default: [{ value: [...bi] }],
|
|
1166
|
+
description: "Tags that identify embedded PowerShell in template literals. Requires the `prettier-plugin-powershell` plugin."
|
|
1167
|
+
}
|
|
1168
|
+
}, wi = /* @__PURE__ */ p({
|
|
1169
|
+
embedder: () => vi,
|
|
1170
|
+
language: () => yi,
|
|
1171
|
+
options: () => Ci
|
|
1172
|
+
}), Ti = A({
|
|
1173
|
+
parser: "prisma-parse",
|
|
1174
|
+
newlineHandling: "hardline"
|
|
1175
|
+
}), Ei = "embeddedPrisma", Di = ["prisma"], Oi = T(Ei), ki = E(Ei), Ai = D(Ei), ji = {
|
|
1176
|
+
[Oi]: {
|
|
1177
|
+
category: "Embed",
|
|
1178
|
+
type: "string",
|
|
1179
|
+
array: !0,
|
|
1180
|
+
default: [{ value: [...Di] }],
|
|
947
1181
|
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.",
|
|
948
|
-
deprecated: `Please use \`${
|
|
1182
|
+
deprecated: `Please use \`${ki}\` or \`${Ai}\`.`
|
|
949
1183
|
},
|
|
950
|
-
[
|
|
1184
|
+
[ki]: {
|
|
951
1185
|
category: "Embed",
|
|
952
1186
|
type: "string",
|
|
953
1187
|
array: !0,
|
|
954
|
-
default: [{ value: [
|
|
1188
|
+
default: [{ value: [k] }],
|
|
955
1189
|
description: "Block comments that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
956
1190
|
},
|
|
957
|
-
[
|
|
1191
|
+
[Ai]: {
|
|
958
1192
|
category: "Embed",
|
|
959
1193
|
type: "string",
|
|
960
1194
|
array: !0,
|
|
961
|
-
default: [{ value: [
|
|
1195
|
+
default: [{ value: [k] }],
|
|
962
1196
|
description: "Tags that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
963
1197
|
}
|
|
964
|
-
},
|
|
965
|
-
embedder: () =>
|
|
966
|
-
language: () =>
|
|
967
|
-
options: () =>
|
|
968
|
-
}),
|
|
969
|
-
|
|
970
|
-
...r,
|
|
971
|
-
...a
|
|
972
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
973
|
-
return v(b(await e(u, {
|
|
974
|
-
...o,
|
|
975
|
-
parser: "dot-properties"
|
|
976
|
-
}), l, p), o, i, d, f);
|
|
977
|
-
}, G = "embeddedProperties", Un = ["properties"], Wn = C(G), Gn = w(G), Kn = T(G), qn = {
|
|
978
|
-
[Wn]: {
|
|
1198
|
+
}, Mi = /* @__PURE__ */ p({
|
|
1199
|
+
embedder: () => Ti,
|
|
1200
|
+
language: () => Ei,
|
|
1201
|
+
options: () => ji
|
|
1202
|
+
}), Ni = A({ parser: "dot-properties" }), Pi = "embeddedProperties", Fi = ["properties"], Ii = T(Pi), Li = E(Pi), Ri = D(Pi), zi = {
|
|
1203
|
+
[Ii]: {
|
|
979
1204
|
category: "Embed",
|
|
980
1205
|
type: "string",
|
|
981
1206
|
array: !0,
|
|
982
|
-
default: [{ value: [...
|
|
1207
|
+
default: [{ value: [...Fi] }],
|
|
983
1208
|
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.",
|
|
984
|
-
deprecated: `Please use \`${
|
|
1209
|
+
deprecated: `Please use \`${Li}\` or \`${Ri}\`.`
|
|
985
1210
|
},
|
|
986
|
-
[
|
|
1211
|
+
[Li]: {
|
|
987
1212
|
category: "Embed",
|
|
988
1213
|
type: "string",
|
|
989
1214
|
array: !0,
|
|
990
|
-
default: [{ value: [
|
|
1215
|
+
default: [{ value: [k] }],
|
|
991
1216
|
description: "Block comments that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
992
1217
|
},
|
|
993
|
-
[
|
|
1218
|
+
[Ri]: {
|
|
994
1219
|
category: "Embed",
|
|
995
1220
|
type: "string",
|
|
996
1221
|
array: !0,
|
|
997
|
-
default: [{ value: [
|
|
1222
|
+
default: [{ value: [k] }],
|
|
998
1223
|
description: "Tags that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
999
1224
|
}
|
|
1000
|
-
},
|
|
1001
|
-
embedder: () =>
|
|
1002
|
-
language: () =>
|
|
1003
|
-
options: () =>
|
|
1004
|
-
}),
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
return v(b(await e(u, {
|
|
1010
|
-
...o,
|
|
1011
|
-
parser: "pug"
|
|
1012
|
-
}), l, p, "hardline"), o, i, d, f);
|
|
1013
|
-
}, K = "embeddedPug", Xn = ["pug", "jade"], Zn = C(K), Qn = w(K), $n = T(K), er = {
|
|
1014
|
-
[Zn]: {
|
|
1225
|
+
}, Bi = /* @__PURE__ */ p({
|
|
1226
|
+
embedder: () => Ni,
|
|
1227
|
+
language: () => Pi,
|
|
1228
|
+
options: () => zi
|
|
1229
|
+
}), Vi = A({
|
|
1230
|
+
parser: "pug",
|
|
1231
|
+
newlineHandling: "hardline"
|
|
1232
|
+
}), Hi = "embeddedPug", Ui = ["pug", "jade"], Wi = T(Hi), Gi = E(Hi), Ki = D(Hi), qi = {
|
|
1233
|
+
[Wi]: {
|
|
1015
1234
|
category: "Embed",
|
|
1016
1235
|
type: "string",
|
|
1017
1236
|
array: !0,
|
|
1018
|
-
default: [{ value: [...
|
|
1237
|
+
default: [{ value: [...Ui] }],
|
|
1019
1238
|
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.",
|
|
1020
|
-
deprecated: `Please use \`${
|
|
1239
|
+
deprecated: `Please use \`${Gi}\` or \`${Ki}\`.`
|
|
1021
1240
|
},
|
|
1022
|
-
[
|
|
1241
|
+
[Gi]: {
|
|
1023
1242
|
category: "Embed",
|
|
1024
1243
|
type: "string",
|
|
1025
1244
|
array: !0,
|
|
1026
|
-
default: [{ value: [
|
|
1245
|
+
default: [{ value: [k] }],
|
|
1027
1246
|
description: "Block comments that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1028
1247
|
},
|
|
1029
|
-
[
|
|
1248
|
+
[Ki]: {
|
|
1030
1249
|
category: "Embed",
|
|
1031
1250
|
type: "string",
|
|
1032
1251
|
array: !0,
|
|
1033
|
-
default: [{ value: [
|
|
1252
|
+
default: [{ value: [k] }],
|
|
1034
1253
|
description: "Tags that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1035
1254
|
}
|
|
1036
|
-
},
|
|
1037
|
-
embedder: () =>
|
|
1038
|
-
language: () =>
|
|
1039
|
-
options: () =>
|
|
1040
|
-
}),
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = S(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = _(s, c), p = y(n, t);
|
|
1045
|
-
return v(b(await e(u, {
|
|
1046
|
-
...o,
|
|
1047
|
-
parser: o.embeddedRubyParser ?? "ruby"
|
|
1048
|
-
}), l, p), o, i, d, f);
|
|
1049
|
-
}, q = "embeddedRuby", rr = ["ruby"], ir = [
|
|
1255
|
+
}, Ji = /* @__PURE__ */ p({
|
|
1256
|
+
embedder: () => Vi,
|
|
1257
|
+
language: () => Hi,
|
|
1258
|
+
options: () => qi
|
|
1259
|
+
}), Yi = A({
|
|
1260
|
+
parser: "ruby",
|
|
1261
|
+
parserOption: "embeddedRubyParser"
|
|
1262
|
+
}), G = "embeddedRuby", Xi = ["ruby"], Zi = [
|
|
1050
1263
|
"ruby",
|
|
1051
1264
|
"rbs",
|
|
1052
1265
|
"haml"
|
|
1053
|
-
],
|
|
1054
|
-
[
|
|
1266
|
+
], Qi = T(G), $i = E(G), ea = D(G), ta = O(G), na = {
|
|
1267
|
+
[Qi]: {
|
|
1055
1268
|
category: "Embed",
|
|
1056
1269
|
type: "string",
|
|
1057
1270
|
array: !0,
|
|
1058
|
-
default: [{ value: [...
|
|
1271
|
+
default: [{ value: [...Xi] }],
|
|
1059
1272
|
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.",
|
|
1060
|
-
deprecated: `Please use \`${
|
|
1273
|
+
deprecated: `Please use \`${$i}\` or \`${ea}\`.`
|
|
1061
1274
|
},
|
|
1062
|
-
[
|
|
1275
|
+
[$i]: {
|
|
1063
1276
|
category: "Embed",
|
|
1064
1277
|
type: "string",
|
|
1065
1278
|
array: !0,
|
|
1066
|
-
default: [{ value: [
|
|
1279
|
+
default: [{ value: [k] }],
|
|
1067
1280
|
description: "Block comments that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1068
1281
|
},
|
|
1069
|
-
[
|
|
1282
|
+
[ea]: {
|
|
1070
1283
|
category: "Embed",
|
|
1071
1284
|
type: "string",
|
|
1072
1285
|
array: !0,
|
|
1073
|
-
default: [{ value: [
|
|
1286
|
+
default: [{ value: [k] }],
|
|
1074
1287
|
description: "Tags that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1075
1288
|
},
|
|
1076
|
-
[
|
|
1289
|
+
[ta]: {
|
|
1077
1290
|
category: "Embed",
|
|
1078
1291
|
type: "choice",
|
|
1079
1292
|
default: "ruby",
|
|
1080
1293
|
description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1081
|
-
choices:
|
|
1294
|
+
choices: Zi.map((e) => ({
|
|
1082
1295
|
value: e,
|
|
1083
1296
|
description: `Use the "${e}" parser.`
|
|
1084
1297
|
}))
|
|
1085
1298
|
}
|
|
1086
|
-
},
|
|
1087
|
-
embedder: () =>
|
|
1088
|
-
language: () =>
|
|
1089
|
-
options: () =>
|
|
1090
|
-
}),
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
return v(b(await e(u, {
|
|
1096
|
-
...o,
|
|
1097
|
-
parser: "sh"
|
|
1098
|
-
}), l, p, "hardline"), o, i, d, f);
|
|
1099
|
-
}, J = "embeddedSh", fr = ["sh"], pr = C(J), mr = w(J), hr = T(J), gr = {
|
|
1100
|
-
[pr]: {
|
|
1299
|
+
}, ra = /* @__PURE__ */ p({
|
|
1300
|
+
embedder: () => Yi,
|
|
1301
|
+
language: () => G,
|
|
1302
|
+
options: () => na
|
|
1303
|
+
}), ia = A({
|
|
1304
|
+
parser: "sh",
|
|
1305
|
+
newlineHandling: "hardline"
|
|
1306
|
+
}), aa = "embeddedSh", oa = ["sh"], sa = T(aa), ca = E(aa), la = D(aa), ua = {
|
|
1307
|
+
[sa]: {
|
|
1101
1308
|
category: "Embed",
|
|
1102
1309
|
type: "string",
|
|
1103
1310
|
array: !0,
|
|
1104
|
-
default: [{ value: [...
|
|
1311
|
+
default: [{ value: [...oa] }],
|
|
1105
1312
|
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.",
|
|
1106
|
-
deprecated: `Please use \`${
|
|
1313
|
+
deprecated: `Please use \`${ca}\` or \`${la}\`.`
|
|
1107
1314
|
},
|
|
1108
|
-
[
|
|
1315
|
+
[ca]: {
|
|
1109
1316
|
category: "Embed",
|
|
1110
1317
|
type: "string",
|
|
1111
1318
|
array: !0,
|
|
1112
|
-
default: [{ value: [
|
|
1319
|
+
default: [{ value: [k] }],
|
|
1113
1320
|
description: "Block comments that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1114
1321
|
},
|
|
1115
|
-
[
|
|
1322
|
+
[la]: {
|
|
1116
1323
|
category: "Embed",
|
|
1117
1324
|
type: "string",
|
|
1118
1325
|
array: !0,
|
|
1119
|
-
default: [{ value: [
|
|
1326
|
+
default: [{ value: [k] }],
|
|
1120
1327
|
description: "Tags that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1121
1328
|
}
|
|
1122
|
-
},
|
|
1123
|
-
embedder: () =>
|
|
1124
|
-
language: () =>
|
|
1125
|
-
options: () =>
|
|
1126
|
-
}),
|
|
1329
|
+
}, da = /* @__PURE__ */ p({
|
|
1330
|
+
embedder: () => ia,
|
|
1331
|
+
language: () => aa,
|
|
1332
|
+
options: () => ua
|
|
1333
|
+
}), K = "embeddedSolidity", fa = A({
|
|
1334
|
+
parser: "slang",
|
|
1335
|
+
parserOption: `${K}Parser`
|
|
1336
|
+
}), pa = ["solidity", "sol"], ma = E(K), ha = D(K), ga = `${K}Parser`, _a = {
|
|
1337
|
+
[ma]: {
|
|
1338
|
+
category: "Embed",
|
|
1339
|
+
type: "string",
|
|
1340
|
+
array: !0,
|
|
1341
|
+
default: [{ value: [...pa] }],
|
|
1342
|
+
description: "Block comments that identify embedded Solidity in template literals. Requires the `prettier-plugin-solidity` plugin."
|
|
1343
|
+
},
|
|
1344
|
+
[ha]: {
|
|
1345
|
+
category: "Embed",
|
|
1346
|
+
type: "string",
|
|
1347
|
+
array: !0,
|
|
1348
|
+
default: [{ value: [...pa] }],
|
|
1349
|
+
description: "Tags that identify embedded Solidity in template literals. Requires the `prettier-plugin-solidity` plugin."
|
|
1350
|
+
},
|
|
1351
|
+
[ga]: {
|
|
1352
|
+
category: "Embed",
|
|
1353
|
+
type: "choice",
|
|
1354
|
+
default: "slang",
|
|
1355
|
+
description: "The parser used to format embedded Solidity.",
|
|
1356
|
+
choices: [
|
|
1357
|
+
{
|
|
1358
|
+
value: "slang",
|
|
1359
|
+
description: "Use the `slang` parser."
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
value: "antlr",
|
|
1363
|
+
description: "Use the `antlr` parser."
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
value: "solidity-parse",
|
|
1367
|
+
description: "Use the `solidity-parse` parser."
|
|
1368
|
+
}
|
|
1369
|
+
]
|
|
1370
|
+
}
|
|
1371
|
+
}, va = /* @__PURE__ */ p({
|
|
1372
|
+
embedder: () => fa,
|
|
1373
|
+
language: () => K,
|
|
1374
|
+
options: () => _a
|
|
1375
|
+
}), ya = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1127
1376
|
let o = {
|
|
1128
1377
|
...r,
|
|
1129
1378
|
...a
|
|
1130
|
-
}, s = o.embeddedSqlPlugin ?? "prettier-plugin-sql", { node: c } = n, { createPlaceholder: l, placeholderRegex: u } =
|
|
1131
|
-
if (s === "prettier-plugin-sql-cst") h =
|
|
1379
|
+
}, s = o.embeddedSqlPlugin ?? "prettier-plugin-sql", { node: c } = n, { createPlaceholder: l, placeholderRegex: u } = w(), { trimmedText: d, leadingWhitespaces: f, trailingWhitespaces: p } = y(c, l), m = x(n, t, o, !1), h;
|
|
1380
|
+
if (s === "prettier-plugin-sql-cst") h = S(await e(d, {
|
|
1132
1381
|
...o,
|
|
1133
1382
|
parser: o.embeddedSqlParser ?? "sqlite"
|
|
1134
1383
|
}), u, m);
|
|
1135
1384
|
else {
|
|
1136
1385
|
let t = new Set(c.quasis.slice(0, -1).flatMap((e, t) => /\n[\t ]*$/.test(e.value.raw) ? [t] : []));
|
|
1137
|
-
h =
|
|
1386
|
+
h = S(await e(re(d), {
|
|
1138
1387
|
...o,
|
|
1139
1388
|
parser: "sql"
|
|
1140
1389
|
}), u, m, "hardline", t, o.tabWidth ?? 2);
|
|
1141
1390
|
}
|
|
1142
|
-
return
|
|
1143
|
-
},
|
|
1391
|
+
return b(h, o, i, f, p);
|
|
1392
|
+
}, q = "embeddedSql", ba = ["sql"], xa = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], Sa = [
|
|
1144
1393
|
"sqlite",
|
|
1145
1394
|
"bigquery",
|
|
1146
1395
|
"mysql",
|
|
1147
1396
|
"mariadb",
|
|
1148
1397
|
"postgresql"
|
|
1149
|
-
],
|
|
1150
|
-
[
|
|
1398
|
+
], Ca = T(q), wa = E(q), Ta = D(q), Ea = ye(q), Da = O(q), Oa = {
|
|
1399
|
+
[Ca]: {
|
|
1151
1400
|
category: "Embed",
|
|
1152
1401
|
type: "string",
|
|
1153
1402
|
array: !0,
|
|
1154
|
-
default: [{ value: [...
|
|
1403
|
+
default: [{ value: [...ba] }],
|
|
1155
1404
|
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.",
|
|
1156
|
-
deprecated: `Please use \`${
|
|
1405
|
+
deprecated: `Please use \`${wa}\` or \`${Ta}\`.`
|
|
1157
1406
|
},
|
|
1158
|
-
[
|
|
1407
|
+
[wa]: {
|
|
1159
1408
|
category: "Embed",
|
|
1160
1409
|
type: "string",
|
|
1161
1410
|
array: !0,
|
|
1162
|
-
default: [{ value: [
|
|
1411
|
+
default: [{ value: [k] }],
|
|
1163
1412
|
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."
|
|
1164
1413
|
},
|
|
1165
|
-
[
|
|
1414
|
+
[Ta]: {
|
|
1166
1415
|
category: "Embed",
|
|
1167
1416
|
type: "string",
|
|
1168
1417
|
array: !0,
|
|
1169
|
-
default: [{ value: [
|
|
1418
|
+
default: [{ value: [k] }],
|
|
1170
1419
|
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."
|
|
1171
1420
|
},
|
|
1172
|
-
[
|
|
1421
|
+
[Ea]: {
|
|
1173
1422
|
category: "Embed",
|
|
1174
1423
|
type: "choice",
|
|
1175
1424
|
default: "prettier-plugin-sql",
|
|
1176
1425
|
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.",
|
|
1177
|
-
choices:
|
|
1426
|
+
choices: xa.map((e) => ({
|
|
1178
1427
|
value: e,
|
|
1179
1428
|
description: `Use the "${e}" plugin.`
|
|
1180
1429
|
}))
|
|
1181
1430
|
},
|
|
1182
|
-
[
|
|
1431
|
+
[Da]: {
|
|
1183
1432
|
category: "Embed",
|
|
1184
1433
|
type: "choice",
|
|
1185
1434
|
default: "sqlite",
|
|
1186
1435
|
description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
|
|
1187
|
-
choices:
|
|
1436
|
+
choices: Sa.map((e) => ({
|
|
1188
1437
|
value: e,
|
|
1189
1438
|
description: `Use the "${e}" parser.`
|
|
1190
1439
|
}))
|
|
1191
1440
|
}
|
|
1192
|
-
},
|
|
1193
|
-
embedder: () =>
|
|
1194
|
-
language: () =>
|
|
1195
|
-
options: () =>
|
|
1196
|
-
}),
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1441
|
+
}, ka = /* @__PURE__ */ p({
|
|
1442
|
+
embedder: () => ya,
|
|
1443
|
+
language: () => q,
|
|
1444
|
+
options: () => Oa
|
|
1445
|
+
}), Aa = A({
|
|
1446
|
+
parser: "svelte",
|
|
1447
|
+
markup: !0
|
|
1448
|
+
}), ja = "embeddedSvelte", Ma = ["svelte"], Na = E(ja), Pa = D(ja), Fa = {
|
|
1449
|
+
[Na]: {
|
|
1450
|
+
category: "Embed",
|
|
1451
|
+
type: "string",
|
|
1452
|
+
array: !0,
|
|
1453
|
+
default: [{ value: [...Ma] }],
|
|
1454
|
+
description: "Block comments that identify embedded Svelte in template literals. Requires the `prettier-plugin-svelte` plugin."
|
|
1455
|
+
},
|
|
1456
|
+
[Pa]: {
|
|
1457
|
+
category: "Embed",
|
|
1458
|
+
type: "string",
|
|
1459
|
+
array: !0,
|
|
1460
|
+
default: [{ value: [...Ma] }],
|
|
1461
|
+
description: "Tags that identify embedded Svelte in template literals. Requires the `prettier-plugin-svelte` plugin."
|
|
1462
|
+
}
|
|
1463
|
+
}, Ia = /* @__PURE__ */ p({
|
|
1464
|
+
embedder: () => Aa,
|
|
1465
|
+
language: () => ja,
|
|
1466
|
+
options: () => Fa
|
|
1467
|
+
}), La = A({
|
|
1468
|
+
parser: "toml",
|
|
1469
|
+
newlineHandling: "hardline"
|
|
1470
|
+
}), J = "embeddedToml", Ra = ["toml"], za = T(J), Ba = E(J), Va = D(J), Ha = {
|
|
1471
|
+
[za]: {
|
|
1207
1472
|
category: "Embed",
|
|
1208
1473
|
type: "string",
|
|
1209
1474
|
array: !0,
|
|
1210
|
-
default: [{ value: [...
|
|
1475
|
+
default: [{ value: [...Ra] }],
|
|
1211
1476
|
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.",
|
|
1212
|
-
deprecated: `Please use \`${
|
|
1477
|
+
deprecated: `Please use \`${Ba}\` or \`${Va}\`.`
|
|
1213
1478
|
},
|
|
1214
|
-
[
|
|
1479
|
+
[Ba]: {
|
|
1215
1480
|
category: "Embed",
|
|
1216
1481
|
type: "string",
|
|
1217
1482
|
array: !0,
|
|
1218
|
-
default: [{ value: [
|
|
1483
|
+
default: [{ value: [k] }],
|
|
1219
1484
|
description: "Block comments that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1220
1485
|
},
|
|
1221
|
-
[
|
|
1486
|
+
[Va]: {
|
|
1222
1487
|
category: "Embed",
|
|
1223
1488
|
type: "string",
|
|
1224
1489
|
array: !0,
|
|
1225
|
-
default: [{ value: [
|
|
1490
|
+
default: [{ value: [k] }],
|
|
1226
1491
|
description: "Tags that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1227
1492
|
}
|
|
1228
|
-
},
|
|
1229
|
-
embedder: () =>
|
|
1230
|
-
language: () =>
|
|
1231
|
-
options: () =>
|
|
1232
|
-
}),
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
return v(b(await e(u, {
|
|
1238
|
-
...o,
|
|
1239
|
-
parser: o.embeddedTsParser ?? "typescript",
|
|
1240
|
-
filepath: void 0
|
|
1241
|
-
}), l, p), o, i, d, f);
|
|
1242
|
-
}, Z = "embeddedTs", Lr = [
|
|
1493
|
+
}, Ua = /* @__PURE__ */ p({
|
|
1494
|
+
embedder: () => La,
|
|
1495
|
+
language: () => J,
|
|
1496
|
+
options: () => Ha
|
|
1497
|
+
}), Wa = A({
|
|
1498
|
+
parser: "typescript",
|
|
1499
|
+
parserOption: "embeddedTsParser",
|
|
1500
|
+
parserOptions: { filepath: void 0 }
|
|
1501
|
+
}), Y = "embeddedTs", Ga = [
|
|
1243
1502
|
"ts",
|
|
1244
1503
|
"tsx",
|
|
1245
1504
|
"cts",
|
|
1246
1505
|
"mts",
|
|
1247
1506
|
"typescript"
|
|
1248
|
-
],
|
|
1249
|
-
[
|
|
1507
|
+
], Ka = ["typescript", "babel-ts"], qa = T(Y), Ja = E(Y), Ya = D(Y), Xa = O(Y), Za = {
|
|
1508
|
+
[qa]: {
|
|
1250
1509
|
category: "Embed",
|
|
1251
1510
|
type: "string",
|
|
1252
1511
|
array: !0,
|
|
1253
|
-
default: [{ value: [...
|
|
1512
|
+
default: [{ value: [...Ga] }],
|
|
1254
1513
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.",
|
|
1255
|
-
deprecated: `Please use \`${
|
|
1514
|
+
deprecated: `Please use \`${Ja}\` or \`${Ya}\`.`
|
|
1256
1515
|
},
|
|
1257
|
-
[
|
|
1516
|
+
[Ja]: {
|
|
1258
1517
|
category: "Embed",
|
|
1259
1518
|
type: "string",
|
|
1260
1519
|
array: !0,
|
|
1261
|
-
default: [{ value: [
|
|
1520
|
+
default: [{ value: [k] }],
|
|
1262
1521
|
description: "Block comments that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1263
1522
|
},
|
|
1264
|
-
[
|
|
1523
|
+
[Ya]: {
|
|
1265
1524
|
category: "Embed",
|
|
1266
1525
|
type: "string",
|
|
1267
1526
|
array: !0,
|
|
1268
|
-
default: [{ value: [
|
|
1527
|
+
default: [{ value: [k] }],
|
|
1269
1528
|
description: "Tags that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1270
1529
|
},
|
|
1271
|
-
[
|
|
1530
|
+
[Xa]: {
|
|
1272
1531
|
category: "Embed",
|
|
1273
1532
|
type: "choice",
|
|
1274
1533
|
default: "typescript",
|
|
1275
1534
|
description: "The parser used to parse the embedded TypeScript language.",
|
|
1276
|
-
choices:
|
|
1535
|
+
choices: Ka.map((e) => ({
|
|
1277
1536
|
value: e,
|
|
1278
1537
|
description: `Use the "${e}" parser.`
|
|
1279
1538
|
}))
|
|
1280
1539
|
}
|
|
1281
|
-
},
|
|
1282
|
-
embedder: () =>
|
|
1283
|
-
language: () =>
|
|
1284
|
-
options: () =>
|
|
1285
|
-
}),
|
|
1540
|
+
}, Qa = /* @__PURE__ */ p({
|
|
1541
|
+
embedder: () => Wa,
|
|
1542
|
+
language: () => Y,
|
|
1543
|
+
options: () => Za
|
|
1544
|
+
}), X = "embeddedXml", { softline: $a } = e, eo = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1286
1545
|
let o = {
|
|
1287
1546
|
...r,
|
|
1288
1547
|
...a
|
|
1289
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } =
|
|
1548
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = w(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = y(s, c), p = x(n, t), m = [], h = 0;
|
|
1290
1549
|
for (; h !== void 0;) {
|
|
1291
1550
|
let t = u.slice(h);
|
|
1292
1551
|
if (t.length === 0) break;
|
|
1293
|
-
h > 0 && o.xmlWhitespaceSensitivity !== "strict" && m.push(
|
|
1552
|
+
h > 0 && o.xmlWhitespaceSensitivity !== "strict" && m.push($a), o.__embeddedXmlFragmentRecoverIndex?.splice(0, o.__embeddedXmlFragmentRecoverIndex.length);
|
|
1294
1553
|
let n = await e(t, {
|
|
1295
1554
|
...o,
|
|
1296
|
-
parser:
|
|
1555
|
+
parser: X
|
|
1297
1556
|
}), [r, i] = o.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1298
1557
|
r === void 0 ? h = void 0 : i === void 0 ? h += r : (n = t.slice(r, i + 1), h += i + 1), m.push(n);
|
|
1299
1558
|
}
|
|
1300
|
-
return
|
|
1301
|
-
},
|
|
1559
|
+
return b(S(m, l, p), o, i, d, f, o.xmlWhitespaceSensitivity === "strict");
|
|
1560
|
+
}, to = [
|
|
1302
1561
|
"xml",
|
|
1303
1562
|
"opml",
|
|
1304
1563
|
"rss",
|
|
1305
1564
|
"svg"
|
|
1306
|
-
],
|
|
1307
|
-
[
|
|
1565
|
+
], no = T(X), ro = E(X), io = D(X), ao = {
|
|
1566
|
+
[no]: {
|
|
1308
1567
|
category: "Embed",
|
|
1309
1568
|
type: "string",
|
|
1310
1569
|
array: !0,
|
|
1311
|
-
default: [{ value: [...
|
|
1570
|
+
default: [{ value: [...to] }],
|
|
1312
1571
|
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.",
|
|
1313
|
-
deprecated: `Please use \`${
|
|
1572
|
+
deprecated: `Please use \`${ro}\` or \`${io}\`.`
|
|
1314
1573
|
},
|
|
1315
|
-
[
|
|
1574
|
+
[ro]: {
|
|
1316
1575
|
category: "Embed",
|
|
1317
1576
|
type: "string",
|
|
1318
1577
|
array: !0,
|
|
1319
|
-
default: [{ value: [
|
|
1578
|
+
default: [{ value: [k] }],
|
|
1320
1579
|
description: "Block comments that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1321
1580
|
},
|
|
1322
|
-
[
|
|
1581
|
+
[io]: {
|
|
1323
1582
|
category: "Embed",
|
|
1324
1583
|
type: "string",
|
|
1325
1584
|
array: !0,
|
|
1326
|
-
default: [{ value: [
|
|
1585
|
+
default: [{ value: [k] }],
|
|
1327
1586
|
description: "Tags that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1328
1587
|
},
|
|
1329
1588
|
__embeddedXmlFragmentRecoverIndex: {
|
|
@@ -1336,15 +1595,15 @@ var { line: Jt, group: R, indent: Yt, softline: Xt, dedentToRoot: Zt, literallin
|
|
|
1336
1595
|
};
|
|
1337
1596
|
//#endregion
|
|
1338
1597
|
//#region src/embedded/xml/parser.ts
|
|
1339
|
-
function
|
|
1598
|
+
function oo(e, t) {
|
|
1340
1599
|
if (t && Number.isFinite(t.line) && Number.isFinite(t.column)) return e.split("\n").slice(0, t.line - 1).reduce((e, t) => e + t.length + 1, 0) + t.column - 1;
|
|
1341
1600
|
}
|
|
1342
|
-
async function
|
|
1601
|
+
async function Z(e, t, n) {
|
|
1343
1602
|
try {
|
|
1344
1603
|
return await n.parse(e, t);
|
|
1345
1604
|
} catch (r) {
|
|
1346
1605
|
if (!(r instanceof Error)) throw r;
|
|
1347
|
-
let { loc: i } = r, a =
|
|
1606
|
+
let { loc: i } = r, a = oo(e, i?.start), o = oo(e, i?.end), s = t, c = (...e) => s.__embeddedXmlFragmentRecoverIndex?.splice(0, s.__embeddedXmlFragmentRecoverIndex.length, ...e), l = "Expecting token of type --> OPEN <-- but found --> ";
|
|
1348
1607
|
if (r.message.startsWith(`${l}'' <--`)) {
|
|
1349
1608
|
let r = await n.parse(`${e}<prettier-embed-fragment />`, t);
|
|
1350
1609
|
return r.children ? delete r.children.element : r.element = null, r.location = {
|
|
@@ -1352,39 +1611,39 @@ async function $(e, t, n) {
|
|
|
1352
1611
|
endOffset: e.length - 1
|
|
1353
1612
|
}, r;
|
|
1354
1613
|
}
|
|
1355
|
-
if (a !== void 0 && a > 0 && (r.message.startsWith("Expecting token of type --> EOF <--") || r.message.startsWith("Redundant input, expecting EOF but found: "))) return c(a),
|
|
1356
|
-
if (a !== void 0 && o !== void 0 && r.message.startsWith(l)) return c(a, o),
|
|
1614
|
+
if (a !== void 0 && a > 0 && (r.message.startsWith("Expecting token of type --> EOF <--") || r.message.startsWith("Redundant input, expecting EOF but found: "))) return c(a), Z(e.slice(0, a), t, n);
|
|
1615
|
+
if (a !== void 0 && o !== void 0 && r.message.startsWith(l)) return c(a, o), Z("", t, n);
|
|
1357
1616
|
throw r;
|
|
1358
1617
|
}
|
|
1359
1618
|
}
|
|
1360
|
-
function
|
|
1619
|
+
function so(e) {
|
|
1361
1620
|
if (typeof e == "object" && e && "parsers" in e) return e.parsers?.xml;
|
|
1362
1621
|
}
|
|
1363
|
-
function
|
|
1364
|
-
let t =
|
|
1622
|
+
function co(e) {
|
|
1623
|
+
let t = so(typeof e == "object" && e && "default" in e ? e.default : e);
|
|
1365
1624
|
if (!t) throw Error("The XML plugin must provide the \"xml\" parser.");
|
|
1366
1625
|
return t;
|
|
1367
1626
|
}
|
|
1368
|
-
async function
|
|
1627
|
+
async function lo(e, t = () => import("@prettier/plugin-xml"), a = import.meta.url) {
|
|
1369
1628
|
try {
|
|
1370
|
-
return
|
|
1629
|
+
return co(await t());
|
|
1371
1630
|
} catch (t) {
|
|
1372
1631
|
for (let t of [a, e ? r.resolve(e) : `${process.cwd()}/package.json`]) try {
|
|
1373
1632
|
let e = n(t).resolve("@prettier/plugin-xml");
|
|
1374
|
-
return
|
|
1633
|
+
return co(await import(i(e).href));
|
|
1375
1634
|
} catch {}
|
|
1376
1635
|
throw Error("Formatting embedded XML requires the consumer to install and load \"@prettier/plugin-xml\".", { cause: t });
|
|
1377
1636
|
}
|
|
1378
1637
|
}
|
|
1379
|
-
async function
|
|
1638
|
+
async function uo(e, t, n = lo) {
|
|
1380
1639
|
for (let n = (t.plugins?.length ?? 0) - 1; n >= 0; n--) {
|
|
1381
|
-
let r =
|
|
1382
|
-
if (r) return
|
|
1640
|
+
let r = so(t.plugins[n]);
|
|
1641
|
+
if (r) return Z(e, t, r);
|
|
1383
1642
|
}
|
|
1384
|
-
return
|
|
1643
|
+
return Z(e, t, await n(t.filepath));
|
|
1385
1644
|
}
|
|
1386
|
-
var
|
|
1387
|
-
parse:
|
|
1645
|
+
var fo = {
|
|
1646
|
+
parse: uo,
|
|
1388
1647
|
astFormat: "xml",
|
|
1389
1648
|
locStart(e) {
|
|
1390
1649
|
return e.location?.startOffset ?? 0;
|
|
@@ -1392,83 +1651,135 @@ var ri = {
|
|
|
1392
1651
|
locEnd(e) {
|
|
1393
1652
|
return e.location?.endOffset ?? NaN;
|
|
1394
1653
|
}
|
|
1395
|
-
},
|
|
1396
|
-
embedder: () =>
|
|
1654
|
+
}, po = /* @__PURE__ */ p({
|
|
1655
|
+
embedder: () => eo,
|
|
1656
|
+
language: () => X,
|
|
1657
|
+
loadXmlParser: () => lo,
|
|
1658
|
+
options: () => ao,
|
|
1659
|
+
parseWithXmlPlugin: () => Z,
|
|
1660
|
+
parseXml: () => uo,
|
|
1661
|
+
parser: () => fo
|
|
1662
|
+
}), Q = "embeddedXQuery", mo = A({
|
|
1663
|
+
parser: "xquery",
|
|
1664
|
+
parserOption: `${Q}Parser`
|
|
1665
|
+
}), ho = ["xquery", "xq"], go = E(Q), _o = D(Q), vo = `${Q}Parser`, yo = {
|
|
1666
|
+
[go]: {
|
|
1667
|
+
category: "Embed",
|
|
1668
|
+
type: "string",
|
|
1669
|
+
array: !0,
|
|
1670
|
+
default: [{ value: [...ho] }],
|
|
1671
|
+
description: "Block comments that identify embedded XQuery in template literals. Requires the `prettier-plugin-xquery` plugin."
|
|
1672
|
+
},
|
|
1673
|
+
[_o]: {
|
|
1674
|
+
category: "Embed",
|
|
1675
|
+
type: "string",
|
|
1676
|
+
array: !0,
|
|
1677
|
+
default: [{ value: [...ho] }],
|
|
1678
|
+
description: "Tags that identify embedded XQuery in template literals. Requires the `prettier-plugin-xquery` plugin."
|
|
1679
|
+
},
|
|
1680
|
+
[vo]: {
|
|
1681
|
+
category: "Embed",
|
|
1682
|
+
type: "choice",
|
|
1683
|
+
default: "xquery",
|
|
1684
|
+
description: "The parser used to format embedded XQuery.",
|
|
1685
|
+
choices: [{
|
|
1686
|
+
value: "xquery",
|
|
1687
|
+
description: "Use the `xquery` parser."
|
|
1688
|
+
}, {
|
|
1689
|
+
value: "xquery4",
|
|
1690
|
+
description: "Use the `xquery4` parser."
|
|
1691
|
+
}]
|
|
1692
|
+
}
|
|
1693
|
+
}, bo = /* @__PURE__ */ p({
|
|
1694
|
+
embedder: () => mo,
|
|
1397
1695
|
language: () => Q,
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
parseWithXmlPlugin: () => $,
|
|
1401
|
-
parseXml: () => ni,
|
|
1402
|
-
parser: () => ri
|
|
1403
|
-
}), ai = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1696
|
+
options: () => yo
|
|
1697
|
+
}), xo = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1404
1698
|
let o = {
|
|
1405
1699
|
...r,
|
|
1406
1700
|
...a
|
|
1407
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } =
|
|
1408
|
-
return
|
|
1701
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = w(), { trimmedText: u, leadingWhitespaces: d, trailingWhitespaces: f } = y(s, c), p = d.slice(d.lastIndexOf("\n") + 1), m = x(n, t);
|
|
1702
|
+
return b(S(await e(p ? u.replace(RegExp(`(\\r?\\n)${ve(p)}`, "g"), "$1") : u, {
|
|
1409
1703
|
...o,
|
|
1410
1704
|
parser: "yaml"
|
|
1411
1705
|
}), l, m), o, i, d, f);
|
|
1412
|
-
},
|
|
1413
|
-
[
|
|
1706
|
+
}, So = "embeddedYaml", Co = ["yaml", "yml"], wo = T(So), To = E(So), Eo = D(So), Do = {
|
|
1707
|
+
[wo]: {
|
|
1414
1708
|
category: "Embed",
|
|
1415
1709
|
type: "string",
|
|
1416
1710
|
array: !0,
|
|
1417
|
-
default: [{ value: [...
|
|
1711
|
+
default: [{ value: [...Co] }],
|
|
1418
1712
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language.",
|
|
1419
|
-
deprecated: `Please use \`${
|
|
1713
|
+
deprecated: `Please use \`${To}\` or \`${Eo}\`.`
|
|
1420
1714
|
},
|
|
1421
|
-
[
|
|
1715
|
+
[To]: {
|
|
1422
1716
|
category: "Embed",
|
|
1423
1717
|
type: "string",
|
|
1424
1718
|
array: !0,
|
|
1425
|
-
default: [{ value: [
|
|
1719
|
+
default: [{ value: [k] }],
|
|
1426
1720
|
description: "Block comments that make their subsequent template literals be identified as embedded YAML language."
|
|
1427
1721
|
},
|
|
1428
|
-
[
|
|
1722
|
+
[Eo]: {
|
|
1429
1723
|
category: "Embed",
|
|
1430
1724
|
type: "string",
|
|
1431
1725
|
array: !0,
|
|
1432
|
-
default: [{ value: [
|
|
1726
|
+
default: [{ value: [k] }],
|
|
1433
1727
|
description: "Tags that make their subsequent template literals be identified as embedded YAML language."
|
|
1434
1728
|
}
|
|
1435
|
-
},
|
|
1436
|
-
embedder: () =>
|
|
1437
|
-
language: () =>
|
|
1438
|
-
options: () =>
|
|
1439
|
-
}),
|
|
1440
|
-
"./
|
|
1441
|
-
"./
|
|
1442
|
-
"./
|
|
1443
|
-
"./
|
|
1444
|
-
"./
|
|
1445
|
-
"./
|
|
1446
|
-
"./
|
|
1447
|
-
"./
|
|
1448
|
-
"./
|
|
1449
|
-
"./
|
|
1450
|
-
"./
|
|
1451
|
-
"./
|
|
1452
|
-
"./
|
|
1453
|
-
"./
|
|
1454
|
-
"./
|
|
1455
|
-
"./
|
|
1456
|
-
"./
|
|
1457
|
-
"./
|
|
1458
|
-
"./
|
|
1459
|
-
"./
|
|
1460
|
-
"./
|
|
1461
|
-
"./
|
|
1462
|
-
"./
|
|
1463
|
-
"./
|
|
1464
|
-
"./
|
|
1729
|
+
}, Oo = /* @__PURE__ */ p({
|
|
1730
|
+
embedder: () => xo,
|
|
1731
|
+
language: () => So,
|
|
1732
|
+
options: () => Do
|
|
1733
|
+
}), ko = [], Ao = {}, jo = {}, Mo = {}, No = /* #__PURE__ */ Object.assign({
|
|
1734
|
+
"./astro/index.ts": Ee,
|
|
1735
|
+
"./css/index.ts": Fe,
|
|
1736
|
+
"./dockerfile/index.ts": He,
|
|
1737
|
+
"./es/index.ts": Ze,
|
|
1738
|
+
"./gherkin/index.ts": it,
|
|
1739
|
+
"./glsl/index.ts": ft,
|
|
1740
|
+
"./go-template/index.ts": yt,
|
|
1741
|
+
"./graphql/index.ts": Dt,
|
|
1742
|
+
"./handlebars/index.ts": Pt,
|
|
1743
|
+
"./html/index.ts": Ut,
|
|
1744
|
+
"./hugo/index.ts": Xt,
|
|
1745
|
+
"./ini/index.ts": rn,
|
|
1746
|
+
"./java/index.ts": dn,
|
|
1747
|
+
"./jinja/index.ts": vn,
|
|
1748
|
+
"./json/index.ts": On,
|
|
1749
|
+
"./jsonata/index.ts": Fn,
|
|
1750
|
+
"./jte/index.ts": Hn,
|
|
1751
|
+
"./latex/index.ts": Yn,
|
|
1752
|
+
"./liquid/index.ts": nr,
|
|
1753
|
+
"./markdown/index.ts": gr,
|
|
1754
|
+
"./marko/index.ts": Cr,
|
|
1755
|
+
"./motoko/index.ts": jr,
|
|
1756
|
+
"./mustache/index.ts": Rr,
|
|
1757
|
+
"./nginx/index.ts": Gr,
|
|
1758
|
+
"./noop/index.ts": Xr,
|
|
1759
|
+
"./nunjucks/index.ts": ri,
|
|
1760
|
+
"./pegjs/index.ts": ui,
|
|
1761
|
+
"./php/index.ts": _i,
|
|
1762
|
+
"./powershell/index.ts": wi,
|
|
1763
|
+
"./prisma/index.ts": Mi,
|
|
1764
|
+
"./properties/index.ts": Bi,
|
|
1765
|
+
"./pug/index.ts": Ji,
|
|
1766
|
+
"./ruby/index.ts": ra,
|
|
1767
|
+
"./sh/index.ts": da,
|
|
1768
|
+
"./solidity/index.ts": va,
|
|
1769
|
+
"./sql/index.ts": ka,
|
|
1770
|
+
"./svelte/index.ts": Ia,
|
|
1771
|
+
"./toml/index.ts": Ua,
|
|
1772
|
+
"./ts/index.ts": Qa,
|
|
1773
|
+
"./xml/index.ts": po,
|
|
1774
|
+
"./xquery/index.ts": bo,
|
|
1775
|
+
"./yaml/index.ts": Oo
|
|
1465
1776
|
});
|
|
1466
|
-
for (let { language: e, parser: t, embedder: n, options: r } of Object.values(
|
|
1777
|
+
for (let { language: e, parser: t, embedder: n, options: r } of Object.values(No)) _e(ko, e, H), t && (Ao[e] = t), n && (jo[e] = n), Object.assign(Mo, r);
|
|
1467
1778
|
//#endregion
|
|
1468
1779
|
//#region src/options.ts
|
|
1469
|
-
var
|
|
1470
|
-
...
|
|
1471
|
-
[
|
|
1780
|
+
var Po = "noEmbeddedIdentificationByComment", Fo = "noEmbeddedIdentificationByTag", Io = "preserveEmbeddedExteriorWhitespaces", Lo = "noEmbeddedMultiLineIndentation", Ro = "embeddedOverrides", zo = {
|
|
1781
|
+
...Mo,
|
|
1782
|
+
[Po]: {
|
|
1472
1783
|
category: "Embed",
|
|
1473
1784
|
type: "string",
|
|
1474
1785
|
array: !0,
|
|
@@ -1476,7 +1787,7 @@ var vi = "noEmbeddedIdentificationByComment", yi = "noEmbeddedIdentificationByTa
|
|
|
1476
1787
|
description: "Turns off `` /* comment */ `...` `` comment-based embedded language identification for the specified identifiers.",
|
|
1477
1788
|
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1478
1789
|
},
|
|
1479
|
-
[
|
|
1790
|
+
[Fo]: {
|
|
1480
1791
|
category: "Embed",
|
|
1481
1792
|
type: "string",
|
|
1482
1793
|
array: !0,
|
|
@@ -1484,53 +1795,53 @@ var vi = "noEmbeddedIdentificationByComment", yi = "noEmbeddedIdentificationByTa
|
|
|
1484
1795
|
description: "Turns off `` tag`...` `` tag-based embedded language identification for the specified identifiers.",
|
|
1485
1796
|
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1486
1797
|
},
|
|
1487
|
-
[
|
|
1798
|
+
[Io]: {
|
|
1488
1799
|
category: "Embed",
|
|
1489
1800
|
type: "string",
|
|
1490
1801
|
array: !0,
|
|
1491
1802
|
default: [{ value: [] }],
|
|
1492
1803
|
description: "Preserves leading and trailing whitespaces in the formatting results for the specified comments or tags."
|
|
1493
1804
|
},
|
|
1494
|
-
[
|
|
1805
|
+
[Lo]: {
|
|
1495
1806
|
category: "Embed",
|
|
1496
1807
|
type: "string",
|
|
1497
1808
|
array: !0,
|
|
1498
1809
|
default: [{ value: [] }],
|
|
1499
1810
|
description: "Turns off auto indentation in the formatting results for the specified comments or tags when they are formatted to span multi lines."
|
|
1500
1811
|
},
|
|
1501
|
-
[
|
|
1812
|
+
[Ro]: {
|
|
1502
1813
|
category: "Embed",
|
|
1503
1814
|
type: "string",
|
|
1504
1815
|
array: !1,
|
|
1505
1816
|
default: void 0,
|
|
1506
1817
|
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."
|
|
1507
1818
|
}
|
|
1508
|
-
},
|
|
1819
|
+
}, Bo = {
|
|
1509
1820
|
...a.parsers,
|
|
1510
1821
|
...o.parsers,
|
|
1511
1822
|
...s.parsers,
|
|
1512
1823
|
...l.parsers,
|
|
1513
1824
|
...c.parsers,
|
|
1514
|
-
...
|
|
1515
|
-
},
|
|
1825
|
+
...Ao
|
|
1826
|
+
}, Vo = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g, Ho = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g, Uo = { parse: (e) => {
|
|
1516
1827
|
e = String(e);
|
|
1517
1828
|
try {
|
|
1518
1829
|
return JSON.parse(e);
|
|
1519
1830
|
} catch {
|
|
1520
|
-
return JSON.parse(e.replace(
|
|
1831
|
+
return JSON.parse(e.replace(Vo, "$1").replace(Ho, "$1"));
|
|
1521
1832
|
}
|
|
1522
|
-
} }, { label:
|
|
1523
|
-
async function
|
|
1833
|
+
} }, { label: Wo } = e;
|
|
1834
|
+
async function Go(e) {
|
|
1524
1835
|
try {
|
|
1525
1836
|
let { readFile: t } = await import("node:fs/promises"), n = await t(e, { encoding: "utf-8" });
|
|
1526
|
-
return
|
|
1837
|
+
return Uo.parse(n);
|
|
1527
1838
|
} catch {}
|
|
1528
1839
|
}
|
|
1529
|
-
var
|
|
1530
|
-
async function
|
|
1840
|
+
var Ko = /* @__PURE__ */ new URL("./import-module-worker.js", import.meta.url);
|
|
1841
|
+
async function qo(e) {
|
|
1531
1842
|
let { Worker: t } = await import("node:worker_threads");
|
|
1532
1843
|
return new Promise((n) => {
|
|
1533
|
-
let r = new t(
|
|
1844
|
+
let r = new t(Ko, { workerData: { absolutePath: e } });
|
|
1534
1845
|
r.once("message", (e) => {
|
|
1535
1846
|
r.terminate(), e.error && console.error(e.error), n(e.overrides);
|
|
1536
1847
|
}), r.once("error", (e) => {
|
|
@@ -1540,88 +1851,88 @@ async function ji(e) {
|
|
|
1540
1851
|
});
|
|
1541
1852
|
});
|
|
1542
1853
|
}
|
|
1543
|
-
async function
|
|
1854
|
+
async function Jo(e, t) {
|
|
1544
1855
|
let { isAbsolute: n, dirname: r, resolve: i } = await import("node:path");
|
|
1545
1856
|
if (n(e)) return e;
|
|
1546
1857
|
let a = await d(t);
|
|
1547
1858
|
return i(typeof a == "string" ? r(a) : process.env.PWD ?? process.cwd(), e);
|
|
1548
1859
|
}
|
|
1549
|
-
var
|
|
1860
|
+
var Yo = async (e, t) => {
|
|
1550
1861
|
let n;
|
|
1551
1862
|
try {
|
|
1552
1863
|
n = (await import("node:path")).extname(e);
|
|
1553
1864
|
} catch {
|
|
1554
1865
|
try {
|
|
1555
|
-
return
|
|
1866
|
+
return Uo.parse(e);
|
|
1556
1867
|
} catch {
|
|
1557
1868
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1558
1869
|
return;
|
|
1559
1870
|
}
|
|
1560
1871
|
}
|
|
1561
|
-
let r =
|
|
1872
|
+
let r = Jo(e, t);
|
|
1562
1873
|
if (n === ".json" || n === ".jsonc") {
|
|
1563
|
-
let e = await r, t = await
|
|
1874
|
+
let e = await r, t = await Go(e);
|
|
1564
1875
|
if (t !== void 0) return t;
|
|
1565
1876
|
console.error(`Failed to parse the json file: ${e}`);
|
|
1566
1877
|
} else if (n === ".mjs" || n === ".cjs" || n === ".js") {
|
|
1567
|
-
let e = await r, t = await
|
|
1878
|
+
let e = await r, t = await qo(e);
|
|
1568
1879
|
if (t !== void 0) return t;
|
|
1569
1880
|
console.error(`Failed to parse the js module file: ${e}`);
|
|
1570
1881
|
} else if (n === ".mts" || n === ".cts" || n === ".ts") {
|
|
1571
|
-
let e = await r, t = await
|
|
1882
|
+
let e = await r, t = await qo(e);
|
|
1572
1883
|
if (t !== void 0) return t;
|
|
1573
1884
|
console.error(`Failed to parse the ts module file: ${e}`);
|
|
1574
1885
|
} else {
|
|
1575
1886
|
if (n === "") {
|
|
1576
|
-
let e = await
|
|
1887
|
+
let e = await Go(await r);
|
|
1577
1888
|
if (e !== void 0) return e;
|
|
1578
1889
|
}
|
|
1579
1890
|
try {
|
|
1580
|
-
return
|
|
1891
|
+
return Uo.parse(e);
|
|
1581
1892
|
} catch {
|
|
1582
1893
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1583
1894
|
}
|
|
1584
1895
|
}
|
|
1585
|
-
},
|
|
1586
|
-
async function
|
|
1896
|
+
}, Xo = /* @__PURE__ */ new WeakMap();
|
|
1897
|
+
async function Zo(e, { commentOrTag: t, kind: n }) {
|
|
1587
1898
|
if (e.embeddedOverrides === void 0) return;
|
|
1588
|
-
let r =
|
|
1589
|
-
r === void 0 && (r =
|
|
1899
|
+
let r = Xo.get(e);
|
|
1900
|
+
r === void 0 && (r = Yo(e.embeddedOverrides, e.filepath), Xo.set(e, r));
|
|
1590
1901
|
let i = await r;
|
|
1591
1902
|
if (i !== void 0) for (let { [`${n}s`]: e, identifiers: r, options: a } of i) {
|
|
1592
1903
|
let n = e ?? [];
|
|
1593
1904
|
if (n.length === 0 && r?.includes(t) || n.includes(t)) return a;
|
|
1594
1905
|
}
|
|
1595
1906
|
}
|
|
1596
|
-
function*
|
|
1597
|
-
yield e, e.type === "CallExpression" && (yield*
|
|
1907
|
+
function* Qo(e) {
|
|
1908
|
+
yield e, e.type === "CallExpression" && (yield* Qo(e.callee));
|
|
1598
1909
|
}
|
|
1599
|
-
function
|
|
1910
|
+
function $(e) {
|
|
1600
1911
|
if (e.type === "Identifier") return e.name;
|
|
1601
1912
|
if (e.type === "ThisExpression") return "this";
|
|
1602
1913
|
if (e.type === "MemberExpression") {
|
|
1603
|
-
let t =
|
|
1914
|
+
let t = $(e.object);
|
|
1604
1915
|
if (t === void 0) return;
|
|
1605
1916
|
let n = "optional" in e && e.optional;
|
|
1606
1917
|
return !e.computed && e.property.type === "Identifier" ? `${t}${n ? "?." : "."}${e.property.name}` : e.property.type === "Literal" ? `${t}${n ? "?." : ""}[${JSON.stringify(e.property.value)}]` : e.property.type === "Identifier" ? `${t}${n ? "?." : ""}[${e.property.name}]` : void 0;
|
|
1607
1918
|
}
|
|
1608
1919
|
if (e.type === "CallExpression") {
|
|
1609
|
-
let t =
|
|
1920
|
+
let t = $(e.callee);
|
|
1610
1921
|
return t === void 0 ? void 0 : `${t}()`;
|
|
1611
1922
|
}
|
|
1612
|
-
if (e.type === "ChainExpression") return
|
|
1923
|
+
if (e.type === "ChainExpression") return $(e.expression);
|
|
1613
1924
|
}
|
|
1614
|
-
function
|
|
1925
|
+
function $o(e, t) {
|
|
1615
1926
|
let n = /^\/(.*)\/([dgimsuvy]*)$/.exec(t);
|
|
1616
1927
|
if (!n) return !1;
|
|
1617
1928
|
try {
|
|
1618
|
-
let t =
|
|
1929
|
+
let t = $(e);
|
|
1619
1930
|
return t !== void 0 && new RegExp(n[1], n[2]).test(t);
|
|
1620
1931
|
} catch {
|
|
1621
1932
|
return !1;
|
|
1622
1933
|
}
|
|
1623
1934
|
}
|
|
1624
|
-
var
|
|
1935
|
+
var es = (() => {
|
|
1625
1936
|
let e = /* @__PURE__ */ new Set([
|
|
1626
1937
|
"start",
|
|
1627
1938
|
"end",
|
|
@@ -1632,7 +1943,7 @@ var zi = (() => {
|
|
|
1632
1943
|
"decorators"
|
|
1633
1944
|
]);
|
|
1634
1945
|
return (t, n, r) => {
|
|
1635
|
-
if (/^\/.*\/[dgimsuvy]*$/.test(n)) return
|
|
1946
|
+
if (/^\/.*\/[dgimsuvy]*$/.test(n)) return $o(t, n);
|
|
1636
1947
|
let i;
|
|
1637
1948
|
try {
|
|
1638
1949
|
let e = r(`${n}\`\``);
|
|
@@ -1644,11 +1955,11 @@ var zi = (() => {
|
|
|
1644
1955
|
if (i.type === "File" && (i = i.program), i.type !== "Program" || i.body[0]?.type !== "ExpressionStatement") return !1;
|
|
1645
1956
|
let a = i.body[0]?.expression;
|
|
1646
1957
|
if (a?.type !== "TaggedTemplateExpression") return !1;
|
|
1647
|
-
for (let n of
|
|
1958
|
+
for (let n of Qo(t)) if (cs(n, a.tag, e)) return !0;
|
|
1648
1959
|
return !1;
|
|
1649
1960
|
};
|
|
1650
1961
|
})();
|
|
1651
|
-
function
|
|
1962
|
+
function ts({ node: e, parent: t }) {
|
|
1652
1963
|
let n = e.comments ?? t?.comments;
|
|
1653
1964
|
if (!n) return;
|
|
1654
1965
|
let r = n[n.length - 1];
|
|
@@ -1660,32 +1971,32 @@ function Bi({ node: e, parent: t }) {
|
|
|
1660
1971
|
let i = r.value;
|
|
1661
1972
|
if (i.length > 1 && i.startsWith(" ") && i.endsWith(" ")) return i.slice(1, -1);
|
|
1662
1973
|
}
|
|
1663
|
-
function
|
|
1974
|
+
function ns({ parent: e }) {
|
|
1664
1975
|
if (e?.type === "TaggedTemplateExpression") return e.tag.type === "Identifier" ? e.tag.name : e.tag;
|
|
1665
1976
|
}
|
|
1666
|
-
function
|
|
1977
|
+
function rs(e, t) {
|
|
1667
1978
|
return e.noEmbeddedIdentificationByComment?.includes(t) ?? !1 ? function* (e) {} : function* (t) {
|
|
1668
|
-
let n = e[
|
|
1669
|
-
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[
|
|
1979
|
+
let n = e[E(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1980
|
+
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[T(t)] ?? [] : yield* n;
|
|
1670
1981
|
};
|
|
1671
1982
|
}
|
|
1672
|
-
function
|
|
1983
|
+
function is(e, t) {
|
|
1673
1984
|
return typeof t == "string" ? e.noEmbeddedIdentificationByTag?.includes(t) ?? !1 ? function* (e) {} : function* (t) {
|
|
1674
|
-
let n = e[
|
|
1675
|
-
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[
|
|
1985
|
+
let n = e[D(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1986
|
+
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[T(t)] ?? [] : yield* n;
|
|
1676
1987
|
} : function* (t) {
|
|
1677
|
-
let n = e[
|
|
1988
|
+
let n = e[D(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1678
1989
|
if (n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed") {
|
|
1679
1990
|
let { noEmbeddedIdentificationByTag: n } = e;
|
|
1680
|
-
for (let r of e[
|
|
1991
|
+
for (let r of e[T(t)] ?? []) n?.includes(r) || (yield r);
|
|
1681
1992
|
} else yield* n;
|
|
1682
1993
|
};
|
|
1683
1994
|
}
|
|
1684
|
-
function
|
|
1685
|
-
let a =
|
|
1995
|
+
function as(e, t, n, r, i) {
|
|
1996
|
+
let a = jo[t];
|
|
1686
1997
|
if (!a) return null;
|
|
1687
1998
|
if (e.quasis.length === 1 && e.quasis[0]?.value.raw.trim() === "") return "``";
|
|
1688
|
-
let o =
|
|
1999
|
+
let o = Zo(i, {
|
|
1689
2000
|
commentOrTag: n,
|
|
1690
2001
|
kind: r
|
|
1691
2002
|
});
|
|
@@ -1696,7 +2007,7 @@ function Wi(e, t, n, r, i) {
|
|
|
1696
2007
|
kind: r,
|
|
1697
2008
|
embeddedOverrideOptions: await o
|
|
1698
2009
|
});
|
|
1699
|
-
return
|
|
2010
|
+
return Wo({
|
|
1700
2011
|
embed: !0,
|
|
1701
2012
|
...t.label
|
|
1702
2013
|
}, t);
|
|
@@ -1705,68 +2016,68 @@ function Wi(e, t, n, r, i) {
|
|
|
1705
2016
|
}
|
|
1706
2017
|
};
|
|
1707
2018
|
}
|
|
1708
|
-
function
|
|
1709
|
-
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ?
|
|
2019
|
+
function os(e, t, n) {
|
|
2020
|
+
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ? ss(e, t, n) : typeof e == "object" && cs(e, t, n);
|
|
1710
2021
|
}
|
|
1711
|
-
function
|
|
2022
|
+
function ss(e, t, n) {
|
|
1712
2023
|
let r = e.length;
|
|
1713
2024
|
if (r !== t.length) return !1;
|
|
1714
|
-
for (let i = 0; i < r; i++) if (!
|
|
2025
|
+
for (let i = 0; i < r; i++) if (!os(e[i], t[i], n)) return !1;
|
|
1715
2026
|
return !0;
|
|
1716
2027
|
}
|
|
1717
|
-
function
|
|
1718
|
-
for (let r of Object.keys(e)) if (!n?.has(r) && !(Object.hasOwn(t, r) &&
|
|
2028
|
+
function cs(e, t, n) {
|
|
2029
|
+
for (let r of Object.keys(e)) if (!n?.has(r) && !(Object.hasOwn(t, r) && os(e[r], t[r], n))) return !1;
|
|
1719
2030
|
return !0;
|
|
1720
2031
|
}
|
|
1721
2032
|
//#endregion
|
|
1722
2033
|
//#region src/printers.ts
|
|
1723
|
-
var { estree:
|
|
2034
|
+
var { estree: ls } = u, { embed: us } = ls, ds = (e, t) => {
|
|
1724
2035
|
let { node: n } = e;
|
|
1725
2036
|
if (n.type !== "TemplateLiteral" || n.quasis.some(({ value: { cooked: e } }) => e === null)) return null;
|
|
1726
|
-
let r =
|
|
2037
|
+
let r = ts(e);
|
|
1727
2038
|
if (typeof r == "string") {
|
|
1728
|
-
let i =
|
|
1729
|
-
for (let e of
|
|
2039
|
+
let i = rs(t, r);
|
|
2040
|
+
for (let e of ko) {
|
|
1730
2041
|
let a = !1;
|
|
1731
2042
|
for (let t of i(e)) if (r === t) {
|
|
1732
2043
|
a = !0;
|
|
1733
2044
|
break;
|
|
1734
2045
|
}
|
|
1735
|
-
if (a) return
|
|
2046
|
+
if (a) return as(n, e, r, "comment", t);
|
|
1736
2047
|
}
|
|
1737
|
-
return
|
|
2048
|
+
return us?.(e, t) ?? null;
|
|
1738
2049
|
}
|
|
1739
|
-
let i =
|
|
2050
|
+
let i = ns(e);
|
|
1740
2051
|
if (typeof i == "string") {
|
|
1741
|
-
let r =
|
|
1742
|
-
for (let e of
|
|
2052
|
+
let r = is(t, i);
|
|
2053
|
+
for (let e of ko) {
|
|
1743
2054
|
let a;
|
|
1744
|
-
for (let t of r(e)) if (i === t ||
|
|
2055
|
+
for (let t of r(e)) if (i === t || $o({
|
|
1745
2056
|
type: "Identifier",
|
|
1746
2057
|
name: i
|
|
1747
2058
|
}, t)) {
|
|
1748
2059
|
a = t;
|
|
1749
2060
|
break;
|
|
1750
2061
|
}
|
|
1751
|
-
if (a !== void 0) return
|
|
2062
|
+
if (a !== void 0) return as(n, e, a, "tag", t);
|
|
1752
2063
|
}
|
|
1753
|
-
return
|
|
2064
|
+
return us?.(e, t) ?? null;
|
|
1754
2065
|
}
|
|
1755
2066
|
if (i !== void 0) {
|
|
1756
|
-
let e = (e) =>
|
|
1757
|
-
for (let a of
|
|
2067
|
+
let e = (e) => Bo[t.parser].parse(e, t), r = is(t);
|
|
2068
|
+
for (let a of ko) {
|
|
1758
2069
|
let o;
|
|
1759
|
-
for (let t of r(a)) if (
|
|
2070
|
+
for (let t of r(a)) if (es(i, t, e)) {
|
|
1760
2071
|
o = t;
|
|
1761
2072
|
break;
|
|
1762
2073
|
}
|
|
1763
|
-
if (o !== void 0) return
|
|
2074
|
+
if (o !== void 0) return as(n, a, o, "tag", t);
|
|
1764
2075
|
}
|
|
1765
2076
|
}
|
|
1766
|
-
return
|
|
1767
|
-
},
|
|
1768
|
-
...
|
|
1769
|
-
embed:
|
|
2077
|
+
return us?.(e, t) ?? null;
|
|
2078
|
+
}, fs = { estree: {
|
|
2079
|
+
...ls,
|
|
2080
|
+
embed: ds
|
|
1770
2081
|
} };
|
|
1771
2082
|
//#endregion
|
|
1772
|
-
export {
|
|
2083
|
+
export { zo as options, Bo as parsers, fs as printers };
|