@intlayer/dictionaries-entry 2.0.12 → 3.0.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.
@@ -22,18 +22,14 @@ __export(src_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(src_exports);
24
24
  var import_fs = require("fs");
25
- var import_module = require("module");
26
25
  var import_path = require("path");
27
26
  var import_config = require("@intlayer/config");
28
- const import_meta = {};
29
- const isESModule = typeof import_meta.url === "string";
30
27
  let dictionaries = void 0;
31
- const requireFunction = isESModule ? (0, import_module.createRequire)(import_meta.url) : require;
32
28
  const { content } = (0, import_config.getConfiguration)();
33
29
  const dictionariesPath = (0, import_path.join)(content.mainDir, "dictionaries.cjs");
34
30
  if ((0, import_fs.existsSync)(dictionariesPath)) {
35
- requireFunction(dictionariesPath);
36
- dictionaries = requireFunction(dictionariesPath);
31
+ (0, import_config.ESMxCJSRequire)(dictionariesPath);
32
+ dictionaries = (0, import_config.ESMxCJSRequire)(dictionariesPath);
37
33
  }
38
34
  var src_default = dictionaries ?? {};
39
35
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\n/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\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 'fs';\nimport { createRequire } from 'module';\nimport { join } from 'path';\nimport { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\n\nconst isESModule = typeof import.meta.url === 'string';\nlet dictionaries = undefined;\n\nconst requireFunction = isESModule ? createRequire(import.meta.url) : require;\n\nconst { content } = getConfiguration();\nconst dictionariesPath = join(content.mainDir, 'dictionaries.cjs');\n\n// Test if the dictionaries file exists\nif (existsSync(dictionariesPath)) {\n requireFunction(dictionariesPath);\n dictionaries = requireFunction(dictionariesPath);\n}\n\nexport default (dictionaries ?? {}) as Record<string, Dictionary>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,gBAA2B;AAC3B,oBAA8B;AAC9B,kBAAqB;AACrB,oBAAiC;AAVjC;AAaA,MAAM,aAAa,OAAO,YAAY,QAAQ;AAC9C,IAAI,eAAe;AAEnB,MAAM,kBAAkB,iBAAa,6BAAc,YAAY,GAAG,IAAI;AAEtE,MAAM,EAAE,QAAQ,QAAI,gCAAiB;AACrC,MAAM,uBAAmB,kBAAK,QAAQ,SAAS,kBAAkB;AAGjE,QAAI,sBAAW,gBAAgB,GAAG;AAChC,kBAAgB,gBAAgB;AAChC,iBAAe,gBAAgB,gBAAgB;AACjD;AAEA,IAAO,cAAS,gBAAgB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\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 'fs';\nimport { join } from 'path';\nimport { getConfiguration, ESMxCJSRequire } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\n\nlet dictionaries = undefined;\n\nconst { content } = getConfiguration();\nconst dictionariesPath = join(content.mainDir, 'dictionaries.cjs');\n\n// Test if the dictionaries file exists\nif (existsSync(dictionariesPath)) {\n ESMxCJSRequire(dictionariesPath);\n dictionaries = ESMxCJSRequire(dictionariesPath);\n}\n\nexport default (dictionaries ?? {}) as Record<Dictionary['key'], Dictionary>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,gBAA2B;AAC3B,kBAAqB;AACrB,oBAAiD;AAGjD,IAAI,eAAe;AAEnB,MAAM,EAAE,QAAQ,QAAI,gCAAiB;AACrC,MAAM,uBAAmB,kBAAK,QAAQ,SAAS,kBAAkB;AAGjE,QAAI,sBAAW,gBAAgB,GAAG;AAChC,oCAAe,gBAAgB;AAC/B,qBAAe,8BAAe,gBAAgB;AAChD;AAEA,IAAO,cAAS,gBAAgB,CAAC;","names":[]}
@@ -1,15 +1,12 @@
1
1
  import { existsSync } from "fs";
2
- import { createRequire } from "module";
3
2
  import { join } from "path";
4
- import { getConfiguration } from "@intlayer/config";
5
- const isESModule = typeof import.meta.url === "string";
3
+ import { getConfiguration, ESMxCJSRequire } from "@intlayer/config";
6
4
  let dictionaries = void 0;
7
- const requireFunction = isESModule ? createRequire(import.meta.url) : require;
8
5
  const { content } = getConfiguration();
9
6
  const dictionariesPath = join(content.mainDir, "dictionaries.cjs");
10
7
  if (existsSync(dictionariesPath)) {
11
- requireFunction(dictionariesPath);
12
- dictionaries = requireFunction(dictionariesPath);
8
+ ESMxCJSRequire(dictionariesPath);
9
+ dictionaries = ESMxCJSRequire(dictionariesPath);
13
10
  }
14
11
  var src_default = dictionaries ?? {};
15
12
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\n/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\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 'fs';\nimport { createRequire } from 'module';\nimport { join } from 'path';\nimport { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\n\nconst isESModule = typeof import.meta.url === 'string';\nlet dictionaries = undefined;\n\nconst requireFunction = isESModule ? createRequire(import.meta.url) : require;\n\nconst { content } = getConfiguration();\nconst dictionariesPath = join(content.mainDir, 'dictionaries.cjs');\n\n// Test if the dictionaries file exists\nif (existsSync(dictionariesPath)) {\n requireFunction(dictionariesPath);\n dictionaries = requireFunction(dictionariesPath);\n}\n\nexport default (dictionaries ?? {}) as Record<string, Dictionary>;\n"],"mappings":"AAOA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAGjC,MAAM,aAAa,OAAO,YAAY,QAAQ;AAC9C,IAAI,eAAe;AAEnB,MAAM,kBAAkB,aAAa,cAAc,YAAY,GAAG,IAAI;AAEtE,MAAM,EAAE,QAAQ,IAAI,iBAAiB;AACrC,MAAM,mBAAmB,KAAK,QAAQ,SAAS,kBAAkB;AAGjE,IAAI,WAAW,gBAAgB,GAAG;AAChC,kBAAgB,gBAAgB;AAChC,iBAAe,gBAAgB,gBAAgB;AACjD;AAEA,IAAO,cAAS,gBAAgB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.\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 'fs';\nimport { join } from 'path';\nimport { getConfiguration, ESMxCJSRequire } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\n\nlet dictionaries = undefined;\n\nconst { content } = getConfiguration();\nconst dictionariesPath = join(content.mainDir, 'dictionaries.cjs');\n\n// Test if the dictionaries file exists\nif (existsSync(dictionariesPath)) {\n ESMxCJSRequire(dictionariesPath);\n dictionaries = ESMxCJSRequire(dictionariesPath);\n}\n\nexport default (dictionaries ?? {}) as Record<Dictionary['key'], Dictionary>;\n"],"mappings":"AAMA,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,kBAAkB,sBAAsB;AAGjD,IAAI,eAAe;AAEnB,MAAM,EAAE,QAAQ,IAAI,iBAAiB;AACrC,MAAM,mBAAmB,KAAK,QAAQ,SAAS,kBAAkB;AAGjE,IAAI,WAAW,gBAAgB,GAAG;AAChC,iBAAe,gBAAgB;AAC/B,iBAAe,eAAe,gBAAgB;AAChD;AAEA,IAAO,cAAS,gBAAgB,CAAC;","names":[]}
@@ -1,11 +1,9 @@
1
- import { Dictionary } from '@intlayer/core';
2
-
3
1
  /**
4
2
  * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.
5
3
  * Using an external package allow to alias it in the bundle configuration (such as webpack).
6
4
  * The alias allow hot reload the app (such as nextjs) on any dictionary change.
7
5
  */
8
-
9
- declare const _default: Record<string, Dictionary>;
10
-
11
- export { _default as default };
6
+ import type { Dictionary } from '@intlayer/core';
7
+ declare const _default: Record<Dictionary["key"], Dictionary>;
8
+ export default _default;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;wBAaV,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;AAA5E,wBAA6E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/dictionaries-entry",
3
- "version": "2.0.12",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "description": "IntLayer - Dictionaries Entry. This package only returns the dictionary entry path. For bundle configuration, this packages should be replaced by using an alias.",
6
6
  "keywords": [
@@ -11,27 +11,27 @@
11
11
  ],
12
12
  "homepage": "https://intlayer.org",
13
13
  "bugs": {
14
- "url": "https://github.com/aypineau/intlayer/issues"
14
+ "url": "https://github.com/aymericzip/intlayer/issues"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/aypineau/intlayer.git"
18
+ "url": "git+https://github.com/aymericzip/intlayer.git"
19
19
  },
20
20
  "license": "Apache-2.0",
21
21
  "author": {
22
22
  "name": "Aymeric PINEAU",
23
- "url": "https://github.com/aypineau"
23
+ "url": "https://github.com/aymericzip"
24
24
  },
25
25
  "contributors": [
26
26
  {
27
27
  "name": "Aymeric Pineau",
28
28
  "email": "ay.pineau@gmail.com",
29
- "url": "https://github.com/aypineau"
29
+ "url": "https://github.com/aymericzip"
30
30
  }
31
31
  ],
32
32
  "exports": {
33
33
  ".": {
34
- "types": "./dist/esm/index.d.mts",
34
+ "types": "./dist/types/index.d.ts",
35
35
  "require": "./dist/cjs/index.cjs",
36
36
  "import": "./dist/esm/index.mjs"
37
37
  },
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "main": "dist/cjs/index.cjs",
41
41
  "module": "dist/esm/index.mjs",
42
+ "types": "dist/types/index.d.ts",
42
43
  "typesVersions": {
43
44
  "*": {
44
45
  "package.json": [
@@ -51,32 +52,41 @@
51
52
  "./package.json"
52
53
  ],
53
54
  "dependencies": {
54
- "@intlayer/config": "^2.0.12"
55
+ "@intlayer/config": "^3.0.0"
55
56
  },
56
57
  "devDependencies": {
57
58
  "@types/node": "^20.14.9",
59
+ "concurrently": "^8.2.2",
60
+ "eslint": "^9.11.1",
61
+ "prettier": "3.3.3",
58
62
  "rimraf": "5.0.5",
59
- "tsup": "^8.1.0",
63
+ "tsc-alias": "^1.8.10",
64
+ "tsup": "^8.3.0",
60
65
  "typescript": "^5.5.2",
61
- "@intlayer/core": "^2.0.12",
66
+ "@intlayer/core": "^3.0.0",
62
67
  "@utils/eslint-config": "^1.0.4",
63
- "@utils/ts-config": "^1.0.4"
68
+ "@utils/ts-config": "^1.0.4",
69
+ "@utils/ts-config-types": "^1.0.4",
70
+ "@utils/tsup-config": "^1.0.4"
64
71
  },
65
72
  "engines": {
66
73
  "node": ">=14.18"
67
74
  },
68
75
  "bug": {
69
- "url": "https://github.com/aypineau/intlayer/issues"
76
+ "url": "https://github.com/aymericzip/intlayer/issues"
70
77
  },
71
78
  "scripts": {
72
- "build": "tsup",
79
+ "build": "pnpm build:package & pnpm build:types",
80
+ "build:package": "tsup",
81
+ "build:types": "tsc --project ./tsconfig.types.json && tsc-alias --project ./tsconfig.types.json",
73
82
  "clean": "rimraf ./dist",
74
- "dev": "tsup --watch",
75
- "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs",
76
- "lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs --fix",
77
- "prettier:fix": "prettier --write src/**/*",
83
+ "dev": "concurrently --prefix none \"tsup --watch\" \"tsc --project ./tsconfig.types.json --watch\" \"tsc-alias --project ./tsconfig.types.json --watch\"",
84
+ "lint": "eslint . --cache",
85
+ "lint:fix": "eslint . --cache --fix",
86
+ "prettier": "prettier . --check",
87
+ "prettier:fix": "prettier . --write",
78
88
  "process-files": "ts-node src/transpiler/processFilesCLI.ts --dir $npm_config_dir --extension $npm_config_extension --no-node-snapshot",
79
89
  "test": "",
80
- "typecheck": "tsup--project ./tsconfig.json --noEmit"
90
+ "typecheck": "tsup --project ./tsconfig.json --noEmit"
81
91
  }
82
92
  }
@@ -1,11 +0,0 @@
1
- import { Dictionary } from '@intlayer/core';
2
-
3
- /**
4
- * @intlayer/dictionaries-entry is a package that only returns the dictionary entry path.
5
- * Using an external package allow to alias it in the bundle configuration (such as webpack).
6
- * The alias allow hot reload the app (such as nextjs) on any dictionary change.
7
- */
8
-
9
- declare const _default: Record<string, Dictionary>;
10
-
11
- export { _default as default };