lynx-intlayer 9.0.0-canary.8 → 9.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"intlayerPolyfill.cjs","names":[],"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["/**\n * Applies necessary polyfills for Lynx to support Intlayer.\n *\n * This includes polyfilling `structuredClone` if missing,\n * and providing no-op implementations for standard DOM `window` methods\n * (`addEventListener`, `removeEventListener`, `postMessage`)\n * to ensure compatibility with libraries that expect a browser-like environment.\n */\nexport const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n }\n\n if (typeof window !== 'undefined') {\n if (typeof window.addEventListener !== 'function') {\n window.addEventListener = () => null;\n }\n if (typeof window.removeEventListener !== 'function') {\n window.removeEventListener = () => null;\n }\n if (typeof window.postMessage !== 'function') {\n window.postMessage = () => null;\n }\n }\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,yBAAyB;AACpC,KAAI,OAAO,OAAO,oBAAoB,WACpC,QAAO,mBAAmB,QAAQ,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC;AAGnE,KAAI,OAAO,WAAW,aAAa;AACjC,MAAI,OAAO,OAAO,qBAAqB,WACrC,QAAO,yBAAyB;AAElC,MAAI,OAAO,OAAO,wBAAwB,WACxC,QAAO,4BAA4B;AAErC,MAAI,OAAO,OAAO,gBAAgB,WAChC,QAAO,oBAAoB"}
1
+ {"version":3,"file":"intlayerPolyfill.cjs","names":[],"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["/**\n * Applies necessary polyfills for Lynx to support Intlayer.\n *\n * This includes polyfilling `structuredClone` if missing,\n * and providing no-op implementations for standard DOM `window` methods\n * (`addEventListener`, `removeEventListener`, `postMessage`)\n * to ensure compatibility with libraries that expect a browser-like environment.\n */\nexport const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n }\n\n if (typeof window !== 'undefined') {\n if (typeof window.addEventListener !== 'function') {\n window.addEventListener = () => null;\n }\n if (typeof window.removeEventListener !== 'function') {\n window.removeEventListener = () => null;\n }\n if (typeof window.postMessage !== 'function') {\n window.postMessage = () => null;\n }\n }\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,yBAAyB;CACpC,IAAI,OAAO,OAAO,oBAAoB,YACpC,OAAO,mBAAmB,QAAQ,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC;CAGlE,IAAI,OAAO,WAAW,aAAa;EACjC,IAAI,OAAO,OAAO,qBAAqB,YACrC,OAAO,yBAAyB;EAElC,IAAI,OAAO,OAAO,wBAAwB,YACxC,OAAO,4BAA4B;EAErC,IAAI,OAAO,OAAO,gBAAgB,YAChC,OAAO,oBAAoB;CAE/B;AACF"}
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let _intlayer_chokidar_build = require("@intlayer/chokidar/build");
3
- let _intlayer_chokidar_watcher = require("@intlayer/chokidar/watcher");
4
2
  let _intlayer_config_colors = require("@intlayer/config/colors");
5
3
  let _intlayer_config_envVars = require("@intlayer/config/envVars");
6
4
  let _intlayer_config_logger = require("@intlayer/config/logger");
7
5
  let _intlayer_config_node = require("@intlayer/config/node");
8
6
  let _intlayer_config_utils = require("@intlayer/config/utils");
9
7
  let _intlayer_dictionaries_entry = require("@intlayer/dictionaries-entry");
8
+ let _intlayer_engine_build = require("@intlayer/engine/build");
9
+ let _intlayer_engine_watcher = require("@intlayer/engine/watcher");
10
10
 
11
11
  //#region src/plugin/pluginIntlayerLynx.ts
