@intlayer/core 3.0.3 → 3.2.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/transpiler/content_transformers/translation/types.cjs +12 -0
- package/dist/cjs/transpiler/content_transformers/translation/types.cjs.map +1 -1
- package/dist/esm/transpiler/content_transformers/translation/types.mjs +4 -0
- package/dist/esm/transpiler/content_transformers/translation/types.mjs.map +1 -1
- package/dist/types/transpiler/content_transformers/translation/types.d.ts +1 -0
- package/dist/types/transpiler/content_transformers/translation/types.d.ts.map +1 -1
- package/package.json +15 -16
|
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
6
10
|
var __copyProps = (to, from, except, desc) => {
|
|
7
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,5 +17,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
17
|
};
|
|
14
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
19
|
var types_exports = {};
|
|
20
|
+
__export(types_exports, {
|
|
21
|
+
FIX_MODULE_TRANSFORMATION: () => FIX_MODULE_TRANSFORMATION
|
|
22
|
+
});
|
|
16
23
|
module.exports = __toCommonJS(types_exports);
|
|
24
|
+
const FIX_MODULE_TRANSFORMATION = void 0;
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
FIX_MODULE_TRANSFORMATION
|
|
28
|
+
});
|
|
17
29
|
//# sourceMappingURL=types.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/types.ts"],"sourcesContent":["/** @ts-nocheck */\n\nimport type { LocalesValues } from '@intlayer/config/client';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IConfigLocales } from 'intlayer';\nimport type { NodeType } from '../../../types';\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return never\n */\nexport type ConfigLocales = keyof IConfigLocales<unknown>;\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return all available locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n */\nexport type CustomLocales = ConfigLocales extends never\n ? LocalesValues\n : ConfigLocales;\n\n/**\n * Record of locales and content\n *\n * const myVar1: LanguageContent<string> = {\n * \"en\": \"\",\n * \"fr\": \"\"\n * }\n *\n * const myVar2: LanguageContent<{age: number, name: string}> = {\n * \"en\": {age: 1, name: \"test\"},\n * \"fr\": {age: 1, name: \"test\"}\n * }\n */\nexport type LanguageContent<Content> = Partial<Record<LocalesValues, Content>>;\n\n/**\n * Valid\n * const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {\n * \"en\": \"test\",\n * \"fr\": \"test\"\n * }\n *\n * const test: CustomizableLanguageContent<number> = {\n * \"fr\": 1,\n * \"en\": 1,\n * ... any other available locale\n * }\n *\n * Invalid\n *\n * const test: CustomizableLanguageContent<string> = {\n * \"en\": \"test\",\n * \"fr\": \"test\",\n * \"sss\": \"test\" // Does not exist in Locales\n * }\n *\n * const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {\n * \"fr\": \"test\"\n * // Locales.ENGLISH is missing\n * }\n *\n */\nexport type CustomizableLanguageContent<Content = string> =\n ConfigLocales extends never\n ? LanguageContent<Content>\n : IConfigLocales<Content>;\n\nexport type TranslationContent<Content> = {\n nodeType: NodeType.Translation;\n [NodeType.Translation]: LanguageContent<Content>;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/types.ts"],"sourcesContent":["/** @ts-nocheck */\n\nimport type { LocalesValues } from '@intlayer/config/client';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IConfigLocales } from 'intlayer';\nimport type { NodeType } from '../../../types';\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return never\n */\nexport type ConfigLocales = keyof IConfigLocales<unknown>;\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return all available locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n */\nexport type CustomLocales = ConfigLocales extends never\n ? LocalesValues\n : ConfigLocales;\n\n/**\n * Record of locales and content\n *\n * const myVar1: LanguageContent<string> = {\n * \"en\": \"\",\n * \"fr\": \"\"\n * }\n *\n * const myVar2: LanguageContent<{age: number, name: string}> = {\n * \"en\": {age: 1, name: \"test\"},\n * \"fr\": {age: 1, name: \"test\"}\n * }\n */\nexport type LanguageContent<Content> = Partial<Record<LocalesValues, Content>>;\n\n/**\n * Valid\n * const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {\n * \"en\": \"test\",\n * \"fr\": \"test\"\n * }\n *\n * const test: CustomizableLanguageContent<number> = {\n * \"fr\": 1,\n * \"en\": 1,\n * ... any other available locale\n * }\n *\n * Invalid\n *\n * const test: CustomizableLanguageContent<string> = {\n * \"en\": \"test\",\n * \"fr\": \"test\",\n * \"sss\": \"test\" // Does not exist in Locales\n * }\n *\n * const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {\n * \"fr\": \"test\"\n * // Locales.ENGLISH is missing\n * }\n *\n */\nexport type CustomizableLanguageContent<Content = string> =\n ConfigLocales extends never\n ? LanguageContent<Content>\n : IConfigLocales<Content>;\n\nexport type TranslationContent<Content> = {\n nodeType: NodeType.Translation;\n [NodeType.Translation]: LanguageContent<Content>;\n};\n\n// Allow to consider this file as a module and fix turbopack issue\nexport const FIX_MODULE_TRANSFORMATION = undefined;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0EO,MAAM,4BAA4B;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/types.ts"],"sourcesContent":["/** @ts-nocheck */\n\nimport type { LocalesValues } from '@intlayer/config/client';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IConfigLocales } from 'intlayer';\nimport type { NodeType } from '../../../types';\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return never\n */\nexport type ConfigLocales = keyof IConfigLocales<unknown>;\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return all available locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n */\nexport type CustomLocales = ConfigLocales extends never\n ? LocalesValues\n : ConfigLocales;\n\n/**\n * Record of locales and content\n *\n * const myVar1: LanguageContent<string> = {\n * \"en\": \"\",\n * \"fr\": \"\"\n * }\n *\n * const myVar2: LanguageContent<{age: number, name: string}> = {\n * \"en\": {age: 1, name: \"test\"},\n * \"fr\": {age: 1, name: \"test\"}\n * }\n */\nexport type LanguageContent<Content> = Partial<Record<LocalesValues, Content>>;\n\n/**\n * Valid\n * const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {\n * \"en\": \"test\",\n * \"fr\": \"test\"\n * }\n *\n * const test: CustomizableLanguageContent<number> = {\n * \"fr\": 1,\n * \"en\": 1,\n * ... any other available locale\n * }\n *\n * Invalid\n *\n * const test: CustomizableLanguageContent<string> = {\n * \"en\": \"test\",\n * \"fr\": \"test\",\n * \"sss\": \"test\" // Does not exist in Locales\n * }\n *\n * const test: CustomizableLanguageContent<string, Locales.ENGLISH | Locales.FRENCH> = {\n * \"fr\": \"test\"\n * // Locales.ENGLISH is missing\n * }\n *\n */\nexport type CustomizableLanguageContent<Content = string> =\n ConfigLocales extends never\n ? LanguageContent<Content>\n : IConfigLocales<Content>;\n\nexport type TranslationContent<Content> = {\n nodeType: NodeType.Translation;\n [NodeType.Translation]: LanguageContent<Content>;\n};\n\n// Allow to consider this file as a module and fix turbopack issue\nexport const FIX_MODULE_TRANSFORMATION = undefined;\n"],"mappings":"AA0EO,MAAM,4BAA4B;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/content_transformers/translation/types.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,SAAS,KAAK,GACnD,aAAa,GACb,aAAa,CAAC;AAElB;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,2BAA2B,CAAC,OAAO,GAAG,MAAM,IACtD,aAAa,SAAS,KAAK,GACvB,eAAe,CAAC,OAAO,CAAC,GACxB,cAAc,CAAC,OAAO,CAAC,CAAC;AAE9B,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI;IACxC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC/B,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;CAClD,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/content_transformers/translation/types.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,SAAS,KAAK,GACnD,aAAa,GACb,aAAa,CAAC;AAElB;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,2BAA2B,CAAC,OAAO,GAAG,MAAM,IACtD,aAAa,SAAS,KAAK,GACvB,eAAe,CAAC,OAAO,CAAC,GACxB,cAAc,CAAC,OAAO,CAAC,CAAC;AAE9B,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI;IACxC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC/B,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;CAClD,CAAC;AAGF,eAAO,MAAM,yBAAyB,KAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "IntLayer - Layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
|
|
6
6
|
"keywords": [
|
|
@@ -59,30 +59,29 @@
|
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@formatjs/intl-localematcher": "^0.5.4",
|
|
62
|
-
"chokidar": "^
|
|
62
|
+
"chokidar": "^3.6.0",
|
|
63
63
|
"negotiator": "^0.6.3",
|
|
64
|
-
"@intlayer/config": "^3.0
|
|
64
|
+
"@intlayer/config": "^3.2.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/negotiator": "^0.6.3",
|
|
68
|
-
"@types/node": "^
|
|
69
|
-
"@types/react": "^18.3.
|
|
70
|
-
"concurrently": "^
|
|
71
|
-
"eslint": "^9.
|
|
72
|
-
"prettier": "3.3.3",
|
|
73
|
-
"
|
|
74
|
-
"rimraf": "5.0.5",
|
|
68
|
+
"@types/node": "^22.9.0",
|
|
69
|
+
"@types/react": "^18.3.12",
|
|
70
|
+
"concurrently": "^9.1.0",
|
|
71
|
+
"eslint": "^9.14.0",
|
|
72
|
+
"prettier": "^3.3.3",
|
|
73
|
+
"rimraf": "^6.0.1",
|
|
75
74
|
"tsc-alias": "^1.8.10",
|
|
76
|
-
"tsup": "^8.3.
|
|
77
|
-
"typescript": "^5.
|
|
75
|
+
"tsup": "^8.3.5",
|
|
76
|
+
"typescript": "^5.6.3",
|
|
78
77
|
"@utils/ts-config": "^1.0.4",
|
|
79
|
-
"@utils/eslint-config": "^1.0.4",
|
|
80
|
-
"@utils/ts-config-types": "^1.0.4",
|
|
81
78
|
"@utils/tsup-config": "^1.0.4",
|
|
82
|
-
"@
|
|
79
|
+
"@utils/ts-config-types": "^1.0.4",
|
|
80
|
+
"@utils/eslint-config": "^1.0.4"
|
|
83
81
|
},
|
|
84
82
|
"peerDependencies": {
|
|
85
|
-
"react": "
|
|
83
|
+
"react": ">=16.0.0 <19.0.0",
|
|
84
|
+
"@intlayer/config": "^3.2.0"
|
|
86
85
|
},
|
|
87
86
|
"engines": {
|
|
88
87
|
"node": ">=14.18"
|