@intlayer/babel 7.3.1 → 7.3.2-canary.1
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 +0 -2
- package/dist/cjs/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/cjs/babel-plugin-intlayer-extract.cjs +242 -0
- package/dist/cjs/babel-plugin-intlayer-extract.cjs.map +1 -0
- package/dist/cjs/{babel-plugin-intlayer.cjs → babel-plugin-intlayer-optimize.cjs} +114 -111
- package/dist/cjs/babel-plugin-intlayer-optimize.cjs.map +1 -0
- package/dist/cjs/getExtractPluginOptions.cjs +80 -0
- package/dist/cjs/getExtractPluginOptions.cjs.map +1 -0
- package/dist/cjs/getOptimizePluginOptions.cjs +60 -0
- package/dist/cjs/getOptimizePluginOptions.cjs.map +1 -0
- package/dist/cjs/index.cjs +8 -2
- package/dist/esm/_virtual/rolldown_runtime.mjs +8 -0
- package/dist/esm/babel-plugin-intlayer-extract.mjs +241 -0
- package/dist/esm/babel-plugin-intlayer-extract.mjs.map +1 -0
- package/dist/esm/{babel-plugin-intlayer.mjs → babel-plugin-intlayer-optimize.mjs} +113 -111
- package/dist/esm/babel-plugin-intlayer-optimize.mjs.map +1 -0
- package/dist/esm/getExtractPluginOptions.mjs +79 -0
- package/dist/esm/getExtractPluginOptions.mjs.map +1 -0
- package/dist/esm/getOptimizePluginOptions.mjs +59 -0
- package/dist/esm/getOptimizePluginOptions.mjs.map +1 -0
- package/dist/esm/index.mjs +5 -2
- package/dist/types/babel-plugin-intlayer-extract.d.ts +133 -0
- package/dist/types/babel-plugin-intlayer-extract.d.ts.map +1 -0
- package/dist/types/{babel-plugin-intlayer.d.ts → babel-plugin-intlayer-optimize.d.ts} +64 -55
- package/dist/types/babel-plugin-intlayer-optimize.d.ts.map +1 -0
- package/dist/types/getExtractPluginOptions.d.ts +13 -0
- package/dist/types/getExtractPluginOptions.d.ts.map +1 -0
- package/dist/types/getOptimizePluginOptions.d.ts +28 -0
- package/dist/types/getOptimizePluginOptions.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -2
- package/package.json +19 -8
- package/dist/cjs/babel-plugin-intlayer.cjs.map +0 -1
- package/dist/esm/babel-plugin-intlayer.mjs.map +0 -1
- package/dist/types/babel-plugin-intlayer.d.ts.map +0 -1
|
@@ -1,59 +1,68 @@
|
|
|
1
1
|
import { PluginObj, PluginPass } from "@babel/core";
|
|
2
2
|
import * as BabelTypes from "@babel/types";
|
|
3
3
|
|
|
4
|
-
//#region src/babel-plugin-intlayer.d.ts
|
|
4
|
+
//#region src/babel-plugin-intlayer-optimize.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Options for the optimization Babel plugin
|
|
8
|
+
*/
|
|
9
|
+
type OptimizePluginOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* If false, the plugin will not apply any transformation.
|
|
12
|
+
*/
|
|
13
|
+
optimize?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The path to the dictionaries directory.
|
|
16
|
+
*/
|
|
17
|
+
dictionariesDir: string;
|
|
18
|
+
/**
|
|
19
|
+
* The path to the dictionaries entry file.
|
|
20
|
+
*/
|
|
21
|
+
dictionariesEntryPath: string;
|
|
22
|
+
/**
|
|
23
|
+
* The path to the unmerged dictionaries entry file.
|
|
24
|
+
*/
|
|
25
|
+
unmergedDictionariesEntryPath: string;
|
|
26
|
+
/**
|
|
27
|
+
* The path to the unmerged dictionaries directory.
|
|
28
|
+
*/
|
|
29
|
+
unmergedDictionariesDir: string;
|
|
30
|
+
/**
|
|
31
|
+
* The path to the dictionaries directory.
|
|
32
|
+
*/
|
|
33
|
+
dynamicDictionariesDir: string;
|
|
34
|
+
/**
|
|
35
|
+
* The path to the dynamic dictionaries entry file.
|
|
36
|
+
*/
|
|
37
|
+
dynamicDictionariesEntryPath: string;
|
|
38
|
+
/**
|
|
39
|
+
* The path to the fetch dictionaries directory.
|
|
40
|
+
*/
|
|
41
|
+
fetchDictionariesDir: string;
|
|
42
|
+
/**
|
|
43
|
+
* The path to the fetch dictionaries entry file.
|
|
44
|
+
*/
|
|
45
|
+
fetchDictionariesEntryPath: string;
|
|
46
|
+
/**
|
|
47
|
+
* If true, the plugin will replace the dictionary entry file with `export default {}`.
|
|
48
|
+
*/
|
|
49
|
+
replaceDictionaryEntry: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* If true, the plugin will activate the dynamic import of the dictionaries. It will rely on Suspense to load the dictionaries.
|
|
52
|
+
*/
|
|
53
|
+
importMode: 'static' | 'dynamic' | 'live';
|
|
54
|
+
/**
|
|
55
|
+
* Activate the live sync of the dictionaries.
|
|
56
|
+
* If `importMode` is `live`, the plugin will activate the live sync of the dictionaries.
|
|
57
|
+
*/
|
|
58
|
+
liveSyncKeys: string[];
|
|
59
|
+
/**
|
|
60
|
+
* Files list to traverse.
|
|
61
|
+
*/
|
|
62
|
+
filesList: string[];
|
|
63
|
+
};
|
|
5
64
|
type State = PluginPass & {
|
|
6
|
-
opts:
|
|
7
|
-
/**
|
|
8
|
-
* The path to the dictionaries directory.
|
|
9
|
-
*/
|
|
10
|
-
dictionariesDir: string;
|
|
11
|
-
/**
|
|
12
|
-
* The path to the dictionaries entry file.
|
|
13
|
-
*/
|
|
14
|
-
dictionariesEntryPath: string;
|
|
15
|
-
/**
|
|
16
|
-
* The path to the unmerged dictionaries entry file.
|
|
17
|
-
*/
|
|
18
|
-
unmergedDictionariesEntryPath: string;
|
|
19
|
-
/**
|
|
20
|
-
* The path to the unmerged dictionaries directory.
|
|
21
|
-
*/
|
|
22
|
-
unmergedDictionariesDir: string;
|
|
23
|
-
/**
|
|
24
|
-
* The path to the dictionaries directory.
|
|
25
|
-
*/
|
|
26
|
-
dynamicDictionariesDir: string;
|
|
27
|
-
/**
|
|
28
|
-
* The path to the dynamic dictionaries entry file.
|
|
29
|
-
*/
|
|
30
|
-
dynamicDictionariesEntryPath: string;
|
|
31
|
-
/**
|
|
32
|
-
* The path to the fetch dictionaries directory.
|
|
33
|
-
*/
|
|
34
|
-
fetchDictionariesDir: string;
|
|
35
|
-
/**
|
|
36
|
-
* The path to the fetch dictionaries entry file.
|
|
37
|
-
*/
|
|
38
|
-
fetchDictionariesEntryPath: string;
|
|
39
|
-
/**
|
|
40
|
-
* If true, the plugin will replace the dictionary entry file with `export default {}`.
|
|
41
|
-
*/
|
|
42
|
-
replaceDictionaryEntry: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* If true, the plugin will activate the dynamic import of the dictionaries. It will rely on Suspense to load the dictionaries.
|
|
45
|
-
*/
|
|
46
|
-
importMode: 'static' | 'dynamic' | 'live';
|
|
47
|
-
/**
|
|
48
|
-
* Activate the live sync of the dictionaries.
|
|
49
|
-
* If `importMode` is `live`, the plugin will activate the live sync of the dictionaries.
|
|
50
|
-
*/
|
|
51
|
-
liveSyncKeys: string[];
|
|
52
|
-
/**
|
|
53
|
-
* Files list to traverse.
|
|
54
|
-
*/
|
|
55
|
-
filesList: string[];
|
|
56
|
-
};
|
|
65
|
+
opts: OptimizePluginOptions;
|
|
57
66
|
/** map key → generated ident (per-file) for static imports */
|
|
58
67
|
_newStaticImports?: Map<string, BabelTypes.Identifier>;
|
|
59
68
|
/** map key → generated ident (per-file) for dynamic imports */
|
|
@@ -149,9 +158,9 @@ type State = PluginPass & {
|
|
|
149
158
|
* const content2 = getIntlayer(_dicHash);
|
|
150
159
|
* ```
|
|
151
160
|
*/
|
|
152
|
-
declare const
|
|
161
|
+
declare const intlayerOptimizeBabelPlugin: (babel: {
|
|
153
162
|
types: typeof BabelTypes;
|
|
154
163
|
}) => PluginObj<State>;
|
|
155
164
|
//#endregion
|
|
156
|
-
export {
|
|
157
|
-
//# sourceMappingURL=babel-plugin-intlayer.d.ts.map
|
|
165
|
+
export { OptimizePluginOptions, intlayerOptimizeBabelPlugin };
|
|
166
|
+
//# sourceMappingURL=babel-plugin-intlayer-optimize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel-plugin-intlayer-optimize.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-optimize.ts"],"sourcesContent":[],"mappings":";;;;;;;AAyDA;AAwDK,KAxDO,qBAAA,GAwDF;EAAG;;;EAGS,QAAA,CAAA,EAAA,OAAA;EAEa;;;EA6ItB,eAAA,EAAA,MAAA;EACG;;;EACH,qBAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KApJR,KAAA,GAAQ;QACL;;sBAEc,YAAY,UAAA,CAAW;;uBAEtB,YAAY,UAAA,CAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6IjC;gBACG;MACZ,UAAU"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtractPluginOptions } from "./babel-plugin-intlayer-extract.js";
|
|
2
|
+
|
|
3
|
+
//#region src/getExtractPluginOptions.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Get the options for the Intlayer Babel extraction plugin
|
|
7
|
+
* This function loads the Intlayer configuration and sets up the onExtract callback
|
|
8
|
+
* to write dictionaries to the filesystem.
|
|
9
|
+
*/
|
|
10
|
+
declare const getExtractPluginOptions: () => ExtractPluginOptions;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getExtractPluginOptions };
|
|
13
|
+
//# sourceMappingURL=getExtractPluginOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getExtractPluginOptions.d.ts","names":[],"sources":["../../src/getExtractPluginOptions.ts"],"sourcesContent":[],"mappings":";;;;;;AA6BA;;;cAAa,+BAA8B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OptimizePluginOptions } from "./babel-plugin-intlayer-optimize.js";
|
|
2
|
+
import { GetConfigurationOptions } from "@intlayer/config";
|
|
3
|
+
import { Dictionary } from "@intlayer/types";
|
|
4
|
+
|
|
5
|
+
//#region src/getOptimizePluginOptions.d.ts
|
|
6
|
+
type GetOptimizePluginOptionsParams = {
|
|
7
|
+
/**
|
|
8
|
+
* Configuration options for loading intlayer config
|
|
9
|
+
*/
|
|
10
|
+
configOptions?: GetConfigurationOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Pre-loaded dictionaries (optional - will be loaded if not provided)
|
|
13
|
+
*/
|
|
14
|
+
dictionaries?: Dictionary[];
|
|
15
|
+
/**
|
|
16
|
+
* Override specific options
|
|
17
|
+
*/
|
|
18
|
+
overrides?: Partial<OptimizePluginOptions>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get the options for the Intlayer Babel optimization plugin
|
|
22
|
+
* This function loads the Intlayer configuration and returns the paths
|
|
23
|
+
* needed for dictionary optimization and import rewriting.
|
|
24
|
+
*/
|
|
25
|
+
declare const getOptimizePluginOptions: (params?: GetOptimizePluginOptionsParams) => OptimizePluginOptions;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getOptimizePluginOptions };
|
|
28
|
+
//# sourceMappingURL=getOptimizePluginOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOptimizePluginOptions.d.ts","names":[],"sources":["../../src/getOptimizePluginOptions.ts"],"sourcesContent":[],"mappings":";;;;;KASK,8BAAA;;AAFyE;;EAU7D,aAAA,CAAA,EAJC,uBAID;EAIK;;;EA2BT,YAAA,CAAA,EA/BI,UA+BJ,EAmEZ;;;;cA9Fa,QAAQ;;;;;;;cA2BT,oCACF,mCACR"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ExtractPluginOptions, ExtractResult, intlayerExtractBabelPlugin } from "./babel-plugin-intlayer-extract.js";
|
|
2
|
+
import { OptimizePluginOptions, intlayerOptimizeBabelPlugin } from "./babel-plugin-intlayer-optimize.js";
|
|
3
|
+
import { getExtractPluginOptions } from "./getExtractPluginOptions.js";
|
|
4
|
+
import { getOptimizePluginOptions } from "./getOptimizePluginOptions.js";
|
|
5
|
+
export { ExtractPluginOptions, ExtractResult, OptimizePluginOptions, getExtractPluginOptions, getOptimizePluginOptions, intlayerExtractBabelPlugin, intlayerOptimizeBabelPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/babel",
|
|
3
|
-
"version": "7.3.1",
|
|
3
|
+
"version": "7.3.2-canary.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Babel plugin for Intlayer that transforms declaration files and provides internationalization features during the build process according to the Intlayer configuration.",
|
|
6
6
|
"keywords": [
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"./package.json"
|
|
59
59
|
],
|
|
60
60
|
"scripts": {
|
|
61
|
+
"_prepublish": "cp -f ../../../README.md ./README.md",
|
|
61
62
|
"build": "tsdown --config tsdown.config.ts",
|
|
62
63
|
"build:ci": "tsdown --config tsdown.config.ts",
|
|
63
64
|
"clean": "rimraf ./dist .turbo",
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
"format:fix": "biome format --write .",
|
|
67
68
|
"lint": "biome lint .",
|
|
68
69
|
"lint:fix": "biome lint --write .",
|
|
69
|
-
"prepublish": "
|
|
70
|
+
"prepublish": "echo prepublish temporally disabled to avoid rewrite readme",
|
|
70
71
|
"publish": "bun publish || true",
|
|
71
72
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
72
73
|
"publish:latest": "bun publish --access public --tag latest || true",
|
|
@@ -80,23 +81,33 @@
|
|
|
80
81
|
"@babel/parser": "7.1.5",
|
|
81
82
|
"@babel/traverse": "7.28.0",
|
|
82
83
|
"@babel/types": "7.28.4",
|
|
83
|
-
"@intlayer/chokidar": "7.3.1",
|
|
84
|
-
"@intlayer/config": "7.3.1",
|
|
85
|
-
"@intlayer/types": "7.3.1",
|
|
84
|
+
"@intlayer/chokidar": "7.3.2-canary.1",
|
|
85
|
+
"@intlayer/config": "7.3.2-canary.1",
|
|
86
|
+
"@intlayer/types": "7.3.2-canary.1",
|
|
86
87
|
"@types/babel__core": "7.20.5",
|
|
87
88
|
"@types/babel__generator": "7.27.0",
|
|
88
|
-
"@types/babel__traverse": "7.28.0"
|
|
89
|
+
"@types/babel__traverse": "7.28.0",
|
|
90
|
+
"fast-glob": "3.3.3"
|
|
89
91
|
},
|
|
90
92
|
"devDependencies": {
|
|
93
|
+
"@intlayer/dictionaries-entry": "7.3.2-canary.1",
|
|
91
94
|
"@types/crypto-js": "4.2.2",
|
|
92
95
|
"@types/node": "24.10.1",
|
|
93
96
|
"@utils/ts-config": "1.0.4",
|
|
94
97
|
"@utils/ts-config-types": "1.0.4",
|
|
95
98
|
"@utils/tsdown-config": "1.0.4",
|
|
96
99
|
"rimraf": "6.1.2",
|
|
97
|
-
"tsdown": "0.16.
|
|
100
|
+
"tsdown": "0.16.8",
|
|
98
101
|
"typescript": "5.9.3",
|
|
99
|
-
"vitest": "4.0.
|
|
102
|
+
"vitest": "4.0.14"
|
|
103
|
+
},
|
|
104
|
+
"peerDependencies": {
|
|
105
|
+
"@intlayer/dictionaries-entry": "7.3.2-canary.1"
|
|
106
|
+
},
|
|
107
|
+
"peerDependenciesMeta": {
|
|
108
|
+
"@intlayer/dictionaries-entry": {
|
|
109
|
+
"optional": true
|
|
110
|
+
}
|
|
100
111
|
},
|
|
101
112
|
"engines": {
|
|
102
113
|
"node": ">=14.18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer.cjs","names":["imports: BabelTypes.ImportDeclaration[]","helperMap: Record<string, string>","perCallMode: 'static' | 'dynamic' | 'live'","ident: BabelTypes.Identifier"],"sources":["../../src/babel-plugin-intlayer.ts"],"sourcesContent":["import { dirname, join, relative } from 'node:path';\nimport type { NodePath, PluginObj, PluginPass } from '@babel/core';\nimport type * as BabelTypes from '@babel/types';\nimport { getFileHash } from '@intlayer/chokidar';\nimport { normalizePath } from '@intlayer/config';\n\n/* ────────────────────────────────────────── constants ───────────────────── */\n\nconst PACKAGE_LIST = [\n 'intlayer',\n '@intlayer/core',\n 'react-intlayer',\n 'react-intlayer/client',\n 'react-intlayer/server',\n 'next-intlayer',\n 'next-intlayer/client',\n 'next-intlayer/server',\n 'svelte-intlayer',\n 'vue-intlayer',\n 'angular-intlayer',\n 'preact-intlayer',\n 'solid-intlayer',\n];\n\nconst CALLER_LIST = ['useIntlayer', 'getIntlayer'] as const;\n\n/**\n * Packages that support dynamic import\n */\nconst PACKAGE_LIST_DYNAMIC = [\n 'react-intlayer',\n 'react-intlayer/client',\n 'react-intlayer/server',\n 'next-intlayer',\n 'next-intlayer/client',\n 'next-intlayer/server',\n 'preact-intlayer',\n 'vue-intlayer',\n 'solid-intlayer',\n 'svelte-intlayer',\n 'angular-intlayer',\n] as const;\n\nconst STATIC_IMPORT_FUNCTION = {\n getIntlayer: 'getDictionary',\n useIntlayer: 'useDictionary',\n} as const;\n\nconst DYNAMIC_IMPORT_FUNCTION = {\n useIntlayer: 'useDictionaryDynamic',\n} as const;\n\n/* ────────────────────────────────────────── types ───────────────────────── */\n\ntype State = PluginPass & {\n opts: {\n /**\n * The path to the dictionaries directory.\n */\n dictionariesDir: string;\n /**\n * The path to the dictionaries entry file.\n */\n dictionariesEntryPath: string;\n /**\n * The path to the unmerged dictionaries entry file.\n */\n unmergedDictionariesEntryPath: string;\n /**\n * The path to the unmerged dictionaries directory.\n */\n unmergedDictionariesDir: string;\n /**\n * The path to the dictionaries directory.\n */\n dynamicDictionariesDir: string;\n /**\n * The path to the dynamic dictionaries entry file.\n */\n dynamicDictionariesEntryPath: string;\n /**\n * The path to the fetch dictionaries directory.\n */\n fetchDictionariesDir: string;\n /**\n * The path to the fetch dictionaries entry file.\n */\n fetchDictionariesEntryPath: string;\n /**\n * If true, the plugin will replace the dictionary entry file with `export default {}`.\n */\n replaceDictionaryEntry: boolean;\n /**\n * If true, the plugin will activate the dynamic import of the dictionaries. It will rely on Suspense to load the dictionaries.\n */\n importMode: 'static' | 'dynamic' | 'live';\n /**\n * Activate the live sync of the dictionaries.\n * If `importMode` is `live`, the plugin will activate the live sync of the dictionaries.\n */\n liveSyncKeys: string[];\n /**\n * Files list to traverse.\n */\n filesList: string[];\n };\n /** map key → generated ident (per-file) for static imports */\n _newStaticImports?: Map<string, BabelTypes.Identifier>;\n /** map key → generated ident (per-file) for dynamic imports */\n _newDynamicImports?: Map<string, BabelTypes.Identifier>;\n /** whether the current file imported *any* intlayer package */\n _hasValidImport?: boolean;\n /** whether the current file *is* the dictionaries entry file */\n _isDictEntry?: boolean;\n /** whether dynamic helpers are active for this file */\n _useDynamicHelpers?: boolean;\n /** whether the current file is included in the filesList */\n _isIncluded?: boolean;\n};\n\n/* ────────────────────────────────────────── helpers ─────────────────────── */\n\n/**\n * Replicates the xxHash64 → Base-62 algorithm used by the SWC version\n * and prefixes an underscore so the generated identifiers never collide\n * with user-defined ones.\n */\nconst makeIdent = (\n key: string,\n t: typeof BabelTypes\n): BabelTypes.Identifier => {\n const hash = getFileHash(key);\n return t.identifier(`_${hash}`);\n};\n\nconst computeImport = (\n fromFile: string,\n dictionariesDir: string,\n dynamicDictionariesDir: string,\n fetchDictionariesDir: string,\n key: string,\n importMode: 'static' | 'dynamic' | 'live'\n): string => {\n let relativePath = join(dictionariesDir, `${key}.json`);\n\n if (importMode === 'live') {\n relativePath = join(fetchDictionariesDir, `${key}.mjs`);\n }\n\n if (importMode === 'dynamic') {\n relativePath = join(dynamicDictionariesDir, `${key}.mjs`);\n }\n\n let rel = relative(dirname(fromFile), relativePath);\n\n // Fix windows path\n rel = normalizePath(rel);\n\n // Fix relative path\n if (!rel.startsWith('./') && !rel.startsWith('../')) {\n rel = `./${rel}`;\n }\n\n return rel;\n};\n\n/* ────────────────────────────────────────── plugin ──────────────────────── */\n\n/**\n * Babel plugin that transforms Intlayer function calls and auto-imports dictionaries.\n *\n * This plugin transforms calls to `useIntlayer()` and `getIntlayer()` from various Intlayer\n * packages into optimized dictionary access patterns, automatically importing the required\n * dictionary files based on the configured import mode.\n *\n * ## Supported Input Patterns\n *\n * The plugin recognizes these function calls:\n *\n * ```ts\n * // useIntlayer\n * import { useIntlayer } from 'react-intlayer';\n * import { useIntlayer } from 'next-intlayer';\n *\n * // getIntlayer\n * import { getIntlayer } from 'intlayer';\n *\n * // Usage\n * const content = useIntlayer('app');\n * const content = getIntlayer('app');\n * ```\n *\n * ## Transformation Modes\n *\n * ### Static Mode (default: `importMode = \"static\"`)\n *\n * Imports JSON dictionaries directly and replaces function calls with dictionary access:\n *\n * **Output:**\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import { useDictionary as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash);\n * const content2 = getIntlayer(_dicHash);\n * ```\n *\n * ### Dynamic Mode (`importMode = \"dynamic\"`)\n *\n * Uses dynamic dictionary loading with Suspense support:\n *\n * **Output:**\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import _dicHash_dyn from '../../.intlayer/dynamic_dictionaries/app.mjs';\n * import { useDictionaryDynamic as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash_dyn, 'app');\n * const content2 = getIntlayer(_dicHash);\n * ```\n *\n * ### Live Mode (`importMode = \"live\"`)\n *\n * Uses live-based dictionary loading for remote dictionaries:\n *\n * **Output if `liveSyncKeys` includes the key:**\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import _dicHash_fetch from '../../.intlayer/fetch_dictionaries/app.mjs';\n * import { useDictionaryDynamic as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash_fetch, \"app\");\n * const content2 = getIntlayer(_dicHash);\n * ```\n *\n * > If `liveSyncKeys` does not include the key, the plugin will fallback to the dynamic impor\n *\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import _dicHash_dyn from '../../.intlayer/dynamic_dictionaries/app.mjs';\n * import { useDictionaryDynamic as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash_dyn, 'app');\n * const content2 = getIntlayer(_dicHash);\n * ```\n */\nexport const intlayerBabelPlugin = (babel: {\n types: typeof BabelTypes;\n}): PluginObj<State> => {\n const { types: t } = babel;\n\n return {\n name: 'babel-plugin-intlayer-transform',\n\n pre() {\n this._newStaticImports = new Map();\n this._newDynamicImports = new Map();\n this._isIncluded = true;\n this._hasValidImport = false;\n this._isDictEntry = false;\n this._useDynamicHelpers = false;\n\n // If filesList is provided, check if current file is included\n const filename = this.file.opts.filename;\n if (this.opts.filesList && filename) {\n const isIncluded = this.opts.filesList.includes(filename);\n\n if (!isIncluded) {\n // Force _isIncluded to false to skip processing\n this._isIncluded = false;\n return;\n }\n }\n },\n\n visitor: {\n /* If this file *is* the dictionaries entry, short-circuit: export {} */\n Program: {\n enter(programPath, state) {\n // Safe access to filename\n const filename = state.file.opts.filename;\n\n // Check if this is the correct file to transform\n if (\n state.opts.replaceDictionaryEntry &&\n filename === state.opts.dictionariesEntryPath\n ) {\n state._isDictEntry = true;\n\n // 3. Traverse the program to surgically remove/edit specific parts\n programPath.traverse({\n // Step A: Remove all import statements (cleaning up 'sssss.json')\n ImportDeclaration(path) {\n path.remove();\n },\n\n // Step B: Find the variable definition and empty the object\n VariableDeclarator(path) {\n // We look for: const x = { ... }\n if (t.isObjectExpression(path.node.init)) {\n // Set the object properties to an empty array: {}\n path.node.init.properties = [];\n }\n },\n });\n\n // (Optional) Stop other plugins from processing this file further if needed\n // programPath.stop();\n }\n },\n\n /* 3. After full traversal, inject the JSON dictionary imports. */\n exit(programPath, state) {\n if (state._isDictEntry) return; // nothing else to do – already replaced\n if (!state._hasValidImport) return; // early-out if we touched nothing\n if (!state._isIncluded) return; // early-out if file is not included\n\n const file = state.file.opts.filename!;\n const dictionariesDir = state.opts.dictionariesDir;\n const dynamicDictionariesDir = state.opts.dynamicDictionariesDir;\n const fetchDictionariesDir = state.opts.fetchDictionariesDir;\n const imports: BabelTypes.ImportDeclaration[] = [];\n\n // Generate static JSON imports (getIntlayer always uses JSON dictionaries)\n for (const [key, ident] of state._newStaticImports!) {\n const rel = computeImport(\n file,\n dictionariesDir,\n dynamicDictionariesDir,\n fetchDictionariesDir,\n key,\n 'static'\n );\n\n const importDeclarationNode = t.importDeclaration(\n [t.importDefaultSpecifier(t.identifier(ident.name))],\n t.stringLiteral(rel)\n );\n\n // Add 'type: json' attribute for JSON files\n importDeclarationNode.attributes = [\n t.importAttribute(t.identifier('type'), t.stringLiteral('json')),\n ];\n\n imports.push(importDeclarationNode);\n }\n\n // Generate dynamic/fetch imports (for useIntlayer when using dynamic/live helpers)\n for (const [key, ident] of state._newDynamicImports!) {\n const modeForThisIdent: 'dynamic' | 'live' = ident.name.endsWith(\n '_fetch'\n )\n ? 'live'\n : 'dynamic';\n\n const rel = computeImport(\n file,\n dictionariesDir,\n dynamicDictionariesDir,\n fetchDictionariesDir,\n key,\n modeForThisIdent\n );\n imports.push(\n t.importDeclaration(\n [t.importDefaultSpecifier(t.identifier(ident.name))],\n t.stringLiteral(rel)\n )\n );\n }\n\n if (!imports.length) return;\n\n /* Keep \"use client\" / \"use server\" directives at the very top. */\n const bodyPaths = programPath.get(\n 'body'\n ) as NodePath<BabelTypes.Statement>[];\n let insertPos = 0;\n for (const stmtPath of bodyPaths) {\n const stmt = stmtPath.node;\n if (\n t.isExpressionStatement(stmt) &&\n t.isStringLiteral(stmt.expression) &&\n !stmt.expression.value.startsWith('import') &&\n !stmt.expression.value.startsWith('require')\n ) {\n insertPos += 1;\n } else {\n break;\n }\n }\n\n programPath.node.body.splice(insertPos, 0, ...imports);\n },\n },\n\n /* 1. Inspect *every* intlayer impor */\n ImportDeclaration(path, state) {\n if (state._isDictEntry) return; // skip if entry file – already handled\n\n const src = path.node.source.value;\n if (!PACKAGE_LIST.includes(src)) return;\n\n // Mark that we do import from an intlayer package in this file; this is\n // enough to know that we *might* need to inject runtime helpers later.\n state._hasValidImport = true;\n\n for (const spec of path.node.specifiers) {\n if (!t.isImportSpecifier(spec)) continue;\n\n // ⚠️ We now key off *imported* name, *not* local name.\n const importedName = t.isIdentifier(spec.imported)\n ? spec.imported.name\n : (spec.imported as BabelTypes.StringLiteral).value;\n\n const importMode = state.opts.importMode;\n // Determine whether this import should use the dynamic helpers.\n const shouldUseDynamicHelpers =\n (importMode === 'dynamic' || importMode === 'live') &&\n PACKAGE_LIST_DYNAMIC.includes(src as any);\n\n // Remember for later (CallExpression) whether we are using the dynamic helpers\n if (shouldUseDynamicHelpers) {\n state._useDynamicHelpers = true;\n }\n\n let helperMap: Record<string, string>;\n\n if (shouldUseDynamicHelpers) {\n // Use dynamic helpers for useIntlayer when dynamic mode is enabled\n helperMap = {\n ...STATIC_IMPORT_FUNCTION,\n ...DYNAMIC_IMPORT_FUNCTION,\n } as Record<string, string>;\n } else {\n // Use static helpers by default\n helperMap = STATIC_IMPORT_FUNCTION as Record<string, string>;\n }\n\n const newIdentifier = helperMap[importedName];\n\n // Only rewrite when we actually have a mapping for the imported\n // specifier (ignore unrelated named imports).\n if (newIdentifier) {\n // Keep the local alias intact (so calls remain `useIntlayer` /\n // `getIntlayer`), but rewrite the imported identifier so it\n // points to our helper implementation.\n spec.imported = t.identifier(newIdentifier);\n }\n }\n },\n\n /* 2. Replace calls: useIntlayer(\"foo\") → useDictionary(_hash) or useDictionaryDynamic(_hash, \"foo\") */\n CallExpression(path, state) {\n if (state._isDictEntry) return; // skip if entry file – already handled\n\n const callee = path.node.callee;\n if (!t.isIdentifier(callee)) return;\n if (!CALLER_LIST.includes(callee.name as any)) return;\n\n // Ensure we ultimately emit helper imports for files that *invoke*\n // the hooks, even if they didn't import them directly (edge cases with\n // re-exports).\n state._hasValidImport = true;\n\n const arg = path.node.arguments[0];\n if (!arg || !t.isStringLiteral(arg)) return; // must be literal\n\n const key = arg.value;\n const importMode = state.opts.importMode;\n const isUseIntlayer = callee.name === 'useIntlayer';\n const useDynamicHelpers = Boolean(state._useDynamicHelpers);\n\n // Decide per-call mode: 'static' | 'dynamic' | 'live'\n let perCallMode: 'static' | 'dynamic' | 'live' = 'static';\n if (isUseIntlayer && useDynamicHelpers) {\n if (importMode === 'dynamic') {\n perCallMode = 'dynamic';\n } else if (importMode === 'live') {\n const liveKeys = state.opts.liveSyncKeys ?? [];\n perCallMode = liveKeys.includes(key) ? 'live' : 'dynamic';\n }\n }\n\n let ident: BabelTypes.Identifier;\n\n if (perCallMode === 'live') {\n // Use fetch dictionaries entry (live mode for selected keys)\n let dynamicIdent = state._newDynamicImports?.get(key);\n if (!dynamicIdent) {\n const hash = getFileHash(key);\n dynamicIdent = t.identifier(`_${hash}_fetch`);\n state._newDynamicImports?.set(key, dynamicIdent);\n }\n ident = dynamicIdent;\n\n // Helper: first argument is the dictionary entry, second is the key\n path.node.arguments = [\n t.identifier(ident.name),\n ...path.node.arguments,\n ];\n } else if (perCallMode === 'dynamic') {\n // Use dynamic dictionaries entry\n let dynamicIdent = state._newDynamicImports?.get(key);\n if (!dynamicIdent) {\n // Create a unique identifier for dynamic imports by appending a suffix\n const hash = getFileHash(key);\n dynamicIdent = t.identifier(`_${hash}_dyn`);\n state._newDynamicImports?.set(key, dynamicIdent);\n }\n ident = dynamicIdent;\n\n // Dynamic helper: first argument is the dictionary, second is the key.\n path.node.arguments = [\n t.identifier(ident.name),\n ...path.node.arguments,\n ];\n } else {\n // Use static imports for getIntlayer or useIntlayer when not using dynamic helpers\n let staticIdent = state._newStaticImports?.get(key);\n if (!staticIdent) {\n staticIdent = makeIdent(key, t);\n state._newStaticImports?.set(key, staticIdent);\n }\n ident = staticIdent;\n\n // Static helper (useDictionary / getDictionary): replace key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AAE,WAAW,MAAM,KAAK;;;GAGtD;EACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer.mjs","names":["imports: BabelTypes.ImportDeclaration[]","helperMap: Record<string, string>","perCallMode: 'static' | 'dynamic' | 'live'","ident: BabelTypes.Identifier"],"sources":["../../src/babel-plugin-intlayer.ts"],"sourcesContent":["import { dirname, join, relative } from 'node:path';\nimport type { NodePath, PluginObj, PluginPass } from '@babel/core';\nimport type * as BabelTypes from '@babel/types';\nimport { getFileHash } from '@intlayer/chokidar';\nimport { normalizePath } from '@intlayer/config';\n\n/* ────────────────────────────────────────── constants ───────────────────── */\n\nconst PACKAGE_LIST = [\n 'intlayer',\n '@intlayer/core',\n 'react-intlayer',\n 'react-intlayer/client',\n 'react-intlayer/server',\n 'next-intlayer',\n 'next-intlayer/client',\n 'next-intlayer/server',\n 'svelte-intlayer',\n 'vue-intlayer',\n 'angular-intlayer',\n 'preact-intlayer',\n 'solid-intlayer',\n];\n\nconst CALLER_LIST = ['useIntlayer', 'getIntlayer'] as const;\n\n/**\n * Packages that support dynamic import\n */\nconst PACKAGE_LIST_DYNAMIC = [\n 'react-intlayer',\n 'react-intlayer/client',\n 'react-intlayer/server',\n 'next-intlayer',\n 'next-intlayer/client',\n 'next-intlayer/server',\n 'preact-intlayer',\n 'vue-intlayer',\n 'solid-intlayer',\n 'svelte-intlayer',\n 'angular-intlayer',\n] as const;\n\nconst STATIC_IMPORT_FUNCTION = {\n getIntlayer: 'getDictionary',\n useIntlayer: 'useDictionary',\n} as const;\n\nconst DYNAMIC_IMPORT_FUNCTION = {\n useIntlayer: 'useDictionaryDynamic',\n} as const;\n\n/* ────────────────────────────────────────── types ───────────────────────── */\n\ntype State = PluginPass & {\n opts: {\n /**\n * The path to the dictionaries directory.\n */\n dictionariesDir: string;\n /**\n * The path to the dictionaries entry file.\n */\n dictionariesEntryPath: string;\n /**\n * The path to the unmerged dictionaries entry file.\n */\n unmergedDictionariesEntryPath: string;\n /**\n * The path to the unmerged dictionaries directory.\n */\n unmergedDictionariesDir: string;\n /**\n * The path to the dictionaries directory.\n */\n dynamicDictionariesDir: string;\n /**\n * The path to the dynamic dictionaries entry file.\n */\n dynamicDictionariesEntryPath: string;\n /**\n * The path to the fetch dictionaries directory.\n */\n fetchDictionariesDir: string;\n /**\n * The path to the fetch dictionaries entry file.\n */\n fetchDictionariesEntryPath: string;\n /**\n * If true, the plugin will replace the dictionary entry file with `export default {}`.\n */\n replaceDictionaryEntry: boolean;\n /**\n * If true, the plugin will activate the dynamic import of the dictionaries. It will rely on Suspense to load the dictionaries.\n */\n importMode: 'static' | 'dynamic' | 'live';\n /**\n * Activate the live sync of the dictionaries.\n * If `importMode` is `live`, the plugin will activate the live sync of the dictionaries.\n */\n liveSyncKeys: string[];\n /**\n * Files list to traverse.\n */\n filesList: string[];\n };\n /** map key → generated ident (per-file) for static imports */\n _newStaticImports?: Map<string, BabelTypes.Identifier>;\n /** map key → generated ident (per-file) for dynamic imports */\n _newDynamicImports?: Map<string, BabelTypes.Identifier>;\n /** whether the current file imported *any* intlayer package */\n _hasValidImport?: boolean;\n /** whether the current file *is* the dictionaries entry file */\n _isDictEntry?: boolean;\n /** whether dynamic helpers are active for this file */\n _useDynamicHelpers?: boolean;\n /** whether the current file is included in the filesList */\n _isIncluded?: boolean;\n};\n\n/* ────────────────────────────────────────── helpers ─────────────────────── */\n\n/**\n * Replicates the xxHash64 → Base-62 algorithm used by the SWC version\n * and prefixes an underscore so the generated identifiers never collide\n * with user-defined ones.\n */\nconst makeIdent = (\n key: string,\n t: typeof BabelTypes\n): BabelTypes.Identifier => {\n const hash = getFileHash(key);\n return t.identifier(`_${hash}`);\n};\n\nconst computeImport = (\n fromFile: string,\n dictionariesDir: string,\n dynamicDictionariesDir: string,\n fetchDictionariesDir: string,\n key: string,\n importMode: 'static' | 'dynamic' | 'live'\n): string => {\n let relativePath = join(dictionariesDir, `${key}.json`);\n\n if (importMode === 'live') {\n relativePath = join(fetchDictionariesDir, `${key}.mjs`);\n }\n\n if (importMode === 'dynamic') {\n relativePath = join(dynamicDictionariesDir, `${key}.mjs`);\n }\n\n let rel = relative(dirname(fromFile), relativePath);\n\n // Fix windows path\n rel = normalizePath(rel);\n\n // Fix relative path\n if (!rel.startsWith('./') && !rel.startsWith('../')) {\n rel = `./${rel}`;\n }\n\n return rel;\n};\n\n/* ────────────────────────────────────────── plugin ──────────────────────── */\n\n/**\n * Babel plugin that transforms Intlayer function calls and auto-imports dictionaries.\n *\n * This plugin transforms calls to `useIntlayer()` and `getIntlayer()` from various Intlayer\n * packages into optimized dictionary access patterns, automatically importing the required\n * dictionary files based on the configured import mode.\n *\n * ## Supported Input Patterns\n *\n * The plugin recognizes these function calls:\n *\n * ```ts\n * // useIntlayer\n * import { useIntlayer } from 'react-intlayer';\n * import { useIntlayer } from 'next-intlayer';\n *\n * // getIntlayer\n * import { getIntlayer } from 'intlayer';\n *\n * // Usage\n * const content = useIntlayer('app');\n * const content = getIntlayer('app');\n * ```\n *\n * ## Transformation Modes\n *\n * ### Static Mode (default: `importMode = \"static\"`)\n *\n * Imports JSON dictionaries directly and replaces function calls with dictionary access:\n *\n * **Output:**\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import { useDictionary as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash);\n * const content2 = getIntlayer(_dicHash);\n * ```\n *\n * ### Dynamic Mode (`importMode = \"dynamic\"`)\n *\n * Uses dynamic dictionary loading with Suspense support:\n *\n * **Output:**\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import _dicHash_dyn from '../../.intlayer/dynamic_dictionaries/app.mjs';\n * import { useDictionaryDynamic as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash_dyn, 'app');\n * const content2 = getIntlayer(_dicHash);\n * ```\n *\n * ### Live Mode (`importMode = \"live\"`)\n *\n * Uses live-based dictionary loading for remote dictionaries:\n *\n * **Output if `liveSyncKeys` includes the key:**\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import _dicHash_fetch from '../../.intlayer/fetch_dictionaries/app.mjs';\n * import { useDictionaryDynamic as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash_fetch, \"app\");\n * const content2 = getIntlayer(_dicHash);\n * ```\n *\n * > If `liveSyncKeys` does not include the key, the plugin will fallback to the dynamic impor\n *\n * ```ts\n * import _dicHash from '../../.intlayer/dictionaries/app.json' with { type: 'json' };\n * import _dicHash_dyn from '../../.intlayer/dynamic_dictionaries/app.mjs';\n * import { useDictionaryDynamic as useIntlayer } from 'react-intlayer';\n * import { getDictionary as getIntlayer } from 'intlayer';\n *\n * const content1 = useIntlayer(_dicHash_dyn, 'app');\n * const content2 = getIntlayer(_dicHash);\n * ```\n */\nexport const intlayerBabelPlugin = (babel: {\n types: typeof BabelTypes;\n}): PluginObj<State> => {\n const { types: t } = babel;\n\n return {\n name: 'babel-plugin-intlayer-transform',\n\n pre() {\n this._newStaticImports = new Map();\n this._newDynamicImports = new Map();\n this._isIncluded = true;\n this._hasValidImport = false;\n this._isDictEntry = false;\n this._useDynamicHelpers = false;\n\n // If filesList is provided, check if current file is included\n const filename = this.file.opts.filename;\n if (this.opts.filesList && filename) {\n const isIncluded = this.opts.filesList.includes(filename);\n\n if (!isIncluded) {\n // Force _isIncluded to false to skip processing\n this._isIncluded = false;\n return;\n }\n }\n },\n\n visitor: {\n /* If this file *is* the dictionaries entry, short-circuit: export {} */\n Program: {\n enter(programPath, state) {\n // Safe access to filename\n const filename = state.file.opts.filename;\n\n // Check if this is the correct file to transform\n if (\n state.opts.replaceDictionaryEntry &&\n filename === state.opts.dictionariesEntryPath\n ) {\n state._isDictEntry = true;\n\n // 3. Traverse the program to surgically remove/edit specific parts\n programPath.traverse({\n // Step A: Remove all import statements (cleaning up 'sssss.json')\n ImportDeclaration(path) {\n path.remove();\n },\n\n // Step B: Find the variable definition and empty the object\n VariableDeclarator(path) {\n // We look for: const x = { ... }\n if (t.isObjectExpression(path.node.init)) {\n // Set the object properties to an empty array: {}\n path.node.init.properties = [];\n }\n },\n });\n\n // (Optional) Stop other plugins from processing this file further if needed\n // programPath.stop();\n }\n },\n\n /* 3. After full traversal, inject the JSON dictionary imports. */\n exit(programPath, state) {\n if (state._isDictEntry) return; // nothing else to do – already replaced\n if (!state._hasValidImport) return; // early-out if we touched nothing\n if (!state._isIncluded) return; // early-out if file is not included\n\n const file = state.file.opts.filename!;\n const dictionariesDir = state.opts.dictionariesDir;\n const dynamicDictionariesDir = state.opts.dynamicDictionariesDir;\n const fetchDictionariesDir = state.opts.fetchDictionariesDir;\n const imports: BabelTypes.ImportDeclaration[] = [];\n\n // Generate static JSON imports (getIntlayer always uses JSON dictionaries)\n for (const [key, ident] of state._newStaticImports!) {\n const rel = computeImport(\n file,\n dictionariesDir,\n dynamicDictionariesDir,\n fetchDictionariesDir,\n key,\n 'static'\n );\n\n const importDeclarationNode = t.importDeclaration(\n [t.importDefaultSpecifier(t.identifier(ident.name))],\n t.stringLiteral(rel)\n );\n\n // Add 'type: json' attribute for JSON files\n importDeclarationNode.attributes = [\n t.importAttribute(t.identifier('type'), t.stringLiteral('json')),\n ];\n\n imports.push(importDeclarationNode);\n }\n\n // Generate dynamic/fetch imports (for useIntlayer when using dynamic/live helpers)\n for (const [key, ident] of state._newDynamicImports!) {\n const modeForThisIdent: 'dynamic' | 'live' = ident.name.endsWith(\n '_fetch'\n )\n ? 'live'\n : 'dynamic';\n\n const rel = computeImport(\n file,\n dictionariesDir,\n dynamicDictionariesDir,\n fetchDictionariesDir,\n key,\n modeForThisIdent\n );\n imports.push(\n t.importDeclaration(\n [t.importDefaultSpecifier(t.identifier(ident.name))],\n t.stringLiteral(rel)\n )\n );\n }\n\n if (!imports.length) return;\n\n /* Keep \"use client\" / \"use server\" directives at the very top. */\n const bodyPaths = programPath.get(\n 'body'\n ) as NodePath<BabelTypes.Statement>[];\n let insertPos = 0;\n for (const stmtPath of bodyPaths) {\n const stmt = stmtPath.node;\n if (\n t.isExpressionStatement(stmt) &&\n t.isStringLiteral(stmt.expression) &&\n !stmt.expression.value.startsWith('import') &&\n !stmt.expression.value.startsWith('require')\n ) {\n insertPos += 1;\n } else {\n break;\n }\n }\n\n programPath.node.body.splice(insertPos, 0, ...imports);\n },\n },\n\n /* 1. Inspect *every* intlayer impor */\n ImportDeclaration(path, state) {\n if (state._isDictEntry) return; // skip if entry file – already handled\n\n const src = path.node.source.value;\n if (!PACKAGE_LIST.includes(src)) return;\n\n // Mark that we do import from an intlayer package in this file; this is\n // enough to know that we *might* need to inject runtime helpers later.\n state._hasValidImport = true;\n\n for (const spec of path.node.specifiers) {\n if (!t.isImportSpecifier(spec)) continue;\n\n // ⚠️ We now key off *imported* name, *not* local name.\n const importedName = t.isIdentifier(spec.imported)\n ? spec.imported.name\n : (spec.imported as BabelTypes.StringLiteral).value;\n\n const importMode = state.opts.importMode;\n // Determine whether this import should use the dynamic helpers.\n const shouldUseDynamicHelpers =\n (importMode === 'dynamic' || importMode === 'live') &&\n PACKAGE_LIST_DYNAMIC.includes(src as any);\n\n // Remember for later (CallExpression) whether we are using the dynamic helpers\n if (shouldUseDynamicHelpers) {\n state._useDynamicHelpers = true;\n }\n\n let helperMap: Record<string, string>;\n\n if (shouldUseDynamicHelpers) {\n // Use dynamic helpers for useIntlayer when dynamic mode is enabled\n helperMap = {\n ...STATIC_IMPORT_FUNCTION,\n ...DYNAMIC_IMPORT_FUNCTION,\n } as Record<string, string>;\n } else {\n // Use static helpers by default\n helperMap = STATIC_IMPORT_FUNCTION as Record<string, string>;\n }\n\n const newIdentifier = helperMap[importedName];\n\n // Only rewrite when we actually have a mapping for the imported\n // specifier (ignore unrelated named imports).\n if (newIdentifier) {\n // Keep the local alias intact (so calls remain `useIntlayer` /\n // `getIntlayer`), but rewrite the imported identifier so it\n // points to our helper implementation.\n spec.imported = t.identifier(newIdentifier);\n }\n }\n },\n\n /* 2. Replace calls: useIntlayer(\"foo\") → useDictionary(_hash) or useDictionaryDynamic(_hash, \"foo\") */\n CallExpression(path, state) {\n if (state._isDictEntry) return; // skip if entry file – already handled\n\n const callee = path.node.callee;\n if (!t.isIdentifier(callee)) return;\n if (!CALLER_LIST.includes(callee.name as any)) return;\n\n // Ensure we ultimately emit helper imports for files that *invoke*\n // the hooks, even if they didn't import them directly (edge cases with\n // re-exports).\n state._hasValidImport = true;\n\n const arg = path.node.arguments[0];\n if (!arg || !t.isStringLiteral(arg)) return; // must be literal\n\n const key = arg.value;\n const importMode = state.opts.importMode;\n const isUseIntlayer = callee.name === 'useIntlayer';\n const useDynamicHelpers = Boolean(state._useDynamicHelpers);\n\n // Decide per-call mode: 'static' | 'dynamic' | 'live'\n let perCallMode: 'static' | 'dynamic' | 'live' = 'static';\n if (isUseIntlayer && useDynamicHelpers) {\n if (importMode === 'dynamic') {\n perCallMode = 'dynamic';\n } else if (importMode === 'live') {\n const liveKeys = state.opts.liveSyncKeys ?? [];\n perCallMode = liveKeys.includes(key) ? 'live' : 'dynamic';\n }\n }\n\n let ident: BabelTypes.Identifier;\n\n if (perCallMode === 'live') {\n // Use fetch dictionaries entry (live mode for selected keys)\n let dynamicIdent = state._newDynamicImports?.get(key);\n if (!dynamicIdent) {\n const hash = getFileHash(key);\n dynamicIdent = t.identifier(`_${hash}_fetch`);\n state._newDynamicImports?.set(key, dynamicIdent);\n }\n ident = dynamicIdent;\n\n // Helper: first argument is the dictionary entry, second is the key\n path.node.arguments = [\n t.identifier(ident.name),\n ...path.node.arguments,\n ];\n } else if (perCallMode === 'dynamic') {\n // Use dynamic dictionaries entry\n let dynamicIdent = state._newDynamicImports?.get(key);\n if (!dynamicIdent) {\n // Create a unique identifier for dynamic imports by appending a suffix\n const hash = getFileHash(key);\n dynamicIdent = t.identifier(`_${hash}_dyn`);\n state._newDynamicImports?.set(key, dynamicIdent);\n }\n ident = dynamicIdent;\n\n // Dynamic helper: first argument is the dictionary, second is the key.\n path.node.arguments = [\n t.identifier(ident.name),\n ...path.node.arguments,\n ];\n } else {\n // Use static imports for getIntlayer or useIntlayer when not using dynamic helpers\n let staticIdent = state._newStaticImports?.get(key);\n if (!staticIdent) {\n staticIdent = makeIdent(key, t);\n state._newStaticImports?.set(key, staticIdent);\n }\n ident = staticIdent;\n\n // Static helper (useDictionary / getDictionary): replace key with iden\n path.node.arguments[0] = t.identifier(ident.name);\n }\n },\n },\n };\n};\n"],"mappings":";;;;;AAQA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,cAAc,CAAC,eAAe,cAAc;;;;AAKlD,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,yBAAyB;CAC7B,aAAa;CACb,aAAa;CACd;AAED,MAAM,0BAA0B,EAC9B,aAAa,wBACd;;;;;;AA6ED,MAAM,aACJ,KACA,MAC0B;CAC1B,MAAM,OAAO,YAAY,IAAI;AAC7B,QAAO,EAAE,WAAW,IAAI,OAAO;;AAGjC,MAAM,iBACJ,UACA,iBACA,wBACA,sBACA,KACA,eACW;CACX,IAAI,eAAe,KAAK,iBAAiB,GAAG,IAAI,OAAO;AAEvD,KAAI,eAAe,OACjB,gBAAe,KAAK,sBAAsB,GAAG,IAAI,MAAM;AAGzD,KAAI,eAAe,UACjB,gBAAe,KAAK,wBAAwB,GAAG,IAAI,MAAM;CAG3D,IAAI,MAAM,SAAS,QAAQ,SAAS,EAAE,aAAa;AAGnD,OAAM,cAAc,IAAI;AAGxB,KAAI,CAAC,IAAI,WAAW,KAAK,IAAI,CAAC,IAAI,WAAW,MAAM,CACjD,OAAM,KAAK;AAGb,QAAO;;;;;;;;;;;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