@lingo.dev/_compiler 0.1.5 → 0.1.7

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/index.cjs CHANGED
@@ -4,7 +4,7 @@ var _unplugin = require('unplugin');
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "@lingo.dev/_compiler",
7
- version: "0.1.5",
7
+ version: "0.1.7",
8
8
  description: "Lingo.dev Compiler",
9
9
  private: false,
10
10
  publishConfig: {
@@ -1513,12 +1513,15 @@ var LCPServer = (_class = class {
1513
1513
  const files = _lodash2.default.call(void 0, fileNames).map((fileName) => {
1514
1514
  const sourceFile = _lodash2.default.get(sourceDictionary.files, fileName);
1515
1515
  const targetFile = _lodash2.default.get(targetDictionary.files, fileName);
1516
- const entries = removeEmptyEntries ? _lodash2.default.pickBy(_optionalChain([sourceFile, 'optionalAccess', _38 => _38.entries]), (value) => _optionalChain([value, 'optionalAccess', _39 => _39.trim, 'call', _40 => _40(), 'optionalAccess', _41 => _41.length]) > 0) : _optionalChain([sourceFile, 'optionalAccess', _42 => _42.entries]);
1516
+ const entries = removeEmptyEntries ? _lodash2.default.pickBy(
1517
+ _optionalChain([sourceFile, 'optionalAccess', _38 => _38.entries]) || {},
1518
+ (value) => _optionalChain([String, 'call', _39 => _39(value || ""), 'optionalAccess', _40 => _40.trim, 'optionalCall', _41 => _41(), 'optionalAccess', _42 => _42.length]) > 0
1519
+ ) : _optionalChain([sourceFile, 'optionalAccess', _43 => _43.entries]) || {};
1517
1520
  return [
1518
1521
  fileName,
1519
1522
  {
1520
1523
  ...targetFile,
1521
- entries: _lodash2.default.merge(_optionalChain([targetFile, 'optionalAccess', _43 => _43.entries]), entries)
1524
+ entries: _lodash2.default.merge(_optionalChain([targetFile, 'optionalAccess', _44 => _44.entries]) || {}, entries)
1522
1525
  }
1523
1526
  ];
1524
1527
  }).fromPairs().value();
@@ -1710,7 +1713,7 @@ function jsxFragmentMutation(payload) {
1710
1713
  var jsxHtmlLangMutation = createCodeMutation((payload) => {
1711
1714
  _traverse2.default.call(void 0, payload.ast, {
1712
1715
  JSXElement: (path6) => {
1713
- if (_optionalChain([getJsxElementName, 'call', _44 => _44(path6), 'optionalAccess', _45 => _45.toLowerCase, 'call', _46 => _46()]) === "html") {
1716
+ if (_optionalChain([getJsxElementName, 'call', _45 => _45(path6), 'optionalAccess', _46 => _46.toLowerCase, 'call', _47 => _47()]) === "html") {
1714
1717
  const mode = getModuleExecutionMode(payload.ast, payload.params.rsc);
1715
1718
  const packagePath = mode === "client" ? "lingo.dev/react/client" /* ReactClient */ : "lingo.dev/react/rsc" /* ReactRSC */;
1716
1719
  const lingoHtmlComponentImport = getOrCreateImport(payload.ast, {
@@ -2397,7 +2400,7 @@ var src_default = {
2397
2400
  ...nextConfig,
2398
2401
  // what if we already have a webpack config?
2399
2402
  webpack: (config2, { isServer }) => {
2400
- config2.plugins.push(
2403
+ config2.plugins.unshift(
2401
2404
  unplugin.webpack(
2402
2405
  _lodash2.default.merge({}, defaultParams, { rsc: true }, compilerParams)
2403
2406
  )
@@ -2406,7 +2409,7 @@ var src_default = {
2406
2409
  }
2407
2410
  }),
2408
2411
  vite: (compilerParams) => (config2) => {
2409
- config2.plugins.push(
2412
+ config2.plugins.unshift(
2410
2413
  unplugin.vite(_lodash2.default.merge({}, defaultParams, { rsc: false }, compilerParams))
2411
2414
  );
2412
2415
  return config2;
package/build/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { createUnplugin } from "unplugin";
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "@lingo.dev/_compiler",
7
- version: "0.1.5",
7
+ version: "0.1.7",
8
8
  description: "Lingo.dev Compiler",
9
9
  private: false,
10
10
  publishConfig: {
@@ -1513,12 +1513,15 @@ var LCPServer = class {
1513
1513
  const files = _7(fileNames).map((fileName) => {
1514
1514
  const sourceFile = _7.get(sourceDictionary.files, fileName);
1515
1515
  const targetFile = _7.get(targetDictionary.files, fileName);
1516
- const entries = removeEmptyEntries ? _7.pickBy(sourceFile?.entries, (value) => value?.trim()?.length > 0) : sourceFile?.entries;
1516
+ const entries = removeEmptyEntries ? _7.pickBy(
1517
+ sourceFile?.entries || {},
1518
+ (value) => String(value || "")?.trim?.()?.length > 0
1519
+ ) : sourceFile?.entries || {};
1517
1520
  return [
1518
1521
  fileName,
1519
1522
  {
1520
1523
  ...targetFile,
1521
- entries: _7.merge(targetFile?.entries, entries)
1524
+ entries: _7.merge(targetFile?.entries || {}, entries)
1522
1525
  }
1523
1526
  ];
1524
1527
  }).fromPairs().value();
@@ -2397,7 +2400,7 @@ var src_default = {
2397
2400
  ...nextConfig,
2398
2401
  // what if we already have a webpack config?
2399
2402
  webpack: (config2, { isServer }) => {
2400
- config2.plugins.push(
2403
+ config2.plugins.unshift(
2401
2404
  unplugin.webpack(
2402
2405
  _11.merge({}, defaultParams, { rsc: true }, compilerParams)
2403
2406
  )
@@ -2406,7 +2409,7 @@ var src_default = {
2406
2409
  }
2407
2410
  }),
2408
2411
  vite: (compilerParams) => (config2) => {
2409
- config2.plugins.push(
2412
+ config2.plugins.unshift(
2410
2413
  unplugin.vite(_11.merge({}, defaultParams, { rsc: false }, compilerParams))
2411
2414
  );
2412
2415
  return config2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_compiler",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Lingo.dev Compiler",
5
5
  "private": false,
6
6
  "publishConfig": {