lynx-intlayer 5.2.4 → 5.2.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.
- package/dist/cjs/index.cjs +1 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/plugin/index.cjs +23 -0
- package/dist/cjs/plugin/index.cjs.map +1 -0
- package/dist/cjs/plugin/pluginIntlayerLynx.cjs.map +1 -0
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/plugin/index.mjs +2 -0
- package/dist/esm/plugin/index.mjs.map +1 -0
- package/dist/esm/plugin/pluginIntlayerLynx.mjs.map +1 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/plugin/index.d.ts +2 -0
- package/dist/types/plugin/index.d.ts.map +1 -0
- package/dist/types/plugin/pluginIntlayerLynx.d.ts.map +1 -0
- package/package.json +13 -8
- package/dist/cjs/pluginIntlayerLynx.cjs.map +0 -1
- package/dist/esm/pluginIntlayerLynx.mjs.map +0 -1
- package/dist/types/pluginIntlayerLynx.d.ts.map +0 -1
- /package/dist/cjs/{pluginIntlayerLynx.cjs → plugin/pluginIntlayerLynx.cjs} +0 -0
- /package/dist/esm/{pluginIntlayerLynx.mjs → plugin/pluginIntlayerLynx.mjs} +0 -0
- /package/dist/types/{pluginIntlayerLynx.d.ts → plugin/pluginIntlayerLynx.d.ts} +0 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -16,10 +16,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
16
16
|
var index_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(index_exports);
|
|
18
18
|
__reExport(index_exports, require('./intlayerPolyfill.cjs'), module.exports);
|
|
19
|
-
__reExport(index_exports, require('./pluginIntlayerLynx.cjs'), module.exports);
|
|
20
19
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21
20
|
0 && (module.exports = {
|
|
22
|
-
...require('./intlayerPolyfill.cjs')
|
|
23
|
-
...require('./pluginIntlayerLynx.cjs')
|
|
21
|
+
...require('./intlayerPolyfill.cjs')
|
|
24
22
|
});
|
|
25
23
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './intlayerPolyfill';\
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './intlayerPolyfill';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,+BAAd;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var plugin_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(plugin_exports);
|
|
18
|
+
__reExport(plugin_exports, require('./pluginIntlayerLynx.cjs'), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require('./pluginIntlayerLynx.cjs')
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/plugin/index.ts"],"sourcesContent":["export * from './pluginIntlayerLynx';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,iCAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"sourcesContent":["import type { RsbuildPlugin } from '@rsbuild/core';\nimport { join, relative } from 'path';\nimport { ESMxCJSRequire, getConfiguration, logger } from '@intlayer/config';\nimport {\n prepareIntlayer,\n watch,\n checkDictionaryChanges,\n} from '@intlayer/chokidar';\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 * hotReload: true, // optional\n * }),\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 intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n // Compute the relative paths for alias configuration.\n const { mainDir, configDir, baseDir } = intlayerConfig.content;\n const dictionariesPath = join(mainDir, 'dictionaries.mjs');\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const configurationPath = join(configDir, 'configuration.json');\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (intlayerConfig.content.watch) {\n watch(intlayerConfig);\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n alias: {\n '@intlayer/dictionaries-entry': relativeDictionariesPath,\n '@intlayer/config/built': relativeConfigurationPath,\n react: ESMxCJSRequire.resolve('@lynx-js/react'),\n },\n },\n });\n });\n\n // Optionally, before compile check for dictionary changes if hot reload is enabled.\n if (intlayerConfig.editor.hotReload) {\n api.onBeforeEnvironmentCompile(async () => {\n try {\n await checkDictionaryChanges();\n } catch (error) {\n logger(`Error checking dictionary changes: ${error}`, {\n level: 'error',\n });\n }\n });\n }\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,oBAAyD;AACzD,sBAIO;AAwBA,MAAM,qBAAqB,MAAqB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IAEN,MAAM,MAAM,KAAK;AAEf,YAAM,qBAAiB,gCAAiB;AAExC,gBAAM,iCAAgB,cAAc;AAGpC,YAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,eAAe;AACvD,YAAM,uBAAmB,kBAAK,SAAS,kBAAkB;AACzD,YAAM,+BAA2B,sBAAS,SAAS,gBAAgB;AACnE,YAAM,wBAAoB,kBAAK,WAAW,oBAAoB;AAC9D,YAAM,gCAA4B,sBAAS,SAAS,iBAAiB;AAGrE,UAAI,eAAe,QAAQ,OAAO;AAChC,mCAAM,cAAc;AAAA,MACtB;AAGA,UAAI,oBAAoB,OAAO,QAAQ,EAAE,mBAAmB,MAAM;AAChE,eAAO,mBAAmB,QAAQ;AAAA,UAChC,QAAQ;AAAA,YACN,OAAO;AAAA,cACL,gCAAgC;AAAA,cAChC,0BAA0B;AAAA,cAC1B,OAAO,6BAAe,QAAQ,gBAAgB;AAAA,YAChD;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAGD,UAAI,eAAe,OAAO,WAAW;AACnC,YAAI,2BAA2B,YAAY;AACzC,cAAI;AACF,sBAAM,wCAAuB;AAAA,UAC/B,SAAS,OAAO;AACd,sCAAO,sCAAsC,KAAK,IAAI;AAAA,cACpD,OAAO;AAAA,YACT,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './intlayerPolyfill';\
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './intlayerPolyfill';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/plugin/index.ts"],"sourcesContent":["export * from './pluginIntlayerLynx';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"sourcesContent":["import type { RsbuildPlugin } from '@rsbuild/core';\nimport { join, relative } from 'path';\nimport { ESMxCJSRequire, getConfiguration, logger } from '@intlayer/config';\nimport {\n prepareIntlayer,\n watch,\n checkDictionaryChanges,\n} from '@intlayer/chokidar';\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 * hotReload: true, // optional\n * }),\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 intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n // Compute the relative paths for alias configuration.\n const { mainDir, configDir, baseDir } = intlayerConfig.content;\n const dictionariesPath = join(mainDir, 'dictionaries.mjs');\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const configurationPath = join(configDir, 'configuration.json');\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (intlayerConfig.content.watch) {\n watch(intlayerConfig);\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n alias: {\n '@intlayer/dictionaries-entry': relativeDictionariesPath,\n '@intlayer/config/built': relativeConfigurationPath,\n react: ESMxCJSRequire.resolve('@lynx-js/react'),\n },\n },\n });\n });\n\n // Optionally, before compile check for dictionary changes if hot reload is enabled.\n if (intlayerConfig.editor.hotReload) {\n api.onBeforeEnvironmentCompile(async () => {\n try {\n await checkDictionaryChanges();\n } catch (error) {\n logger(`Error checking dictionary changes: ${error}`, {\n level: 'error',\n });\n }\n });\n }\n },\n };\n};\n"],"mappings":"AACA,SAAS,MAAM,gBAAgB;AAC/B,SAAS,gBAAgB,kBAAkB,cAAc;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAwBA,MAAM,qBAAqB,MAAqB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IAEN,MAAM,MAAM,KAAK;AAEf,YAAM,iBAAiB,iBAAiB;AAExC,YAAM,gBAAgB,cAAc;AAGpC,YAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,eAAe;AACvD,YAAM,mBAAmB,KAAK,SAAS,kBAAkB;AACzD,YAAM,2BAA2B,SAAS,SAAS,gBAAgB;AACnE,YAAM,oBAAoB,KAAK,WAAW,oBAAoB;AAC9D,YAAM,4BAA4B,SAAS,SAAS,iBAAiB;AAGrE,UAAI,eAAe,QAAQ,OAAO;AAChC,cAAM,cAAc;AAAA,MACtB;AAGA,UAAI,oBAAoB,OAAO,QAAQ,EAAE,mBAAmB,MAAM;AAChE,eAAO,mBAAmB,QAAQ;AAAA,UAChC,QAAQ;AAAA,YACN,OAAO;AAAA,cACL,gCAAgC;AAAA,cAChC,0BAA0B;AAAA,cAC1B,OAAO,eAAe,QAAQ,gBAAgB;AAAA,YAChD;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAGD,UAAI,eAAe,OAAO,WAAW;AACnC,YAAI,2BAA2B,YAAY;AACzC,cAAI;AACF,kBAAM,uBAAuB;AAAA,UAC/B,SAAS,OAAO;AACd,mBAAO,sCAAsC,KAAK,IAAI;AAAA,cACpD,OAAO;AAAA,YACT,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginIntlayerLynx.d.ts","sourceRoot":"","sources":["../../../src/plugin/pluginIntlayerLynx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AASnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,kBAAkB,QAAO,aAiDrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lynx-intlayer",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A React Native plugin for seamless internationalization (i18n), providing locale detection, redirection, and environment-based configuration",
|
|
6
6
|
"keywords": [
|
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
"require": "./dist/cjs/index.cjs",
|
|
41
41
|
"import": "./dist/esm/index.mjs"
|
|
42
42
|
},
|
|
43
|
+
"./plugin": {
|
|
44
|
+
"types": "./dist/types/plugin/index.d.ts",
|
|
45
|
+
"require": "./dist/cjs/plugin/index.cjs",
|
|
46
|
+
"import": "./dist/esm/plugin/index.mjs"
|
|
47
|
+
},
|
|
43
48
|
"./package.json": "./package.json"
|
|
44
49
|
},
|
|
45
50
|
"main": "dist/cjs/index.cjs",
|
|
@@ -57,9 +62,9 @@
|
|
|
57
62
|
"./package.json"
|
|
58
63
|
],
|
|
59
64
|
"dependencies": {
|
|
60
|
-
"@intlayer/
|
|
61
|
-
"@intlayer/
|
|
62
|
-
"@intlayer/core": "5.2.
|
|
65
|
+
"@intlayer/config": "5.2.6",
|
|
66
|
+
"@intlayer/chokidar": "5.2.6",
|
|
67
|
+
"@intlayer/core": "5.2.6"
|
|
63
68
|
},
|
|
64
69
|
"devDependencies": {
|
|
65
70
|
"@rsbuild/core": "^1.2.16",
|
|
@@ -74,8 +79,8 @@
|
|
|
74
79
|
"tsc-alias": "^1.8.10",
|
|
75
80
|
"tsup": "^8.3.5",
|
|
76
81
|
"typescript": "^5.7.3",
|
|
77
|
-
"@utils/eslint-config": "1.0.4",
|
|
78
82
|
"@utils/ts-config": "1.0.4",
|
|
83
|
+
"@utils/eslint-config": "1.0.4",
|
|
79
84
|
"@utils/ts-config-types": "1.0.4",
|
|
80
85
|
"@utils/tsup-config": "1.0.4"
|
|
81
86
|
},
|
|
@@ -85,9 +90,9 @@
|
|
|
85
90
|
"expo": "^52.0.37",
|
|
86
91
|
"metro-resolver": "^0.82.0",
|
|
87
92
|
"vite": ">=4.0.0",
|
|
88
|
-
"@intlayer/
|
|
89
|
-
"@intlayer/
|
|
90
|
-
"@intlayer/
|
|
93
|
+
"@intlayer/config": "5.2.6",
|
|
94
|
+
"@intlayer/chokidar": "5.2.6",
|
|
95
|
+
"@intlayer/core": "5.2.6"
|
|
91
96
|
},
|
|
92
97
|
"engines": {
|
|
93
98
|
"node": ">=14.18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pluginIntlayerLynx.ts"],"sourcesContent":["import type { RsbuildPlugin } from '@rsbuild/core';\nimport { join, relative } from 'path';\nimport { ESMxCJSRequire, getConfiguration, logger } from '@intlayer/config';\nimport {\n prepareIntlayer,\n watch,\n checkDictionaryChanges,\n} from '@intlayer/chokidar';\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 * hotReload: true, // optional\n * }),\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 intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n // Compute the relative paths for alias configuration.\n const { mainDir, configDir, baseDir } = intlayerConfig.content;\n const dictionariesPath = join(mainDir, 'dictionaries.mjs');\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const configurationPath = join(configDir, 'configuration.json');\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (intlayerConfig.content.watch) {\n watch(intlayerConfig);\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n alias: {\n '@intlayer/dictionaries-entry': relativeDictionariesPath,\n '@intlayer/config/built': relativeConfigurationPath,\n react: ESMxCJSRequire.resolve('@lynx-js/react'),\n },\n },\n });\n });\n\n // Optionally, before compile check for dictionary changes if hot reload is enabled.\n if (intlayerConfig.editor.hotReload) {\n api.onBeforeEnvironmentCompile(async () => {\n try {\n await checkDictionaryChanges();\n } catch (error) {\n logger(`Error checking dictionary changes: ${error}`, {\n level: 'error',\n });\n }\n });\n }\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,oBAAyD;AACzD,sBAIO;AAwBA,MAAM,qBAAqB,MAAqB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IAEN,MAAM,MAAM,KAAK;AAEf,YAAM,qBAAiB,gCAAiB;AAExC,gBAAM,iCAAgB,cAAc;AAGpC,YAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,eAAe;AACvD,YAAM,uBAAmB,kBAAK,SAAS,kBAAkB;AACzD,YAAM,+BAA2B,sBAAS,SAAS,gBAAgB;AACnE,YAAM,wBAAoB,kBAAK,WAAW,oBAAoB;AAC9D,YAAM,gCAA4B,sBAAS,SAAS,iBAAiB;AAGrE,UAAI,eAAe,QAAQ,OAAO;AAChC,mCAAM,cAAc;AAAA,MACtB;AAGA,UAAI,oBAAoB,OAAO,QAAQ,EAAE,mBAAmB,MAAM;AAChE,eAAO,mBAAmB,QAAQ;AAAA,UAChC,QAAQ;AAAA,YACN,OAAO;AAAA,cACL,gCAAgC;AAAA,cAChC,0BAA0B;AAAA,cAC1B,OAAO,6BAAe,QAAQ,gBAAgB;AAAA,YAChD;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAGD,UAAI,eAAe,OAAO,WAAW;AACnC,YAAI,2BAA2B,YAAY;AACzC,cAAI;AACF,sBAAM,wCAAuB;AAAA,UAC/B,SAAS,OAAO;AACd,sCAAO,sCAAsC,KAAK,IAAI;AAAA,cACpD,OAAO;AAAA,YACT,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pluginIntlayerLynx.ts"],"sourcesContent":["import type { RsbuildPlugin } from '@rsbuild/core';\nimport { join, relative } from 'path';\nimport { ESMxCJSRequire, getConfiguration, logger } from '@intlayer/config';\nimport {\n prepareIntlayer,\n watch,\n checkDictionaryChanges,\n} from '@intlayer/chokidar';\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 * hotReload: true, // optional\n * }),\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 intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n // Compute the relative paths for alias configuration.\n const { mainDir, configDir, baseDir } = intlayerConfig.content;\n const dictionariesPath = join(mainDir, 'dictionaries.mjs');\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const configurationPath = join(configDir, 'configuration.json');\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n\n // If file watching is enabled in Intlayer's config, start it.\n if (intlayerConfig.content.watch) {\n watch(intlayerConfig);\n }\n\n // Merge Intlayer-specific environment variables and alias configuration.\n api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {\n return mergeRsbuildConfig(config, {\n source: {\n alias: {\n '@intlayer/dictionaries-entry': relativeDictionariesPath,\n '@intlayer/config/built': relativeConfigurationPath,\n react: ESMxCJSRequire.resolve('@lynx-js/react'),\n },\n },\n });\n });\n\n // Optionally, before compile check for dictionary changes if hot reload is enabled.\n if (intlayerConfig.editor.hotReload) {\n api.onBeforeEnvironmentCompile(async () => {\n try {\n await checkDictionaryChanges();\n } catch (error) {\n logger(`Error checking dictionary changes: ${error}`, {\n level: 'error',\n });\n }\n });\n }\n },\n };\n};\n"],"mappings":"AACA,SAAS,MAAM,gBAAgB;AAC/B,SAAS,gBAAgB,kBAAkB,cAAc;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAwBA,MAAM,qBAAqB,MAAqB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IAEN,MAAM,MAAM,KAAK;AAEf,YAAM,iBAAiB,iBAAiB;AAExC,YAAM,gBAAgB,cAAc;AAGpC,YAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,eAAe;AACvD,YAAM,mBAAmB,KAAK,SAAS,kBAAkB;AACzD,YAAM,2BAA2B,SAAS,SAAS,gBAAgB;AACnE,YAAM,oBAAoB,KAAK,WAAW,oBAAoB;AAC9D,YAAM,4BAA4B,SAAS,SAAS,iBAAiB;AAGrE,UAAI,eAAe,QAAQ,OAAO;AAChC,cAAM,cAAc;AAAA,MACtB;AAGA,UAAI,oBAAoB,OAAO,QAAQ,EAAE,mBAAmB,MAAM;AAChE,eAAO,mBAAmB,QAAQ;AAAA,UAChC,QAAQ;AAAA,YACN,OAAO;AAAA,cACL,gCAAgC;AAAA,cAChC,0BAA0B;AAAA,cAC1B,OAAO,eAAe,QAAQ,gBAAgB;AAAA,YAChD;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAGD,UAAI,eAAe,OAAO,WAAW;AACnC,YAAI,2BAA2B,YAAY;AACzC,cAAI;AACF,kBAAM,uBAAuB;AAAA,UAC/B,SAAS,OAAO;AACd,mBAAO,sCAAsC,KAAK,IAAI;AAAA,cACpD,OAAO;AAAA,YACT,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluginIntlayerLynx.d.ts","sourceRoot":"","sources":["../../src/pluginIntlayerLynx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AASnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,kBAAkB,QAAO,aAiDrC,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|