@lingo.dev/_compiler 0.7.5 → 0.7.6

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.
@@ -403,6 +403,20 @@ function getJsxAttributeValue(nodePath, attributeName) {
403
403
  }
404
404
  return extractAttributeValue(attribute);
405
405
  }
406
+ function setJsxAttributeValue(nodePath, attributeName, value) {
407
+ const attributes = nodePath.node.openingElement.attributes;
408
+ const attributeIndex = _3.findIndex(
409
+ attributes,
410
+ (attr) => attr.type === "JSXAttribute" && attr.name.type === "JSXIdentifier" && attr.name.name === attributeName
411
+ );
412
+ const jsxValue = createAttributeValue(value);
413
+ const jsxAttribute7 = t.jsxAttribute(t.jsxIdentifier(attributeName), jsxValue);
414
+ if (attributeIndex >= 0) {
415
+ attributes[attributeIndex] = jsxAttribute7;
416
+ } else {
417
+ attributes.push(jsxAttribute7);
418
+ }
419
+ }
406
420
  function extractAttributeValue(attribute) {
407
421
  if (!attribute.value) {
408
422
  return true;
@@ -424,6 +438,24 @@ function extractAttributeValue(attribute) {
424
438
  }
425
439
  return null;
426
440
  }
441
+ function createAttributeValue(value) {
442
+ if (value === null || value === void 0) {
443
+ return null;
444
+ }
445
+ if (typeof value === "string") {
446
+ return t.stringLiteral(value);
447
+ }
448
+ if (typeof value === "boolean") {
449
+ return t.jsxExpressionContainer(t.booleanLiteral(value));
450
+ }
451
+ if (typeof value === "number") {
452
+ return t.jsxExpressionContainer(t.numericLiteral(value));
453
+ }
454
+ if (t.isExpression(value)) {
455
+ return t.jsxExpressionContainer(value);
456
+ }
457
+ return t.jsxExpressionContainer(t.stringLiteral(JSON.stringify(value)));
458
+ }
427
459
 
428
460
  // src/utils/index.ts
429
461
  function getJsxRoots(node) {
@@ -877,26 +909,18 @@ var lingoJsxAttributeScopeInjectMutation = createCodeMutation(
877
909
  jsxScope.node.openingElement.attributes.push(
878
910
  t10.jsxAttribute(t10.jsxIdentifier("$attrAs"), as)
879
911
  );
880
- jsxScope.node.openingElement.attributes.push(
881
- t10.jsxAttribute(
882
- t10.jsxIdentifier("$fileKey"),
883
- t10.stringLiteral(payload.relativeFilePath)
884
- )
885
- );
886
- jsxScope.node.openingElement.attributes.push(
887
- t10.jsxAttribute(
888
- t10.jsxIdentifier("$attributes"),
889
- t10.jsxExpressionContainer(
890
- t10.objectExpression(
891
- attributes.map((attributeDefinition) => {
892
- const [attribute, key = ""] = attributeDefinition.split(":");
893
- return t10.objectProperty(
894
- t10.stringLiteral(attribute),
895
- t10.stringLiteral(key)
896
- );
897
- })
898
- )
899
- )
912
+ setJsxAttributeValue(jsxScope, "$fileKey", payload.relativeFilePath);
913
+ setJsxAttributeValue(
914
+ jsxScope,
915
+ "$attributes",
916
+ t10.objectExpression(
917
+ attributes.map((attributeDefinition) => {
918
+ const [attribute, key = ""] = attributeDefinition.split(":");
919
+ return t10.objectProperty(
920
+ t10.stringLiteral(attribute),
921
+ t10.stringLiteral(key)
922
+ );
923
+ })
900
924
  )
901
925
  );
902
926
  if (mode === "server") {
@@ -904,18 +928,14 @@ var lingoJsxAttributeScopeInjectMutation = createCodeMutation(
904
928
  exportedName: "loadDictionary",
905
929
  moduleName: ModuleId.ReactRSC
906
930
  });
907
- jsxScope.node.openingElement.attributes.push(
908
- t10.jsxAttribute(
909
- t10.jsxIdentifier("$loadDictionary"),
910
- t10.jsxExpressionContainer(
911
- t10.arrowFunctionExpression(
912
- [t10.identifier("locale")],
913
- t10.callExpression(
914
- t10.identifier(loadDictionaryImport.importedName),
915
- [t10.identifier("locale")]
916
- )
917
- )
918
- )
931
+ setJsxAttributeValue(
932
+ jsxScope,
933
+ "$loadDictionary",
934
+ t10.arrowFunctionExpression(
935
+ [t10.identifier("locale")],
936
+ t10.callExpression(t10.identifier(loadDictionaryImport.importedName), [
937
+ t10.identifier("locale")
938
+ ])
919
939
  )
920
940
  );
921
941
  }
@@ -1505,91 +1525,64 @@ var lingoJsxScopeInjectMutation = createCodeMutation((payload) => {
1505
1525
  if (!originalJsxElementName) {
1506
1526
  continue;
1507
1527
  }
1508
- const originalAttributes = jsxScope.node.openingElement.attributes.slice();
1509
- const as = /^[A-Z]/.test(originalJsxElementName) ? t21.jsxExpressionContainer(t21.identifier(originalJsxElementName)) : t21.stringLiteral(originalJsxElementName);
1510
- originalAttributes.push(t21.jsxAttribute(t21.jsxIdentifier("$as"), as));
1511
- originalAttributes.push(
1512
- t21.jsxAttribute(
1513
- t21.jsxIdentifier("$fileKey"),
1514
- t21.stringLiteral(payload.relativeFilePath)
1515
- )
1528
+ const newNode = t21.jsxElement(
1529
+ t21.jsxOpeningElement(
1530
+ t21.jsxIdentifier(lingoComponentImport.importedName),
1531
+ jsxScope.node.openingElement.attributes.slice(),
1532
+ // original attributes
1533
+ true
1534
+ // selfClosing
1535
+ ),
1536
+ null,
1537
+ // no closing element
1538
+ [],
1539
+ // no children
1540
+ true
1541
+ // selfClosing
1516
1542
  );
1517
- originalAttributes.push(
1518
- t21.jsxAttribute(
1519
- t21.jsxIdentifier("$entryKey"),
1520
- t21.stringLiteral(getJsxScopeAttribute(jsxScope))
1521
- )
1543
+ const newNodePath = {
1544
+ node: newNode
1545
+ };
1546
+ const as = /^[A-Z]/.test(originalJsxElementName) ? t21.identifier(originalJsxElementName) : originalJsxElementName;
1547
+ setJsxAttributeValue(newNodePath, "$as", as);
1548
+ setJsxAttributeValue(newNodePath, "$fileKey", payload.relativeFilePath);
1549
+ setJsxAttributeValue(
1550
+ newNodePath,
1551
+ "$entryKey",
1552
+ getJsxScopeAttribute(jsxScope)
1522
1553
  );
1523
1554
  const $variables = getJsxVariables(jsxScope);
1524
1555
  if ($variables.properties.length > 0) {
1525
- originalAttributes.push(
1526
- t21.jsxAttribute(
1527
- t21.jsxIdentifier("$variables"),
1528
- t21.jsxExpressionContainer($variables)
1529
- )
1530
- );
1556
+ setJsxAttributeValue(newNodePath, "$variables", $variables);
1531
1557
  }
1532
1558
  const $elements = getNestedJsxElements(jsxScope);
1533
1559
  if ($elements.elements.length > 0) {
1534
- originalAttributes.push(
1535
- t21.jsxAttribute(
1536
- t21.jsxIdentifier("$elements"),
1537
- t21.jsxExpressionContainer($elements)
1538
- )
1539
- );
1560
+ setJsxAttributeValue(newNodePath, "$elements", $elements);
1540
1561
  }
1541
1562
  const $functions = getJsxFunctions(jsxScope);
1542
1563
  if ($functions.properties.length > 0) {
1543
- originalAttributes.push(
1544
- t21.jsxAttribute(
1545
- t21.jsxIdentifier("$functions"),
1546
- t21.jsxExpressionContainer($functions)
1547
- )
1548
- );
1564
+ setJsxAttributeValue(newNodePath, "$functions", $functions);
1549
1565
  }
1550
1566
  const $expressions = getJsxExpressions(jsxScope);
1551
1567
  if ($expressions.elements.length > 0) {
1552
- originalAttributes.push(
1553
- t21.jsxAttribute(
1554
- t21.jsxIdentifier("$expressions"),
1555
- t21.jsxExpressionContainer($expressions)
1556
- )
1557
- );
1568
+ setJsxAttributeValue(newNodePath, "$expressions", $expressions);
1558
1569
  }
1559
1570
  if (mode === "server") {
1560
1571
  const loadDictionaryImport = getOrCreateImport(payload.ast, {
1561
1572
  exportedName: "loadDictionary",
1562
1573
  moduleName: ModuleId.ReactRSC
1563
1574
  });
1564
- originalAttributes.push(
1565
- t21.jsxAttribute(
1566
- t21.jsxIdentifier("$loadDictionary"),
1567
- t21.jsxExpressionContainer(
1568
- t21.arrowFunctionExpression(
1569
- [t21.identifier("locale")],
1570
- t21.callExpression(
1571
- t21.identifier(loadDictionaryImport.importedName),
1572
- [t21.identifier("locale")]
1573
- )
1574
- )
1575
- )
1575
+ setJsxAttributeValue(
1576
+ newNodePath,
1577
+ "$loadDictionary",
1578
+ t21.arrowFunctionExpression(
1579
+ [t21.identifier("locale")],
1580
+ t21.callExpression(t21.identifier(loadDictionaryImport.importedName), [
1581
+ t21.identifier("locale")
1582
+ ])
1576
1583
  )
1577
1584
  );
1578
1585
  }
1579
- const newNode = t21.jsxElement(
1580
- t21.jsxOpeningElement(
1581
- t21.jsxIdentifier(lingoComponentImport.importedName),
1582
- originalAttributes,
1583
- true
1584
- // selfClosing
1585
- ),
1586
- null,
1587
- // no closing element
1588
- [],
1589
- // no children
1590
- true
1591
- // selfClosing
1592
- );
1593
1586
  jsxScope.replaceWith(newNode);
1594
1587
  }
1595
1588
  return payload;
@@ -403,6 +403,20 @@ function getJsxAttributeValue(nodePath, attributeName) {
403
403
  }
404
404
  return extractAttributeValue(attribute);
405
405
  }
406
+ function setJsxAttributeValue(nodePath, attributeName, value) {
407
+ const attributes = nodePath.node.openingElement.attributes;
408
+ const attributeIndex = _lodash2.default.findIndex(
409
+ attributes,
410
+ (attr) => attr.type === "JSXAttribute" && attr.name.type === "JSXIdentifier" && attr.name.name === attributeName
411
+ );
412
+ const jsxValue = createAttributeValue(value);
413
+ const jsxAttribute7 = t.jsxAttribute(t.jsxIdentifier(attributeName), jsxValue);
414
+ if (attributeIndex >= 0) {
415
+ attributes[attributeIndex] = jsxAttribute7;
416
+ } else {
417
+ attributes.push(jsxAttribute7);
418
+ }
419
+ }
406
420
  function extractAttributeValue(attribute) {
407
421
  if (!attribute.value) {
408
422
  return true;
@@ -424,6 +438,24 @@ function extractAttributeValue(attribute) {
424
438
  }
425
439
  return null;
426
440
  }
441
+ function createAttributeValue(value) {
442
+ if (value === null || value === void 0) {
443
+ return null;
444
+ }
445
+ if (typeof value === "string") {
446
+ return t.stringLiteral(value);
447
+ }
448
+ if (typeof value === "boolean") {
449
+ return t.jsxExpressionContainer(t.booleanLiteral(value));
450
+ }
451
+ if (typeof value === "number") {
452
+ return t.jsxExpressionContainer(t.numericLiteral(value));
453
+ }
454
+ if (t.isExpression(value)) {
455
+ return t.jsxExpressionContainer(value);
456
+ }
457
+ return t.jsxExpressionContainer(t.stringLiteral(JSON.stringify(value)));
458
+ }
427
459
 
428
460
  // src/utils/index.ts
429
461
  function getJsxRoots(node) {
@@ -877,26 +909,18 @@ var lingoJsxAttributeScopeInjectMutation = createCodeMutation(
877
909
  jsxScope.node.openingElement.attributes.push(
878
910
  t10.jsxAttribute(t10.jsxIdentifier("$attrAs"), as)
879
911
  );
880
- jsxScope.node.openingElement.attributes.push(
881
- t10.jsxAttribute(
882
- t10.jsxIdentifier("$fileKey"),
883
- t10.stringLiteral(payload.relativeFilePath)
884
- )
885
- );
886
- jsxScope.node.openingElement.attributes.push(
887
- t10.jsxAttribute(
888
- t10.jsxIdentifier("$attributes"),
889
- t10.jsxExpressionContainer(
890
- t10.objectExpression(
891
- attributes.map((attributeDefinition) => {
892
- const [attribute, key = ""] = attributeDefinition.split(":");
893
- return t10.objectProperty(
894
- t10.stringLiteral(attribute),
895
- t10.stringLiteral(key)
896
- );
897
- })
898
- )
899
- )
912
+ setJsxAttributeValue(jsxScope, "$fileKey", payload.relativeFilePath);
913
+ setJsxAttributeValue(
914
+ jsxScope,
915
+ "$attributes",
916
+ t10.objectExpression(
917
+ attributes.map((attributeDefinition) => {
918
+ const [attribute, key = ""] = attributeDefinition.split(":");
919
+ return t10.objectProperty(
920
+ t10.stringLiteral(attribute),
921
+ t10.stringLiteral(key)
922
+ );
923
+ })
900
924
  )
901
925
  );
902
926
  if (mode === "server") {
@@ -904,18 +928,14 @@ var lingoJsxAttributeScopeInjectMutation = createCodeMutation(
904
928
  exportedName: "loadDictionary",
905
929
  moduleName: ModuleId.ReactRSC
906
930
  });
907
- jsxScope.node.openingElement.attributes.push(
908
- t10.jsxAttribute(
909
- t10.jsxIdentifier("$loadDictionary"),
910
- t10.jsxExpressionContainer(
911
- t10.arrowFunctionExpression(
912
- [t10.identifier("locale")],
913
- t10.callExpression(
914
- t10.identifier(loadDictionaryImport.importedName),
915
- [t10.identifier("locale")]
916
- )
917
- )
918
- )
931
+ setJsxAttributeValue(
932
+ jsxScope,
933
+ "$loadDictionary",
934
+ t10.arrowFunctionExpression(
935
+ [t10.identifier("locale")],
936
+ t10.callExpression(t10.identifier(loadDictionaryImport.importedName), [
937
+ t10.identifier("locale")
938
+ ])
919
939
  )
920
940
  );
921
941
  }
@@ -1505,91 +1525,64 @@ var lingoJsxScopeInjectMutation = createCodeMutation((payload) => {
1505
1525
  if (!originalJsxElementName) {
1506
1526
  continue;
1507
1527
  }
1508
- const originalAttributes = jsxScope.node.openingElement.attributes.slice();
1509
- const as = /^[A-Z]/.test(originalJsxElementName) ? t21.jsxExpressionContainer(t21.identifier(originalJsxElementName)) : t21.stringLiteral(originalJsxElementName);
1510
- originalAttributes.push(t21.jsxAttribute(t21.jsxIdentifier("$as"), as));
1511
- originalAttributes.push(
1512
- t21.jsxAttribute(
1513
- t21.jsxIdentifier("$fileKey"),
1514
- t21.stringLiteral(payload.relativeFilePath)
1515
- )
1528
+ const newNode = t21.jsxElement(
1529
+ t21.jsxOpeningElement(
1530
+ t21.jsxIdentifier(lingoComponentImport.importedName),
1531
+ jsxScope.node.openingElement.attributes.slice(),
1532
+ // original attributes
1533
+ true
1534
+ // selfClosing
1535
+ ),
1536
+ null,
1537
+ // no closing element
1538
+ [],
1539
+ // no children
1540
+ true
1541
+ // selfClosing
1516
1542
  );
1517
- originalAttributes.push(
1518
- t21.jsxAttribute(
1519
- t21.jsxIdentifier("$entryKey"),
1520
- t21.stringLiteral(getJsxScopeAttribute(jsxScope))
1521
- )
1543
+ const newNodePath = {
1544
+ node: newNode
1545
+ };
1546
+ const as = /^[A-Z]/.test(originalJsxElementName) ? t21.identifier(originalJsxElementName) : originalJsxElementName;
1547
+ setJsxAttributeValue(newNodePath, "$as", as);
1548
+ setJsxAttributeValue(newNodePath, "$fileKey", payload.relativeFilePath);
1549
+ setJsxAttributeValue(
1550
+ newNodePath,
1551
+ "$entryKey",
1552
+ getJsxScopeAttribute(jsxScope)
1522
1553
  );
1523
1554
  const $variables = getJsxVariables(jsxScope);
1524
1555
  if ($variables.properties.length > 0) {
1525
- originalAttributes.push(
1526
- t21.jsxAttribute(
1527
- t21.jsxIdentifier("$variables"),
1528
- t21.jsxExpressionContainer($variables)
1529
- )
1530
- );
1556
+ setJsxAttributeValue(newNodePath, "$variables", $variables);
1531
1557
  }
1532
1558
  const $elements = getNestedJsxElements(jsxScope);
1533
1559
  if ($elements.elements.length > 0) {
1534
- originalAttributes.push(
1535
- t21.jsxAttribute(
1536
- t21.jsxIdentifier("$elements"),
1537
- t21.jsxExpressionContainer($elements)
1538
- )
1539
- );
1560
+ setJsxAttributeValue(newNodePath, "$elements", $elements);
1540
1561
  }
1541
1562
  const $functions = getJsxFunctions(jsxScope);
1542
1563
  if ($functions.properties.length > 0) {
1543
- originalAttributes.push(
1544
- t21.jsxAttribute(
1545
- t21.jsxIdentifier("$functions"),
1546
- t21.jsxExpressionContainer($functions)
1547
- )
1548
- );
1564
+ setJsxAttributeValue(newNodePath, "$functions", $functions);
1549
1565
  }
1550
1566
  const $expressions = getJsxExpressions(jsxScope);
1551
1567
  if ($expressions.elements.length > 0) {
1552
- originalAttributes.push(
1553
- t21.jsxAttribute(
1554
- t21.jsxIdentifier("$expressions"),
1555
- t21.jsxExpressionContainer($expressions)
1556
- )
1557
- );
1568
+ setJsxAttributeValue(newNodePath, "$expressions", $expressions);
1558
1569
  }
1559
1570
  if (mode === "server") {
1560
1571
  const loadDictionaryImport = getOrCreateImport(payload.ast, {
1561
1572
  exportedName: "loadDictionary",
1562
1573
  moduleName: ModuleId.ReactRSC
1563
1574
  });
1564
- originalAttributes.push(
1565
- t21.jsxAttribute(
1566
- t21.jsxIdentifier("$loadDictionary"),
1567
- t21.jsxExpressionContainer(
1568
- t21.arrowFunctionExpression(
1569
- [t21.identifier("locale")],
1570
- t21.callExpression(
1571
- t21.identifier(loadDictionaryImport.importedName),
1572
- [t21.identifier("locale")]
1573
- )
1574
- )
1575
- )
1575
+ setJsxAttributeValue(
1576
+ newNodePath,
1577
+ "$loadDictionary",
1578
+ t21.arrowFunctionExpression(
1579
+ [t21.identifier("locale")],
1580
+ t21.callExpression(t21.identifier(loadDictionaryImport.importedName), [
1581
+ t21.identifier("locale")
1582
+ ])
1576
1583
  )
1577
1584
  );
1578
1585
  }
1579
- const newNode = t21.jsxElement(
1580
- t21.jsxOpeningElement(
1581
- t21.jsxIdentifier(lingoComponentImport.importedName),
1582
- originalAttributes,
1583
- true
1584
- // selfClosing
1585
- ),
1586
- null,
1587
- // no closing element
1588
- [],
1589
- // no children
1590
- true
1591
- // selfClosing
1592
- );
1593
1586
  jsxScope.replaceWith(newNode);
1594
1587
  }
1595
1588
  return payload;
package/build/index.cjs CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
 
19
19
 
20
- var _chunkTMJ2TCIWcjs = require('./chunk-TMJ2TCIW.cjs');
20
+ var _chunkBX6IK562cjs = require('./chunk-BX6IK562.cjs');
21
21
 
22
22
  // src/index.ts
23
23
  var _unplugin = require('unplugin');
@@ -25,7 +25,7 @@ var _unplugin = require('unplugin');
25
25
  // package.json
26
26
  var package_default = {
27
27
  name: "@lingo.dev/_compiler",
28
- version: "0.7.5",
28
+ version: "0.7.6",
29
29
  description: "Lingo.dev Compiler",
30
30
  private: false,
31
31
  publishConfig: {
@@ -132,7 +132,7 @@ async function trackEvent(event, properties) {
132
132
  }
133
133
  }
134
134
  async function getActualId() {
135
- const rc = _chunkTMJ2TCIWcjs.getRc.call(void 0, );
135
+ const rc = _chunkBX6IK562cjs.getRc.call(void 0, );
136
136
  const apiKey = process.env.LINGODOTDEV_API_KEY || _optionalChain([rc, 'optionalAccess', _3 => _3.auth, 'optionalAccess', _4 => _4.apiKey]);
137
137
  const apiUrl = process.env.LINGODOTDEV_API_URL || _optionalChain([rc, 'optionalAccess', _5 => _5.auth, 'optionalAccess', _6 => _6.apiUrl]) || "https://engine.lingo.dev";
138
138
  if (apiKey) {
@@ -160,20 +160,20 @@ async function getActualId() {
160
160
  // src/index.ts
161
161
  var keyCheckers = {
162
162
  groq: {
163
- checkEnv: _chunkTMJ2TCIWcjs.getGroqKeyFromEnv,
164
- checkRc: _chunkTMJ2TCIWcjs.getGroqKeyFromRc
163
+ checkEnv: _chunkBX6IK562cjs.getGroqKeyFromEnv,
164
+ checkRc: _chunkBX6IK562cjs.getGroqKeyFromRc
165
165
  },
166
166
  google: {
167
- checkEnv: _chunkTMJ2TCIWcjs.getGoogleKeyFromEnv,
168
- checkRc: _chunkTMJ2TCIWcjs.getGoogleKeyFromRc
167
+ checkEnv: _chunkBX6IK562cjs.getGoogleKeyFromEnv,
168
+ checkRc: _chunkBX6IK562cjs.getGoogleKeyFromRc
169
169
  },
170
170
  mistral: {
171
- checkEnv: _chunkTMJ2TCIWcjs.getMistralKeyFromEnv,
172
- checkRc: _chunkTMJ2TCIWcjs.getMistralKeyFromRc
171
+ checkEnv: _chunkBX6IK562cjs.getMistralKeyFromEnv,
172
+ checkRc: _chunkBX6IK562cjs.getMistralKeyFromRc
173
173
  },
174
174
  "lingo.dev": {
175
- checkEnv: _chunkTMJ2TCIWcjs.getLingoDotDevKeyFromEnv,
176
- checkRc: _chunkTMJ2TCIWcjs.getLingoDotDevKeyFromRc
175
+ checkEnv: _chunkBX6IK562cjs.getLingoDotDevKeyFromEnv,
176
+ checkRc: _chunkBX6IK562cjs.getLingoDotDevKeyFromRc
177
177
  }
178
178
  };
179
179
  var alreadySentBuildEvent = { value: false };
@@ -189,14 +189,14 @@ function sendBuildEvent(framework, config, isDev) {
189
189
  var unplugin = _unplugin.createUnplugin.call(void 0,
190
190
  (_params, _meta) => {
191
191
  console.log("\u2139\uFE0F Starting Lingo.dev compiler...");
192
- const params = _lodash2.default.defaults(_params, _chunkTMJ2TCIWcjs.defaultParams);
193
- if (!_chunkTMJ2TCIWcjs.isRunningInCIOrDocker.call(void 0, )) {
192
+ const params = _lodash2.default.defaults(_params, _chunkBX6IK562cjs.defaultParams);
193
+ if (!_chunkBX6IK562cjs.isRunningInCIOrDocker.call(void 0, )) {
194
194
  if (params.models === "lingo.dev") {
195
195
  validateLLMKeyDetails(["lingo.dev"]);
196
196
  } else {
197
197
  const configuredProviders = getConfiguredProviders(params.models);
198
198
  validateLLMKeyDetails(configuredProviders);
199
- const invalidLocales = _chunkTMJ2TCIWcjs.getInvalidLocales.call(void 0,
199
+ const invalidLocales = _chunkBX6IK562cjs.getInvalidLocales.call(void 0,
200
200
  params.models,
201
201
  params.sourceLocale,
202
202
  params.targetLocales
@@ -219,7 +219,7 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
219
219
  }
220
220
  }
221
221
  }
222
- _chunkTMJ2TCIWcjs.LCPCache.ensureDictionaryFile({
222
+ _chunkBX6IK562cjs.LCPCache.ensureDictionaryFile({
223
223
  sourceRoot: params.sourceRoot,
224
224
  lingoDir: params.lingoDir
225
225
  });
@@ -227,9 +227,9 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
227
227
  sendBuildEvent("unplugin", params, isDev);
228
228
  return {
229
229
  name: package_default.name,
230
- loadInclude: (id) => !!id.match(_chunkTMJ2TCIWcjs.LCP_DICTIONARY_FILE_NAME),
230
+ loadInclude: (id) => !!id.match(_chunkBX6IK562cjs.LCP_DICTIONARY_FILE_NAME),
231
231
  async load(id) {
232
- const dictionary = await _chunkTMJ2TCIWcjs.loadDictionary.call(void 0, {
232
+ const dictionary = await _chunkBX6IK562cjs.loadDictionary.call(void 0, {
233
233
  resourcePath: id,
234
234
  resourceQuery: "",
235
235
  params: {
@@ -253,7 +253,7 @@ var unplugin = _unplugin.createUnplugin.call(void 0,
253
253
  enforce: "pre",
254
254
  transform(code, id) {
255
255
  try {
256
- const result = _chunkTMJ2TCIWcjs.transformComponent.call(void 0, {
256
+ const result = _chunkBX6IK562cjs.transformComponent.call(void 0, {
257
257
  code,
258
258
  params,
259
259
  resourcePath: id,
@@ -295,7 +295,7 @@ var src_default = {
295
295
  next: (compilerParams) => (nextConfig = {}) => {
296
296
  const mergedParams = _lodash2.default.merge(
297
297
  {},
298
- _chunkTMJ2TCIWcjs.defaultParams,
298
+ _chunkBX6IK562cjs.defaultParams,
299
299
  {
300
300
  rsc: true,
301
301
  turbopack: {
@@ -346,7 +346,7 @@ var src_default = {
346
346
  turbopackConfigPath.rules ??= {};
347
347
  const rules = turbopackConfigPath.rules;
348
348
  const lingoGlob = `**/*.{ts,tsx,js,jsx}`;
349
- const lingoLoaderPath = _chunkTMJ2TCIWcjs.__require.resolve("./lingo-turbopack-loader.cjs");
349
+ const lingoLoaderPath = _chunkBX6IK562cjs.__require.resolve("./lingo-turbopack-loader.cjs");
350
350
  rules[lingoGlob] = {
351
351
  loaders: [
352
352
  {
@@ -406,7 +406,7 @@ var src_default = {
406
406
  vite: (compilerParams) => (config) => {
407
407
  const mergedParams = _lodash2.default.merge(
408
408
  {},
409
- _chunkTMJ2TCIWcjs.defaultParams,
409
+ _chunkBX6IK562cjs.defaultParams,
410
410
  { rsc: false },
411
411
  compilerParams
412
412
  );
@@ -420,7 +420,7 @@ var src_default = {
420
420
  };
421
421
  function getConfiguredProviders(models) {
422
422
  return _lodash2.default.chain(Object.values(models)).map((modelString) => modelString.split(":")[0]).filter(Boolean).uniq().filter(
423
- (providerId) => _chunkTMJ2TCIWcjs.providerDetails.hasOwnProperty(providerId) && keyCheckers.hasOwnProperty(providerId)
423
+ (providerId) => _chunkBX6IK562cjs.providerDetails.hasOwnProperty(providerId) && keyCheckers.hasOwnProperty(providerId)
424
424
  ).value();
425
425
  }
426
426
  function validateLLMKeyDetails(configuredProviders) {
@@ -431,7 +431,7 @@ function validateLLMKeyDetails(configuredProviders) {
431
431
  const missingProviders = [];
432
432
  const foundProviders = [];
433
433
  for (const providerId of configuredProviders) {
434
- const details = _chunkTMJ2TCIWcjs.providerDetails[providerId];
434
+ const details = _chunkBX6IK562cjs.providerDetails[providerId];
435
435
  const checkers = keyCheckers[providerId];
436
436
  if (!details || !checkers) continue;
437
437
  const foundInEnv = !!checkers.checkEnv();
package/build/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  loadDictionary,
18
18
  providerDetails,
19
19
  transformComponent
20
- } from "./chunk-ANLZ4QTT.mjs";
20
+ } from "./chunk-3ZKCOBSO.mjs";
21
21
 
22
22
  // src/index.ts
23
23
  import { createUnplugin } from "unplugin";
@@ -25,7 +25,7 @@ import { createUnplugin } from "unplugin";
25
25
  // package.json
26
26
  var package_default = {
27
27
  name: "@lingo.dev/_compiler",
28
- version: "0.7.5",
28
+ version: "0.7.6",
29
29
  description: "Lingo.dev Compiler",
30
30
  private: false,
31
31
  publishConfig: {
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkTMJ2TCIWcjs = require('./chunk-TMJ2TCIW.cjs');
4
+ var _chunkBX6IK562cjs = require('./chunk-BX6IK562.cjs');
5
5
 
6
6
  // src/lingo-turbopack-loader.ts
7
7
  async function lingo_turbopack_loader_default(source) {
@@ -9,7 +9,7 @@ async function lingo_turbopack_loader_default(source) {
9
9
  const params = this.getOptions();
10
10
  const isDev = process.env.NODE_ENV !== "production";
11
11
  try {
12
- const dictionary = await _chunkTMJ2TCIWcjs.loadDictionary.call(void 0, {
12
+ const dictionary = await _chunkBX6IK562cjs.loadDictionary.call(void 0, {
13
13
  resourcePath: this.resourcePath,
14
14
  resourceQuery: this.resourceQuery,
15
15
  params,
@@ -21,7 +21,7 @@ async function lingo_turbopack_loader_default(source) {
21
21
  const code = `export default ${JSON.stringify(dictionary, null, 2)};`;
22
22
  return callback(null, code);
23
23
  }
24
- const result = _chunkTMJ2TCIWcjs.transformComponent.call(void 0, {
24
+ const result = _chunkBX6IK562cjs.transformComponent.call(void 0, {
25
25
  code: source,
26
26
  params,
27
27
  resourcePath: this.resourcePath,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadDictionary,
3
3
  transformComponent
4
- } from "./chunk-ANLZ4QTT.mjs";
4
+ } from "./chunk-3ZKCOBSO.mjs";
5
5
 
6
6
  // src/lingo-turbopack-loader.ts
7
7
  async function lingo_turbopack_loader_default(source) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_compiler",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Lingo.dev Compiler",
5
5
  "private": false,
6
6
  "publishConfig": {