@intlayer/unmerged-dictionaries-entry 8.11.1 → 8.11.2

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,9 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
2
  let node_fs = require("node:fs");
4
3
  let node_path = require("node:path");
5
4
  let _intlayer_config_built = require("@intlayer/config/built");
6
- _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
7
5
 
8
6
  //#region src/index.ts
9
7
  /**
@@ -11,9 +9,12 @@ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
11
9
  * Using an external package allow to alias it in the bundle configuration (such as webpack).
12
10
  * The alias allow hot reload the app (such as nextjs) on any dictionary change.
13
11
  */
14
- const getUnmergedDictionaries = (configuration = _intlayer_config_built.default) => {
15
- const { system } = configuration;
16
- const { unmergedDictionariesDir } = system;
12
+ const getUnmergedDictionaries = (configuration = {
13
+ system: _intlayer_config_built.system,
14
+ build: _intlayer_config_built.build
15
+ }) => {
16
+ const { system: system$1 } = configuration;
17
+ const { unmergedDictionariesDir } = system$1;
17
18
  const dictionaries = {};
18
19
  if ((0, node_fs.existsSync)(unmergedDictionariesDir)) {
19
20
  const files = (0, node_fs.readdirSync)(unmergedDictionariesDir).filter((file) => file.endsWith(".json"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["defaultConfiguration"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/unmerged-dictionaries-entry is a package that only returns the unmerged 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 defaultConfiguration } 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?: IntlayerConfig\n) => UnmergedDictionaries;\n\nexport const getUnmergedDictionaries: GetUnmergedDictionaries = (\n configuration: IntlayerConfig = defaultConfiguration\n) => {\n const { system } = configuration;\n const { unmergedDictionariesDir } = system;\n\n const dictionaries: Record<string, any> = {};\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":";;;;;;;;;;;;;AAmBA,MAAa,2BACX,gBAAgCA,mCAC7B;CACH,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,4BAA4B;CAEpC,MAAM,eAAoC,CAAC;CAE3C,4BAAe,uBAAuB,GAAG;EAEvC,MAAM,iCAAoB,uBAAuB,EAAE,QAAQ,SACzD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,8BAAe,6BAAc,IAAI,CAAC;GACxC,MAAM,wDACC,yBAAyB,IAAI,GAClC,OACF;GACA,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"index.cjs","names":["system"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/unmerged-dictionaries-entry is a package that only returns the unmerged 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 { 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, any> = {};\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":";;;;;;;;;;;AAmBA,MAAa,2BACX,gBAA0D;CAAE;CAAQ;AAAM,MACvE;CACH,MAAM,EAAE,qBAAW;CACnB,MAAM,EAAE,4BAA4BA;CAEpC,MAAM,eAAoC,CAAC;CAE3C,4BAAe,uBAAuB,GAAG;EAEvC,MAAM,iCAAoB,uBAAuB,EAAE,QAAQ,SACzD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,8BAAe,6BAAc,IAAI,CAAC;GACxC,MAAM,wDACC,yBAAyB,IAAI,GAClC,OACF;GACA,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
@@ -1,6 +1,6 @@
1
1
  import { existsSync, readFileSync, readdirSync } from "node:fs";
2
2
  import { basename, extname, join } from "node:path";
3
- import defaultConfiguration from "@intlayer/config/built";
3
+ import { build, system } from "@intlayer/config/built";
4
4
 
5
5
  //#region src/index.ts
6
6
  /**
@@ -8,9 +8,12 @@ import defaultConfiguration 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 getUnmergedDictionaries = (configuration = defaultConfiguration) => {
12
- const { system } = configuration;
13
- const { unmergedDictionariesDir } = system;
11
+ const getUnmergedDictionaries = (configuration = {
12
+ system,
13
+ build
14
+ }) => {
15
+ const { system: system$1 } = configuration;
16
+ const { unmergedDictionariesDir } = system$1;
14
17
  const dictionaries = {};
15
18
  if (existsSync(unmergedDictionariesDir)) {
16
19
  const files = readdirSync(unmergedDictionariesDir).filter((file) => file.endsWith(".json"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/unmerged-dictionaries-entry is a package that only returns the unmerged 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 defaultConfiguration } 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?: IntlayerConfig\n) => UnmergedDictionaries;\n\nexport const getUnmergedDictionaries: GetUnmergedDictionaries = (\n configuration: IntlayerConfig = defaultConfiguration\n) => {\n const { system } = configuration;\n const { unmergedDictionariesDir } = system;\n\n const dictionaries: Record<string, any> = {};\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":";;;;;;;;;;AAmBA,MAAa,2BACX,gBAAgC,yBAC7B;CACH,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,4BAA4B;CAEpC,MAAM,eAAoC,CAAC;CAE3C,IAAI,WAAW,uBAAuB,GAAG;EAEvC,MAAM,QAAQ,YAAY,uBAAuB,EAAE,QAAQ,SACzD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,MAAM,SAAS,MAAM,QAAQ,IAAI,CAAC;GACxC,MAAM,UAAU,aACd,KAAK,yBAAyB,IAAI,GAClC,OACF;GACA,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"index.mjs","names":["system"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/unmerged-dictionaries-entry is a package that only returns the unmerged 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 { 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, any> = {};\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":";;;;;;;;;;AAmBA,MAAa,2BACX,gBAA0D;CAAE;CAAQ;AAAM,MACvE;CACH,MAAM,EAAE,qBAAW;CACnB,MAAM,EAAE,4BAA4BA;CAEpC,MAAM,eAAoC,CAAC;CAE3C,IAAI,WAAW,uBAAuB,GAAG;EAEvC,MAAM,QAAQ,YAAY,uBAAuB,EAAE,QAAQ,SACzD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,MAAM,SAAS,MAAM,QAAQ,IAAI,CAAC;GACxC,MAAM,UAAU,aACd,KAAK,yBAAyB,IAAI,GAClC,OACF;GACA,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
@@ -4,7 +4,7 @@ import { DictionaryKeys } from "@intlayer/types/module_augmentation";
4
4
 
5
5
  //#region src/index.d.ts
6
6
  type UnmergedDictionaries = Record<DictionaryKeys, Dictionary[]>;
7
- type GetUnmergedDictionaries = (configuration?: IntlayerConfig) => UnmergedDictionaries;
7
+ type GetUnmergedDictionaries = (configuration?: Pick<IntlayerConfig, 'system' | 'build'>) => UnmergedDictionaries;
8
8
  declare const getUnmergedDictionaries: GetUnmergedDictionaries;
9
9
  //#endregion
10
10
  export { UnmergedDictionaries, getUnmergedDictionaries };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;KAaY,oBAAA,GAAuB,MAAA,CAAO,cAAA,EAAgB,UAAA;AAAA,KAErD,uBAAA,IACH,aAAA,GAAgB,cAAA,KACb,oBAAoB;AAAA,cAEZ,uBAAA,EAAyB,uBAyBrC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;KAaY,oBAAA,GAAuB,MAAA,CAAO,cAAA,EAAgB,UAAA;AAAA,KAErD,uBAAA,IACH,aAAA,GAAgB,IAAA,CAAK,cAAA,0BAClB,oBAAA;AAAA,cAEQ,uBAAA,EAAyB,uBAyBrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/unmerged-dictionaries-entry",
3
- "version": "8.11.1",
3
+ "version": "8.11.2",
4
4
  "private": false,
5
5
  "description": "Provides the entry path for Intlayer dictionaries, solving filesystem retrieval issues for bundlers like Webpack and Rollup.",
6
6
  "keywords": [
@@ -72,16 +72,16 @@
72
72
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
73
73
  },
74
74
  "dependencies": {
75
- "@intlayer/config": "8.11.1"
75
+ "@intlayer/config": "8.11.2"
76
76
  },
77
77
  "devDependencies": {
78
- "@intlayer/types": "8.11.1",
78
+ "@intlayer/types": "8.11.2",
79
79
  "@types/node": "25.9.1",
80
80
  "@utils/ts-config": "1.0.4",
81
81
  "@utils/ts-config-types": "1.0.4",
82
82
  "@utils/tsdown-config": "1.0.4",
83
83
  "rimraf": "6.1.3",
84
- "tsdown": "0.22.00",
84
+ "tsdown": "0.22.1",
85
85
  "typescript": "6.0.3",
86
86
  "vitest": "4.1.7"
87
87
  },
@@ -1,29 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
-
29
- exports.__toESM = __toESM;