@intlayer/core 7.0.0-canary.2 → 7.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.
- package/dist/cjs/getStorageAttributes.cjs +24 -5
- package/dist/cjs/getStorageAttributes.cjs.map +1 -1
- package/dist/cjs/localization/getMultilingualUrls.cjs +3 -1
- package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
- package/dist/cjs/transpiler/file/file.cjs +2 -2
- package/dist/cjs/utils/localeStorage.cjs +18 -5
- package/dist/cjs/utils/localeStorage.cjs.map +1 -1
- package/dist/esm/getStorageAttributes.mjs +24 -5
- package/dist/esm/getStorageAttributes.mjs.map +1 -1
- package/dist/esm/localization/getMultilingualUrls.mjs +2 -1
- package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
- package/dist/esm/transpiler/file/file.mjs +1 -1
- package/dist/esm/utils/localeStorage.mjs +18 -5
- package/dist/esm/utils/localeStorage.mjs.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +4 -4
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +4 -4
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +4 -4
- package/dist/types/deepTransformPlugins/index.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/index.d.ts.map +1 -0
- package/dist/types/formatters/index.d.ts.map +1 -0
- package/dist/types/getStorageAttributes.d.ts +7 -3
- package/dist/types/getStorageAttributes.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interpreter/getContent/index.d.ts.map +1 -0
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/interpreter/getIntlayerAsync.d.ts +13 -0
- package/dist/types/interpreter/getIntlayerAsync.d.ts.map +1 -0
- package/dist/types/interpreter/index.d.ts.map +1 -0
- package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts.map +1 -0
- package/dist/types/localization/localeList.d.ts +3 -0
- package/dist/types/localization/localeList.d.ts.map +1 -0
- package/dist/types/transpiler/condition/index.d.ts.map +1 -0
- package/dist/types/transpiler/enumeration/index.d.ts.map +1 -0
- package/dist/types/transpiler/file/index.d.ts.map +1 -0
- package/dist/types/transpiler/gender/index.d.ts.map +1 -0
- package/dist/types/transpiler/index.d.ts.map +1 -0
- package/dist/types/transpiler/insertion/index.d.ts.map +1 -0
- package/dist/types/transpiler/markdown/index.d.ts.map +1 -0
- package/dist/types/transpiler/nesting/index.d.ts.map +1 -0
- package/dist/types/transpiler/translation/index.d.ts.map +1 -0
- package/dist/types/types/dictionary.d.ts +307 -0
- package/dist/types/types/dictionary.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/intlayer.d.ts +5 -0
- package/dist/types/types/intlayer.d.ts.map +1 -0
- package/dist/types/types/keyPath.d.ts +47 -0
- package/dist/types/types/keyPath.d.ts.map +1 -0
- package/dist/types/types/nodeType.d.ts +30 -0
- package/dist/types/types/nodeType.d.ts.map +1 -0
- package/dist/types/types/translation.d.ts +25 -0
- package/dist/types/types/translation.d.ts.map +1 -0
- package/dist/types/utils/localeStorage.d.ts +8 -6
- package/dist/types/utils/localeStorage.d.ts.map +1 -1
- package/package.json +14 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/types/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,M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AAI,MAAM,IAAI,EAAE,GAC/D,CAAC,SAAS,MAAM,CAAC,GACf,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GACtB,KAAK,GACP,CAAC,SAAS,MAAM,CAAC,GACf,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intlayer.d.ts","sourceRoot":"","sources":["../../../src/types/intlayer.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,YAAY,EACV,cAAc,EACd,gCAAgC,EAChC,eAAe,EACf,aAAa,GACd,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { NodeType } from './nodeType';
|
|
2
|
+
export type ObjectNode = {
|
|
3
|
+
type: NodeType.Object;
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
export type ArrayNode = {
|
|
7
|
+
type: NodeType.Array;
|
|
8
|
+
key: number;
|
|
9
|
+
};
|
|
10
|
+
export type EnumerationNode = {
|
|
11
|
+
type: NodeType.Enumeration;
|
|
12
|
+
key: string;
|
|
13
|
+
};
|
|
14
|
+
export type TranslationNode = {
|
|
15
|
+
type: NodeType.Translation;
|
|
16
|
+
key: string;
|
|
17
|
+
};
|
|
18
|
+
export type ConditionNode = {
|
|
19
|
+
type: NodeType.Condition;
|
|
20
|
+
key: string;
|
|
21
|
+
};
|
|
22
|
+
export type GenderNode = {
|
|
23
|
+
type: NodeType.Gender;
|
|
24
|
+
key: string;
|
|
25
|
+
};
|
|
26
|
+
export type InsertionNode = {
|
|
27
|
+
type: NodeType.Insertion;
|
|
28
|
+
key?: undefined;
|
|
29
|
+
};
|
|
30
|
+
export type MarkdownNode = {
|
|
31
|
+
type: NodeType.Markdown;
|
|
32
|
+
key?: undefined;
|
|
33
|
+
};
|
|
34
|
+
export type ReactNode = {
|
|
35
|
+
type: NodeType.ReactNode;
|
|
36
|
+
key?: undefined;
|
|
37
|
+
};
|
|
38
|
+
export type NestedNode = {
|
|
39
|
+
type: NodeType.Nested;
|
|
40
|
+
key?: undefined;
|
|
41
|
+
};
|
|
42
|
+
export type FileNode = {
|
|
43
|
+
type: NodeType.File;
|
|
44
|
+
key?: undefined;
|
|
45
|
+
};
|
|
46
|
+
export type KeyPath = ObjectNode | ArrayNode | TranslationNode | EnumerationNode | InsertionNode | GenderNode | MarkdownNode | ReactNode | ConditionNode | NestedNode | FileNode;
|
|
47
|
+
//# sourceMappingURL=keyPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyPath.d.ts","sourceRoot":"","sources":["../../../src/types/keyPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,OAAO,GACf,UAAU,GACV,SAAS,GACT,eAAe,GACf,eAAe,GACf,aAAa,GACb,UAAU,GACV,YAAY,GACZ,SAAS,GACT,aAAa,GACb,UAAU,GACV,QAAQ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum NodeType {
|
|
2
|
+
Translation = "translation",
|
|
3
|
+
Enumeration = "enumeration",
|
|
4
|
+
Condition = "condition",
|
|
5
|
+
Insertion = "insertion",
|
|
6
|
+
File = "file",
|
|
7
|
+
Object = "object",
|
|
8
|
+
Array = "array",
|
|
9
|
+
Nested = "nested",
|
|
10
|
+
ReactNode = "reactNode",
|
|
11
|
+
Markdown = "markdown",
|
|
12
|
+
Text = "text",
|
|
13
|
+
Number = "number",
|
|
14
|
+
Boolean = "boolean",
|
|
15
|
+
Gender = "gender",
|
|
16
|
+
Unknown = "unknown"
|
|
17
|
+
}
|
|
18
|
+
type AdditionalAttributesType = {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
export type TypedNodeModel<T extends NodeType, Content, AdditionalAttributes extends AdditionalAttributesType = {}> = {
|
|
22
|
+
nodeType: T | `${T}`;
|
|
23
|
+
} & {
|
|
24
|
+
[K in T]: Content;
|
|
25
|
+
} & AdditionalAttributes;
|
|
26
|
+
export declare const formatNodeType: <T extends NodeType, Content = any, AdditionalAttributes extends AdditionalAttributesType = {}>(nodeType: T | `${T}`, content: Content, additionalAttributes?: {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}) => TypedNodeModel<T, Content, AdditionalAttributes>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=nodeType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeType.d.ts","sourceRoot":"","sources":["../../../src/types/nodeType.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,KAAK,wBAAwB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,CACxB,CAAC,SAAS,QAAQ,EAClB,OAAO,EACP,oBAAoB,SAAS,wBAAwB,GAAG,EAAE,IACxD;IACF,QAAQ,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;CACtB,GAAG;KACD,CAAC,IAAI,CAAC,GAAG,OAAO;CAClB,GAAG,oBAAoB,CAAC;AAEzB,eAAO,MAAM,cAAc,GACzB,CAAC,SAAS,QAAQ,EAClB,OAAO,GAAG,GAAG,EACb,oBAAoB,SAAS,wBAAwB,GAAG,EAAE,EAE1D,UAAU,CAAC,GAAG,GAAG,CAAC,EAAE,EACpB,SAAS,OAAO,EAChB,uBAAuB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,KAMvC,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LocalesValues } from '@intlayer/config/client';
|
|
2
|
+
import type { IConfigLocales } from './intlayer';
|
|
3
|
+
/**
|
|
4
|
+
* If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...
|
|
5
|
+
* If not, it will return never
|
|
6
|
+
*/
|
|
7
|
+
export type ConfigLocales = keyof IConfigLocales<unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Record of locales and content
|
|
10
|
+
*
|
|
11
|
+
* const myVar1: TranslationContentState<string> = {
|
|
12
|
+
* "en": "",
|
|
13
|
+
* "fr": ""
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* const myVar2: TranslationContentState<{age: number, name: string}> = {
|
|
17
|
+
* "en": {age: 1, name: "test"},
|
|
18
|
+
* "fr": {age: 1, name: "test"}
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export type TranslationContentState<Content = unknown> = {
|
|
22
|
+
[locale in LocalesValues]?: Content;
|
|
23
|
+
};
|
|
24
|
+
export type LanguageContent<Content = unknown> = keyof IConfigLocales<unknown> extends never ? TranslationContentState<Content> : IConfigLocales<Content>;
|
|
25
|
+
//# sourceMappingURL=translation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../src/types/translation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,CAAC,OAAO,GAAG,OAAO,IAAI;KACtD,MAAM,IAAI,aAAa,CAAC,CAAC,EAAE,OAAO;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,OAAO,GAAG,OAAO,IAC3C,MAAM,cAAc,CAAC,OAAO,CAAC,SAAS,KAAK,GACvC,uBAAuB,CAAC,OAAO,CAAC,GAChC,cAAc,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -67,16 +67,18 @@ type LocaleStorageOptions = {
|
|
|
67
67
|
getSessionStorage?: (name: string) => string | undefined | null;
|
|
68
68
|
setLocaleStorage?: (name: string, value: string) => void;
|
|
69
69
|
getLocaleStorage?: (name: string) => string | undefined | null;
|
|
70
|
+
getHeader?: (name: string) => string | undefined | null;
|
|
71
|
+
setHeader?: (name: string, value: string) => void;
|
|
70
72
|
};
|
|
71
73
|
/**
|
|
72
|
-
* Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage).
|
|
74
|
+
* Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
73
75
|
* The function checks storage locations in order of priority as defined in the configuration.
|
|
74
76
|
*
|
|
75
77
|
* @returns The locale if found in any storage, or undefined if not found
|
|
76
78
|
*/
|
|
77
|
-
declare const getLocaleFromStorage: (options: Pick<LocaleStorageOptions, "getCookie" | "getSessionStorage" | "getLocaleStorage" | "isCookieEnabled">) => Locale | undefined;
|
|
79
|
+
declare const getLocaleFromStorage: (options: Pick<LocaleStorageOptions, "getCookie" | "getSessionStorage" | "getLocaleStorage" | "getHeader" | "isCookieEnabled">) => Locale | undefined;
|
|
78
80
|
/**
|
|
79
|
-
* Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage).
|
|
81
|
+
* Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
80
82
|
* The function writes to all configured storage locations according to their attributes.
|
|
81
83
|
* Respects overwrite flags for localStorage and sessionStorage.
|
|
82
84
|
*
|
|
@@ -86,11 +88,11 @@ declare const setLocaleInStorage: (locale: LocalesValues, options?: LocaleStorag
|
|
|
86
88
|
/**
|
|
87
89
|
* Utility object to get and set the locale in the storage by considering the configuration
|
|
88
90
|
*
|
|
89
|
-
* @property getLocale - Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage).
|
|
90
|
-
* Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage).
|
|
91
|
+
* @property getLocale - Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
92
|
+
* Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
91
93
|
* The function checks storage locations in order of priority as defined in the configuration.
|
|
92
94
|
*
|
|
93
|
-
* @property setLocale - Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage).
|
|
95
|
+
* @property setLocale - Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
94
96
|
* The function writes to all configured storage locations according to their attributes.
|
|
95
97
|
* Respects overwrite flags for localStorage and sessionStorage.
|
|
96
98
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeStorage.d.ts","names":[],"sources":["../../../src/utils/localeStorage.ts"],"sourcesContent":[],"mappings":";;;KAIK,qBAAA;;AAH2E;AA+EhF;
|
|
1
|
+
{"version":3,"file":"localeStorage.d.ts","names":[],"sources":["../../../src/utils/localeStorage.ts"],"sourcesContent":[],"mappings":";;;KAIK,qBAAA;;AAH2E;AA+EhF;AAwBA;;;;;EAiHa,MAAA,CAAA,EAAA,MAAA;EAkGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA3OD,oBAAA;;;yDAMA;;;;;;;;;;;;;;;;cAkBC,gCACF,KACP,oHAOD;;;;;;;;cAwGU,6BACH,yBACE;;;;;;;;;;;;;;cAgGC,yBAA0B;;sBAEjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
|
|
6
6
|
"keywords": [
|
|
@@ -98,29 +98,29 @@
|
|
|
98
98
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@intlayer/api": "7.0.0
|
|
102
|
-
"@intlayer/config": "7.0.0
|
|
103
|
-
"@intlayer/dictionaries-entry": "7.0.0
|
|
104
|
-
"@intlayer/types": "7.0.0
|
|
105
|
-
"@intlayer/unmerged-dictionaries-entry": "7.0.0
|
|
101
|
+
"@intlayer/api": "7.0.0",
|
|
102
|
+
"@intlayer/config": "7.0.0",
|
|
103
|
+
"@intlayer/dictionaries-entry": "7.0.0",
|
|
104
|
+
"@intlayer/types": "7.0.0",
|
|
105
|
+
"@intlayer/unmerged-dictionaries-entry": "7.0.0",
|
|
106
106
|
"deepmerge": "4.3.1"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@types/node": "24.9.1",
|
|
110
|
-
"@utils/ts-config": "7.0.0
|
|
111
|
-
"@utils/ts-config-types": "7.0.0
|
|
112
|
-
"@utils/tsdown-config": "7.0.0
|
|
110
|
+
"@utils/ts-config": "7.0.0",
|
|
111
|
+
"@utils/ts-config-types": "7.0.0",
|
|
112
|
+
"@utils/tsdown-config": "7.0.0",
|
|
113
113
|
"rimraf": "6.0.1",
|
|
114
114
|
"tsdown": "0.15.9",
|
|
115
115
|
"typescript": "5.9.3",
|
|
116
116
|
"vitest": "4.0.3"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@intlayer/api": "7.0.0
|
|
120
|
-
"@intlayer/config": "7.0.0
|
|
121
|
-
"@intlayer/dictionaries-entry": "7.0.0
|
|
122
|
-
"@intlayer/types": "7.0.0
|
|
123
|
-
"@intlayer/unmerged-dictionaries-entry": "7.0.0
|
|
119
|
+
"@intlayer/api": "7.0.0",
|
|
120
|
+
"@intlayer/config": "7.0.0",
|
|
121
|
+
"@intlayer/dictionaries-entry": "7.0.0",
|
|
122
|
+
"@intlayer/types": "7.0.0",
|
|
123
|
+
"@intlayer/unmerged-dictionaries-entry": "7.0.0"
|
|
124
124
|
},
|
|
125
125
|
"engines": {
|
|
126
126
|
"node": ">=14.18"
|