@intlayer/fetch-dictionaries-entry 8.1.2 → 8.1.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.
@@ -1,29 +1 @@
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;
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
@@ -1,28 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- let node_fs = require("node:fs");
4
- let node_path = require("node:path");
5
- let _intlayer_config = require("@intlayer/config");
6
- let _intlayer_config_built = require("@intlayer/config/built");
7
- _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
8
-
9
- //#region src/index.ts
10
- /**
11
- * @intlayer/fetch-dictionaries-entry is a package that only returns the fetch dictionary entry file.
12
- * Using an external package allow to alias it in the bundle configuration (such as webpack).
13
- * The alias allow hot reload the app (such as nextjs) on any dictionary change.
14
- */
15
- const getDynamicDictionaries = (configuration = _intlayer_config_built.default) => {
16
- const { system, build } = configuration;
17
- const dictionariesPath = (0, node_path.join)(system.mainDir, `fetch_dictionaries.cjs`);
18
- let dictionaries = {};
19
- if ((0, node_fs.existsSync)(dictionariesPath)) {
20
- (0, _intlayer_config.clearModuleCache)(dictionariesPath);
21
- dictionaries = (build.require ?? _intlayer_config.configESMxCJSRequire)(dictionariesPath);
22
- }
23
- return dictionaries;
24
- };
25
-
26
- //#endregion
27
- exports.getDynamicDictionaries = getDynamicDictionaries;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`node:fs`),n=require(`node:path`),r=require(`@intlayer/config/built`);r=e.__toESM(r);let i=require(`@intlayer/config/utils`);const a=(e=r.default)=>{let{system:a,build:o}=e,s=(0,n.join)(a.mainDir,`fetch_dictionaries.cjs`),c={};return(0,t.existsSync)(s)&&((0,i.clearModuleCache)(s),c=(o.require??i.configESMxCJSRequire)(s)),c};exports.getDynamicDictionaries=a;
28
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["config","configESMxCJSRequire"],"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 } from 'node:fs';\nimport { join } from 'node:path';\nimport { clearModuleCache, configESMxCJSRequire } from '@intlayer/config';\nimport config from '@intlayer/config/built';\nimport type {\n Dictionary,\n DictionaryKeys,\n IntlayerConfig,\n StrictModeLocaleMap,\n} from '@intlayer/types';\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, build } = configuration;\n\n // Always use cjs for dictionaries entry as it uses require\n const dictionariesPath = join(system.mainDir, `fetch_dictionaries.cjs`);\n let dictionaries: Record<\n DictionaryKeys,\n StrictModeLocaleMap<Dictionary>\n > = {};\n\n if (existsSync(dictionariesPath)) {\n // Clear cache for dynamic_dictionaries.cjs and all its dependencies (JSON files)\n clearModuleCache(dictionariesPath);\n dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);\n }\n\n return dictionaries;\n};\n"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAa,0BACX,gBAAgCA,mCAC7B;CACH,MAAM,EAAE,QAAQ,UAAU;CAG1B,MAAM,uCAAwB,OAAO,SAAS,yBAAyB;CACvE,IAAI,eAGA,EAAE;AAEN,6BAAe,iBAAiB,EAAE;AAEhC,yCAAiB,iBAAiB;AAClC,kBAAgB,MAAM,WAAWC,uCAAsB,iBAAiB;;AAG1E,QAAO"}
1
+ {"version":3,"file":"index.cjs","names":["config","configESMxCJSRequire"],"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 } from 'node:fs';\nimport { join } from 'node:path';\nimport config from '@intlayer/config/built';\nimport { clearModuleCache, configESMxCJSRequire } from '@intlayer/config/utils';\nimport type {\n Dictionary,\n DictionaryKeys,\n IntlayerConfig,\n StrictModeLocaleMap,\n} from '@intlayer/types';\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, build } = configuration;\n\n // Always use cjs for dictionaries entry as it uses require\n const dictionariesPath = join(system.mainDir, `fetch_dictionaries.cjs`);\n let dictionaries: Record<\n DictionaryKeys,\n StrictModeLocaleMap<Dictionary>\n > = {};\n\n if (existsSync(dictionariesPath)) {\n // Clear cache for dynamic_dictionaries.cjs and all its dependencies (JSON files)\n clearModuleCache(dictionariesPath);\n dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);\n }\n\n return dictionaries;\n};\n"],"mappings":"kQA0BA,MAAa,GACX,EAAgCA,EAAAA,UAC7B,CACH,GAAM,CAAE,SAAQ,SAAU,EAGpB,GAAA,EAAA,EAAA,MAAwB,EAAO,QAAS,yBAAyB,CACnE,EAGA,EAAE,CAQN,OANA,EAAA,EAAA,YAAe,EAAiB,IAE9B,EAAA,EAAA,kBAAiB,EAAiB,CAClC,GAAgB,EAAM,SAAWC,EAAAA,sBAAsB,EAAiB,EAGnE"}
@@ -1,25 +1,2 @@
1
- import { existsSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { clearModuleCache, configESMxCJSRequire } from "@intlayer/config";
4
- import config from "@intlayer/config/built";
5
-
6
- //#region src/index.ts
7
- /**
8
- * @intlayer/fetch-dictionaries-entry is a package that only returns the fetch dictionary entry file.
9
- * Using an external package allow to alias it in the bundle configuration (such as webpack).
10
- * The alias allow hot reload the app (such as nextjs) on any dictionary change.
11
- */
12
- const getDynamicDictionaries = (configuration = config) => {
13
- const { system, build } = configuration;
14
- const dictionariesPath = join(system.mainDir, `fetch_dictionaries.cjs`);
15
- let dictionaries = {};
16
- if (existsSync(dictionariesPath)) {
17
- clearModuleCache(dictionariesPath);
18
- dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);
19
- }
20
- return dictionaries;
21
- };
22
-
23
- //#endregion
24
- export { getDynamicDictionaries };
1
+ import{existsSync as e}from"node:fs";import{join as t}from"node:path";import n from"@intlayer/config/built";import{clearModuleCache as r,configESMxCJSRequire as i}from"@intlayer/config/utils";const a=(a=n)=>{let{system:o,build:s}=a,c=t(o.mainDir,`fetch_dictionaries.cjs`),l={};return e(c)&&(r(c),l=(s.require??i)(c)),l};export{a as getDynamicDictionaries};
25
2
  //# sourceMappingURL=index.mjs.map
