@intlayer/fetch-dictionaries-entry 8.11.1 → 8.11.3
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
CHANGED
|
@@ -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,9 @@ _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 getDynamicDictionaries = (configuration = _intlayer_config_built.
|
|
15
|
-
const { system } = configuration;
|
|
16
|
-
const { fetchDictionariesDir } = system;
|
|
12
|
+
const getDynamicDictionaries = (configuration = { system: _intlayer_config_built.system }) => {
|
|
13
|
+
const { system: system$1 } = configuration;
|
|
14
|
+
const { fetchDictionariesDir } = system$1;
|
|
17
15
|
const dictionaries = {};
|
|
18
16
|
if ((0, node_fs.existsSync)(fetchDictionariesDir)) {
|
|
19
17
|
const files = (0, node_fs.readdirSync)(fetchDictionariesDir).filter((file) => file.endsWith(".json"));
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["system"],"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 { 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?: IntlayerConfig\n) => FetchDictionaries;\n\nexport const getDynamicDictionaries: GetFetchDictionaries = (\n configuration: Pick<IntlayerConfig, 'system'> = { system }\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,gBAAgD,EAAE,sCAAO,MACtD;CACH,MAAM,EAAE,qBAAW;CACnB,MAAM,EAAE,yBAAyBA;CAEjC,MAAM,eAAoC,CAAC;CAE3C,4BAAe,oBAAoB,GAAG;EAEpC,MAAM,iCAAoB,oBAAoB,EAAE,QAAQ,SACtD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,8BAAe,6BAAc,IAAI,CAAC;GACxC,MAAM,wDAA4B,sBAAsB,IAAI,GAAG,OAAO;GACtE,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
|
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 { system } from "@intlayer/config/built";
|
|
4
4
|
|
|
5
5
|
//#region src/index.ts
|
|
6
6
|
/**
|
|
@@ -8,9 +8,9 @@ import builtConfiguration 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 =
|
|
12
|
-
const { system } = configuration;
|
|
13
|
-
const { fetchDictionariesDir } = system;
|
|
11
|
+
const getDynamicDictionaries = (configuration = { system }) => {
|
|
12
|
+
const { system: system$1 } = configuration;
|
|
13
|
+
const { fetchDictionariesDir } = system$1;
|
|
14
14
|
const dictionaries = {};
|
|
15
15
|
if (existsSync(fetchDictionariesDir)) {
|
|
16
16
|
const files = readdirSync(fetchDictionariesDir).filter((file) => file.endsWith(".json"));
|
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":["system"],"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 { 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?: IntlayerConfig\n) => FetchDictionaries;\n\nexport const getDynamicDictionaries: GetFetchDictionaries = (\n configuration: Pick<IntlayerConfig, 'system'> = { system }\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,gBAAgD,EAAE,OAAO,MACtD;CACH,MAAM,EAAE,qBAAW;CACnB,MAAM,EAAE,yBAAyBA;CAEjC,MAAM,eAAoC,CAAC;CAE3C,IAAI,WAAW,oBAAoB,GAAG;EAEpC,MAAM,QAAQ,YAAY,oBAAoB,EAAE,QAAQ,SACtD,KAAK,SAAS,OAAO,CACvB;EAEA,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,MAAM,SAAS,MAAM,QAAQ,IAAI,CAAC;GACxC,MAAM,UAAU,aAAa,KAAK,sBAAsB,IAAI,GAAG,OAAO;GACtE,aAAa,OAAO,KAAK,MAAM,OAAO;EACxC;CACF;CAEA,OAAO;AACT"}
|
|
@@ -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":";;;;;KAgBY,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.11.
|
|
3
|
+
"version": "8.11.3",
|
|
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": [
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@intlayer/config": "8.11.
|
|
82
|
-
"@intlayer/core": "8.11.
|
|
83
|
-
"@intlayer/types": "8.11.
|
|
81
|
+
"@intlayer/config": "8.11.3",
|
|
82
|
+
"@intlayer/core": "8.11.3",
|
|
83
|
+
"@intlayer/types": "8.11.3"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@types/node": "25.9.1",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@utils/ts-config-types": "1.0.4",
|
|
89
89
|
"@utils/tsdown-config": "1.0.4",
|
|
90
90
|
"rimraf": "6.1.3",
|
|
91
|
-
"tsdown": "0.22.
|
|
91
|
+
"tsdown": "0.22.1",
|
|
92
92
|
"typescript": "6.0.3",
|
|
93
93
|
"vitest": "4.1.7"
|
|
94
94
|
},
|
|
@@ -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;
|