@lingo.dev/_compiler 0.8.8 → 0.8.10
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/build/{acorn-QFXI4BEA.cjs → acorn-H37LPRUJ.cjs} +5 -5
- package/build/{acorn-GCP5ZV2A.mjs → acorn-TSED2ZW2.mjs} +4 -4
- package/build/{angular-OXTGJOFJ.cjs → angular-DBMVLDKI.cjs} +5 -6
- package/build/{angular-JQSQXFBY.mjs → angular-OBBMKZBS.mjs} +4 -5
- package/build/{babel-EJ7OIZP4.cjs → babel-76IVLWL7.cjs} +3 -3
- package/build/{babel-R5G642DR.mjs → babel-LRHLMQHJ.mjs} +2 -2
- package/build/{chunk-AKV7BRP5.cjs → chunk-NKMWW3RS.cjs} +39 -39
- package/build/{chunk-AKFJBAG4.cjs → chunk-O75UYLMX.cjs} +1 -1
- package/build/{chunk-VG5I5JDL.mjs → chunk-OAQHCRD4.mjs} +33 -33
- package/build/{estree-XLH46TSP.mjs → estree-LU4FIQBG.mjs} +13 -13
- package/build/{estree-NGS2AYBH.cjs → estree-X6XJ6F3E.cjs} +14 -14
- package/build/{flow-DHPXOK5S.mjs → flow-2AIHOIVA.mjs} +3 -3
- package/build/{flow-RDDDCZAV.cjs → flow-6TJTSSIZ.cjs} +4 -4
- package/build/{glimmer-CAMUE4OK.cjs → glimmer-QMODKDQ6.cjs} +1 -1
- package/build/{graphql-YJNPH5D2.cjs → graphql-SQICRJKN.cjs} +1 -1
- package/build/{html-ZAWF5C3B.mjs → html-6E5RYVQV.mjs} +2 -2
- package/build/{html-TYMOOA3H.cjs → html-VZRXWOHI.cjs} +3 -3
- package/build/index.cjs +43 -29
- package/build/index.mjs +21 -7
- package/build/lingo-turbopack-loader.cjs +4 -4
- package/build/lingo-turbopack-loader.mjs +1 -1
- package/build/{markdown-EW4GGIPV.cjs → markdown-GKZ3QYSF.cjs} +5 -5
- package/build/{markdown-WJTZKU3V.mjs → markdown-WSFBOJYK.mjs} +4 -4
- package/build/{meriyah-OWUHWYCU.cjs → meriyah-JTLZ4L4D.cjs} +3 -3
- package/build/{meriyah-FBYDJ6EA.mjs → meriyah-W5CXPHUI.mjs} +2 -2
- package/build/{postcss-3TJJTQXP.mjs → postcss-UJ655DUW.mjs} +3 -3
- package/build/{postcss-MQS25GNZ.cjs → postcss-YO2YIECD.cjs} +4 -4
- package/build/{typescript-FJLY3MEC.mjs → typescript-FXTHOZH7.mjs} +2 -2
- package/build/{typescript-Z5DYTVQY.cjs → typescript-L4COLYNU.cjs} +3 -3
- package/build/{yaml-MMD4LQP5.mjs → yaml-3XEDC4EB.mjs} +1 -1
- package/build/{yaml-FHNA2CVI.cjs → yaml-QEWKPLU4.cjs} +2 -2
- package/package.json +3 -3
|
@@ -1075,10 +1075,10 @@ function $u(e) {
|
|
|
1075
1075
|
`;
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
-
var Ie = Symbol("MODE_BREAK");
|
|
1079
|
-
var pt = Symbol("MODE_FLAT");
|
|
1080
|
-
var Xt = Symbol("cursor");
|
|
1081
|
-
var ns = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
1078
|
+
var Ie = /* @__PURE__ */ Symbol("MODE_BREAK");
|
|
1079
|
+
var pt = /* @__PURE__ */ Symbol("MODE_FLAT");
|
|
1080
|
+
var Xt = /* @__PURE__ */ Symbol("cursor");
|
|
1081
|
+
var ns = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
1082
1082
|
function Ku() {
|
|
1083
1083
|
return { value: "", length: 0, queue: [] };
|
|
1084
1084
|
}
|
|
@@ -1624,7 +1624,7 @@ function di(e) {
|
|
|
1624
1624
|
`) + u;
|
|
1625
1625
|
}
|
|
1626
1626
|
function yc(e, t) {
|
|
1627
|
-
let { originalText: r, [Symbol.for("comments")]: n, locStart: s, locEnd: u, [Symbol.for("printedComments")]: i } = t, { node: a } = e, o = s(a), p = u(a);
|
|
1627
|
+
let { originalText: r, [/* @__PURE__ */ Symbol.for("comments")]: n, locStart: s, locEnd: u, [/* @__PURE__ */ Symbol.for("printedComments")]: i } = t, { node: a } = e, o = s(a), p = u(a);
|
|
1628
1628
|
for (let m of n) s(m) >= o && u(m) <= p && i.add(m);
|
|
1629
1629
|
return r.slice(o, p);
|
|
1630
1630
|
}
|
|
@@ -2076,7 +2076,7 @@ function N(e, t, r = {}) {
|
|
|
2076
2076
|
function fs(e, t) {
|
|
2077
2077
|
let r = e.node;
|
|
2078
2078
|
if (!r) return {};
|
|
2079
|
-
let n = t[Symbol.for("printedComments")];
|
|
2079
|
+
let n = t[/* @__PURE__ */ Symbol.for("printedComments")];
|
|
2080
2080
|
if ((r.comments || []).filter((o) => !n.has(o)).length === 0) return { leading: "", trailing: "" };
|
|
2081
2081
|
let u = [], i = [], a;
|
|
2082
2082
|
return e.each(() => {
|
|
@@ -2378,7 +2378,7 @@ function $r(e, t, r) {
|
|
|
2378
2378
|
let m = s.type === "ReturnStatement" || s.type === "ThrowStatement" || s.type === "JSXExpressionContainer" && u.type === "JSXAttribute" || n.operator !== "|" && s.type === "JsExpressionRoot" || n.type !== "NGPipeExpression" && (s.type === "NGRoot" && t.parser === "__ng_binding" || s.type === "NGMicrosyntaxExpression" && u.type === "NGMicrosyntax" && u.body.length === 1) || n === s.body && s.type === "ArrowFunctionExpression" || n !== s.body && s.type === "ForStatement" || s.type === "ConditionalExpression" && u.type !== "ReturnStatement" && u.type !== "ThrowStatement" && !w(u) || s.type === "TemplateLiteral", f = s.type === "AssignmentExpression" || s.type === "VariableDeclarator" || s.type === "ClassProperty" || s.type === "PropertyDefinition" || s.type === "TSAbstractPropertyDefinition" || s.type === "ClassPrivateProperty" || Te(s), y = Fe(n.left) && ar(n.operator, n.left.operator);
|
|
2379
2379
|
if (m || Ht(n) && !y || !Ht(n) && f) return l(p);
|
|
2380
2380
|
if (p.length === 0) return "";
|
|
2381
|
-
let C = Y(n.right), c = p.findIndex((J) => typeof J != "string" && !Array.isArray(J) && J.type === fe), A = p.slice(0, c === -1 ? 1 : c + 1), T = p.slice(A.length, C ? -1 : void 0), B = Symbol("logicalChain-" + ++qc), g = l([...A, D(T)], { id: B });
|
|
2381
|
+
let C = Y(n.right), c = p.findIndex((J) => typeof J != "string" && !Array.isArray(J) && J.type === fe), A = p.slice(0, c === -1 ? 1 : c + 1), T = p.slice(A.length, C ? -1 : void 0), B = /* @__PURE__ */ Symbol("logicalChain-" + ++qc), g = l([...A, D(T)], { id: B });
|
|
2382
2382
|
if (!C) return g;
|
|
2383
2383
|
let _ = v(false, p, -1);
|
|
2384
2384
|
return l([g, xt(_, { groupId: B })]);
|
|
@@ -2688,7 +2688,7 @@ function ht(e, t, r, n, s, u) {
|
|
|
2688
2688
|
case "never-break-after-operator":
|
|
2689
2689
|
return l([l(n), s, " ", a]);
|
|
2690
2690
|
case "fluid": {
|
|
2691
|
-
let o = Symbol("assignment");
|
|
2691
|
+
let o = /* @__PURE__ */ Symbol("assignment");
|
|
2692
2692
|
return l([l(n), s, l(D(x), { id: o }), je, xt(a, { groupId: o })]);
|
|
2693
2693
|
}
|
|
2694
2694
|
case "break-lhs":
|
|
@@ -3029,7 +3029,7 @@ function Kt(e, t, r) {
|
|
|
3029
3029
|
let { node: n } = e, s = [], u = "[", i = "]", a = n.type === "TupleTypeAnnotation" && n.types ? "types" : n.type === "TSTupleType" || n.type === "TupleTypeAnnotation" ? "elementTypes" : "elements", o = n[a];
|
|
3030
3030
|
if (o.length === 0) s.push(xl(e, t, u, i));
|
|
3031
3031
|
else {
|
|
3032
|
-
let p = v(false, o, -1), m = (p == null ? void 0 : p.type) !== "RestElement" && !n.inexact, f = p === null, y = Symbol("array"), C = !t.__inJestEach && o.length > 1 && o.every((T, B, g) => {
|
|
3032
|
+
let p = v(false, o, -1), m = (p == null ? void 0 : p.type) !== "RestElement" && !n.inexact, f = p === null, y = /* @__PURE__ */ Symbol("array"), C = !t.__inJestEach && o.length > 1 && o.every((T, B, g) => {
|
|
3033
3033
|
let _ = T == null ? void 0 : T.type;
|
|
3034
3034
|
if (!U(T) && !ue(T)) return false;
|
|
3035
3035
|
let M = g[B + 1];
|
|
@@ -3170,7 +3170,7 @@ function sa(e, t, r, n = {}) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
o && (a || (a = g.returnType && Q(g).length > 0 || g.typeParameters || Q(g).some((M) => M.type !== "Identifier"))), !o || g.body.type !== "ArrowFunctionExpression" ? (u = r("body", n), p = g.body) : e.call(B, "body");
|
|
3172
3172
|
})();
|
|
3173
|
-
let m = !de(t.originalText, p) && (wl(p) || _l(p, u, t) || !a && na(p)), f = e.key === "callee" && yt(e.parent), y = Symbol("arrow-chain"), C = Ml(e, n, { signatureDocs: s, shouldBreak: a }), c = false, A = false, T = false;
|
|
3173
|
+
let m = !de(t.originalText, p) && (wl(p) || _l(p, u, t) || !a && na(p)), f = e.key === "callee" && yt(e.parent), y = /* @__PURE__ */ Symbol("arrow-chain"), C = Ml(e, n, { signatureDocs: s, shouldBreak: a }), c = false, A = false, T = false;
|
|
3174
3174
|
return o && (f || n.assignmentLayout) && (A = true, T = !d(e.node, h.Leading & h.Line), c = n.assignmentLayout === "chain-tail-arrow-chain" || f && !m), u = vl(e, t, n, { bodyDoc: u, bodyComments: i, functionBody: p, shouldPutBodyOnSameLine: m }), l([l(A ? D([T ? E : "", C]) : C, { shouldBreak: c, id: y }), " =>", o ? xt(u, { groupId: y }) : l(u), o && f ? S(E, "", { groupId: y }) : ""]);
|
|
3175
3175
|
}
|
|
3176
3176
|
function Ol(e, t, r, n) {
|
|
@@ -3266,7 +3266,7 @@ function Gl(e, t) {
|
|
|
3266
3266
|
function Tn(e, t, r) {
|
|
3267
3267
|
let { node: n } = e, s = [n.const ? "const " : ""], u = n.type === "TSTypeParameter" ? r("name") : n.name;
|
|
3268
3268
|
if (n.variance && s.push(r("variance")), n.in && s.push("in "), n.out && s.push("out "), s.push(u), n.bound && (n.usesExtendsBound && s.push(" extends "), s.push(H(e, r, "bound"))), n.constraint) {
|
|
3269
|
-
let i = Symbol("constraint");
|
|
3269
|
+
let i = /* @__PURE__ */ Symbol("constraint");
|
|
3270
3270
|
s.push(" extends", l(D(x), { id: i }), je, xt(r("constraint"), { groupId: i }));
|
|
3271
3271
|
}
|
|
3272
3272
|
return n.default && s.push(" = ", r("default")), l(s);
|
|
@@ -3464,7 +3464,7 @@ function Ca(e, t) {
|
|
|
3464
3464
|
}
|
|
3465
3465
|
function Hl(e, t, r) {
|
|
3466
3466
|
let n = e.originalText.slice(t, r);
|
|
3467
|
-
for (let s of e[Symbol.for("comments")]) {
|
|
3467
|
+
for (let s of e[/* @__PURE__ */ Symbol.for("comments")]) {
|
|
3468
3468
|
let u = j(s);
|
|
3469
3469
|
if (u > r) break;
|
|
3470
3470
|
let i = P(s);
|
|
@@ -3665,7 +3665,7 @@ function zt(e, t, r, n) {
|
|
|
3665
3665
|
}, "test"), !g && d(f, h.Dangling) && e.call((Xe) => {
|
|
3666
3666
|
er.push(N(Xe, t));
|
|
3667
3667
|
}, "alternate"), d(s, h.Dangling) && er.push(N(e, t));
|
|
3668
|
-
let Gs = Symbol("test"), Va = Symbol("consequent"), dr = Symbol("test-and-consequent"), $a = u ? [Ms(r("test")), s.test.type === "ConditionalExpression" ? Ce : ""] : [r("checkType"), " ", "extends", " ", Je(s.extendsType) || s.extendsType.type === "TSMappedType" ? r("extendsType") : l(Ms(r("extendsType")))], qs = l([$a, " ?"], { id: Gs }), Ka = r(a), Tr = D([B || Z && (Y(m) || c || _) ? F : x, Ns, Ka]), Qa = Js ? l([qs, _ ? Tr : S(Tr, l(Tr, { id: Va }), { groupId: Gs })], { id: dr }) : [qs, Tr], wn = r(o), Ws = nt ? S(wn, Jr(Ms(wn)), { groupId: dr }) : wn, tr = [Qa, er.length > 0 ? [D([F, er]), F] : g ? F : nt ? S(x, " ", { groupId: dr }) : x, ":", g ? " " : M ? Js ? S(Ae, S(_ || nt ? " " : Ae, " "), { groupId: dr }) : S(Ae, " ") : " ", g ? Ws : l([D(Ws), Z && !nt ? E : ""]), L && !lt ? E : "", Ot ? Ce : ""];
|
|
3668
|
+
let Gs = /* @__PURE__ */ Symbol("test"), Va = /* @__PURE__ */ Symbol("consequent"), dr = /* @__PURE__ */ Symbol("test-and-consequent"), $a = u ? [Ms(r("test")), s.test.type === "ConditionalExpression" ? Ce : ""] : [r("checkType"), " ", "extends", " ", Je(s.extendsType) || s.extendsType.type === "TSMappedType" ? r("extendsType") : l(Ms(r("extendsType")))], qs = l([$a, " ?"], { id: Gs }), Ka = r(a), Tr = D([B || Z && (Y(m) || c || _) ? F : x, Ns, Ka]), Qa = Js ? l([qs, _ ? Tr : S(Tr, l(Tr, { id: Va }), { groupId: Gs })], { id: dr }) : [qs, Tr], wn = r(o), Ws = nt ? S(wn, Jr(Ms(wn)), { groupId: dr }) : wn, tr = [Qa, er.length > 0 ? [D([F, er]), F] : g ? F : nt ? S(x, " ", { groupId: dr }) : x, ":", g ? " " : M ? Js ? S(Ae, S(_ || nt ? " " : Ae, " "), { groupId: dr }) : S(Ae, " ") : " ", g ? Ws : l([D(Ws), Z && !nt ? E : ""]), L && !lt ? E : "", Ot ? Ce : ""];
|
|
3669
3669
|
return W && !Ot ? l(D([E, l(tr)])) : W || ne ? l(D(tr)) : lt || i && A ? l([D([E, tr]), se ? E : ""]) : C === k ? l(tr) : tr;
|
|
3670
3670
|
}
|
|
3671
3671
|
function Pa(e, t, r, n) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2; var _class3;require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2; var _class3;require('./chunk-O75UYLMX.cjs');
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/estree.mjs
|
|
4
4
|
var za = Object.defineProperty;
|
|
@@ -1075,10 +1075,10 @@ function $u(e) {
|
|
|
1075
1075
|
`;
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
-
var Ie = Symbol("MODE_BREAK");
|
|
1079
|
-
var pt = Symbol("MODE_FLAT");
|
|
1080
|
-
var Xt = Symbol("cursor");
|
|
1081
|
-
var ns = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
1078
|
+
var Ie = /* @__PURE__ */ Symbol("MODE_BREAK");
|
|
1079
|
+
var pt = /* @__PURE__ */ Symbol("MODE_FLAT");
|
|
1080
|
+
var Xt = /* @__PURE__ */ Symbol("cursor");
|
|
1081
|
+
var ns = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
1082
1082
|
function Ku() {
|
|
1083
1083
|
return { value: "", length: 0, queue: [] };
|
|
1084
1084
|
}
|
|
@@ -1624,7 +1624,7 @@ function di(e) {
|
|
|
1624
1624
|
`) + u;
|
|
1625
1625
|
}
|
|
1626
1626
|
function yc(e, t) {
|
|
1627
|
-
let { originalText: r, [Symbol.for("comments")]: n, locStart: s, locEnd: u, [Symbol.for("printedComments")]: i } = t, { node: a } = e, o = s(a), p = u(a);
|
|
1627
|
+
let { originalText: r, [/* @__PURE__ */ Symbol.for("comments")]: n, locStart: s, locEnd: u, [/* @__PURE__ */ Symbol.for("printedComments")]: i } = t, { node: a } = e, o = s(a), p = u(a);
|
|
1628
1628
|
for (let m of n) s(m) >= o && u(m) <= p && i.add(m);
|
|
1629
1629
|
return r.slice(o, p);
|
|
1630
1630
|
}
|
|
@@ -2076,7 +2076,7 @@ function N(e, t, r = {}) {
|
|
|
2076
2076
|
function fs(e, t) {
|
|
2077
2077
|
let r = e.node;
|
|
2078
2078
|
if (!r) return {};
|
|
2079
|
-
let n = t[Symbol.for("printedComments")];
|
|
2079
|
+
let n = t[/* @__PURE__ */ Symbol.for("printedComments")];
|
|
2080
2080
|
if ((r.comments || []).filter((o) => !n.has(o)).length === 0) return { leading: "", trailing: "" };
|
|
2081
2081
|
let u = [], i = [], a;
|
|
2082
2082
|
return e.each(() => {
|
|
@@ -2378,7 +2378,7 @@ function $r(e, t, r) {
|
|
|
2378
2378
|
let m = s.type === "ReturnStatement" || s.type === "ThrowStatement" || s.type === "JSXExpressionContainer" && u.type === "JSXAttribute" || n.operator !== "|" && s.type === "JsExpressionRoot" || n.type !== "NGPipeExpression" && (s.type === "NGRoot" && t.parser === "__ng_binding" || s.type === "NGMicrosyntaxExpression" && u.type === "NGMicrosyntax" && u.body.length === 1) || n === s.body && s.type === "ArrowFunctionExpression" || n !== s.body && s.type === "ForStatement" || s.type === "ConditionalExpression" && u.type !== "ReturnStatement" && u.type !== "ThrowStatement" && !w(u) || s.type === "TemplateLiteral", f = s.type === "AssignmentExpression" || s.type === "VariableDeclarator" || s.type === "ClassProperty" || s.type === "PropertyDefinition" || s.type === "TSAbstractPropertyDefinition" || s.type === "ClassPrivateProperty" || Te(s), y = Fe(n.left) && ar(n.operator, n.left.operator);
|
|
2379
2379
|
if (m || Ht(n) && !y || !Ht(n) && f) return l(p);
|
|
2380
2380
|
if (p.length === 0) return "";
|
|
2381
|
-
let C = Y(n.right), c = p.findIndex((J) => typeof J != "string" && !Array.isArray(J) && J.type === fe), A = p.slice(0, c === -1 ? 1 : c + 1), T = p.slice(A.length, C ? -1 : void 0), B = Symbol("logicalChain-" + ++qc), g = l([...A, D(T)], { id: B });
|
|
2381
|
+
let C = Y(n.right), c = p.findIndex((J) => typeof J != "string" && !Array.isArray(J) && J.type === fe), A = p.slice(0, c === -1 ? 1 : c + 1), T = p.slice(A.length, C ? -1 : void 0), B = /* @__PURE__ */ Symbol("logicalChain-" + ++qc), g = l([...A, D(T)], { id: B });
|
|
2382
2382
|
if (!C) return g;
|
|
2383
2383
|
let _ = v(false, p, -1);
|
|
2384
2384
|
return l([g, xt(_, { groupId: B })]);
|
|
@@ -2688,7 +2688,7 @@ function ht(e, t, r, n, s, u) {
|
|
|
2688
2688
|
case "never-break-after-operator":
|
|
2689
2689
|
return l([l(n), s, " ", a]);
|
|
2690
2690
|
case "fluid": {
|
|
2691
|
-
let o = Symbol("assignment");
|
|
2691
|
+
let o = /* @__PURE__ */ Symbol("assignment");
|
|
2692
2692
|
return l([l(n), s, l(D(x), { id: o }), je, xt(a, { groupId: o })]);
|
|
2693
2693
|
}
|
|
2694
2694
|
case "break-lhs":
|
|
@@ -3029,7 +3029,7 @@ function Kt(e, t, r) {
|
|
|
3029
3029
|
let { node: n } = e, s = [], u = "[", i = "]", a = n.type === "TupleTypeAnnotation" && n.types ? "types" : n.type === "TSTupleType" || n.type === "TupleTypeAnnotation" ? "elementTypes" : "elements", o = n[a];
|
|
3030
3030
|
if (o.length === 0) s.push(xl(e, t, u, i));
|
|
3031
3031
|
else {
|
|
3032
|
-
let p = v(false, o, -1), m = (p == null ? void 0 : p.type) !== "RestElement" && !n.inexact, f = p === null, y = Symbol("array"), C = !t.__inJestEach && o.length > 1 && o.every((T, B, g) => {
|
|
3032
|
+
let p = v(false, o, -1), m = (p == null ? void 0 : p.type) !== "RestElement" && !n.inexact, f = p === null, y = /* @__PURE__ */ Symbol("array"), C = !t.__inJestEach && o.length > 1 && o.every((T, B, g) => {
|
|
3033
3033
|
let _ = T == null ? void 0 : T.type;
|
|
3034
3034
|
if (!U(T) && !ue(T)) return false;
|
|
3035
3035
|
let M = g[B + 1];
|
|
@@ -3170,7 +3170,7 @@ function sa(e, t, r, n = {}) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
o && (a || (a = g.returnType && Q(g).length > 0 || g.typeParameters || Q(g).some((M) => M.type !== "Identifier"))), !o || g.body.type !== "ArrowFunctionExpression" ? (u = r("body", n), p = g.body) : e.call(B, "body");
|
|
3172
3172
|
})();
|
|
3173
|
-
let m = !de(t.originalText, p) && (wl(p) || _l(p, u, t) || !a && na(p)), f = e.key === "callee" && yt(e.parent), y = Symbol("arrow-chain"), C = Ml(e, n, { signatureDocs: s, shouldBreak: a }), c = false, A = false, T = false;
|
|
3173
|
+
let m = !de(t.originalText, p) && (wl(p) || _l(p, u, t) || !a && na(p)), f = e.key === "callee" && yt(e.parent), y = /* @__PURE__ */ Symbol("arrow-chain"), C = Ml(e, n, { signatureDocs: s, shouldBreak: a }), c = false, A = false, T = false;
|
|
3174
3174
|
return o && (f || n.assignmentLayout) && (A = true, T = !d(e.node, h.Leading & h.Line), c = n.assignmentLayout === "chain-tail-arrow-chain" || f && !m), u = vl(e, t, n, { bodyDoc: u, bodyComments: i, functionBody: p, shouldPutBodyOnSameLine: m }), l([l(A ? D([T ? E : "", C]) : C, { shouldBreak: c, id: y }), " =>", o ? xt(u, { groupId: y }) : l(u), o && f ? S(E, "", { groupId: y }) : ""]);
|
|
3175
3175
|
}
|
|
3176
3176
|
function Ol(e, t, r, n) {
|
|
@@ -3266,7 +3266,7 @@ function Gl(e, t) {
|
|
|
3266
3266
|
function Tn(e, t, r) {
|
|
3267
3267
|
let { node: n } = e, s = [n.const ? "const " : ""], u = n.type === "TSTypeParameter" ? r("name") : n.name;
|
|
3268
3268
|
if (n.variance && s.push(r("variance")), n.in && s.push("in "), n.out && s.push("out "), s.push(u), n.bound && (n.usesExtendsBound && s.push(" extends "), s.push(H(e, r, "bound"))), n.constraint) {
|
|
3269
|
-
let i = Symbol("constraint");
|
|
3269
|
+
let i = /* @__PURE__ */ Symbol("constraint");
|
|
3270
3270
|
s.push(" extends", l(D(x), { id: i }), je, xt(r("constraint"), { groupId: i }));
|
|
3271
3271
|
}
|
|
3272
3272
|
return n.default && s.push(" = ", r("default")), l(s);
|
|
@@ -3464,7 +3464,7 @@ function Ca(e, t) {
|
|
|
3464
3464
|
}
|
|
3465
3465
|
function Hl(e, t, r) {
|
|
3466
3466
|
let n = e.originalText.slice(t, r);
|
|
3467
|
-
for (let s of e[Symbol.for("comments")]) {
|
|
3467
|
+
for (let s of e[/* @__PURE__ */ Symbol.for("comments")]) {
|
|
3468
3468
|
let u = j(s);
|
|
3469
3469
|
if (u > r) break;
|
|
3470
3470
|
let i = P(s);
|
|
@@ -3665,7 +3665,7 @@ function zt(e, t, r, n) {
|
|
|
3665
3665
|
}, "test"), !g && d(f, h.Dangling) && e.call((Xe) => {
|
|
3666
3666
|
er.push(N(Xe, t));
|
|
3667
3667
|
}, "alternate"), d(s, h.Dangling) && er.push(N(e, t));
|
|
3668
|
-
let Gs = Symbol("test"), Va = Symbol("consequent"), dr = Symbol("test-and-consequent"), $a = u ? [Ms(r("test")), s.test.type === "ConditionalExpression" ? Ce : ""] : [r("checkType"), " ", "extends", " ", Je(s.extendsType) || s.extendsType.type === "TSMappedType" ? r("extendsType") : l(Ms(r("extendsType")))], qs = l([$a, " ?"], { id: Gs }), Ka = r(a), Tr = D([B || Z && (Y(m) || c || _) ? F : x, Ns, Ka]), Qa = Js ? l([qs, _ ? Tr : S(Tr, l(Tr, { id: Va }), { groupId: Gs })], { id: dr }) : [qs, Tr], wn = r(o), Ws = nt ? S(wn, Jr(Ms(wn)), { groupId: dr }) : wn, tr = [Qa, er.length > 0 ? [D([F, er]), F] : g ? F : nt ? S(x, " ", { groupId: dr }) : x, ":", g ? " " : M ? Js ? S(Ae, S(_ || nt ? " " : Ae, " "), { groupId: dr }) : S(Ae, " ") : " ", g ? Ws : l([D(Ws), Z && !nt ? E : ""]), L && !lt ? E : "", Ot ? Ce : ""];
|
|
3668
|
+
let Gs = /* @__PURE__ */ Symbol("test"), Va = /* @__PURE__ */ Symbol("consequent"), dr = /* @__PURE__ */ Symbol("test-and-consequent"), $a = u ? [Ms(r("test")), s.test.type === "ConditionalExpression" ? Ce : ""] : [r("checkType"), " ", "extends", " ", Je(s.extendsType) || s.extendsType.type === "TSMappedType" ? r("extendsType") : l(Ms(r("extendsType")))], qs = l([$a, " ?"], { id: Gs }), Ka = r(a), Tr = D([B || Z && (Y(m) || c || _) ? F : x, Ns, Ka]), Qa = Js ? l([qs, _ ? Tr : S(Tr, l(Tr, { id: Va }), { groupId: Gs })], { id: dr }) : [qs, Tr], wn = r(o), Ws = nt ? S(wn, Jr(Ms(wn)), { groupId: dr }) : wn, tr = [Qa, er.length > 0 ? [D([F, er]), F] : g ? F : nt ? S(x, " ", { groupId: dr }) : x, ":", g ? " " : M ? Js ? S(Ae, S(_ || nt ? " " : Ae, " "), { groupId: dr }) : S(Ae, " ") : " ", g ? Ws : l([D(Ws), Z && !nt ? E : ""]), L && !lt ? E : "", Ot ? Ce : ""];
|
|
3669
3669
|
return W && !Ot ? l(D([E, l(tr)])) : W || ne ? l(D(tr)) : lt || i && A ? l([D([E, tr]), se ? E : ""]) : C === k ? l(tr) : tr;
|
|
3670
3670
|
}
|
|
3671
3671
|
function Pa(e, t, r, n) {
|
|
@@ -1622,7 +1622,7 @@ var kY = bA0((mj) => {
|
|
|
1622
1622
|
A2.prototype.nm = function(x) {
|
|
1623
1623
|
return this.root + x;
|
|
1624
1624
|
}, A2.prototype.create_dir_if_needed = function(x) {
|
|
1625
|
-
for (var r = x.split(ve), e = tx, t = 0; t < r.length - 1; t++) e += r[t] + ve, !this.content[e] && (this.content[e] = Symbol("directory"));
|
|
1625
|
+
for (var r = x.split(ve), e = tx, t = 0; t < r.length - 1; t++) e += r[t] + ve, !this.content[e] && (this.content[e] = /* @__PURE__ */ Symbol("directory"));
|
|
1626
1626
|
}, A2.prototype.slash = function(x) {
|
|
1627
1627
|
return /\/$/.test(x) ? x : x + ve;
|
|
1628
1628
|
}, A2.prototype.lookup = function(x) {
|
|
@@ -27007,7 +27007,7 @@ function CA0(a0) {
|
|
|
27007
27007
|
var $l = CA0;
|
|
27008
27008
|
function NA0(a0, W0, bx) {
|
|
27009
27009
|
let Yx = a0.originalText.slice(W0, bx);
|
|
27010
|
-
for (let x1 of a0[Symbol.for("comments")]) {
|
|
27010
|
+
for (let x1 of a0[/* @__PURE__ */ Symbol.for("comments")]) {
|
|
27011
27011
|
let D1 = Pe(x1);
|
|
27012
27012
|
if (D1 > bx) break;
|
|
27013
27013
|
let Ie = V2(x1);
|
|
@@ -27144,7 +27144,7 @@ function BA0(a0, W0) {
|
|
|
27144
27144
|
break;
|
|
27145
27145
|
case "TSEnumDeclaration":
|
|
27146
27146
|
if (!Rr.body) {
|
|
27147
|
-
let _1 = V2(Rr.id), { members: Ce } = Rr, Qs = yY({ originalText: Yx, [Symbol.for("comments")]: x1 }, _1, Ce[0] ? Pe(Ce[0]) : V2(Rr)), Qa = _1 + Qs.indexOf("{");
|
|
27147
|
+
let _1 = V2(Rr.id), { members: Ce } = Rr, Qs = yY({ originalText: Yx, [/* @__PURE__ */ Symbol.for("comments")]: x1 }, _1, Ce[0] ? Pe(Ce[0]) : V2(Rr)), Qa = _1 + Qs.indexOf("{");
|
|
27148
27148
|
Rr.body = { type: "TSEnumBody", members: Ce, range: [Qa, V2(Rr)] }, delete Rr.members;
|
|
27149
27149
|
}
|
|
27150
27150
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }require('./chunk-O75UYLMX.cjs');
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/flow.mjs
|
|
4
4
|
var hA0 = Object.create;
|
|
@@ -1622,7 +1622,7 @@ var kY = bA0((mj) => {
|
|
|
1622
1622
|
A2.prototype.nm = function(x) {
|
|
1623
1623
|
return this.root + x;
|
|
1624
1624
|
}, A2.prototype.create_dir_if_needed = function(x) {
|
|
1625
|
-
for (var r = x.split(ve), e = tx, t = 0; t < r.length - 1; t++) e += r[t] + ve, !this.content[e] && (this.content[e] = Symbol("directory"));
|
|
1625
|
+
for (var r = x.split(ve), e = tx, t = 0; t < r.length - 1; t++) e += r[t] + ve, !this.content[e] && (this.content[e] = /* @__PURE__ */ Symbol("directory"));
|
|
1626
1626
|
}, A2.prototype.slash = function(x) {
|
|
1627
1627
|
return /\/$/.test(x) ? x : x + ve;
|
|
1628
1628
|
}, A2.prototype.lookup = function(x) {
|
|
@@ -27007,7 +27007,7 @@ function CA0(a0) {
|
|
|
27007
27007
|
var $l = CA0;
|
|
27008
27008
|
function NA0(a0, W0, bx) {
|
|
27009
27009
|
let Yx = a0.originalText.slice(W0, bx);
|
|
27010
|
-
for (let x1 of a0[Symbol.for("comments")]) {
|
|
27010
|
+
for (let x1 of a0[/* @__PURE__ */ Symbol.for("comments")]) {
|
|
27011
27011
|
let D1 = Pe(x1);
|
|
27012
27012
|
if (D1 > bx) break;
|
|
27013
27013
|
let Ie = V2(x1);
|
|
@@ -27144,7 +27144,7 @@ function BA0(a0, W0) {
|
|
|
27144
27144
|
break;
|
|
27145
27145
|
case "TSEnumDeclaration":
|
|
27146
27146
|
if (!Rr.body) {
|
|
27147
|
-
let _1 = V2(Rr.id), { members: Ce } = Rr, Qs = yY({ originalText: Yx, [Symbol.for("comments")]: x1 }, _1, Ce[0] ? Pe(Ce[0]) : V2(Rr)), Qa = _1 + Qs.indexOf("{");
|
|
27147
|
+
let _1 = V2(Rr.id), { members: Ce } = Rr, Qs = yY({ originalText: Yx, [/* @__PURE__ */ Symbol.for("comments")]: x1 }, _1, Ce[0] ? Pe(Ce[0]) : V2(Rr)), Qa = _1 + Qs.indexOf("{");
|
|
27148
27148
|
Rr.body = { type: "TSEnumBody", members: Ce, range: [Qa, V2(Rr)] }, delete Rr.members;
|
|
27149
27149
|
}
|
|
27150
27150
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;require('./chunk-O75UYLMX.cjs');
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/glimmer.mjs
|
|
4
4
|
var zs = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;require('./chunk-O75UYLMX.cjs');
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/graphql.mjs
|
|
4
4
|
var Et = Object.defineProperty;
|
|
@@ -999,7 +999,7 @@ function Re(t7, e, r) {
|
|
|
999
999
|
let a = i.node, o = a.prev ? It(a.prev, a) : "";
|
|
1000
1000
|
return [o ? [o, Je(a.prev) ? S : ""] : "", ot(i, e, r)];
|
|
1001
1001
|
}, "children")];
|
|
1002
|
-
let s = n.children.map(() => Symbol(""));
|
|
1002
|
+
let s = n.children.map(() => /* @__PURE__ */ Symbol(""));
|
|
1003
1003
|
return t7.map((i, a) => {
|
|
1004
1004
|
let o = i.node;
|
|
1005
1005
|
if ($(o)) {
|
|
@@ -1044,7 +1044,7 @@ function Ns(t7, e, r) {
|
|
|
1044
1044
|
function Is(t7, e, r) {
|
|
1045
1045
|
let { node: n } = t7;
|
|
1046
1046
|
if (wt(n, e)) return [z(n, e), E(st(t7, e, r)), B(Nt(n, e)), ...tt(n, e), G(n, e)];
|
|
1047
|
-
let s = n.children.length === 1 && (n.firstChild.type === "interpolation" || n.firstChild.type === "angularIcuExpression") && n.firstChild.isLeadingSpaceSensitive && !n.firstChild.hasLeadingSpaces && n.lastChild.isTrailingSpaceSensitive && !n.lastChild.hasTrailingSpaces, i = Symbol("element-attr-group-id"), a = (l) => E([E(st(t7, e, r), { id: i }), l, tt(n, e)]), o = (l) => s ? Cn(l, { groupId: i }) : (W(n, e) || et(n, e)) && n.parent.type === "root" && e.parser === "vue" && !e.vueIndentScriptAndStyle ? l : k(l), u = () => s ? pe(v, "", { groupId: i }) : n.firstChild.hasLeadingSpaces && n.firstChild.isLeadingSpaceSensitive ? _ : n.firstChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive ? dn(v) : v, p = () => (n.next ? Q(n.next) : Ee(n.parent)) ? n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? " " : "" : s ? pe(v, "", { groupId: i }) : n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? _ : (n.lastChild.type === "comment" || n.lastChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive) && new RegExp(`\\n[\\t ]{${e.tabWidth * (t7.ancestors.length - 1)}}$`, "u").test(n.lastChild.value) ? "" : v;
|
|
1047
|
+
let s = n.children.length === 1 && (n.firstChild.type === "interpolation" || n.firstChild.type === "angularIcuExpression") && n.firstChild.isLeadingSpaceSensitive && !n.firstChild.hasLeadingSpaces && n.lastChild.isTrailingSpaceSensitive && !n.lastChild.hasTrailingSpaces, i = /* @__PURE__ */ Symbol("element-attr-group-id"), a = (l) => E([E(st(t7, e, r), { id: i }), l, tt(n, e)]), o = (l) => s ? Cn(l, { groupId: i }) : (W(n, e) || et(n, e)) && n.parent.type === "root" && e.parser === "vue" && !e.vueIndentScriptAndStyle ? l : k(l), u = () => s ? pe(v, "", { groupId: i }) : n.firstChild.hasLeadingSpaces && n.firstChild.isLeadingSpaceSensitive ? _ : n.firstChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive ? dn(v) : v, p = () => (n.next ? Q(n.next) : Ee(n.parent)) ? n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? " " : "" : s ? pe(v, "", { groupId: i }) : n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? _ : (n.lastChild.type === "comment" || n.lastChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive) && new RegExp(`\\n[\\t ]{${e.tabWidth * (t7.ancestors.length - 1)}}$`, "u").test(n.lastChild.value) ? "" : v;
|
|
1048
1048
|
return n.children.length === 0 ? a(n.hasDanglingSpaces && n.isDanglingSpaceSensitive ? _ : "") : a([Gn(n) ? ne : "", o([u(), Re(t7, e, r)]), p()]);
|
|
1049
1049
|
}
|
|
1050
1050
|
function ut(t7) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;require('./chunk-O75UYLMX.cjs');
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/html.mjs
|
|
4
4
|
var on = Object.defineProperty;
|
|
@@ -999,7 +999,7 @@ function Re(t7, e, r) {
|
|
|
999
999
|
let a = i.node, o = a.prev ? It(a.prev, a) : "";
|
|
1000
1000
|
return [o ? [o, Je(a.prev) ? S : ""] : "", ot(i, e, r)];
|
|
1001
1001
|
}, "children")];
|
|
1002
|
-
let s = n.children.map(() => Symbol(""));
|
|
1002
|
+
let s = n.children.map(() => /* @__PURE__ */ Symbol(""));
|
|
1003
1003
|
return t7.map((i, a) => {
|
|
1004
1004
|
let o = i.node;
|
|
1005
1005
|
if ($(o)) {
|
|
@@ -1044,7 +1044,7 @@ function Ns(t7, e, r) {
|
|
|
1044
1044
|
function Is(t7, e, r) {
|
|
1045
1045
|
let { node: n } = t7;
|
|
1046
1046
|
if (wt(n, e)) return [z(n, e), E(st(t7, e, r)), B(Nt(n, e)), ...tt(n, e), G(n, e)];
|
|
1047
|
-
let s = n.children.length === 1 && (n.firstChild.type === "interpolation" || n.firstChild.type === "angularIcuExpression") && n.firstChild.isLeadingSpaceSensitive && !n.firstChild.hasLeadingSpaces && n.lastChild.isTrailingSpaceSensitive && !n.lastChild.hasTrailingSpaces, i = Symbol("element-attr-group-id"), a = (l) => E([E(st(t7, e, r), { id: i }), l, tt(n, e)]), o = (l) => s ? Cn(l, { groupId: i }) : (W(n, e) || et(n, e)) && n.parent.type === "root" && e.parser === "vue" && !e.vueIndentScriptAndStyle ? l : k(l), u = () => s ? pe(v, "", { groupId: i }) : n.firstChild.hasLeadingSpaces && n.firstChild.isLeadingSpaceSensitive ? _ : n.firstChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive ? dn(v) : v, p = () => (n.next ? Q(n.next) : Ee(n.parent)) ? n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? " " : "" : s ? pe(v, "", { groupId: i }) : n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? _ : (n.lastChild.type === "comment" || n.lastChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive) && new RegExp(`\\n[\\t ]{${e.tabWidth * (t7.ancestors.length - 1)}}$`, "u").test(n.lastChild.value) ? "" : v;
|
|
1047
|
+
let s = n.children.length === 1 && (n.firstChild.type === "interpolation" || n.firstChild.type === "angularIcuExpression") && n.firstChild.isLeadingSpaceSensitive && !n.firstChild.hasLeadingSpaces && n.lastChild.isTrailingSpaceSensitive && !n.lastChild.hasTrailingSpaces, i = /* @__PURE__ */ Symbol("element-attr-group-id"), a = (l) => E([E(st(t7, e, r), { id: i }), l, tt(n, e)]), o = (l) => s ? Cn(l, { groupId: i }) : (W(n, e) || et(n, e)) && n.parent.type === "root" && e.parser === "vue" && !e.vueIndentScriptAndStyle ? l : k(l), u = () => s ? pe(v, "", { groupId: i }) : n.firstChild.hasLeadingSpaces && n.firstChild.isLeadingSpaceSensitive ? _ : n.firstChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive ? dn(v) : v, p = () => (n.next ? Q(n.next) : Ee(n.parent)) ? n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? " " : "" : s ? pe(v, "", { groupId: i }) : n.lastChild.hasTrailingSpaces && n.lastChild.isTrailingSpaceSensitive ? _ : (n.lastChild.type === "comment" || n.lastChild.type === "text" && n.isWhitespaceSensitive && n.isIndentationSensitive) && new RegExp(`\\n[\\t ]{${e.tabWidth * (t7.ancestors.length - 1)}}$`, "u").test(n.lastChild.value) ? "" : v;
|
|
1048
1048
|
return n.children.length === 0 ? a(n.hasDanglingSpaces && n.isDanglingSpaceSensitive ? _ : "") : a([Gn(n) ? ne : "", o([u(), Re(t7, e, r)]), p()]);
|
|
1049
1049
|
}
|
|
1050
1050
|
function ut(t7) {
|
package/build/index.cjs
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkNKMWW3RScjs = require('./chunk-NKMWW3RS.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkO75UYLMXcjs = require('./chunk-O75UYLMX.cjs');
|
|
23
23
|
|
|
24
24
|
// src/index.ts
|
|
25
25
|
var _unplugin = require('unplugin');
|
|
@@ -27,7 +27,7 @@ var _unplugin = require('unplugin');
|
|
|
27
27
|
// package.json
|
|
28
28
|
var package_default = {
|
|
29
29
|
name: "@lingo.dev/_compiler",
|
|
30
|
-
version: "0.8.
|
|
30
|
+
version: "0.8.10",
|
|
31
31
|
description: "Lingo.dev Compiler",
|
|
32
32
|
private: false,
|
|
33
33
|
repository: {
|
|
@@ -115,7 +115,17 @@ var _nodemachineid = require('node-machine-id'); var machineIdLib = _interopRequ
|
|
|
115
115
|
|
|
116
116
|
// src/utils/repository-id.ts
|
|
117
117
|
var _child_process = require('child_process');
|
|
118
|
+
var _crypto = require('crypto');
|
|
118
119
|
var cachedGitRepoId = void 0;
|
|
120
|
+
function hashProjectName(fullPath) {
|
|
121
|
+
const parts = fullPath.split("/");
|
|
122
|
+
if (parts.length !== 2) {
|
|
123
|
+
return _crypto.createHash.call(void 0, "sha256").update(fullPath).digest("hex").slice(0, 8);
|
|
124
|
+
}
|
|
125
|
+
const [org, project] = parts;
|
|
126
|
+
const hashedProject = _crypto.createHash.call(void 0, "sha256").update(project).digest("hex").slice(0, 8);
|
|
127
|
+
return `${org}/${hashedProject}`;
|
|
128
|
+
}
|
|
119
129
|
function getRepositoryId() {
|
|
120
130
|
const ciRepoId = getCIRepositoryId();
|
|
121
131
|
if (ciRepoId) return ciRepoId;
|
|
@@ -125,13 +135,16 @@ function getRepositoryId() {
|
|
|
125
135
|
}
|
|
126
136
|
function getCIRepositoryId() {
|
|
127
137
|
if (process.env.GITHUB_REPOSITORY) {
|
|
128
|
-
|
|
138
|
+
const hashed = hashProjectName(process.env.GITHUB_REPOSITORY);
|
|
139
|
+
return `github:${hashed}`;
|
|
129
140
|
}
|
|
130
141
|
if (process.env.CI_PROJECT_PATH) {
|
|
131
|
-
|
|
142
|
+
const hashed = hashProjectName(process.env.CI_PROJECT_PATH);
|
|
143
|
+
return `gitlab:${hashed}`;
|
|
132
144
|
}
|
|
133
145
|
if (process.env.BITBUCKET_REPO_FULL_NAME) {
|
|
134
|
-
|
|
146
|
+
const hashed = hashProjectName(process.env.BITBUCKET_REPO_FULL_NAME);
|
|
147
|
+
return `bitbucket:${hashed}`;
|
|
135
148
|
}
|
|
136
149
|
return null;
|
|
137
150
|
}
|
|
@@ -169,10 +182,11 @@ function parseGitUrl(url) {
|
|
|
169
182
|
const httpsMatch = cleanUrl.match(/\/([^/]+\/[^/]+)$/);
|
|
170
183
|
const repoPath = _optionalChain([sshMatch, 'optionalAccess', _2 => _2[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _3 => _3[1]]);
|
|
171
184
|
if (!repoPath) return null;
|
|
185
|
+
const hashedPath = hashProjectName(repoPath);
|
|
172
186
|
if (platform) {
|
|
173
|
-
return `${platform}:${
|
|
187
|
+
return `${platform}:${hashedPath}`;
|
|
174
188
|
}
|
|
175
|
-
return `git:${
|
|
189
|
+
return `git:${hashedPath}`;
|
|
176
190
|
}
|
|
177
191
|
|
|
178
192
|
// src/utils/observability.ts
|
|
@@ -250,7 +264,7 @@ async function getDistinctId() {
|
|
|
250
264
|
};
|
|
251
265
|
}
|
|
252
266
|
async function tryGetEmail() {
|
|
253
|
-
const rc =
|
|
267
|
+
const rc = _chunkNKMWW3RScjs.getRc.call(void 0, );
|
|
254
268
|
const apiKey = process.env.LINGODOTDEV_API_KEY || _optionalChain([rc, 'optionalAccess', _5 => _5.auth, 'optionalAccess', _6 => _6.apiKey]);
|
|
255
269
|
const apiUrl = process.env.LINGODOTDEV_API_URL || _optionalChain([rc, 'optionalAccess', _7 => _7.auth, 'optionalAccess', _8 => _8.apiUrl]) || "https://engine.lingo.dev";
|
|
256
270
|
if (!apiKey) {
|
|
@@ -278,20 +292,20 @@ async function tryGetEmail() {
|
|
|
278
292
|
// src/index.ts
|
|
279
293
|
var keyCheckers = {
|
|
280
294
|
groq: {
|
|
281
|
-
checkEnv:
|
|
282
|
-
checkRc:
|
|
295
|
+
checkEnv: _chunkNKMWW3RScjs.getGroqKeyFromEnv,
|
|
296
|
+
checkRc: _chunkNKMWW3RScjs.getGroqKeyFromRc
|
|
283
297
|
},
|
|
284
298
|
google: {
|
|
285
|
-
checkEnv:
|
|
286
|
-
checkRc:
|
|
299
|
+
checkEnv: _chunkNKMWW3RScjs.getGoogleKeyFromEnv,
|
|
300
|
+
checkRc: _chunkNKMWW3RScjs.getGoogleKeyFromRc
|
|
287
301
|
},
|
|
288
302
|
mistral: {
|
|
289
|
-
checkEnv:
|
|
290
|
-
checkRc:
|
|
303
|
+
checkEnv: _chunkNKMWW3RScjs.getMistralKeyFromEnv,
|
|
304
|
+
checkRc: _chunkNKMWW3RScjs.getMistralKeyFromRc
|
|
291
305
|
},
|
|
292
306
|
"lingo.dev": {
|
|
293
|
-
checkEnv:
|
|
294
|
-
checkRc:
|
|
307
|
+
checkEnv: _chunkNKMWW3RScjs.getLingoDotDevKeyFromEnv,
|
|
308
|
+
checkRc: _chunkNKMWW3RScjs.getLingoDotDevKeyFromRc
|
|
295
309
|
}
|
|
296
310
|
};
|
|
297
311
|
var alreadySentBuildEvent = { value: false };
|
|
@@ -307,14 +321,14 @@ function sendBuildEvent(framework, config, isDev) {
|
|
|
307
321
|
var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
308
322
|
(_params, _meta) => {
|
|
309
323
|
console.log("\u2139\uFE0F Starting Lingo.dev compiler...");
|
|
310
|
-
const params = _lodash2.default.defaults(_params,
|
|
311
|
-
if (!
|
|
324
|
+
const params = _lodash2.default.defaults(_params, _chunkNKMWW3RScjs.defaultParams);
|
|
325
|
+
if (!_chunkNKMWW3RScjs.isRunningInCIOrDocker.call(void 0, )) {
|
|
312
326
|
if (params.models === "lingo.dev") {
|
|
313
327
|
validateLLMKeyDetails(["lingo.dev"]);
|
|
314
328
|
} else {
|
|
315
329
|
const configuredProviders = getConfiguredProviders(params.models);
|
|
316
330
|
validateLLMKeyDetails(configuredProviders);
|
|
317
|
-
const invalidLocales =
|
|
331
|
+
const invalidLocales = _chunkNKMWW3RScjs.getInvalidLocales.call(void 0,
|
|
318
332
|
params.models,
|
|
319
333
|
params.sourceLocale,
|
|
320
334
|
params.targetLocales
|
|
@@ -333,7 +347,7 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
|
333
347
|
}
|
|
334
348
|
}
|
|
335
349
|
}
|
|
336
|
-
|
|
350
|
+
_chunkNKMWW3RScjs.LCPCache.ensureDictionaryFile({
|
|
337
351
|
sourceRoot: params.sourceRoot,
|
|
338
352
|
lingoDir: params.lingoDir
|
|
339
353
|
});
|
|
@@ -341,9 +355,9 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
|
341
355
|
sendBuildEvent("unplugin", params, isDev);
|
|
342
356
|
return {
|
|
343
357
|
name: package_default.name,
|
|
344
|
-
loadInclude: (id) => !!id.match(
|
|
358
|
+
loadInclude: (id) => !!id.match(_chunkNKMWW3RScjs.LCP_DICTIONARY_FILE_NAME),
|
|
345
359
|
async load(id) {
|
|
346
|
-
const dictionary = await
|
|
360
|
+
const dictionary = await _chunkNKMWW3RScjs.loadDictionary.call(void 0, {
|
|
347
361
|
resourcePath: id,
|
|
348
362
|
resourceQuery: "",
|
|
349
363
|
params: {
|
|
@@ -367,7 +381,7 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
|
367
381
|
enforce: "pre",
|
|
368
382
|
transform(code, id) {
|
|
369
383
|
try {
|
|
370
|
-
const result =
|
|
384
|
+
const result = _chunkNKMWW3RScjs.transformComponent.call(void 0, {
|
|
371
385
|
code,
|
|
372
386
|
params,
|
|
373
387
|
resourcePath: id,
|
|
@@ -409,7 +423,7 @@ var index_default = {
|
|
|
409
423
|
next: (compilerParams) => (nextConfig = {}) => {
|
|
410
424
|
const mergedParams = _lodash2.default.merge(
|
|
411
425
|
{},
|
|
412
|
-
|
|
426
|
+
_chunkNKMWW3RScjs.defaultParams,
|
|
413
427
|
{
|
|
414
428
|
rsc: true,
|
|
415
429
|
turbopack: {
|
|
@@ -460,7 +474,7 @@ var index_default = {
|
|
|
460
474
|
turbopackConfigPath.rules ??= {};
|
|
461
475
|
const rules = turbopackConfigPath.rules;
|
|
462
476
|
const lingoGlob = `**/*.{ts,tsx,js,jsx}`;
|
|
463
|
-
const lingoLoaderPath =
|
|
477
|
+
const lingoLoaderPath = _chunkO75UYLMXcjs.__require.resolve("./lingo-turbopack-loader.cjs");
|
|
464
478
|
rules[lingoGlob] = {
|
|
465
479
|
loaders: [
|
|
466
480
|
{
|
|
@@ -520,7 +534,7 @@ var index_default = {
|
|
|
520
534
|
vite: (compilerParams) => (config) => {
|
|
521
535
|
const mergedParams = _lodash2.default.merge(
|
|
522
536
|
{},
|
|
523
|
-
|
|
537
|
+
_chunkNKMWW3RScjs.defaultParams,
|
|
524
538
|
{ rsc: false },
|
|
525
539
|
compilerParams
|
|
526
540
|
);
|
|
@@ -534,7 +548,7 @@ var index_default = {
|
|
|
534
548
|
};
|
|
535
549
|
function getConfiguredProviders(models) {
|
|
536
550
|
return _lodash2.default.chain(Object.values(models)).map((modelString) => modelString.split(":")[0]).filter(Boolean).uniq().filter(
|
|
537
|
-
(providerId) =>
|
|
551
|
+
(providerId) => _chunkNKMWW3RScjs.providerDetails.hasOwnProperty(providerId) && keyCheckers.hasOwnProperty(providerId)
|
|
538
552
|
).value();
|
|
539
553
|
}
|
|
540
554
|
function validateLLMKeyDetails(configuredProviders) {
|
|
@@ -545,7 +559,7 @@ function validateLLMKeyDetails(configuredProviders) {
|
|
|
545
559
|
const missingProviders = [];
|
|
546
560
|
const foundProviders = [];
|
|
547
561
|
for (const providerId of configuredProviders) {
|
|
548
|
-
const details =
|
|
562
|
+
const details = _chunkNKMWW3RScjs.providerDetails[providerId];
|
|
549
563
|
const checkers = keyCheckers[providerId];
|
|
550
564
|
if (!details || !checkers) continue;
|
|
551
565
|
const foundInEnv = !!checkers.checkEnv();
|
package/build/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
loadDictionary,
|
|
17
17
|
providerDetails,
|
|
18
18
|
transformComponent
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OAQHCRD4.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__require
|
|
22
22
|
} from "./chunk-6BWS3CLP.mjs";
|
|
@@ -27,7 +27,7 @@ import { createUnplugin } from "unplugin";
|
|
|
27
27
|
// package.json
|
|
28
28
|
var package_default = {
|
|
29
29
|
name: "@lingo.dev/_compiler",
|
|
30
|
-
version: "0.8.
|
|
30
|
+
version: "0.8.10",
|
|
31
31
|
description: "Lingo.dev Compiler",
|
|
32
32
|
private: false,
|
|
33
33
|
repository: {
|
|
@@ -115,7 +115,17 @@ import * as machineIdLib from "node-machine-id";
|
|
|
115
115
|
|
|
116
116
|
// src/utils/repository-id.ts
|
|
117
117
|
import { execSync } from "child_process";
|
|
118
|
+
import { createHash } from "crypto";
|
|
118
119
|
var cachedGitRepoId = void 0;
|
|
120
|
+
function hashProjectName(fullPath) {
|
|
121
|
+
const parts = fullPath.split("/");
|
|
122
|
+
if (parts.length !== 2) {
|
|
123
|
+
return createHash("sha256").update(fullPath).digest("hex").slice(0, 8);
|
|
124
|
+
}
|
|
125
|
+
const [org, project] = parts;
|
|
126
|
+
const hashedProject = createHash("sha256").update(project).digest("hex").slice(0, 8);
|
|
127
|
+
return `${org}/${hashedProject}`;
|
|
128
|
+
}
|
|
119
129
|
function getRepositoryId() {
|
|
120
130
|
const ciRepoId = getCIRepositoryId();
|
|
121
131
|
if (ciRepoId) return ciRepoId;
|
|
@@ -125,13 +135,16 @@ function getRepositoryId() {
|
|
|
125
135
|
}
|
|
126
136
|
function getCIRepositoryId() {
|
|
127
137
|
if (process.env.GITHUB_REPOSITORY) {
|
|
128
|
-
|
|
138
|
+
const hashed = hashProjectName(process.env.GITHUB_REPOSITORY);
|
|
139
|
+
return `github:${hashed}`;
|
|
129
140
|
}
|
|
130
141
|
if (process.env.CI_PROJECT_PATH) {
|
|
131
|
-
|
|
142
|
+
const hashed = hashProjectName(process.env.CI_PROJECT_PATH);
|
|
143
|
+
return `gitlab:${hashed}`;
|
|
132
144
|
}
|
|
133
145
|
if (process.env.BITBUCKET_REPO_FULL_NAME) {
|
|
134
|
-
|
|
146
|
+
const hashed = hashProjectName(process.env.BITBUCKET_REPO_FULL_NAME);
|
|
147
|
+
return `bitbucket:${hashed}`;
|
|
135
148
|
}
|
|
136
149
|
return null;
|
|
137
150
|
}
|
|
@@ -169,10 +182,11 @@ function parseGitUrl(url) {
|
|
|
169
182
|
const httpsMatch = cleanUrl.match(/\/([^/]+\/[^/]+)$/);
|
|
170
183
|
const repoPath = sshMatch?.[1] || httpsMatch?.[1];
|
|
171
184
|
if (!repoPath) return null;
|
|
185
|
+
const hashedPath = hashProjectName(repoPath);
|
|
172
186
|
if (platform) {
|
|
173
|
-
return `${platform}:${
|
|
187
|
+
return `${platform}:${hashedPath}`;
|
|
174
188
|
}
|
|
175
|
-
return `git:${
|
|
189
|
+
return `git:${hashedPath}`;
|
|
176
190
|
}
|
|
177
191
|
|
|
178
192
|
// src/utils/observability.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkNKMWW3RScjs = require('./chunk-NKMWW3RS.cjs');
|
|
5
|
+
require('./chunk-O75UYLMX.cjs');
|
|
6
6
|
|
|
7
7
|
// src/lingo-turbopack-loader.ts
|
|
8
8
|
async function lingo_turbopack_loader_default(source) {
|
|
@@ -10,7 +10,7 @@ async function lingo_turbopack_loader_default(source) {
|
|
|
10
10
|
const params = this.getOptions();
|
|
11
11
|
const isDev = process.env.NODE_ENV !== "production";
|
|
12
12
|
try {
|
|
13
|
-
const dictionary = await
|
|
13
|
+
const dictionary = await _chunkNKMWW3RScjs.loadDictionary.call(void 0, {
|
|
14
14
|
resourcePath: this.resourcePath,
|
|
15
15
|
resourceQuery: this.resourceQuery,
|
|
16
16
|
params,
|
|
@@ -22,7 +22,7 @@ async function lingo_turbopack_loader_default(source) {
|
|
|
22
22
|
const code = `export default ${JSON.stringify(dictionary, null, 2)};`;
|
|
23
23
|
return callback(null, code);
|
|
24
24
|
}
|
|
25
|
-
const result =
|
|
25
|
+
const result = _chunkNKMWW3RScjs.transformComponent.call(void 0, {
|
|
26
26
|
code: source,
|
|
27
27
|
params,
|
|
28
28
|
resourcePath: this.resourcePath,
|