@intlayer/fetch-dictionaries-entry 8.6.2 → 8.6.4
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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["builtConfiguration"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/fetch-dictionaries-entry is a package that only returns the fetch dictionary entry file.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\n\nimport { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { basename, extname, join } from 'node:path';\nimport { default as builtConfiguration } from '@intlayer/config/built';\n\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?: IntlayerConfig\n) => FetchDictionaries;\n\nexport const getDynamicDictionaries: GetFetchDictionaries = (\n configuration: IntlayerConfig = builtConfiguration\n) => {\n const { system } = configuration;\n const { fetchDictionariesDir } = system;\n\n const dictionaries: Record<string, any> = {};\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":";;;;;;;;;;;;;AA0BA,MAAa,0BACX,gBAAgCA,mCAC7B;CACH,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,yBAAyB;CAEjC,MAAM,eAAoC,EAAE;AAE5C,6BAAe,qBAAqB,EAAE;EAEpC,MAAM,iCAAoB,qBAAqB,CAAC,QAAQ,SACtD,KAAK,SAAS,QAAQ,CACvB;AAED,OAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,8BAAe,6BAAc,KAAK,CAAC;GACzC,MAAM,wDAA4B,sBAAsB,KAAK,EAAE,QAAQ;AACvE,gBAAa,OAAO,KAAK,MAAM,QAAQ;;;AAI3C,QAAO"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
2
2
|
import { basename, extname, join } from "node:path";
|
|
3
|
-
import
|
|
3
|
+
import builtConfiguration from "@intlayer/config/built";
|
|
4
4
|
|
|
5
5
|
//#region src/index.ts
|
|
6
6
|
/**
|
|
@@ -8,7 +8,7 @@ import config from "@intlayer/config/built";
|
|
|
8
8
|
* Using an external package allow to alias it in the bundle configuration (such as webpack).
|
|
9
9
|
* The alias allow hot reload the app (such as nextjs) on any dictionary change.
|
|
10
10
|
*/
|
|
11
|
-
const getDynamicDictionaries = (configuration =
|
|
11
|
+
const getDynamicDictionaries = (configuration = builtConfiguration) => {
|
|
12
12
|
const { system } = configuration;
|
|
13
13
|
const { fetchDictionariesDir } = system;
|
|
14
14
|
const dictionaries = {};
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/fetch-dictionaries-entry is a package that only returns the fetch dictionary entry file.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\n\nimport { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { basename, extname, join } from 'node:path';\nimport
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/fetch-dictionaries-entry is a package that only returns the fetch dictionary entry file.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\n\nimport { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { basename, extname, join } from 'node:path';\nimport { default as builtConfiguration } from '@intlayer/config/built';\n\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?: IntlayerConfig\n) => FetchDictionaries;\n\nexport const getDynamicDictionaries: GetFetchDictionaries = (\n configuration: IntlayerConfig = builtConfiguration\n) => {\n const { system } = configuration;\n const { fetchDictionariesDir } = system;\n\n const dictionaries: Record<string, any> = {};\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":";;;;;;;;;;AA0BA,MAAa,0BACX,gBAAgC,uBAC7B;CACH,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,yBAAyB;CAEjC,MAAM,eAAoC,EAAE;AAE5C,KAAI,WAAW,qBAAqB,EAAE;EAEpC,MAAM,QAAQ,YAAY,qBAAqB,CAAC,QAAQ,SACtD,KAAK,SAAS,QAAQ,CACvB;AAED,OAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,MAAM,SAAS,MAAM,QAAQ,KAAK,CAAC;GACzC,MAAM,UAAU,aAAa,KAAK,sBAAsB,KAAK,EAAE,QAAQ;AACvE,gBAAa,OAAO,KAAK,MAAM,QAAQ;;;AAI3C,QAAO"}
|
|
@@ -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":";;;;;KAiBY,iBAAA,GAAoB,MAAA,CAC9B,cAAA,EACA,mBAAA,CAAoB,UAAA;AAAA,KAGjB,oBAAA,IACH,aAAA,GAAgB,cAAA,KACb,iBAAA;AAAA,cAEQ,sBAAA,EAAwB,oBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/fetch-dictionaries-entry",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Provides the entry path for Intlayer fetch dictionaries, solving filesystem retrieval issues for bundlers like Webpack and Rollup.",
|
|
6
6
|
"keywords": [
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@intlayer/config": "8.6.
|
|
80
|
-
"@intlayer/core": "8.6.
|
|
81
|
-
"@intlayer/types": "8.6.
|
|
79
|
+
"@intlayer/config": "8.6.4",
|
|
80
|
+
"@intlayer/core": "8.6.4",
|
|
81
|
+
"@intlayer/types": "8.6.4"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/node": "25.5.0",
|