@intlayer/fetch-dictionaries-entry 8.6.3 → 8.6.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["config"],"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 config 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?: IntlayerConfig\n) => FetchDictionaries;\n\nexport const getDynamicDictionaries: GetFetchDictionaries = (\n configuration: IntlayerConfig = config\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":";;;;;;;;;;;;;AAyBA,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"}
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"}
@@ -1,6 +1,6 @@
1
1
  import { existsSync, readFileSync, readdirSync } from "node:fs";
2
2
  import { basename, extname, join } from "node:path";
3
- import config from "@intlayer/config/built";
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 = config) => {
11
+ const getDynamicDictionaries = (configuration = builtConfiguration) => {
12
12
  const { system } = configuration;
13
13
  const { fetchDictionariesDir } = system;
14
14
  const dictionaries = {};
@@ -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 config 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?: IntlayerConfig\n) => FetchDictionaries;\n\nexport const getDynamicDictionaries: GetFetchDictionaries = (\n configuration: IntlayerConfig = config\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":";;;;;;;;;;AAyBA,MAAa,0BACX,gBAAgC,WAC7B;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
+ {"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":";;;;;KAgBY,iBAAA,GAAoB,MAAA,CAC9B,cAAA,EACA,mBAAA,CAAoB,UAAA;AAAA,KAGjB,oBAAA,IACH,aAAA,GAAgB,cAAA,KACb,iBAAA;AAAA,cAEQ,sBAAA,EAAwB,oBAAA"}
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",
3
+ "version": "8.6.5",
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.3",
80
- "@intlayer/core": "8.6.3",
81
- "@intlayer/types": "8.6.3"
79
+ "@intlayer/config": "8.6.5",
80
+ "@intlayer/core": "8.6.5",
81
+ "@intlayer/types": "8.6.5"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@types/node": "25.5.0",