intlayer 9.5.0 → 9.5.1
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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["internationalization"],"sources":["../../src/index.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noEmptyInterface: Intlayer module augmentation registries */\n\nimport type {\n CustomIntlayerConfig,\n IntlayerConfig,\n} from '@intlayer/types/config';\nimport type { Dictionary as DictionaryCore } from '@intlayer/types/dictionary';\nimport type {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["internationalization"],"sources":["../../src/index.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noEmptyInterface: Intlayer module augmentation registries */\n\nimport type {\n CustomIntlayerConfig,\n IntlayerConfig,\n} from '@intlayer/types/config';\nimport type { Dictionary as DictionaryCore } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n RequiredLocales,\n SchemaKeys,\n} from '@intlayer/types/module_augmentation';\n\n/**\n * The dictionary type used to define the structure of a dictionary.\n * It is used to provide type safety and autocompletion when defining a dictionary.\n *\n * @example\n * ```ts\n * import { Dictionary } from 'intlayer';\n *\n * const dictionary: Dictionary = { ... };\n * ```\n */\ntype Dictionary<\n T = undefined,\n SchemaKey extends SchemaKeys | undefined = undefined,\n> = DictionaryCore<T, SchemaKey, true>;\n\n/**\n * The content of a dictionary.\n *\n * @deprecated Use `Dictionary<T>` instead.\n */\ntype DeclarationContent<\n T = undefined,\n SchemaKey extends SchemaKeys | undefined = undefined,\n> = Dictionary<T, SchemaKey>;\n\nexport { ALL_LOCALES, type Locale } from '@intlayer/types/allLocales';\nexport type { ContentNode } from '@intlayer/types/dictionary';\nexport * as Locales from '@intlayer/types/locales';\nexport type {\n DeclaredLocales,\n LocalesValues,\n RequiredLocales,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\n\nexport type {\n CustomIntlayerConfig as IntlayerConfig,\n DeclarationContent,\n Dictionary,\n};\n\nimport {\n content,\n /**\n * The editor configuration defined in the configuration.\n */\n editor,\n internationalization,\n log,\n routing,\n} from '@intlayer/config/built';\n\n/**\n * `RequiredLocales` resolves to `never` when the project declares no required\n * locale, which would make the array unusable. Fall back to the declared locales.\n */\ntype ConfiguredRequiredLocales = [RequiredLocales] extends [never]\n ? DeclaredLocales\n : RequiredLocales;\n\n/**\n * The locales defined in the configuration.\n */\nconst locales = internationalization.locales as DeclaredLocales[];\n\n/**\n * The required locales defined in the configuration.\n */\nconst requiredLocales =\n internationalization.requiredLocales as ConfiguredRequiredLocales[];\n\n/**\n * The default locale defined in the configuration.\n */\nconst defaultLocale = internationalization.defaultLocale as DeclaredLocales;\n\n/**\n * @deprecated Use `defaultLocale`, `locales`, `requiredLocales` or `editor` instead.\n *\n * Configuration of Intlayer.\n *\n */\nconst configuration: Pick<\n IntlayerConfig,\n 'editor' | 'internationalization' | 'log' | 'routing' | 'content'\n> = {\n editor,\n internationalization,\n log,\n content,\n routing,\n};\n\n/**\n * Returns the configuration of Intlayer.\n */\nconst getConfiguration = () => configuration;\n\nexport { file } from '@intlayer/core/file'; // Include specific export for browser because of node js function that can't be used in browser\nexport {\n compact,\n currency,\n date,\n Intl,\n number,\n percentage,\n relativeTime,\n units,\n} from '@intlayer/core/formatters';\nexport {\n getDictionary,\n getDictionaryAsync,\n getEnumeration,\n /**\n * @deprecated Use `getEnumeration` instead.\n */\n getEnumeration as getEnumerationContent,\n getIntlayer,\n getIntlayerAsync,\n getNesting,\n getTranslation,\n /**\n * @deprecated Use `getTranslation` instead.\n */\n getTranslation as getTranslationContent,\n} from '@intlayer/core/interpreter';\nexport type {\n GenerateSitemapOptions,\n SitemapUrlEntry,\n} from '@intlayer/core/localization';\nexport {\n comparePaths,\n generateSitemap,\n generateSitemapUrl,\n getBrowserLocale,\n getCanonicalPath,\n getHTMLTextDir,\n getLocale,\n getLocaleFromPath,\n getLocaleLang,\n getLocaleName,\n getLocalizedPath,\n getLocalizedUrl,\n getMultilingualUrls,\n getPathWithoutLocale,\n getPrefix,\n getRewriteRules,\n isDeclaredLocale,\n localeDetector,\n localeFlatMap,\n localeMap,\n localeRecord,\n localeResolver,\n normalizePath,\n validatePrefix,\n} from '@intlayer/core/localization';\nexport { getMarkdownMetadata } from '@intlayer/core/markdown';\nexport {\n cond,\n enu,\n gender,\n html,\n insert,\n md,\n nest,\n plural,\n select,\n t,\n} from '@intlayer/core/transpiler';\nexport {\n getCookie,\n /**\n * @deprecated Use `getLocaleFromStorageClient` or `getLocaleFromStorageServer` instead.\n */\n getLocaleFromStorage,\n getLocaleFromStorageClient,\n getLocaleFromStorageServer,\n LocaleStorageClient,\n LocaleStorageServer,\n /**\n * @deprecated Use `setLocaleInStorageClient` or `setLocaleInStorageServer` instead.\n */\n setLocaleInStorage,\n setLocaleInStorageClient,\n setLocaleInStorageServer,\n} from '@intlayer/core/utils';\n\n// Reexport here for CJS compatibility\n// Fix ReferenceError: Cannot access 'xxx' before initialization\nexport {\n /**\n * @deprecated Use `defaultLocale`, `locales`, `requiredLocales` or `editor` instead.\n */\n configuration,\n defaultLocale,\n editor,\n getConfiguration,\n locales,\n requiredLocales,\n};\n\n// --- Registries to be augmented by the generator ---\nexport interface __DictionaryRegistry {} // id -> interfaceof ictionary\nexport interface __DeclaredLocalesRegistry {} // 'fr': 1, 'en': 1, ...\nexport interface __RequiredLocalesRegistry {} // 'en': 1, ...\nexport interface __SchemaRegistry {} // id -> interface of schema\nexport interface __StrictModeRegistry {} // one of: { strict: true } | { inclusive: true } | { loose: true }\nexport interface __EditorRegistry {} // one of: { enabled: true } | { enabled: false }\nexport interface __RoutingRegistry {} // { mode: 'prefix-no-default'; defaultLocale: 'en' }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,MAAM,UAAUA,4CAAqB;;;;AAKrC,MAAM,kBACJA,4CAAqB;;;;AAKvB,MAAM,gBAAgBA,4CAAqB;;;;;;;AAQ3C,MAAM,gBAGF;CACF;CACA;CACA;CACA;CACA;AACF;;;;AAKA,MAAM,yBAAyB"}
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noEmptyInterface: Intlayer module augmentation registries */\n\nimport type {\n CustomIntlayerConfig,\n IntlayerConfig,\n} from '@intlayer/types/config';\nimport type { Dictionary as DictionaryCore } from '@intlayer/types/dictionary';\nimport type {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noEmptyInterface: Intlayer module augmentation registries */\n\nimport type {\n CustomIntlayerConfig,\n IntlayerConfig,\n} from '@intlayer/types/config';\nimport type { Dictionary as DictionaryCore } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n RequiredLocales,\n SchemaKeys,\n} from '@intlayer/types/module_augmentation';\n\n/**\n * The dictionary type used to define the structure of a dictionary.\n * It is used to provide type safety and autocompletion when defining a dictionary.\n *\n * @example\n * ```ts\n * import { Dictionary } from 'intlayer';\n *\n * const dictionary: Dictionary = { ... };\n * ```\n */\ntype Dictionary<\n T = undefined,\n SchemaKey extends SchemaKeys | undefined = undefined,\n> = DictionaryCore<T, SchemaKey, true>;\n\n/**\n * The content of a dictionary.\n *\n * @deprecated Use `Dictionary<T>` instead.\n */\ntype DeclarationContent<\n T = undefined,\n SchemaKey extends SchemaKeys | undefined = undefined,\n> = Dictionary<T, SchemaKey>;\n\nexport { ALL_LOCALES, type Locale } from '@intlayer/types/allLocales';\nexport type { ContentNode } from '@intlayer/types/dictionary';\nexport * as Locales from '@intlayer/types/locales';\nexport type {\n DeclaredLocales,\n LocalesValues,\n RequiredLocales,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\n\nexport type {\n CustomIntlayerConfig as IntlayerConfig,\n DeclarationContent,\n Dictionary,\n};\n\nimport {\n content,\n /**\n * The editor configuration defined in the configuration.\n */\n editor,\n internationalization,\n log,\n routing,\n} from '@intlayer/config/built';\n\n/**\n * `RequiredLocales` resolves to `never` when the project declares no required\n * locale, which would make the array unusable. Fall back to the declared locales.\n */\ntype ConfiguredRequiredLocales = [RequiredLocales] extends [never]\n ? DeclaredLocales\n : RequiredLocales;\n\n/**\n * The locales defined in the configuration.\n */\nconst locales = internationalization.locales as DeclaredLocales[];\n\n/**\n * The required locales defined in the configuration.\n */\nconst requiredLocales =\n internationalization.requiredLocales as ConfiguredRequiredLocales[];\n\n/**\n * The default locale defined in the configuration.\n */\nconst defaultLocale = internationalization.defaultLocale as DeclaredLocales;\n\n/**\n * @deprecated Use `defaultLocale`, `locales`, `requiredLocales` or `editor` instead.\n *\n * Configuration of Intlayer.\n *\n */\nconst configuration: Pick<\n IntlayerConfig,\n 'editor' | 'internationalization' | 'log' | 'routing' | 'content'\n> = {\n editor,\n internationalization,\n log,\n content,\n routing,\n};\n\n/**\n * Returns the configuration of Intlayer.\n */\nconst getConfiguration = () => configuration;\n\nexport { file } from '@intlayer/core/file'; // Include specific export for browser because of node js function that can't be used in browser\nexport {\n compact,\n currency,\n date,\n Intl,\n number,\n percentage,\n relativeTime,\n units,\n} from '@intlayer/core/formatters';\nexport {\n getDictionary,\n getDictionaryAsync,\n getEnumeration,\n /**\n * @deprecated Use `getEnumeration` instead.\n */\n getEnumeration as getEnumerationContent,\n getIntlayer,\n getIntlayerAsync,\n getNesting,\n getTranslation,\n /**\n * @deprecated Use `getTranslation` instead.\n */\n getTranslation as getTranslationContent,\n} from '@intlayer/core/interpreter';\nexport type {\n GenerateSitemapOptions,\n SitemapUrlEntry,\n} from '@intlayer/core/localization';\nexport {\n comparePaths,\n generateSitemap,\n generateSitemapUrl,\n getBrowserLocale,\n getCanonicalPath,\n getHTMLTextDir,\n getLocale,\n getLocaleFromPath,\n getLocaleLang,\n getLocaleName,\n getLocalizedPath,\n getLocalizedUrl,\n getMultilingualUrls,\n getPathWithoutLocale,\n getPrefix,\n getRewriteRules,\n isDeclaredLocale,\n localeDetector,\n localeFlatMap,\n localeMap,\n localeRecord,\n localeResolver,\n normalizePath,\n validatePrefix,\n} from '@intlayer/core/localization';\nexport { getMarkdownMetadata } from '@intlayer/core/markdown';\nexport {\n cond,\n enu,\n gender,\n html,\n insert,\n md,\n nest,\n plural,\n select,\n t,\n} from '@intlayer/core/transpiler';\nexport {\n getCookie,\n /**\n * @deprecated Use `getLocaleFromStorageClient` or `getLocaleFromStorageServer` instead.\n */\n getLocaleFromStorage,\n getLocaleFromStorageClient,\n getLocaleFromStorageServer,\n LocaleStorageClient,\n LocaleStorageServer,\n /**\n * @deprecated Use `setLocaleInStorageClient` or `setLocaleInStorageServer` instead.\n */\n setLocaleInStorage,\n setLocaleInStorageClient,\n setLocaleInStorageServer,\n} from '@intlayer/core/utils';\n\n// Reexport here for CJS compatibility\n// Fix ReferenceError: Cannot access 'xxx' before initialization\nexport {\n /**\n * @deprecated Use `defaultLocale`, `locales`, `requiredLocales` or `editor` instead.\n */\n configuration,\n defaultLocale,\n editor,\n getConfiguration,\n locales,\n requiredLocales,\n};\n\n// --- Registries to be augmented by the generator ---\nexport interface __DictionaryRegistry {} // id -> interfaceof ictionary\nexport interface __DeclaredLocalesRegistry {} // 'fr': 1, 'en': 1, ...\nexport interface __RequiredLocalesRegistry {} // 'en': 1, ...\nexport interface __SchemaRegistry {} // id -> interface of schema\nexport interface __StrictModeRegistry {} // one of: { strict: true } | { inclusive: true } | { loose: true }\nexport interface __EditorRegistry {} // one of: { enabled: true } | { enabled: false }\nexport interface __RoutingRegistry {} // { mode: 'prefix-no-default'; defaultLocale: 'en' }\n"],"mappings":";;;;;;;;;;;;;;;AA6EA,MAAM,UAAU,qBAAqB;;;;AAKrC,MAAM,kBACJ,qBAAqB;;;;AAKvB,MAAM,gBAAgB,qBAAqB;;;;;;;AAQ3C,MAAM,gBAGF;CACF;CACA;CACA;CACA;CACA;AACF;;;;AAKA,MAAM,yBAAyB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CustomIntlayerConfig, IntlayerConfig } from "@intlayer/types/config";
|
|
2
2
|
import { ContentNode, Dictionary as Dictionary$1 } from "@intlayer/types/dictionary";
|
|
3
|
-
import { DeclaredLocales, LocalesValues, RequiredLocales, SchemaKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
3
|
+
import { DeclaredLocales, DeclaredLocales as DeclaredLocales$1, LocalesValues, RequiredLocales, RequiredLocales as RequiredLocales$1, SchemaKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
4
4
|
import { ALL_LOCALES, Locale } from "@intlayer/types/allLocales";
|
|
5
5
|
import * as Locales from "@intlayer/types/locales";
|
|
6
6
|
import { editor } from "@intlayer/config/built";
|
|
@@ -30,29 +30,34 @@ type Dictionary<T = undefined, SchemaKey extends SchemaKeys | undefined = undefi
|
|
|
30
30
|
* @deprecated Use `Dictionary<T>` instead.
|
|
31
31
|
*/
|
|
32
32
|
type DeclarationContent<T = undefined, SchemaKey extends SchemaKeys | undefined = undefined> = Dictionary<T, SchemaKey>;
|
|
33
|
+
/**
|
|
34
|
+
* `RequiredLocales` resolves to `never` when the project declares no required
|
|
35
|
+
* locale, which would make the array unusable. Fall back to the declared locales.
|
|
36
|
+
*/
|
|
37
|
+
type ConfiguredRequiredLocales = [RequiredLocales$1] extends [never] ? DeclaredLocales$1 : RequiredLocales$1;
|
|
33
38
|
/**
|
|
34
39
|
* The locales defined in the configuration.
|
|
35
40
|
*/
|
|
36
|
-
declare const locales:
|
|
41
|
+
declare const locales: DeclaredLocales$1[];
|
|
37
42
|
/**
|
|
38
43
|
* The required locales defined in the configuration.
|
|
39
44
|
*/
|
|
40
|
-
declare const requiredLocales:
|
|
45
|
+
declare const requiredLocales: ConfiguredRequiredLocales[];
|
|
41
46
|
/**
|
|
42
47
|
* The default locale defined in the configuration.
|
|
43
48
|
*/
|
|
44
|
-
declare const defaultLocale:
|
|
49
|
+
declare const defaultLocale: DeclaredLocales$1;
|
|
45
50
|
/**
|
|
46
51
|
* @deprecated Use `defaultLocale`, `locales`, `requiredLocales` or `editor` instead.
|
|
47
52
|
*
|
|
48
53
|
* Configuration of Intlayer.
|
|
49
54
|
*
|
|
50
55
|
*/
|
|
51
|
-
declare const configuration: Pick<IntlayerConfig, 'editor' | 'internationalization' | 'log' | 'routing'>;
|
|
56
|
+
declare const configuration: Pick<IntlayerConfig, 'editor' | 'internationalization' | 'log' | 'routing' | 'content'>;
|
|
52
57
|
/**
|
|
53
58
|
* Returns the configuration of Intlayer.
|
|
54
59
|
*/
|
|
55
|
-
declare const getConfiguration: () => Pick<IntlayerConfig, "editor" | "internationalization" | "log" | "routing">;
|
|
60
|
+
declare const getConfiguration: () => Pick<IntlayerConfig, "content" | "editor" | "internationalization" | "log" | "routing">;
|
|
56
61
|
export interface __DictionaryRegistry {}
|
|
57
62
|
export interface __DeclaredLocalesRegistry {}
|
|
58
63
|
export interface __RequiredLocalesRegistry {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;KAwBK,WACH,eACA,kBAAkB,sCAChB,aAAe,GAAG;;;;;;KAOjB,mBACH,eACA,kBAAkB,sCAChB,WAAW,GAAG;;;;;KAiCb,6BAA6B,qCAC9B,oBACA;;;;cAKE,SAA0C;;;;cAK1C,iBACoC;;;;cAKpC,eAAsD;;;;;;;cAQtD,eAAe,KACnB;;;;cAaI,wBAAgB,KAAA;iBA0GL;iBACA;iBACA;iBACA;iBACA;iBACA;iBACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Manage internationalization i18n in a simple way, through TypeScript, declaration file, declare your multilingual content every where in your code.",
|
|
6
6
|
"keywords": [
|
|
@@ -95,10 +95,10 @@
|
|
|
95
95
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@intlayer/cli": "9.5.
|
|
99
|
-
"@intlayer/config": "9.5.
|
|
100
|
-
"@intlayer/core": "9.5.
|
|
101
|
-
"@intlayer/types": "9.5.
|
|
98
|
+
"@intlayer/cli": "9.5.1",
|
|
99
|
+
"@intlayer/config": "9.5.1",
|
|
100
|
+
"@intlayer/core": "9.5.1",
|
|
101
|
+
"@intlayer/types": "9.5.1"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@types/node": "26.5.0",
|