@@ -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 } from 'node:fs';\nimport { join } from 'node:path';\nimport { clearModuleCache, configESMxCJSRequire } from '@intlayer/config';\nimport config from '@intlayer/config/built';\nimport type {\n Dictionary,\n DictionaryKeys,\n IntlayerConfig,\n StrictModeLocaleMap,\n} from '@intlayer/types';\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, build } = configuration;\n\n // Always use cjs for dictionaries entry as it uses require\n const dictionariesPath = join(system.mainDir, `fetch_dictionaries.cjs`);\n let dictionaries: Record<\n DictionaryKeys,\n StrictModeLocaleMap<Dictionary>\n > = {};\n\n if (existsSync(dictionariesPath)) {\n // Clear cache for dynamic_dictionaries.cjs and all its dependencies (JSON files)\n clearModuleCache(dictionariesPath);\n dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);\n }\n\n return dictionaries;\n};\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,0BACX,gBAAgC,WAC7B;CACH,MAAM,EAAE,QAAQ,UAAU;CAG1B,MAAM,mBAAmB,KAAK,OAAO,SAAS,yBAAyB;CACvE,IAAI,eAGA,EAAE;AAEN,KAAI,WAAW,iBAAiB,EAAE;AAEhC,mBAAiB,iBAAiB;AAClC,kBAAgB,MAAM,WAAW,sBAAsB,iBAAiB;;AAG1E,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 } from 'node:fs';\nimport { join } from 'node:path';\nimport config from '@intlayer/config/built';\nimport { clearModuleCache, configESMxCJSRequire } from '@intlayer/config/utils';\nimport type {\n Dictionary,\n DictionaryKeys,\n IntlayerConfig,\n StrictModeLocaleMap,\n} from '@intlayer/types';\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, build } = configuration;\n\n // Always use cjs for dictionaries entry as it uses require\n const dictionariesPath = join(system.mainDir, `fetch_dictionaries.cjs`);\n let dictionaries: Record<\n DictionaryKeys,\n StrictModeLocaleMap<Dictionary>\n > = {};\n\n if (existsSync(dictionariesPath)) {\n // Clear cache for dynamic_dictionaries.cjs and all its dependencies (JSON files)\n clearModuleCache(dictionariesPath);\n dictionaries = (build.require ?? configESMxCJSRequire)(dictionariesPath);\n }\n\n return dictionaries;\n};\n"],"mappings":"gMA0BA,MAAa,GACX,EAAgC,IAC7B,CACH,GAAM,CAAE,SAAQ,SAAU,EAGpB,EAAmB,EAAK,EAAO,QAAS,yBAAyB,CACnE,EAGA,EAAE,CAQN,OANI,EAAW,EAAiB,GAE9B,EAAiB,EAAiB,CAClC,GAAgB,EAAM,SAAW,GAAsB,EAAiB,EAGnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/fetch-dictionaries-entry",
3
- "version": "8.1.2",
3
+ "version": "8.1.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": [
@@ -77,9 +77,9 @@
77
77
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
78
78
  },
79
79
  "dependencies": {
80
- "@intlayer/config": "8.1.2",
81
- "@intlayer/core": "8.1.2",
82
- "@intlayer/types": "8.1.2"
80
+ "@intlayer/config": "8.1.3",
81
+ "@intlayer/core": "8.1.3",
82
+ "@intlayer/types": "8.1.3"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@types/node": "25.2.3",