12
12
  /**
@@ -34,8 +34,8 @@ const pluginIntlayerLynx = () => {
34
34
  name: "plugin-intlayer-lynx",
35
35
  async setup(api) {
36
36
  const configuration = (0, _intlayer_config_node.getConfiguration)();
37
- await (0, _intlayer_chokidar_build.prepareIntlayer)(configuration);
38
- if (configuration.content.watch) await (0, _intlayer_chokidar_watcher.watch)({ configuration });
37
+ await (0, _intlayer_engine_build.prepareIntlayer)(configuration);
38
+ if (configuration.content.watch) await (0, _intlayer_engine_watcher.watch)({ configuration });
39
39
  const isBuild = api.context.action === "build";
40
40
  let defineVars = {};
41
41
  if (isBuild) {
@@ -50,6 +50,7 @@ const pluginIntlayerLynx = () => {
50
50
  ].includes(key)).map((key) => (0, _intlayer_config_logger.colorize)(key, _intlayer_config_colors.BLUE)).join(", ")], { isVerbose: true });
51
51
  defineVars = {
52
52
  ...(0, _intlayer_config_envVars.formatNodeTypeToEnvVar)(unusedNodeTypes, (key) => `process.env.${key}`, (value) => `"${value}"`),
53
+ ...(0, _intlayer_config_envVars.formatDictionarySelectorEnvVar)((0, _intlayer_config_utils.getHasDictionarySelector)(dictionaries), (key) => `process.env.${key}`, (value) => `"${value}"`),
53
54
  ...(0, _intlayer_config_envVars.getConfigEnvVars)(configuration, (key) => `process.env.${key}`, (value) => `"${value}"`)
54
55
  };
55
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pluginIntlayerLynx.cjs","names":["BLUE"],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"sourcesContent":["import { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { BLUE } from '@intlayer/config/colors';\nimport {\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getAlias,\n getProjectRequire,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { RsbuildPlugin } from '@rsbuild/core';\n\n/**\n * A Lynx plugin to integrate Intlayer into the Lynx build process.\n *\n * - Loads the Intlayer configuration and injects environment variables.\n * - If enabled, starts a file watcher for dictionary changes.\n * - On build, prepares the Intlayer configuration.\n * - Optionally checks for dictionary changes before compiling (hot reload).\n *\n * Usage in your lynx.config.ts:\n *\n * import { defineConfig } from '@lynx-js/rspeedy'\n * import { pluginIntlayerLynx } from '@intlayer/lynx-plugin'\n *\n * export default defineConfig({\n * plugins: [\n * pluginIntlayerLynx(),\n * ],\n * // ...other configuration\n * })\n */\nexport const pluginIntlayerLynx = (): RsbuildPlugin => {\n return {\n name: 'plugin-intlayer-lynx',\n\n async setup(api) {\n // Load the Intlayer configuration and format env variables for Lynx.\n const configuration = getConfiguration();\n\n await prepareIntlayer(configuration);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (configuration.content.watch) {\n await watch({ configuration });\n }\n\n const isBuild = api.context.action === 'build';\n\n let defineVars = {};\n\n if (isBuild) {\n const appLogger = getAppLogger(configuration);\n\n const dictionaries = getDictionaries(configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out unused logic:',\n unusedNodeTypes\n .filter(\n (key) =>\n !['reactNode', 'solidNode', 'preactNode'].includes(key)\n )\n .map((key) => colorize(key, BLUE))\n .join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n defineVars = {\n ...formatNodeTypeToEnvVar(\n unusedNodeTypes,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n ...getConfigEnvVars(\n configuration,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n };\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n define: defineVars,\n },\n resolve: {\n alias: {\n ...getAlias({ configuration }),\n react: getProjectRequire().resolve('@lynx-js/react'),\n },\n },\n });\n });\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,2BAA0C;AACrD,QAAO;EACL,MAAM;EAEN,MAAM,MAAM,KAAK;GAEf,MAAM,6DAAkC;AAExC,uDAAsB,cAAc;AAGpC,OAAI,cAAc,QAAQ,MACxB,6CAAY,EAAE,eAAe,CAAC;GAGhC,MAAM,UAAU,IAAI,QAAQ,WAAW;GAEvC,IAAI,aAAa,EAAE;AAEnB,OAAI,SAAS;IACX,MAAM,sDAAyB,cAAc;IAE7C,MAAM,iEAA+B,cAAc;AAEnD,QAAI,OAAO,KAAK,aAAa,CAAC,WAAW,EACvC,WAAU,2DAA2D,EACnE,WAAW,MACZ,CAAC;IAGJ,MAAM,kBAAkB,0DAA8B,aAAa;AAEnE,QAAI,gBAAgB,SAAS,EAC3B,WACE,CACE,+BACA,gBACG,QACE,QACC,CAAC;KAAC;KAAa;KAAa;KAAa,CAAC,SAAS,IAAI,CAC1D,CACA,KAAK,8CAAiB,KAAKA,6BAAK,CAAC,CACjC,KAAK,KAAK,CACd,EACD,EACE,WAAW,MACZ,CACF;AAGH,iBAAa;KACX,wDACE,kBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,GACtB;KACD,kDACE,gBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,GACtB;KACF;;AAIH,OAAI,oBAAoB,OAAO,QAAQ,EAAE,yBAAyB;AAChE,WAAO,mBAAmB,QAAQ;KAChC,QAAQ,EACN,QAAQ,YACT;KACD,SAAS,EACP,OAAO;MACL,wCAAY,EAAE,eAAe,CAAC;MAC9B,sDAA0B,CAAC,QAAQ,iBAAiB;MACrD,EACF;KACF,CAAC;KACF;;EAEL"}
1
+ {"version":3,"file":"pluginIntlayerLynx.cjs","names":["BLUE"],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"sourcesContent":["import { BLUE } from '@intlayer/config/colors';\nimport {\n formatDictionarySelectorEnvVar,\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getAlias,\n getHasDictionarySelector,\n getProjectRequire,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { watch } from '@intlayer/engine/watcher';\nimport type { RsbuildPlugin } from '@rsbuild/core';\n\n/**\n * A Lynx plugin to integrate Intlayer into the Lynx build process.\n *\n * - Loads the Intlayer configuration and injects environment variables.\n * - If enabled, starts a file watcher for dictionary changes.\n * - On build, prepares the Intlayer configuration.\n * - Optionally checks for dictionary changes before compiling (hot reload).\n *\n * Usage in your lynx.config.ts:\n *\n * import { defineConfig } from '@lynx-js/rspeedy'\n * import { pluginIntlayerLynx } from '@intlayer/lynx-plugin'\n *\n * export default defineConfig({\n * plugins: [\n * pluginIntlayerLynx(),\n * ],\n * // ...other configuration\n * })\n */\nexport const pluginIntlayerLynx = (): RsbuildPlugin => {\n return {\n name: 'plugin-intlayer-lynx',\n\n async setup(api) {\n // Load the Intlayer configuration and format env variables for Lynx.\n const configuration = getConfiguration();\n\n await prepareIntlayer(configuration);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (configuration.content.watch) {\n await watch({ configuration });\n }\n\n const isBuild = api.context.action === 'build';\n\n let defineVars = {};\n\n if (isBuild) {\n const appLogger = getAppLogger(configuration);\n\n const dictionaries = getDictionaries(configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out unused logic:',\n unusedNodeTypes\n .filter(\n (key) =>\n !['reactNode', 'solidNode', 'preactNode'].includes(key)\n )\n .map((key) => colorize(key, BLUE))\n .join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n defineVars = {\n // Tree shaking based on unused node types\n ...formatNodeTypeToEnvVar(\n unusedNodeTypes,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n // Tree shaking the dictionary selector logic\n // (collections / variants)\n ...formatDictionarySelectorEnvVar(\n getHasDictionarySelector(dictionaries),\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n // Tree shaking based on config\n ...getConfigEnvVars(\n configuration,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n };\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n define: defineVars,\n },\n resolve: {\n alias: {\n ...getAlias({ configuration }),\n react: getProjectRequire().resolve('@lynx-js/react'),\n },\n },\n });\n });\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,2BAA0C;CACrD,OAAO;EACL,MAAM;EAEN,MAAM,MAAM,KAAK;GAEf,MAAM,4DAAiC;GAEvC,kDAAsB,aAAa;GAGnC,IAAI,cAAc,QAAQ,OACxB,0CAAY,EAAE,cAAc,CAAC;GAG/B,MAAM,UAAU,IAAI,QAAQ,WAAW;GAEvC,IAAI,aAAa,CAAC;GAElB,IAAI,SAAS;IACX,MAAM,sDAAyB,aAAa;IAE5C,MAAM,iEAA+B,aAAa;IAElD,IAAI,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,GACvC,UAAU,2DAA2D,EACnE,WAAW,KACb,CAAC;IAGH,MAAM,kBAAkB,0DAA8B,YAAY;IAElE,IAAI,gBAAgB,SAAS,GAC3B,UACE,CACE,+BACA,gBACG,QACE,QACC,CAAC;KAAC;KAAa;KAAa;IAAY,CAAC,CAAC,SAAS,GAAG,CAC1D,CAAC,CACA,KAAK,8CAAiB,KAAKA,4BAAI,CAAC,CAAC,CACjC,KAAK,IAAI,CACd,GACA,EACE,WAAW,KACb,CACF;IAGF,aAAa;KAEX,wDACE,kBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;KAGA,qHAC2B,YAAY,IACpC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;KAEA,kDACE,gBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;IACF;GACF;GAGA,IAAI,oBAAoB,OAAO,QAAQ,EAAE,yBAAyB;IAChE,OAAO,mBAAmB,QAAQ;KAChC,QAAQ,EACN,QAAQ,WACV;KACA,SAAS,EACP,OAAO;MACL,wCAAY,EAAE,cAAc,CAAC;MAC7B,qDAAyB,CAAC,CAAC,QAAQ,gBAAgB;KACrD,EACF;IACF,CAAC;GACH,CAAC;EACH;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"intlayerPolyfill.mjs","names":[],"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["/**\n * Applies necessary polyfills for Lynx to support Intlayer.\n *\n * This includes polyfilling `structuredClone` if missing,\n * and providing no-op implementations for standard DOM `window` methods\n * (`addEventListener`, `removeEventListener`, `postMessage`)\n * to ensure compatibility with libraries that expect a browser-like environment.\n */\nexport const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n }\n\n if (typeof window !== 'undefined') {\n if (typeof window.addEventListener !== 'function') {\n window.addEventListener = () => null;\n }\n if (typeof window.removeEventListener !== 'function') {\n window.removeEventListener = () => null;\n }\n if (typeof window.postMessage !== 'function') {\n window.postMessage = () => null;\n }\n }\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,yBAAyB;AACpC,KAAI,OAAO,OAAO,oBAAoB,WACpC,QAAO,mBAAmB,QAAQ,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC;AAGnE,KAAI,OAAO,WAAW,aAAa;AACjC,MAAI,OAAO,OAAO,qBAAqB,WACrC,QAAO,yBAAyB;AAElC,MAAI,OAAO,OAAO,wBAAwB,WACxC,QAAO,4BAA4B;AAErC,MAAI,OAAO,OAAO,gBAAgB,WAChC,QAAO,oBAAoB"}
1
+ {"version":3,"file":"intlayerPolyfill.mjs","names":[],"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["/**\n * Applies necessary polyfills for Lynx to support Intlayer.\n *\n * This includes polyfilling `structuredClone` if missing,\n * and providing no-op implementations for standard DOM `window` methods\n * (`addEventListener`, `removeEventListener`, `postMessage`)\n * to ensure compatibility with libraries that expect a browser-like environment.\n */\nexport const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n }\n\n if (typeof window !== 'undefined') {\n if (typeof window.addEventListener !== 'function') {\n window.addEventListener = () => null;\n }\n if (typeof window.removeEventListener !== 'function') {\n window.removeEventListener = () => null;\n }\n if (typeof window.postMessage !== 'function') {\n window.postMessage = () => null;\n }\n }\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,yBAAyB;CACpC,IAAI,OAAO,OAAO,oBAAoB,YACpC,OAAO,mBAAmB,QAAQ,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC;CAGlE,IAAI,OAAO,WAAW,aAAa;EACjC,IAAI,OAAO,OAAO,qBAAqB,YACrC,OAAO,yBAAyB;EAElC,IAAI,OAAO,OAAO,wBAAwB,YACxC,OAAO,4BAA4B;EAErC,IAAI,OAAO,OAAO,gBAAgB,YAChC,OAAO,oBAAoB;CAE/B;AACF"}
@@ -1,11 +1,11 @@
1
- import { prepareIntlayer } from "@intlayer/chokidar/build";
2
- import { watch } from "@intlayer/chokidar/watcher";
3
1
  import { BLUE } from "@intlayer/config/colors";
4
- import { formatNodeTypeToEnvVar, getConfigEnvVars } from "@intlayer/config/envVars";
2
+ import { formatDictionarySelectorEnvVar, formatNodeTypeToEnvVar, getConfigEnvVars } from "@intlayer/config/envVars";
5
3
  import { colorize, getAppLogger } from "@intlayer/config/logger";
6
4
  import { getConfiguration } from "@intlayer/config/node";
7
- import { getAlias, getProjectRequire, getUnusedNodeTypesAsync } from "@intlayer/config/utils";
5
+ import { getAlias, getHasDictionarySelector, getProjectRequire, getUnusedNodeTypesAsync } from "@intlayer/config/utils";
8
6
  import { getDictionaries } from "@intlayer/dictionaries-entry";
7
+ import { prepareIntlayer } from "@intlayer/engine/build";
8
+ import { watch } from "@intlayer/engine/watcher";
9
9
 
10
10
  //#region src/plugin/pluginIntlayerLynx.ts
11
11
  /**
@@ -49,6 +49,7 @@ const pluginIntlayerLynx = () => {
49
49
  ].includes(key)).map((key) => colorize(key, BLUE)).join(", ")], { isVerbose: true });
50
50
  defineVars = {
51
51
  ...formatNodeTypeToEnvVar(unusedNodeTypes, (key) => `process.env.${key}`, (value) => `"${value}"`),
52
+ ...formatDictionarySelectorEnvVar(getHasDictionarySelector(dictionaries), (key) => `process.env.${key}`, (value) => `"${value}"`),
52
53
  ...getConfigEnvVars(configuration, (key) => `process.env.${key}`, (value) => `"${value}"`)
53
54
  };
54
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pluginIntlayerLynx.mjs","names":[],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"sourcesContent":["import { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { BLUE } from '@intlayer/config/colors';\nimport {\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getAlias,\n getProjectRequire,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { RsbuildPlugin } from '@rsbuild/core';\n\n/**\n * A Lynx plugin to integrate Intlayer into the Lynx build process.\n *\n * - Loads the Intlayer configuration and injects environment variables.\n * - If enabled, starts a file watcher for dictionary changes.\n * - On build, prepares the Intlayer configuration.\n * - Optionally checks for dictionary changes before compiling (hot reload).\n *\n * Usage in your lynx.config.ts:\n *\n * import { defineConfig } from '@lynx-js/rspeedy'\n * import { pluginIntlayerLynx } from '@intlayer/lynx-plugin'\n *\n * export default defineConfig({\n * plugins: [\n * pluginIntlayerLynx(),\n * ],\n * // ...other configuration\n * })\n */\nexport const pluginIntlayerLynx = (): RsbuildPlugin => {\n return {\n name: 'plugin-intlayer-lynx',\n\n async setup(api) {\n // Load the Intlayer configuration and format env variables for Lynx.\n const configuration = getConfiguration();\n\n await prepareIntlayer(configuration);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (configuration.content.watch) {\n await watch({ configuration });\n }\n\n const isBuild = api.context.action === 'build';\n\n let defineVars = {};\n\n if (isBuild) {\n const appLogger = getAppLogger(configuration);\n\n const dictionaries = getDictionaries(configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out unused logic:',\n unusedNodeTypes\n .filter(\n (key) =>\n !['reactNode', 'solidNode', 'preactNode'].includes(key)\n )\n .map((key) => colorize(key, BLUE))\n .join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n defineVars = {\n ...formatNodeTypeToEnvVar(\n unusedNodeTypes,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n ...getConfigEnvVars(\n configuration,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n };\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n define: defineVars,\n },\n resolve: {\n alias: {\n ...getAlias({ configuration }),\n react: getProjectRequire().resolve('@lynx-js/react'),\n },\n },\n });\n });\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,2BAA0C;AACrD,QAAO;EACL,MAAM;EAEN,MAAM,MAAM,KAAK;GAEf,MAAM,gBAAgB,kBAAkB;AAExC,SAAM,gBAAgB,cAAc;AAGpC,OAAI,cAAc,QAAQ,MACxB,OAAM,MAAM,EAAE,eAAe,CAAC;GAGhC,MAAM,UAAU,IAAI,QAAQ,WAAW;GAEvC,IAAI,aAAa,EAAE;AAEnB,OAAI,SAAS;IACX,MAAM,YAAY,aAAa,cAAc;IAE7C,MAAM,eAAe,gBAAgB,cAAc;AAEnD,QAAI,OAAO,KAAK,aAAa,CAAC,WAAW,EACvC,WAAU,2DAA2D,EACnE,WAAW,MACZ,CAAC;IAGJ,MAAM,kBAAkB,MAAM,wBAAwB,aAAa;AAEnE,QAAI,gBAAgB,SAAS,EAC3B,WACE,CACE,+BACA,gBACG,QACE,QACC,CAAC;KAAC;KAAa;KAAa;KAAa,CAAC,SAAS,IAAI,CAC1D,CACA,KAAK,QAAQ,SAAS,KAAK,KAAK,CAAC,CACjC,KAAK,KAAK,CACd,EACD,EACE,WAAW,MACZ,CACF;AAGH,iBAAa;KACX,GAAG,uBACD,kBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,GACtB;KACD,GAAG,iBACD,gBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,GACtB;KACF;;AAIH,OAAI,oBAAoB,OAAO,QAAQ,EAAE,yBAAyB;AAChE,WAAO,mBAAmB,QAAQ;KAChC,QAAQ,EACN,QAAQ,YACT;KACD,SAAS,EACP,OAAO;MACL,GAAG,SAAS,EAAE,eAAe,CAAC;MAC9B,OAAO,mBAAmB,CAAC,QAAQ,iBAAiB;MACrD,EACF;KACF,CAAC;KACF;;EAEL"}
1
+ {"version":3,"file":"pluginIntlayerLynx.mjs","names":[],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"sourcesContent":["import { BLUE } from '@intlayer/config/colors';\nimport {\n formatDictionarySelectorEnvVar,\n formatNodeTypeToEnvVar,\n getConfigEnvVars,\n} from '@intlayer/config/envVars';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n getAlias,\n getHasDictionarySelector,\n getProjectRequire,\n getUnusedNodeTypesAsync,\n} from '@intlayer/config/utils';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { watch } from '@intlayer/engine/watcher';\nimport type { RsbuildPlugin } from '@rsbuild/core';\n\n/**\n * A Lynx plugin to integrate Intlayer into the Lynx build process.\n *\n * - Loads the Intlayer configuration and injects environment variables.\n * - If enabled, starts a file watcher for dictionary changes.\n * - On build, prepares the Intlayer configuration.\n * - Optionally checks for dictionary changes before compiling (hot reload).\n *\n * Usage in your lynx.config.ts:\n *\n * import { defineConfig } from '@lynx-js/rspeedy'\n * import { pluginIntlayerLynx } from '@intlayer/lynx-plugin'\n *\n * export default defineConfig({\n * plugins: [\n * pluginIntlayerLynx(),\n * ],\n * // ...other configuration\n * })\n */\nexport const pluginIntlayerLynx = (): RsbuildPlugin => {\n return {\n name: 'plugin-intlayer-lynx',\n\n async setup(api) {\n // Load the Intlayer configuration and format env variables for Lynx.\n const configuration = getConfiguration();\n\n await prepareIntlayer(configuration);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (configuration.content.watch) {\n await watch({ configuration });\n }\n\n const isBuild = api.context.action === 'build';\n\n let defineVars = {};\n\n if (isBuild) {\n const appLogger = getAppLogger(configuration);\n\n const dictionaries = getDictionaries(configuration);\n\n if (Object.keys(dictionaries).length === 0) {\n appLogger('No dictionaries found. Please check your configuration.', {\n isVerbose: true,\n });\n }\n\n const unusedNodeTypes = await getUnusedNodeTypesAsync(dictionaries);\n\n if (unusedNodeTypes.length > 0) {\n appLogger(\n [\n 'Filtering out unused logic:',\n unusedNodeTypes\n .filter(\n (key) =>\n !['reactNode', 'solidNode', 'preactNode'].includes(key)\n )\n .map((key) => colorize(key, BLUE))\n .join(', '),\n ],\n {\n isVerbose: true,\n }\n );\n }\n\n defineVars = {\n // Tree shaking based on unused node types\n ...formatNodeTypeToEnvVar(\n unusedNodeTypes,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n // Tree shaking the dictionary selector logic\n // (collections / variants)\n ...formatDictionarySelectorEnvVar(\n getHasDictionarySelector(dictionaries),\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n // Tree shaking based on config\n ...getConfigEnvVars(\n configuration,\n (key) => `process.env.${key}`,\n (value) => `\"${value}\"`\n ),\n };\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n define: defineVars,\n },\n resolve: {\n alias: {\n ...getAlias({ configuration }),\n react: getProjectRequire().resolve('@lynx-js/react'),\n },\n },\n });\n });\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,2BAA0C;CACrD,OAAO;EACL,MAAM;EAEN,MAAM,MAAM,KAAK;GAEf,MAAM,gBAAgB,iBAAiB;GAEvC,MAAM,gBAAgB,aAAa;GAGnC,IAAI,cAAc,QAAQ,OACxB,MAAM,MAAM,EAAE,cAAc,CAAC;GAG/B,MAAM,UAAU,IAAI,QAAQ,WAAW;GAEvC,IAAI,aAAa,CAAC;GAElB,IAAI,SAAS;IACX,MAAM,YAAY,aAAa,aAAa;IAE5C,MAAM,eAAe,gBAAgB,aAAa;IAElD,IAAI,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,GACvC,UAAU,2DAA2D,EACnE,WAAW,KACb,CAAC;IAGH,MAAM,kBAAkB,MAAM,wBAAwB,YAAY;IAElE,IAAI,gBAAgB,SAAS,GAC3B,UACE,CACE,+BACA,gBACG,QACE,QACC,CAAC;KAAC;KAAa;KAAa;IAAY,CAAC,CAAC,SAAS,GAAG,CAC1D,CAAC,CACA,KAAK,QAAQ,SAAS,KAAK,IAAI,CAAC,CAAC,CACjC,KAAK,IAAI,CACd,GACA,EACE,WAAW,KACb,CACF;IAGF,aAAa;KAEX,GAAG,uBACD,kBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;KAGA,GAAG,+BACD,yBAAyB,YAAY,IACpC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;KAEA,GAAG,iBACD,gBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;IACF;GACF;GAGA,IAAI,oBAAoB,OAAO,QAAQ,EAAE,yBAAyB;IAChE,OAAO,mBAAmB,QAAQ;KAChC,QAAQ,EACN,QAAQ,WACV;KACA,SAAS,EACP,OAAO;MACL,GAAG,SAAS,EAAE,cAAc,CAAC;MAC7B,OAAO,kBAAkB,CAAC,CAAC,QAAQ,gBAAgB;KACrD,EACF;IACF,CAAC;GACH,CAAC;EACH;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"intlayerPolyfill.d.ts","names":[],"sources":["../../src/intlayerPolyfill.ts"],"mappings":";;AAQA;;;;;;;cAAa,gBAAA"}
1
+ {"version":3,"file":"intlayerPolyfill.d.ts","names":[],"sources":["../../src/intlayerPolyfill.ts"],"mappings":";;;;;;;;;cAQa"}
@@ -1,5 +1,4 @@
1
1
  import { RsbuildPlugin } from "@rsbuild/core";
2
-
3
2
  //#region src/plugin/pluginIntlayerLynx.d.ts
4
3
  /**
5
4
  * A Lynx plugin to integrate Intlayer into the Lynx build process.
@@ -1 +1 @@
1
- {"version":3,"file":"pluginIntlayerLynx.d.ts","names":[],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"mappings":";;;;;AAqCA;;;;;;;;;;;;;;;;;;cAAa,kBAAA,QAAyB,aAAA"}
1
+ {"version":3,"file":"pluginIntlayerLynx.d.ts","names":[],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;cAuCa,0BAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lynx-intlayer",
3
- "version": "9.0.0-canary.8",
3
+ "version": "9.0.0",
4
4
  "private": false,
5
5
  "description": "A Lynx plugin for seamless internationalization (i18n) and localization (l10n) of your mobile app.",
6
6
  "keywords": [
@@ -86,22 +86,22 @@
86
86
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
87
87
  },
88
88
  "dependencies": {
89
- "@intlayer/chokidar": "9.0.0-canary.8",
90
- "@intlayer/config": "9.0.0-canary.8",
91
- "@intlayer/core": "9.0.0-canary.8",
92
- "@intlayer/dictionaries-entry": "9.0.0-canary.8",
93
- "@intlayer/types": "9.0.0-canary.8"
89
+ "@intlayer/config": "9.0.0",
90
+ "@intlayer/core": "9.0.0",
91
+ "@intlayer/dictionaries-entry": "9.0.0",
92
+ "@intlayer/engine": "9.0.0",
93
+ "@intlayer/types": "9.0.0"
94
94
  },
95
95
  "devDependencies": {
96
96
  "@rsbuild/core": "2.0.6",
97
- "@types/node": "25.9.4",
97
+ "@types/node": "26.1.1",
98
98
  "@utils/ts-config": "1.0.4",
99
99
  "@utils/ts-config-types": "1.0.4",
100
100
  "@utils/tsdown-config": "1.0.4",
101
101
  "rimraf": "6.1.3",
102
- "tsdown": "0.21.10",
103
- "typescript": "6.0.3",
104
- "vitest": "4.1.9"
102
+ "tsdown": "0.22.13",
103
+ "typescript": "7.0.2",
104
+ "vitest": "4.1.10"
105
105
  },
106
106
  "peerDependencies": {
107
107
  "@lynx-js/rspeedy": ">=0.5.0",