@intlayer/unmerged-dictionaries-entry 6.0.0 → 6.0.2-canary.0
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 +8 -24
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +13 -24
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/cjs/index.cjs
CHANGED
|
@@ -25,32 +25,16 @@ module.exports = __toCommonJS(index_exports);
|
|
|
25
25
|
var import_config = require("@intlayer/config");
|
|
26
26
|
var import_fs = require("fs");
|
|
27
27
|
var import_path = require("path");
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const cachedModule = import_config.ESMxCJSRequire.cache[resolvedPath];
|
|
36
|
-
if (cachedModule) {
|
|
37
|
-
if (cachedModule.children) {
|
|
38
|
-
cachedModule.children.forEach((child) => {
|
|
39
|
-
clearModuleCache(child.filename, visited);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
delete import_config.ESMxCJSRequire.cache[resolvedPath];
|
|
43
|
-
}
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.warn(`Could not clear cache for module: ${modulePath}`, error);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const getUnmergedDictionaries = () => {
|
|
49
|
-
const { content } = (0, import_config.getConfiguration)();
|
|
50
|
-
const dictionariesPath = (0, import_path.join)(content.mainDir, "unmerged_dictionaries.cjs");
|
|
28
|
+
const getUnmergedDictionaries = (configuration = (0, import_config.getConfiguration)()) => {
|
|
29
|
+
const { content } = configuration;
|
|
30
|
+
const extension = (0, import_config.getExtension)(configuration);
|
|
31
|
+
const dictionariesPath = (0, import_path.join)(
|
|
32
|
+
content.mainDir,
|
|
33
|
+
`unmerged_dictionaries.${extension}`
|
|
34
|
+
);
|
|
51
35
|
let dictionaries = {};
|
|
52
36
|
if ((0, import_fs.existsSync)(dictionariesPath)) {
|
|
53
|
-
clearModuleCache(dictionariesPath);
|
|
37
|
+
(0, import_config.clearModuleCache)(dictionariesPath);
|
|
54
38
|
dictionaries = (0, import_config.ESMxCJSRequire)(dictionariesPath);
|
|
55
39
|
}
|
|
56
40
|
return dictionaries;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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 {
|
|
1
|
+
{"version":3,"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 {\n clearModuleCache,\n ESMxCJSRequire,\n getConfiguration,\n getExtension,\n type IntlayerConfig,\n} from '@intlayer/config';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n// @ts-ignore intlayer declared for module augmentation\nimport type { Dictionary, IntlayerDictionaryTypesConnector } from 'intlayer';\n\nexport const getUnmergedDictionaries = (\n configuration: IntlayerConfig = getConfiguration()\n) => {\n const { content } = configuration;\n\n const extension = getExtension(configuration);\n\n const dictionariesPath = join(\n content.mainDir,\n `unmerged_dictionaries.${extension}`\n );\n let dictionaries: Record<\n IntlayerDictionaryTypesConnector['key'],\n Dictionary[]\n > = {};\n\n if (existsSync(dictionariesPath)) {\n // Clear cache for unmerged_dictionaries.cjs and all its dependencies (JSON files)\n clearModuleCache(dictionariesPath);\n dictionaries = ESMxCJSRequire(dictionariesPath);\n }\n\n return dictionaries;\n};\n\nexport default (() => getUnmergedDictionaries())();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAMO;AACP,gBAA2B;AAC3B,kBAAqB;AAId,MAAM,0BAA0B,CACrC,oBAAgC,gCAAiB,MAC9C;AACH,QAAM,EAAE,QAAQ,IAAI;AAEpB,QAAM,gBAAY,4BAAa,aAAa;AAE5C,QAAM,uBAAmB;AAAA,IACvB,QAAQ;AAAA,IACR,yBAAyB,SAAS;AAAA,EACpC;AACA,MAAI,eAGA,CAAC;AAEL,UAAI,sBAAW,gBAAgB,GAAG;AAEhC,wCAAiB,gBAAgB;AACjC,uBAAe,8BAAe,gBAAgB;AAAA,EAChD;AAEA,SAAO;AACT;AAEA,IAAO,iBAAS,MAAM,wBAAwB,GAAG;","names":[]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
clearModuleCache,
|
|
3
|
+
ESMxCJSRequire,
|
|
4
|
+
getConfiguration,
|
|
5
|
+
getExtension
|
|
6
|
+
} from "@intlayer/config";
|
|
2
7
|
import { existsSync } from "fs";
|
|
3
8
|
import { join } from "path";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const cachedModule = ESMxCJSRequire.cache[resolvedPath];
|
|
12
|
-
if (cachedModule) {
|
|
13
|
-
if (cachedModule.children) {
|
|
14
|
-
cachedModule.children.forEach((child) => {
|
|
15
|
-
clearModuleCache(child.filename, visited);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
delete ESMxCJSRequire.cache[resolvedPath];
|
|
19
|
-
}
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.warn(`Could not clear cache for module: ${modulePath}`, error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const getUnmergedDictionaries = () => {
|
|
25
|
-
const { content } = getConfiguration();
|
|
26
|
-
const dictionariesPath = join(content.mainDir, "unmerged_dictionaries.cjs");
|
|
9
|
+
const getUnmergedDictionaries = (configuration = getConfiguration()) => {
|
|
10
|
+
const { content } = configuration;
|
|
11
|
+
const extension = getExtension(configuration);
|
|
12
|
+
const dictionariesPath = join(
|
|
13
|
+
content.mainDir,
|
|
14
|
+
`unmerged_dictionaries.${extension}`
|
|
15
|
+
);
|
|
27
16
|
let dictionaries = {};
|
|
28
17
|
if (existsSync(dictionariesPath)) {
|
|
29
18
|
clearModuleCache(dictionariesPath);
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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 {
|
|
1
|
+
{"version":3,"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 {\n clearModuleCache,\n ESMxCJSRequire,\n getConfiguration,\n getExtension,\n type IntlayerConfig,\n} from '@intlayer/config';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n// @ts-ignore intlayer declared for module augmentation\nimport type { Dictionary, IntlayerDictionaryTypesConnector } from 'intlayer';\n\nexport const getUnmergedDictionaries = (\n configuration: IntlayerConfig = getConfiguration()\n) => {\n const { content } = configuration;\n\n const extension = getExtension(configuration);\n\n const dictionariesPath = join(\n content.mainDir,\n `unmerged_dictionaries.${extension}`\n );\n let dictionaries: Record<\n IntlayerDictionaryTypesConnector['key'],\n Dictionary[]\n > = {};\n\n if (existsSync(dictionariesPath)) {\n // Clear cache for unmerged_dictionaries.cjs and all its dependencies (JSON files)\n clearModuleCache(dictionariesPath);\n dictionaries = ESMxCJSRequire(dictionariesPath);\n }\n\n return dictionaries;\n};\n\nexport default (() => getUnmergedDictionaries())();\n"],"mappings":"AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAId,MAAM,0BAA0B,CACrC,gBAAgC,iBAAiB,MAC9C;AACH,QAAM,EAAE,QAAQ,IAAI;AAEpB,QAAM,YAAY,aAAa,aAAa;AAE5C,QAAM,mBAAmB;AAAA,IACvB,QAAQ;AAAA,IACR,yBAAyB,SAAS;AAAA,EACpC;AACA,MAAI,eAGA,CAAC;AAEL,MAAI,WAAW,gBAAgB,GAAG;AAEhC,qBAAiB,gBAAgB;AACjC,mBAAe,eAAe,gBAAgB;AAAA,EAChD;AAEA,SAAO;AACT;AAEA,IAAO,iBAAS,MAAM,wBAAwB,GAAG;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Using an external package allow to alias it in the bundle configuration (such as webpack).
|
|
4
4
|
* The alias allow hot reload the app (such as nextjs) on any dictionary change.
|
|
5
5
|
*/
|
|
6
|
+
import { type IntlayerConfig } from '@intlayer/config';
|
|
6
7
|
import type { Dictionary } from 'intlayer';
|
|
7
|
-
export declare const getUnmergedDictionaries: () => Record<IntlayerDictionaryTypesConnector, Dictionary[]>;
|
|
8
|
+
export declare const getUnmergedDictionaries: (configuration?: IntlayerConfig) => Record<IntlayerDictionaryTypesConnector, Dictionary[]>;
|
|
8
9
|
declare const _default: Record<IntlayerDictionaryTypesConnector, Dictionary[]>;
|
|
9
10
|
export default _default;
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAoC,MAAM,UAAU,CAAC;AAE7E,eAAO,MAAM,uBAAuB,GAClC,gBAAe,cAAmC,2DAsBnD,CAAC;;AAEF,wBAAmD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/unmerged-dictionaries-entry",
|
|
3
|
-
"version": "6.0.0",
|
|
3
|
+
"version": "6.0.2-canary.0",
|
|
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": [
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"./package.json"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@intlayer/config": "6.0.0"
|
|
56
|
+
"@intlayer/config": "6.0.2-canary.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^24.2.1",
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"tsup": "^8.5.0",
|
|
67
67
|
"typescript": "^5.9.2",
|
|
68
68
|
"vitest": "^3.2.4",
|
|
69
|
-
"@utils/
|
|
69
|
+
"@utils/eslint-config": "1.0.4",
|
|
70
70
|
"@utils/ts-config-types": "1.0.4",
|
|
71
|
-
"@utils/
|
|
72
|
-
"@utils/
|
|
71
|
+
"@utils/ts-config": "1.0.4",
|
|
72
|
+
"@utils/tsup-config": "1.0.4"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@intlayer/config": "6.0.0",
|
|
76
|
-
"intlayer": "6.0.0"
|
|
75
|
+
"@intlayer/config": "6.0.2-canary.0",
|
|
76
|
+
"intlayer": "6.0.2-canary.0"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=14.18"
|