lynx-intlayer 8.9.7 → 8.10.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/cjs/intlayerPolyfill.cjs.map +1 -1
- package/dist/cjs/plugin/pluginIntlayerLynx.cjs.map +1 -1
- package/dist/esm/intlayerPolyfill.mjs.map +1 -1
- package/dist/esm/plugin/pluginIntlayerLynx.mjs.map +1 -1
- package/dist/types/intlayerPolyfill.d.ts.map +1 -1
- package/dist/types/plugin/pluginIntlayerLynx.d.ts.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -67,6 +67,7 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
|
|
|
67
67
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
|
|
68
68
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
|
|
69
69
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) |
|
|
70
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/benchmark.png?raw=true" alt="Feature" width="700"> | **Performances & Benchmark**<br><br>Uses advanced tree-shaking and dynamic loading to boost performances and keep the solution as light as possible. <br><br> - [Performances & Benchmark](https://intlayer.org/doc/benchmark) |
|
|
70
71
|
|
|
71
72
|
---
|
|
72
73
|
|
|
@@ -249,6 +250,19 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
249
250
|
</ul>
|
|
250
251
|
</details>
|
|
251
252
|
|
|
253
|
+
## Multilingual content management system
|
|
254
|
+
|
|
255
|
+
More than an i18n library, Intlayer is a complete **multilingual content management system**. A full CMS is available for free at [app.intlayer.org](https://app.intlayer.org).
|
|
256
|
+
|
|
257
|
+
Intlayer connects **developers**, **copywriters**, and **AI agents** in one workflow for creating and maintaining multilingual websites effortlessly.Intlayer replaces the following stack in a single solution:
|
|
258
|
+
|
|
259
|
+
- i18n solutions (e.g. `i18next`, `next-intl`, `vue-i18n`)
|
|
260
|
+
- TMSs (Translation Management Systems) (e.g. Crowdin, Phrase, Lokalise)
|
|
261
|
+
- Feature flags
|
|
262
|
+
- Headless CMSs (e.g. Contentful, Strapi, Sanity)
|
|
263
|
+
|
|
264
|
+

|
|
265
|
+
|
|
252
266
|
## 🌐 Readme in other languages
|
|
253
267
|
|
|
254
268
|
<p align="center">
|
|
@@ -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;CACpC,IAAI,OAAO,OAAO,oBAAoB,YACpC,OAAO,mBAAmB,QAAQ,KAAK,MAAM,KAAK,UAAU,
|
|
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 +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;CACrD,OAAO;EACL,MAAM;EAEN,MAAM,MAAM,KAAK;GAEf,MAAM,
|
|
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;CACrD,OAAO;EACL,MAAM;EAEN,MAAM,MAAM,KAAK;GAEf,MAAM,4DAAiC;GAEvC,oDAAsB,aAAa;GAGnC,IAAI,cAAc,QAAQ,OACxB,4CAAY,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,EAAE,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,EAAE,SAAS,GAAG,CAC1D,EACC,KAAK,8CAAiB,KAAKA,4BAAI,CAAC,EAChC,KAAK,IAAI,CACd,GACA,EACE,WAAW,KACb,CACF;IAGF,aAAa;KACX,wDACE,kBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;KACA,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,EAAE,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;CACpC,IAAI,OAAO,OAAO,oBAAoB,YACpC,OAAO,mBAAmB,QAAQ,KAAK,MAAM,KAAK,UAAU,
|
|
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 +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;CACrD,OAAO;EACL,MAAM;EAEN,MAAM,MAAM,KAAK;GAEf,MAAM,gBAAgB,
|
|
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;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,EAAE,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,EAAE,SAAS,GAAG,CAC1D,EACC,KAAK,QAAQ,SAAS,KAAK,IAAI,CAAC,EAChC,KAAK,IAAI,CACd,GACA,EACE,WAAW,KACb,CACF;IAGF,aAAa;KACX,GAAG,uBACD,kBACC,QAAQ,eAAe,QACvB,UAAU,IAAI,MAAM,EACvB;KACA,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,EAAE,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
|
|
1
|
+
{"version":3,"file":"intlayerPolyfill.d.ts","names":[],"sources":["../../src/intlayerPolyfill.ts"],"mappings":";;AAQA;;;;AAgBC;;;cAhBY,gBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginIntlayerLynx.d.ts","names":[],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"mappings":";;;;;AAqCA
|
|
1
|
+
{"version":3,"file":"pluginIntlayerLynx.d.ts","names":[],"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"mappings":";;;;;AAqCA;;;;AAgFC;;;;;;;;;;;;;;cAhFY,kBAAA,QAAyB,aAgFrC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lynx-intlayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0-canary.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,15 +86,15 @@
|
|
|
86
86
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@intlayer/chokidar": "8.
|
|
90
|
-
"@intlayer/config": "8.
|
|
91
|
-
"@intlayer/core": "8.
|
|
92
|
-
"@intlayer/dictionaries-entry": "8.
|
|
93
|
-
"@intlayer/types": "8.
|
|
89
|
+
"@intlayer/chokidar": "8.10.0-canary.0",
|
|
90
|
+
"@intlayer/config": "8.10.0-canary.0",
|
|
91
|
+
"@intlayer/core": "8.10.0-canary.0",
|
|
92
|
+
"@intlayer/dictionaries-entry": "8.10.0-canary.0",
|
|
93
|
+
"@intlayer/types": "8.10.0-canary.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@rsbuild/core": "1.7.5",
|
|
97
|
-
"@types/node": "25.
|
|
97
|
+
"@types/node": "25.9.0",
|
|
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",
|