@intlayer/dictionaries-entry 5.4.1 → 5.5.0-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 +17 -8
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +13 -8
- 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
|
@@ -18,17 +18,26 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var index_exports = {};
|
|
20
20
|
__export(index_exports, {
|
|
21
|
-
default: () => index_default
|
|
21
|
+
default: () => index_default,
|
|
22
|
+
getDictionaries: () => getDictionaries
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(index_exports);
|
|
24
25
|
var import_config = require("@intlayer/config");
|
|
25
26
|
var import_fs = require("fs");
|
|
26
27
|
var import_path = require("path");
|
|
27
|
-
|
|
28
|
-
const { content } = (0, import_config.getConfiguration)();
|
|
29
|
-
const dictionariesPath = (0, import_path.join)(content.mainDir,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
const getDictionaries = () => {
|
|
29
|
+
const { content } = (0, import_config.getConfiguration)();
|
|
30
|
+
const dictionariesPath = (0, import_path.join)(content.mainDir, `dictionaries.cjs`);
|
|
31
|
+
let dictionaries = {};
|
|
32
|
+
if ((0, import_fs.existsSync)(dictionariesPath)) {
|
|
33
|
+
delete import_config.ESMxCJSRequire.cache[dictionariesPath];
|
|
34
|
+
dictionaries = (0, import_config.ESMxCJSRequire)(dictionariesPath);
|
|
35
|
+
}
|
|
36
|
+
return dictionaries ?? {};
|
|
37
|
+
};
|
|
38
|
+
var index_default = getDictionaries();
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
getDictionaries
|
|
42
|
+
});
|
|
34
43
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/dictionaries-entry is a package that only returns the 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 { ESMxCJSRequire, getConfiguration } from '@intlayer/config';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\n\
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/dictionaries-entry is a package that only returns the 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 { ESMxCJSRequire, getConfiguration } from '@intlayer/config';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\n\nexport const getDictionaries = () => {\n const { content } = getConfiguration();\n\n const dictionariesPath = join(content.mainDir, `dictionaries.cjs`);\n\n let dictionaries = {};\n if (existsSync(dictionariesPath)) {\n delete ESMxCJSRequire.cache[dictionariesPath];\n\n dictionaries = ESMxCJSRequire(dictionariesPath);\n }\n\n return (dictionaries ?? {}) as Record<\n IntlayerDictionaryTypesConnector['key'],\n IntlayerDictionaryTypesConnector\n >;\n};\n\nexport default getDictionaries();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAiD;AACjD,gBAA2B;AAC3B,kBAAqB;AAId,MAAM,kBAAkB,MAAM;AACnC,QAAM,EAAE,QAAQ,QAAI,gCAAiB;AAErC,QAAM,uBAAmB,kBAAK,QAAQ,SAAS,kBAAkB;AAEjE,MAAI,eAAe,CAAC;AACpB,UAAI,sBAAW,gBAAgB,GAAG;AAChC,WAAO,6BAAe,MAAM,gBAAgB;AAE5C,uBAAe,8BAAe,gBAAgB;AAAA,EAChD;AAEA,SAAQ,gBAAgB,CAAC;AAI3B;AAEA,IAAO,gBAAQ,gBAAgB;","names":[]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { ESMxCJSRequire, getConfiguration } from "@intlayer/config";
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { join } from "path";
|
|
4
|
-
|
|
5
|
-
const { content } = getConfiguration();
|
|
6
|
-
const dictionariesPath = join(content.mainDir,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const getDictionaries = () => {
|
|
5
|
+
const { content } = getConfiguration();
|
|
6
|
+
const dictionariesPath = join(content.mainDir, `dictionaries.cjs`);
|
|
7
|
+
let dictionaries = {};
|
|
8
|
+
if (existsSync(dictionariesPath)) {
|
|
9
|
+
delete ESMxCJSRequire.cache[dictionariesPath];
|
|
10
|
+
dictionaries = ESMxCJSRequire(dictionariesPath);
|
|
11
|
+
}
|
|
12
|
+
return dictionaries ?? {};
|
|
13
|
+
};
|
|
14
|
+
var index_default = getDictionaries();
|
|
11
15
|
export {
|
|
12
|
-
index_default as default
|
|
16
|
+
index_default as default,
|
|
17
|
+
getDictionaries
|
|
13
18
|
};
|
|
14
19
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/dictionaries-entry is a package that only returns the 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 { ESMxCJSRequire, getConfiguration } from '@intlayer/config';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\n\
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/dictionaries-entry is a package that only returns the 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 { ESMxCJSRequire, getConfiguration } from '@intlayer/config';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\n\nexport const getDictionaries = () => {\n const { content } = getConfiguration();\n\n const dictionariesPath = join(content.mainDir, `dictionaries.cjs`);\n\n let dictionaries = {};\n if (existsSync(dictionariesPath)) {\n delete ESMxCJSRequire.cache[dictionariesPath];\n\n dictionaries = ESMxCJSRequire(dictionariesPath);\n }\n\n return (dictionaries ?? {}) as Record<\n IntlayerDictionaryTypesConnector['key'],\n IntlayerDictionaryTypesConnector\n >;\n};\n\nexport default getDictionaries();\n"],"mappings":"AAMA,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAId,MAAM,kBAAkB,MAAM;AACnC,QAAM,EAAE,QAAQ,IAAI,iBAAiB;AAErC,QAAM,mBAAmB,KAAK,QAAQ,SAAS,kBAAkB;AAEjE,MAAI,eAAe,CAAC;AACpB,MAAI,WAAW,gBAAgB,GAAG;AAChC,WAAO,eAAe,MAAM,gBAAgB;AAE5C,mBAAe,eAAe,gBAAgB;AAAA,EAChD;AAEA,SAAQ,gBAAgB,CAAC;AAI3B;AAEA,IAAO,gBAAQ,gBAAgB;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* The alias allow hot reload the app (such as nextjs) on any dictionary change.
|
|
5
5
|
*/
|
|
6
6
|
import type { IntlayerDictionaryTypesConnector } from 'intlayer';
|
|
7
|
-
declare const
|
|
7
|
+
export declare const getDictionaries: () => Record<IntlayerDictionaryTypesConnector["key"], IntlayerDictionaryTypesConnector>;
|
|
8
|
+
declare const _default: Record<IntlayerDictionaryTypesConnector, IntlayerDictionaryTypesConnector>;
|
|
8
9
|
export default _default;
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAEjE,eAAO,MAAM,eAAe,QAYK,MAAM,CACnC,gCAAgC,CAAC,KAAK,CAAC,EACvC,gCAAgC,CAEnC,CAAC;;AAEF,wBAAiC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/dictionaries-entry",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0-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": "5.
|
|
56
|
+
"@intlayer/config": "5.5.0-canary.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^22.13.10",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"tsc-alias": "^1.8.11",
|
|
66
66
|
"tsup": "^8.4.0",
|
|
67
67
|
"typescript": "^5.8.2",
|
|
68
|
-
"@utils/eslint-config": "1.0.4",
|
|
69
|
-
"@utils/tsup-config": "1.0.4",
|
|
70
68
|
"@utils/ts-config": "1.0.4",
|
|
71
|
-
"@utils/
|
|
69
|
+
"@utils/eslint-config": "1.0.4",
|
|
70
|
+
"@utils/ts-config-types": "1.0.4",
|
|
71
|
+
"@utils/tsup-config": "1.0.4"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@intlayer/config": "5.
|
|
75
|
-
"intlayer": "5.
|
|
74
|
+
"@intlayer/config": "5.5.0-canary.0",
|
|
75
|
+
"intlayer": "5.5.0-canary.0"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
78
|
"node": ">=14.18"
|