@intlayer/dictionaries-entry 9.7.0 → 9.7.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/dist/cjs/dynamic.browser.cjs +1 -2
- package/dist/cjs/dynamic.cjs +4 -5
- package/dist/cjs/dynamic.cjs.map +1 -1
- package/dist/cjs/fetch.browser.cjs +1 -2
- package/dist/cjs/fetch.cjs +3 -4
- package/dist/cjs/fetch.cjs.map +1 -1
- package/dist/cjs/index.browser.cjs +1 -2
- package/dist/cjs/index.cjs +4 -5
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/remote.browser.cjs +1 -2
- package/dist/cjs/remote.cjs +4 -5
- package/dist/cjs/remote.cjs.map +1 -1
- package/dist/cjs/unmerged.browser.cjs +1 -2
- package/dist/cjs/unmerged.cjs +3 -4
- package/dist/cjs/unmerged.cjs.map +1 -1
- package/dist/esm/dynamic.browser.mjs +1 -2
- package/dist/esm/dynamic.mjs +1 -2
- package/dist/esm/fetch.browser.mjs +1 -2
- package/dist/esm/fetch.mjs +1 -2
- package/dist/esm/index.browser.mjs +1 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/remote.browser.mjs +1 -2
- package/dist/esm/remote.mjs +1 -2
- package/dist/esm/unmerged.browser.mjs +1 -2
- package/dist/esm/unmerged.mjs +1 -2
- package/dist/types/dynamic.browser.d.ts +0 -2
- package/dist/types/dynamic.browser.d.ts.map +1 -1
- package/dist/types/dynamic.d.ts +1 -2
- package/dist/types/dynamic.d.ts.map +1 -1
- package/dist/types/fetch.browser.d.ts +0 -2
- package/dist/types/fetch.browser.d.ts.map +1 -1
- package/dist/types/fetch.d.ts +1 -2
- package/dist/types/fetch.d.ts.map +1 -1
- package/dist/types/index.browser.d.ts +0 -2
- package/dist/types/index.browser.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/remote.browser.d.ts +0 -2
- package/dist/types/remote.browser.d.ts.map +1 -1
- package/dist/types/remote.d.ts +1 -2
- package/dist/types/remote.d.ts.map +1 -1
- package/dist/types/unmerged.browser.d.ts +0 -2
- package/dist/types/unmerged.browser.d.ts.map +1 -1
- package/dist/types/unmerged.d.ts +1 -2
- package/dist/types/unmerged.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/dynamic.browser.ts
|
|
3
3
|
const getDynamicDictionaries = () => ({});
|
|
4
4
|
|
|
5
|
-
//#endregion
|
|
6
5
|
exports.getDynamicDictionaries = getDynamicDictionaries;
|
|
7
6
|
//# sourceMappingURL=dynamic.browser.cjs.map
|
package/dist/cjs/dynamic.cjs
CHANGED
|
@@ -4,7 +4,7 @@ let node_path = require("node:path");
|
|
|
4
4
|
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
5
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/dynamic.ts
|
|
8
8
|
/**
|
|
9
9
|
* Returns the dynamic dictionaries generated by Intlayer (per-locale lazy
|
|
10
10
|
* loaders).
|
|
@@ -17,13 +17,12 @@ const getDynamicDictionaries = (configuration = {
|
|
|
17
17
|
system: _intlayer_config_built.system,
|
|
18
18
|
build: _intlayer_config_built.build
|
|
19
19
|
}) => {
|
|
20
|
-
const { system
|
|
21
|
-
const dictionariesPath = (0, node_path.join)(system
|
|
20
|
+
const { system, build } = configuration;
|
|
21
|
+
const dictionariesPath = (0, node_path.join)(system.mainDir, `dynamic_dictionaries.cjs`);
|
|
22
22
|
let dictionaries = {};
|
|
23
|
-
if ((0, node_fs.existsSync)(dictionariesPath)) dictionaries = (build
|
|
23
|
+
if ((0, node_fs.existsSync)(dictionariesPath)) dictionaries = (build.require ?? _intlayer_config_utils.configESMxCJSRequire)(dictionariesPath);
|
|
24
24
|
return dictionaries;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.getDynamicDictionaries = getDynamicDictionaries;
|
|
29
28
|
//# sourceMappingURL=dynamic.cjs.map
|
package/dist/cjs/dynamic.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic.cjs","names":["join","
|
|
1
|
+
{"version":3,"file":"dynamic.cjs","names":["join","existsSync","configESMxCJSRequire"],"sources":["../../src/dynamic.ts"],"sourcesContent":["/**\n * Returns the dynamic dictionaries generated by Intlayer (per-locale lazy\n * loaders).\n *\n * `@intlayer/dictionaries-entry/dynamic` is meant to be aliased by the bundler\n * configuration to the generated `.intlayer/main/dynamic_dictionaries` entry.\n * Outside a bundler (Node) this stub reads the entry itself.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { build, system } from '@intlayer/config/built';\nimport { configESMxCJSRequire } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\n\nexport type DynamicDictionaries = Record<\n DictionaryKeys,\n StrictModeLocaleMap<() => Promise<Dictionary>>\n>;\n\ntype GetDynamicDictionaries = (\n configuration?: Pick<IntlayerConfig, 'system' | 'build'>\n) => DynamicDictionaries;\n\nexport const getDynamicDictionaries: GetDynamicDictionaries = (\n configuration: Pick<IntlayerConfig, 'system' | 'build'> = { system, build }\n) => {\n const { system, build } = configuration;\n\n // Always use cjs for dictionaries entry as it uses require\n const dictionariesPath = join(system.mainDir, `dynamic_dictionaries.cjs`);\n let dictionaries: DynamicDictionaries = {};\n\n if (existsSync(dictionariesPath)) {\n dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);\n }\n\n return dictionaries;\n};\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,MAAa,0BACX,gBAA0D;CAAE;CAAQ;AAAM,MACvE;CACH,MAAM,EAAE,QAAQ,UAAU;CAG1B,MAAM,uBAAmBA,gBAAK,OAAO,SAAS,0BAA0B;CACxE,IAAI,eAAoC,CAAC;CAEzC,QAAIC,oBAAW,gBAAgB,GAC7B,gBAAgB,MAAM,WAAWC,4CAAoB,CAAE,gBAAgB;CAGzE,OAAO;AACT"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/fetch.browser.ts
|
|
3
3
|
const getFetchDictionaries = () => ({});
|
|
4
4
|
|
|
5
|
-
//#endregion
|
|
6
5
|
exports.getFetchDictionaries = getFetchDictionaries;
|
|
7
6
|
//# sourceMappingURL=fetch.browser.cjs.map
|
package/dist/cjs/fetch.cjs
CHANGED
|
@@ -3,7 +3,7 @@ let node_fs = require("node:fs");
|
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/fetch.ts
|
|
7
7
|
/**
|
|
8
8
|
* Returns the fetch dictionaries generated by Intlayer (per-locale JSON files
|
|
9
9
|
* fetched at runtime).
|
|
@@ -13,8 +13,8 @@ let _intlayer_config_built = require("@intlayer/config/built");
|
|
|
13
13
|
* Outside a bundler (Node) this stub reads the JSON files itself.
|
|
14
14
|
*/
|
|
15
15
|
const getFetchDictionaries = (configuration = { system: _intlayer_config_built.system }) => {
|
|
16
|
-
const { system
|
|
17
|
-
const { fetchDictionariesDir } = system
|
|
16
|
+
const { system } = configuration;
|
|
17
|
+
const { fetchDictionariesDir } = system;
|
|
18
18
|
const dictionaries = {};
|
|
19
19
|
if ((0, node_fs.existsSync)(fetchDictionariesDir)) {
|
|
20
20
|
const files = (0, node_fs.readdirSync)(fetchDictionariesDir).filter((file) => file.endsWith(".json"));
|
|
@@ -27,6 +27,5 @@ const getFetchDictionaries = (configuration = { system: _intlayer_config_built.s
|
|
|
27
27
|
return dictionaries;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
//#endregion
|
|
31
30
|
exports.getFetchDictionaries = getFetchDictionaries;
|
|
32
31
|
//# sourceMappingURL=fetch.cjs.map
|
package/dist/cjs/fetch.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.cjs","names":["
|
|
1
|
+
{"version":3,"file":"fetch.cjs","names":["existsSync","readdirSync","basename","extname","readFileSync","join"],"sources":["../../src/fetch.ts"],"sourcesContent":["/**\n * Returns the fetch dictionaries generated by Intlayer (per-locale JSON files\n * fetched at runtime).\n *\n * `@intlayer/dictionaries-entry/fetch` is meant to be aliased by the bundler\n * configuration to the generated `.intlayer/main/fetch_dictionaries` entry.\n * Outside a bundler (Node) this stub reads the JSON files itself.\n */\n\nimport { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { basename, extname, join } from 'node:path';\nimport { system } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\n\nexport type FetchDictionaries = Record<\n DictionaryKeys,\n StrictModeLocaleMap<Dictionary>\n>;\n\ntype GetFetchDictionaries = (\n configuration?: Pick<IntlayerConfig, 'system'>\n) => FetchDictionaries;\n\nexport const getFetchDictionaries: GetFetchDictionaries = (\n configuration: Pick<IntlayerConfig, 'system'> = { system }\n) => {\n const { system } = configuration;\n const { fetchDictionariesDir } = system;\n\n const dictionaries: Record<string, StrictModeLocaleMap<Dictionary>> = {};\n\n if (existsSync(fetchDictionariesDir)) {\n // Read JSON files directly to avoid require.cache memory leak\n const files = readdirSync(fetchDictionariesDir).filter((file) =>\n file.endsWith('.json')\n );\n\n for (const file of files) {\n const key = basename(file, extname(file));\n const content = readFileSync(join(fetchDictionariesDir, file), 'utf-8');\n dictionaries[key] = JSON.parse(content);\n }\n }\n\n return dictionaries as FetchDictionaries;\n};\n"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAa,wBACX,gBAAgD,EAAE,sCAAO,MACtD;CACH,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,yBAAyB;CAEjC,MAAM,eAAgE,CAAC;CAEvE,QAAIA,oBAAW,oBAAoB,GAAG;EAEpC,MAAM,YAAQC,qBAAY,oBAAoB,CAAC,CAAC,QAAQ,SACtD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,UAAMC,oBAAS,UAAMC,mBAAQ,IAAI,CAAC;GACxC,MAAM,cAAUC,0BAAaC,gBAAK,sBAAsB,IAAI,GAAG,OAAO;GACtE,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/index.browser.ts
|
|
3
3
|
const getDictionaries = () => ({});
|
|
4
4
|
|
|
5
|
-
//#endregion
|
|
6
5
|
exports.getDictionaries = getDictionaries;
|
|
7
6
|
//# sourceMappingURL=index.browser.cjs.map
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ let node_path = require("node:path");
|
|
|
4
4
|
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
5
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/index.ts
|
|
8
8
|
/**
|
|
9
9
|
* Returns the merged dictionaries generated by Intlayer.
|
|
10
10
|
*
|
|
@@ -17,13 +17,12 @@ const getDictionaries = (configuration = {
|
|
|
17
17
|
system: _intlayer_config_built.system,
|
|
18
18
|
build: _intlayer_config_built.build
|
|
19
19
|
}) => {
|
|
20
|
-
const { system
|
|
21
|
-
const dictionariesPath = (0, node_path.join)(system
|
|
20
|
+
const { system, build } = configuration;
|
|
21
|
+
const dictionariesPath = (0, node_path.join)(system.mainDir, `dictionaries.cjs`);
|
|
22
22
|
let dictionaries = {};
|
|
23
|
-
if ((0, node_fs.existsSync)(dictionariesPath)) dictionaries = (build
|
|
23
|
+
if ((0, node_fs.existsSync)(dictionariesPath)) dictionaries = (build.require ?? _intlayer_config_utils.configESMxCJSRequire)(dictionariesPath);
|
|
24
24
|
return dictionaries ?? {};
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.getDictionaries = getDictionaries;
|
|
29
28
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["join","
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["join","existsSync","configESMxCJSRequire"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * Returns the merged dictionaries generated by Intlayer.\n *\n * `@intlayer/dictionaries-entry` is meant to be aliased by the\n * bundler configuration (webpack, Vite, Turbopack, esbuild, Metro, …) to the\n * generated `.intlayer/main/dictionaries` entry, so the app hot reloads on any\n * dictionary change. Outside a bundler (Node) this stub reads the entry itself.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { build, system } from '@intlayer/config/built';\nimport { configESMxCJSRequire } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { DictionaryRegistry } from '@intlayer/types/module_augmentation';\n\ntype GetDictionaries = (\n configuration?: Pick<IntlayerConfig, 'system' | 'build'>\n) => DictionaryRegistry;\n\nexport const getDictionaries: GetDictionaries = (\n configuration: Pick<IntlayerConfig, 'system' | 'build'> = { system, build }\n) => {\n const { system, build } = configuration;\n\n // Always use cjs for dictionaries entry as it uses require\n const dictionariesPath = join(system.mainDir, `dictionaries.cjs`);\n\n let dictionaries = {};\n if (existsSync(dictionariesPath)) {\n dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);\n }\n\n return (dictionaries ?? {}) as DictionaryRegistry;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAa,mBACX,gBAA0D;CAAE;CAAQ;AAAM,MACvE;CACH,MAAM,EAAE,QAAQ,UAAU;CAG1B,MAAM,uBAAmBA,gBAAK,OAAO,SAAS,kBAAkB;CAEhE,IAAI,eAAe,CAAC;CACpB,QAAIC,oBAAW,gBAAgB,GAC7B,gBAAgB,MAAM,WAAWC,4CAAoB,CAAE,gBAAgB;CAGzE,OAAQ,gBAAgB,CAAC;AAC3B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/remote.browser.ts
|
|
3
3
|
const getRemoteDictionaries = () => ({});
|
|
4
4
|
|
|
5
|
-
//#endregion
|
|
6
5
|
exports.getRemoteDictionaries = getRemoteDictionaries;
|
|
7
6
|
//# sourceMappingURL=remote.browser.cjs.map
|
package/dist/cjs/remote.cjs
CHANGED
|
@@ -4,7 +4,7 @@ let node_path = require("node:path");
|
|
|
4
4
|
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
5
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/remote.ts
|
|
8
8
|
/**
|
|
9
9
|
* Returns the remote dictionaries pulled from the Intlayer CMS.
|
|
10
10
|
*
|
|
@@ -16,16 +16,15 @@ const getRemoteDictionaries = (configuration = {
|
|
|
16
16
|
system: _intlayer_config_built.system,
|
|
17
17
|
build: _intlayer_config_built.build
|
|
18
18
|
}) => {
|
|
19
|
-
const { system
|
|
20
|
-
const dictionariesPath = (0, node_path.join)(system
|
|
19
|
+
const { system, build } = configuration;
|
|
20
|
+
const dictionariesPath = (0, node_path.join)(system.mainDir, `remote_dictionaries.cjs`);
|
|
21
21
|
let dictionaries = {};
|
|
22
22
|
if ((0, node_fs.existsSync)(dictionariesPath)) {
|
|
23
23
|
(0, _intlayer_config_utils.clearModuleCache)(dictionariesPath);
|
|
24
|
-
dictionaries = (build
|
|
24
|
+
dictionaries = (build.require ?? _intlayer_config_utils.configESMxCJSRequire)(dictionariesPath);
|
|
25
25
|
}
|
|
26
26
|
return dictionaries;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
exports.getRemoteDictionaries = getRemoteDictionaries;
|
|
31
30
|
//# sourceMappingURL=remote.cjs.map
|
package/dist/cjs/remote.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.cjs","names":["join","
|
|
1
|
+
{"version":3,"file":"remote.cjs","names":["join","existsSync","configESMxCJSRequire"],"sources":["../../src/remote.ts"],"sourcesContent":["/**\n * Returns the remote dictionaries pulled from the Intlayer CMS.\n *\n * `@intlayer/dictionaries-entry/remote` is meant to be aliased by the bundler\n * configuration to the generated `.intlayer/main/remote_dictionaries` entry.\n * Outside a bundler (Node) this stub reads the entry itself.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { DictionaryAPI } from '@intlayer/backend-contract/dictionary';\nimport { build, system } from '@intlayer/config/built';\nimport { clearModuleCache, configESMxCJSRequire } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { DictionaryKey } from '@intlayer/types/dictionary';\n\nexport type RemoteDictionaries = Record<DictionaryKey, DictionaryAPI[]>;\n\ntype GetRemoteDictionaries = (\n configuration?: Pick<IntlayerConfig, 'system' | 'build'>\n) => RemoteDictionaries;\n\nexport const getRemoteDictionaries: GetRemoteDictionaries = (\n configuration: Pick<IntlayerConfig, 'system' | 'build'> = { system, build }\n) => {\n const { system, build } = configuration;\n\n // Always use cjs for dictionaries entry as it uses require\n const dictionariesPath = join(system.mainDir, `remote_dictionaries.cjs`);\n let dictionaries: RemoteDictionaries = {};\n\n if (existsSync(dictionariesPath)) {\n // Clear cache for remote_dictionaries.cjs and all its dependencies (JSON files)\n clearModuleCache(dictionariesPath);\n dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);\n }\n\n return dictionaries;\n};\n"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAa,yBACX,gBAA0D;CAAE;CAAQ;AAAM,MACvE;CACH,MAAM,EAAE,QAAQ,UAAU;CAG1B,MAAM,uBAAmBA,gBAAK,OAAO,SAAS,yBAAyB;CACvE,IAAI,eAAmC,CAAC;CAExC,QAAIC,oBAAW,gBAAgB,GAAG;EAEhC,6CAAiB,gBAAgB;EACjC,gBAAgB,MAAM,WAAWC,4CAAoB,CAAE,gBAAgB;CACzE;CAEA,OAAO;AACT"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/unmerged.browser.ts
|
|
3
3
|
const getUnmergedDictionaries = () => ({});
|
|
4
4
|
|
|
5
|
-
//#endregion
|
|
6
5
|
exports.getUnmergedDictionaries = getUnmergedDictionaries;
|
|
7
6
|
//# sourceMappingURL=unmerged.browser.cjs.map
|
package/dist/cjs/unmerged.cjs
CHANGED
|
@@ -3,7 +3,7 @@ let node_fs = require("node:fs");
|
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/unmerged.ts
|
|
7
7
|
/**
|
|
8
8
|
* Returns the unmerged dictionaries generated by Intlayer (one array of
|
|
9
9
|
* declarations per key, before merging).
|
|
@@ -16,8 +16,8 @@ const getUnmergedDictionaries = (configuration = {
|
|
|
16
16
|
system: _intlayer_config_built.system,
|
|
17
17
|
build: _intlayer_config_built.build
|
|
18
18
|
}) => {
|
|
19
|
-
const { system
|
|
20
|
-
const { unmergedDictionariesDir } = system
|
|
19
|
+
const { system } = configuration;
|
|
20
|
+
const { unmergedDictionariesDir } = system;
|
|
21
21
|
const dictionaries = {};
|
|
22
22
|
if ((0, node_fs.existsSync)(unmergedDictionariesDir)) {
|
|
23
23
|
const files = (0, node_fs.readdirSync)(unmergedDictionariesDir).filter((file) => file.endsWith(".json"));
|
|
@@ -30,6 +30,5 @@ const getUnmergedDictionaries = (configuration = {
|
|
|
30
30
|
return dictionaries;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
//#endregion
|
|
34
33
|
exports.getUnmergedDictionaries = getUnmergedDictionaries;
|
|
35
34
|
//# sourceMappingURL=unmerged.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unmerged.cjs","names":["
|
|
1
|
+
{"version":3,"file":"unmerged.cjs","names":["existsSync","readdirSync","basename","extname","readFileSync","join"],"sources":["../../src/unmerged.ts"],"sourcesContent":["/**\n * Returns the unmerged dictionaries generated by Intlayer (one array of\n * declarations per key, before merging).\n *\n * `@intlayer/dictionaries-entry/unmerged` is meant to be aliased by the bundler\n * configuration to the generated `.intlayer/main/unmerged_dictionaries` entry.\n * Outside a bundler (Node) this stub reads the JSON files itself.\n */\n\nimport { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { basename, extname, join } from 'node:path';\nimport { build, system } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { DictionaryKeys } from '@intlayer/types/module_augmentation';\n\nexport type UnmergedDictionaries = Record<DictionaryKeys, Dictionary[]>;\n\ntype GetUnmergedDictionaries = (\n configuration?: Pick<IntlayerConfig, 'system' | 'build'>\n) => UnmergedDictionaries;\n\nexport const getUnmergedDictionaries: GetUnmergedDictionaries = (\n configuration: Pick<IntlayerConfig, 'system' | 'build'> = { system, build }\n) => {\n const { system } = configuration;\n const { unmergedDictionariesDir } = system;\n\n const dictionaries: Record<string, Dictionary[]> = {};\n\n if (existsSync(unmergedDictionariesDir)) {\n // Read JSON files directly to avoid require.cache memory leak\n const files = readdirSync(unmergedDictionariesDir).filter((file) =>\n file.endsWith('.json')\n );\n\n for (const file of files) {\n const key = basename(file, extname(file));\n const content = readFileSync(\n join(unmergedDictionariesDir, file),\n 'utf-8'\n );\n dictionaries[key] = JSON.parse(content);\n }\n }\n\n return dictionaries as UnmergedDictionaries;\n};\n"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAa,2BACX,gBAA0D;CAAE;CAAQ;AAAM,MACvE;CACH,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,4BAA4B;CAEpC,MAAM,eAA6C,CAAC;CAEpD,QAAIA,oBAAW,uBAAuB,GAAG;EAEvC,MAAM,YAAQC,qBAAY,uBAAuB,CAAC,CAAC,QAAQ,SACzD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,UAAMC,oBAAS,UAAMC,mBAAQ,IAAI,CAAC;GACxC,MAAM,cAAUC,0BACdC,gBAAK,yBAAyB,IAAI,GAClC,OACF;GACA,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
|
package/dist/esm/dynamic.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
import { build, system } from "@intlayer/config/built";
|
|
4
4
|
import { configESMxCJSRequire } from "@intlayer/config/utils";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/dynamic.ts
|
|
7
7
|
/**
|
|
8
8
|
* Returns the dynamic dictionaries generated by Intlayer (per-locale lazy
|
|
9
9
|
* loaders).
|
|
@@ -23,6 +23,5 @@ const getDynamicDictionaries = (configuration = {
|
|
|
23
23
|
return dictionaries;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { getDynamicDictionaries };
|
|
28
27
|
//# sourceMappingURL=dynamic.mjs.map
|
package/dist/esm/fetch.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
|
2
2
|
import { basename, extname, join } from "node:path";
|
|
3
3
|
import { system } from "@intlayer/config/built";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/fetch.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns the fetch dictionaries generated by Intlayer (per-locale JSON files
|
|
8
8
|
* fetched at runtime).
|
|
@@ -26,6 +26,5 @@ const getFetchDictionaries = (configuration = { system }) => {
|
|
|
26
26
|
return dictionaries;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { getFetchDictionaries };
|
|
31
30
|
//# sourceMappingURL=fetch.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
import { build, system } from "@intlayer/config/built";
|
|
4
4
|
import { configESMxCJSRequire } from "@intlayer/config/utils";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/index.ts
|
|
7
7
|
/**
|
|
8
8
|
* Returns the merged dictionaries generated by Intlayer.
|
|
9
9
|
*
|
|
@@ -23,6 +23,5 @@ const getDictionaries = (configuration = {
|
|
|
23
23
|
return dictionaries ?? {};
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { getDictionaries };
|
|
28
27
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/remote.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
import { build, system } from "@intlayer/config/built";
|
|
4
4
|
import { clearModuleCache, configESMxCJSRequire } from "@intlayer/config/utils";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/remote.ts
|
|
7
7
|
/**
|
|
8
8
|
* Returns the remote dictionaries pulled from the Intlayer CMS.
|
|
9
9
|
*
|
|
@@ -25,6 +25,5 @@ const getRemoteDictionaries = (configuration = {
|
|
|
25
25
|
return dictionaries;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
//#endregion
|
|
29
28
|
export { getRemoteDictionaries };
|
|
30
29
|
//# sourceMappingURL=remote.mjs.map
|
package/dist/esm/unmerged.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
|
2
2
|
import { basename, extname, join } from "node:path";
|
|
3
3
|
import { build, system } from "@intlayer/config/built";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/unmerged.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns the unmerged dictionaries generated by Intlayer (one array of
|
|
8
8
|
* declarations per key, before merging).
|
|
@@ -29,6 +29,5 @@ const getUnmergedDictionaries = (configuration = {
|
|
|
29
29
|
return dictionaries;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
//#endregion
|
|
33
32
|
export { getUnmergedDictionaries };
|
|
34
33
|
//# sourceMappingURL=unmerged.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic.browser.d.ts","names":[],"sources":["../../src/dynamic.browser.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic.browser.d.ts","names":[],"sources":["../../src/dynamic.browser.ts"],"mappings":"A,qBAAa"}
|
package/dist/types/dynamic.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
2
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
3
|
import { DictionaryKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
4
|
-
//#region src/dynamic.d.ts
|
|
5
4
|
export type DynamicDictionaries = Record<DictionaryKeys, StrictModeLocaleMap<() => Promise<Dictionary>>>;
|
|
6
5
|
type GetDynamicDictionaries = (configuration?: Pick<IntlayerConfig, "system" | "build">) => DynamicDictionaries;
|
|
7
6
|
export declare const getDynamicDictionaries: GetDynamicDictionaries;
|
|
8
|
-
|
|
7
|
+
export {};
|
|
9
8
|
//# sourceMappingURL=dynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic.d.ts","names":[],"sources":["../../src/dynamic.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic.d.ts","names":[],"sources":["../../src/dynamic.ts"],"mappings":";;;YAoBY,sBAAsB,OAChC,gBACA,0BAA0B,QAAQ;KAG/B,0BACH,gBAAgB,KAAK,wCAClB;qBAEQ,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.browser.d.ts","names":[],"sources":["../../src/fetch.browser.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.browser.d.ts","names":[],"sources":["../../src/fetch.browser.ts"],"mappings":"A,qBAAa"}
|
package/dist/types/fetch.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
2
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
3
|
import { DictionaryKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
4
|
-
//#region src/fetch.d.ts
|
|
5
4
|
export type FetchDictionaries = Record<DictionaryKeys, StrictModeLocaleMap<Dictionary>>;
|
|
6
5
|
type GetFetchDictionaries = (configuration?: Pick<IntlayerConfig, "system">) => FetchDictionaries;
|
|
7
6
|
export declare const getFetchDictionaries: GetFetchDictionaries;
|
|
8
|
-
|
|
7
|
+
export {};
|
|
9
8
|
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","names":[],"sources":["../../src/fetch.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","names":[],"sources":["../../src/fetch.ts"],"mappings":";;;YAmBY,oBAAoB,OAC9B,gBACA,oBAAoB;KAGjB,wBACH,gBAAgB,KAAK,8BAClB;qBAEQ,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","names":[],"sources":["../../src/index.browser.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","names":[],"sources":["../../src/index.browser.ts"],"mappings":"A,qBAAa"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
2
|
import { DictionaryRegistry } from "@intlayer/types/module_augmentation";
|
|
3
|
-
//#region src/index.d.ts
|
|
4
3
|
type GetDictionaries = (configuration?: Pick<IntlayerConfig, "system" | "build">) => DictionaryRegistry;
|
|
5
4
|
export declare const getDictionaries: GetDictionaries;
|
|
6
|
-
|
|
5
|
+
export {};
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;KAgBK,mBACH,gBAAgB,KAAK,wCAClB;qBAEQ,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.browser.d.ts","names":[],"sources":["../../src/remote.browser.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote.browser.d.ts","names":[],"sources":["../../src/remote.browser.ts"],"mappings":"A,qBAAa"}
|
package/dist/types/remote.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
2
|
import { DictionaryKey } from "@intlayer/types/dictionary";
|
|
3
3
|
import { DictionaryAPI } from "@intlayer/backend-contract/dictionary";
|
|
4
|
-
//#region src/remote.d.ts
|
|
5
4
|
export type RemoteDictionaries = Record<DictionaryKey, DictionaryAPI[]>;
|
|
6
5
|
type GetRemoteDictionaries = (configuration?: Pick<IntlayerConfig, "system" | "build">) => RemoteDictionaries;
|
|
7
6
|
export declare const getRemoteDictionaries: GetRemoteDictionaries;
|
|
8
|
-
|
|
7
|
+
export {};
|
|
9
8
|
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","names":[],"sources":["../../src/remote.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote.d.ts","names":[],"sources":["../../src/remote.ts"],"mappings":";;;YAgBY,qBAAqB,OAAO,eAAe;KAElD,yBACH,gBAAgB,KAAK,wCAClB;qBAEQ,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unmerged.browser.d.ts","names":[],"sources":["../../src/unmerged.browser.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"unmerged.browser.d.ts","names":[],"sources":["../../src/unmerged.browser.ts"],"mappings":"A,qBAAa"}
|
package/dist/types/unmerged.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
2
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
3
|
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
4
|
-
//#region src/unmerged.d.ts
|
|
5
4
|
export type UnmergedDictionaries = Record<DictionaryKeys, Dictionary[]>;
|
|
6
5
|
type GetUnmergedDictionaries = (configuration?: Pick<IntlayerConfig, "system" | "build">) => UnmergedDictionaries;
|
|
7
6
|
export declare const getUnmergedDictionaries: GetUnmergedDictionaries;
|
|
8
|
-
|
|
7
|
+
export {};
|
|
9
8
|
//# sourceMappingURL=unmerged.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unmerged.d.ts","names":[],"sources":["../../src/unmerged.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"unmerged.d.ts","names":[],"sources":["../../src/unmerged.ts"],"mappings":";;;YAgBY,uBAAuB,OAAO,gBAAgB;KAErD,2BACH,gBAAgB,KAAK,wCAClB;qBAEQ,yBAAyB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/dictionaries-entry",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Provides the entry points for the generated Intlayer dictionaries (merged, unmerged, remote, dynamic, fetch), designed to be aliased by bundlers like Webpack, Vite, Turbopack, esbuild and Metro.",
|
|
6
6
|
"keywords": [
|
|
@@ -113,19 +113,19 @@
|
|
|
113
113
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
|
-
"@intlayer/backend-contract": "9.7.
|
|
117
|
-
"@intlayer/config": "9.7.
|
|
116
|
+
"@intlayer/backend-contract": "9.7.1",
|
|
117
|
+
"@intlayer/config": "9.7.1"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@intlayer/types": "9.7.
|
|
120
|
+
"@intlayer/types": "9.7.1",
|
|
121
121
|
"@types/node": "^26",
|
|
122
122
|
"@utils/ts-config": "1.0.4",
|
|
123
123
|
"@utils/ts-config-types": "1.0.4",
|
|
124
124
|
"@utils/tsdown-config": "1.0.4",
|
|
125
125
|
"rimraf": "6.1.3",
|
|
126
|
-
"tsdown": "0.23.
|
|
126
|
+
"tsdown": "0.23.4",
|
|
127
127
|
"typescript": "7.0.2",
|
|
128
|
-
"vitest": "5.0
|
|
128
|
+
"vitest": "5.1.0"
|
|
129
129
|
},
|
|
130
130
|
"engines": {
|
|
131
131
|
"node": ">=14.18"
|