@intlayer/config 5.5.3 → 5.5.5
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/configFile/buildConfigurationFields.cjs +66 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/defaultValues/build.cjs +38 -0
- package/dist/cjs/defaultValues/build.cjs.map +1 -0
- package/dist/cjs/defaultValues/content.cjs +3 -0
- package/dist/cjs/defaultValues/content.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs +9 -2
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +9 -2
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +9 -2
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +8 -1
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -1
- package/dist/cjs/envVariables/getConfiguration.cjs +14 -1
- package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
- package/dist/cjs/types/config.cjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +71 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/defaultValues/build.mjs +12 -0
- package/dist/esm/defaultValues/build.mjs.map +1 -0
- package/dist/esm/defaultValues/content.mjs +2 -0
- package/dist/esm/defaultValues/content.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/next.mjs +9 -2
- package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +9 -2
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +9 -2
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs +8 -1
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -1
- package/dist/esm/envVariables/getConfiguration.mjs +14 -1
- package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/defaultValues/build.d.ts +4 -0
- package/dist/types/defaultValues/build.d.ts.map +1 -0
- package/dist/types/defaultValues/content.d.ts +1 -0
- package/dist/types/defaultValues/content.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/next.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/react_app.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/vite.d.ts.map +1 -1
- package/dist/types/envVariables/getConfiguration.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +67 -0
- package/dist/types/types/config.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -29,6 +29,7 @@ const extractViteEnvVariable = () => {
|
|
|
29
29
|
dictionariesDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,
|
|
30
30
|
moduleAugmentationDir: import.meta.env.VITE_INTLAYER_MODULE_AUGMENTATION_DIR,
|
|
31
31
|
unmergedDictionariesDir: import.meta.env.VITE_INTLAYER_UNMERGED_DICTIONARIES_DIR,
|
|
32
|
+
dynamicDictionariesDir: import.meta.env.VITE_INTLAYER_DYNAMIC_DICTIONARIES_DIR,
|
|
32
33
|
i18nextResourcesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,
|
|
33
34
|
reactIntlMessagesDir: import.meta.env.VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,
|
|
34
35
|
typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,
|
|
@@ -63,13 +64,19 @@ const extractViteEnvVariable = () => {
|
|
|
63
64
|
apiKey: import.meta.env.VITE_INTLAYER_AI_API_KEY,
|
|
64
65
|
applicationContext: import.meta.env.VITE_INTLAYER_AI_APPLICATION_CONTEXT
|
|
65
66
|
};
|
|
67
|
+
const build = {
|
|
68
|
+
optimize: import.meta.env.VITE_INTLAYER_BUILD_OPTIMIZE,
|
|
69
|
+
activateDynamicImport: import.meta.env.VITE_INTLAYER_BUILD_ACTIVATE_DYNAMIC_IMPORT,
|
|
70
|
+
traversePattern: import.meta.env.VITE_INTLAYER_BUILD_TRAVERSE_PATTERN
|
|
71
|
+
};
|
|
66
72
|
return {
|
|
67
73
|
internationalization,
|
|
68
74
|
middleware,
|
|
69
75
|
content,
|
|
70
76
|
editor,
|
|
71
77
|
log,
|
|
72
|
-
ai
|
|
78
|
+
ai,
|
|
79
|
+
build
|
|
73
80
|
};
|
|
74
81
|
};
|
|
75
82
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"sourcesContent":["import { logger } from '../../logger';\nimport type {\n AiConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\n\nexport const extractViteEnvVariable = (): IntlayerConfigEnvVariable => {\n if (!import.meta.env) {\n logger('Vite env variables cannot be loaded on a commonjs environment.', {\n level: 'error',\n });\n return extractEmptyEnvVariable();\n }\n\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: import.meta.env.VITE_INTLAYER_LOCALES,\n requiredLocales: import.meta.env.VITE_INTLAYER_REQUIRED_LOCALES,\n strictMode: import.meta.env.VITE_INTLAYER_STRICT_MODE,\n defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,\n cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,\n prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,\n basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,\n serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,\n baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,\n contentDir: import.meta.env.VITE_INTLAYER_CONTENT_DIR,\n excludedPath: import.meta.env.VITE_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,\n moduleAugmentationDir: import.meta.env\n .VITE_INTLAYER_MODULE_AUGMENTATION_DIR,\n unmergedDictionariesDir: import.meta.env\n .VITE_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n i18nextResourcesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: import.meta.env\n .VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,\n mainDir: import.meta.env.VITE_INTLAYER_MAIN_DIR,\n configDir: import.meta.env.VITE_INTLAYER_CONFIG_DIR,\n watchedFilesPattern: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: import.meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT,\n watch: import.meta.env.VITE_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: import.meta.env.VITE_INTLAYER_APPLICATION_URL,\n editorURL: import.meta.env.VITE_INTLAYER_EDITOR_URL,\n cmsURL: import.meta.env.VITE_INTLAYER_CMS_URL,\n backendURL: import.meta.env.VITE_INTLAYER_BACKEND_URL,\n port: import.meta.env.VITE_INTLAYER_PORT,\n enabled: import.meta.env.VITE_INTLAYER_ENABLED,\n clientId: import.meta.env.VITE_INTLAYER_CLIENT_ID,\n clientSecret: import.meta.env.VITE_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy: import.meta.env\n .VITE_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: import.meta.env.VITE_INTLAYER_HOT_RELOAD,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: import.meta.env.VITE_INTLAYER_LOG_MODE,\n prefix: import.meta.env.VITE_INTLAYER_LOG_PREFIX,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: import.meta.env.VITE_INTLAYER_AI_PROVIDER,\n model: import.meta.env.VITE_INTLAYER_AI_MODEL,\n temperature: import.meta.env.VITE_INTLAYER_AI_TEMPERATURE,\n apiKey: import.meta.env.VITE_INTLAYER_AI_API_KEY,\n applicationContext: import.meta.env.VITE_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n };\n};\n"],"mappings":"AAAA,SAAS,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"sourcesContent":["import { logger } from '../../logger';\nimport type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\n\nexport const extractViteEnvVariable = (): IntlayerConfigEnvVariable => {\n if (!import.meta.env) {\n logger('Vite env variables cannot be loaded on a commonjs environment.', {\n level: 'error',\n });\n return extractEmptyEnvVariable();\n }\n\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: import.meta.env.VITE_INTLAYER_LOCALES,\n requiredLocales: import.meta.env.VITE_INTLAYER_REQUIRED_LOCALES,\n strictMode: import.meta.env.VITE_INTLAYER_STRICT_MODE,\n defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,\n cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,\n prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,\n basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,\n serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,\n baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,\n contentDir: import.meta.env.VITE_INTLAYER_CONTENT_DIR,\n excludedPath: import.meta.env.VITE_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,\n moduleAugmentationDir: import.meta.env\n .VITE_INTLAYER_MODULE_AUGMENTATION_DIR,\n unmergedDictionariesDir: import.meta.env\n .VITE_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n dynamicDictionariesDir: import.meta.env\n .VITE_INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n i18nextResourcesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: import.meta.env\n .VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,\n mainDir: import.meta.env.VITE_INTLAYER_MAIN_DIR,\n configDir: import.meta.env.VITE_INTLAYER_CONFIG_DIR,\n watchedFilesPattern: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: import.meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT,\n watch: import.meta.env.VITE_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: import.meta.env.VITE_INTLAYER_APPLICATION_URL,\n editorURL: import.meta.env.VITE_INTLAYER_EDITOR_URL,\n cmsURL: import.meta.env.VITE_INTLAYER_CMS_URL,\n backendURL: import.meta.env.VITE_INTLAYER_BACKEND_URL,\n port: import.meta.env.VITE_INTLAYER_PORT,\n enabled: import.meta.env.VITE_INTLAYER_ENABLED,\n clientId: import.meta.env.VITE_INTLAYER_CLIENT_ID,\n clientSecret: import.meta.env.VITE_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy: import.meta.env\n .VITE_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: import.meta.env.VITE_INTLAYER_HOT_RELOAD,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: import.meta.env.VITE_INTLAYER_LOG_MODE,\n prefix: import.meta.env.VITE_INTLAYER_LOG_PREFIX,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: import.meta.env.VITE_INTLAYER_AI_PROVIDER,\n model: import.meta.env.VITE_INTLAYER_AI_MODEL,\n temperature: import.meta.env.VITE_INTLAYER_AI_TEMPERATURE,\n apiKey: import.meta.env.VITE_INTLAYER_AI_API_KEY,\n applicationContext: import.meta.env.VITE_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: import.meta.env.VITE_INTLAYER_BUILD_OPTIMIZE,\n activateDynamicImport: import.meta.env\n .VITE_INTLAYER_BUILD_ACTIVATE_DYNAMIC_IMPORT,\n traversePattern: import.meta.env.VITE_INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n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,QAAM,SAAqC;AAAA,IACzC,gBAAgB,YAAY,IAAI;AAAA,IAChC,WAAW,YAAY,IAAI;AAAA,IAC3B,QAAQ,YAAY,IAAI;AAAA,IACxB,YAAY,YAAY,IAAI;AAAA,IAC5B,MAAM,YAAY,IAAI;AAAA,IACtB,SAAS,YAAY,IAAI;AAAA,IACzB,UAAU,YAAY,IAAI;AAAA,IAC1B,cAAc,YAAY,IAAI;AAAA,IAC9B,4BAA4B,YAAY,IACrC;AAAA,IACH,WAAW,YAAY,IAAI;AAAA,EAC7B;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,YAAY,IAAI;AAAA,IACtB,QAAQ,YAAY,IAAI;AAAA,EAC1B;AAEA,QAAM,KAA6B;AAAA,IACjC,UAAU,YAAY,IAAI;AAAA,IAC1B,OAAO,YAAY,IAAI;AAAA,IACvB,aAAa,YAAY,IAAI;AAAA,IAC7B,QAAQ,YAAY,IAAI;AAAA,IACxB,oBAAoB,YAAY,IAAI;AAAA,EACtC;AAEA,QAAM,QAAmC;AAAA,IACvC,UAAU,YAAY,IAAI;AAAA,IAC1B,uBAAuB,YAAY,IAChC;AAAA,IACH,iBAAiB,YAAY,IAAI;AAAA,EACnC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -48,6 +48,10 @@ const getConfiguration = (options) => {
|
|
|
48
48
|
env.content.unmergedDictionariesDir,
|
|
49
49
|
"string"
|
|
50
50
|
),
|
|
51
|
+
dynamicDictionariesDir: getEnvValue(
|
|
52
|
+
env.content.dynamicDictionariesDir,
|
|
53
|
+
"string"
|
|
54
|
+
),
|
|
51
55
|
i18nextResourcesDir: getEnvValue(
|
|
52
56
|
env.content.i18nextResourcesDir,
|
|
53
57
|
"string"
|
|
@@ -98,13 +102,22 @@ const getConfiguration = (options) => {
|
|
|
98
102
|
temperature: getEnvValue(env.ai?.temperature, "number"),
|
|
99
103
|
apiKey: getEnvValue(env.ai?.apiKey, "string")
|
|
100
104
|
};
|
|
105
|
+
const buildConfiguration = {
|
|
106
|
+
optimize: getEnvValue(env.build.optimize, "boolean"),
|
|
107
|
+
activateDynamicImport: getEnvValue(
|
|
108
|
+
env.build.activateDynamicImport,
|
|
109
|
+
"boolean"
|
|
110
|
+
),
|
|
111
|
+
traversePattern: getEnvValue(env.build.traversePattern, "array")
|
|
112
|
+
};
|
|
101
113
|
const intlayerConfiguration = {
|
|
102
114
|
internationalization: intlayerIntlConfiguration,
|
|
103
115
|
middleware: intlayerMiddlewareConfiguration,
|
|
104
116
|
content: intlayerContentConfiguration,
|
|
105
117
|
editor: intlayerEditorConfiguration,
|
|
106
118
|
log: logConfiguration,
|
|
107
|
-
ai: aiConfiguration
|
|
119
|
+
ai: aiConfiguration,
|
|
120
|
+
build: buildConfiguration
|
|
108
121
|
};
|
|
109
122
|
return intlayerConfiguration;
|
|
110
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n AiConfig,\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n StrictMode,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport {\n extractEnvVariable,\n type ExtractEnvVariableOptions,\n} from './extractEnvVariable/index';\nimport { getEnvValue } from './utils';\n\n/**\n * Get all configuration values using environment variables\n * Can be used in the client side as the server side\n * To use it, be sure to have the environment variables set\n */\nexport const getConfiguration = (\n options?: ExtractEnvVariableOptions\n): IntlayerConfig => {\n const env = extractEnvVariable(options);\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\n requiredLocales: getEnvValue<Locales>(\n env.internationalization.requiredLocales,\n 'array'\n )!,\n strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n contentDir: getEnvValue<string>(env.content.contentDir, 'array')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n unmergedDictionariesDir: getEnvValue(\n env.content.unmergedDictionariesDir,\n 'string'\n )!,\n i18nextResourcesDir: getEnvValue(\n env.content.i18nextResourcesDir,\n 'string'\n )!,\n reactIntlMessagesDir: getEnvValue(\n env.content.reactIntlMessagesDir,\n 'string'\n )!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, 'string')!,\n configDir: getEnvValue(env.content.configDir, 'string')!,\n watchedFilesPattern: getEnvValue<string>(\n env.content.watchedFilesPattern,\n 'array'\n )!,\n watchedFilesPatternWithPath: getEnvValue<string>(\n env.content.watchedFilesPatternWithPath,\n 'array'\n )!,\n outputFilesPatternWithPath: getEnvValue(\n env.content.outputFilesPatternWithPath,\n 'string'\n )!,\n watch: getEnvValue(env.content.watch, 'boolean')!,\n };\n\n const intlayerEditorConfiguration = {\n applicationURL: getEnvValue(env.editor.applicationURL, 'string')!,\n editorURL: getEnvValue(env.editor.editorURL, 'string')!,\n cmsURL: getEnvValue(env.editor.cmsURL, 'string')!,\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n port: getEnvValue(env.editor.port, 'number')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'local_first' | 'distant_first',\n hotReload: getEnvValue(env.editor.hotReload, 'boolean')!,\n };\n\n const logConfiguration: LogConfig = {\n mode: getEnvValue(env.log.mode, 'string')!,\n prefix: getEnvValue(env.log.prefix, 'string')!,\n };\n\n const aiConfiguration: AiConfig = {\n provider: getEnvValue(env.ai?.provider, 'string')!,\n model: getEnvValue(env.ai?.model, 'string')!,\n temperature: getEnvValue(env.ai?.temperature, 'number')!,\n apiKey: getEnvValue(env.ai?.apiKey, 'string')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n log: logConfiguration,\n ai: aiConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n StrictMode,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport {\n extractEnvVariable,\n type ExtractEnvVariableOptions,\n} from './extractEnvVariable/index';\nimport { getEnvValue } from './utils';\n\n/**\n * Get all configuration values using environment variables\n * Can be used in the client side as the server side\n * To use it, be sure to have the environment variables set\n */\nexport const getConfiguration = (\n options?: ExtractEnvVariableOptions\n): IntlayerConfig => {\n const env = extractEnvVariable(options);\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\n requiredLocales: getEnvValue<Locales>(\n env.internationalization.requiredLocales,\n 'array'\n )!,\n strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n contentDir: getEnvValue<string>(env.content.contentDir, 'array')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n unmergedDictionariesDir: getEnvValue(\n env.content.unmergedDictionariesDir,\n 'string'\n )!,\n dynamicDictionariesDir: getEnvValue(\n env.content.dynamicDictionariesDir,\n 'string'\n )!,\n i18nextResourcesDir: getEnvValue(\n env.content.i18nextResourcesDir,\n 'string'\n )!,\n reactIntlMessagesDir: getEnvValue(\n env.content.reactIntlMessagesDir,\n 'string'\n )!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, 'string')!,\n configDir: getEnvValue(env.content.configDir, 'string')!,\n watchedFilesPattern: getEnvValue<string>(\n env.content.watchedFilesPattern,\n 'array'\n )!,\n watchedFilesPatternWithPath: getEnvValue<string>(\n env.content.watchedFilesPatternWithPath,\n 'array'\n )!,\n outputFilesPatternWithPath: getEnvValue(\n env.content.outputFilesPatternWithPath,\n 'string'\n )!,\n watch: getEnvValue(env.content.watch, 'boolean')!,\n };\n\n const intlayerEditorConfiguration = {\n applicationURL: getEnvValue(env.editor.applicationURL, 'string')!,\n editorURL: getEnvValue(env.editor.editorURL, 'string')!,\n cmsURL: getEnvValue(env.editor.cmsURL, 'string')!,\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n port: getEnvValue(env.editor.port, 'number')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'local_first' | 'distant_first',\n hotReload: getEnvValue(env.editor.hotReload, 'boolean')!,\n };\n\n const logConfiguration: LogConfig = {\n mode: getEnvValue(env.log.mode, 'string')!,\n prefix: getEnvValue(env.log.prefix, 'string')!,\n };\n\n const aiConfiguration: AiConfig = {\n provider: getEnvValue(env.ai?.provider, 'string')!,\n model: getEnvValue(env.ai?.model, 'string')!,\n temperature: getEnvValue(env.ai?.temperature, 'number')!,\n apiKey: getEnvValue(env.ai?.apiKey, 'string')!,\n };\n\n const buildConfiguration: BuildConfig = {\n optimize: getEnvValue(env.build.optimize, 'boolean')!,\n activateDynamicImport: getEnvValue(\n env.build.activateDynamicImport,\n 'boolean'\n )!,\n traversePattern: getEnvValue<string>(env.build.traversePattern, 'array')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n log: logConfiguration,\n ai: aiConfiguration,\n build: buildConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":"AAaA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,mBAAmB;AAOrB,MAAM,mBAAmB,CAC9B,YACmB;AACnB,QAAM,MAAM,mBAAmB,OAAO;AAEtC,QAAM,4BAAwD;AAAA,IAC5D,SAAS,YAAqB,IAAI,qBAAqB,SAAS,OAAO;AAAA,IACvE,iBAAiB;AAAA,MACf,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,eAAe;AAAA,MACb,KAAK,qBAAqB;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kCAAoD;AAAA,IACxD,YAAY,YAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,YAAY,YAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,eAAe,YAAY,IAAI,WAAW,eAAe,SAAS;AAAA,IAClE,UAAU,YAAY,IAAI,WAAW,UAAU,QAAQ;AAAA,IACvD,iBAAiB;AAAA,MACf,IAAI,WAAW;AAAA,MACf;AAAA,IACF;AAAA,IACA,UAAU,YAAY,IAAI,WAAW,UAAU,SAAS;AAAA,EAC1D;AAEA,QAAM,+BAA8C;AAAA,IAClD,gBAAgB,YAAoB,IAAI,QAAQ,gBAAgB,OAAO;AAAA,IACvE,SAAS,YAAY,IAAI,QAAQ,SAAS,QAAQ;AAAA,IAClD,YAAY,YAAoB,IAAI,QAAQ,YAAY,OAAO;AAAA,IAC/D,cAAc,YAAoB,IAAI,QAAQ,cAAc,OAAO;AAAA,IACnE,iBAAiB,YAAY,IAAI,QAAQ,iBAAiB,QAAQ;AAAA,IAClE,uBAAuB;AAAA,MACrB,IAAI,QAAQ;AAAA,MACZ;AAAA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AAA,MACX;AAAA,IACF;AAAA,IACA,WAAW,YAAY,IAAI,OAAO,WAAW,SAAS;AAAA,EACxD;AAEA,QAAM,mBAA8B;AAAA,IAClC,MAAM,YAAY,IAAI,IAAI,MAAM,QAAQ;AAAA,IACxC,QAAQ,YAAY,IAAI,IAAI,QAAQ,QAAQ;AAAA,EAC9C;AAEA,QAAM,kBAA4B;AAAA,IAChC,UAAU,YAAY,IAAI,IAAI,UAAU,QAAQ;AAAA,IAChD,OAAO,YAAY,IAAI,IAAI,OAAO,QAAQ;AAAA,IAC1C,aAAa,YAAY,IAAI,IAAI,aAAa,QAAQ;AAAA,IACtD,QAAQ,YAAY,IAAI,IAAI,QAAQ,QAAQ;AAAA,EAC9C;AAEA,QAAM,qBAAkC;AAAA,IACtC,UAAU,YAAY,IAAI,MAAM,UAAU,SAAS;AAAA,IACnD,uBAAuB;AAAA,MACrB,IAAI,MAAM;AAAA,MACV;AAAA,IACF;AAAA,IACA,iBAAiB,YAAoB,IAAI,MAAM,iBAAiB,OAAO;AAAA,EACzE;AAEA,QAAM,wBAAwC;AAAA,IAC5C,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAMV,oBAAoB,EAGpB,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAunBzB;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,sBAAsB,oBAAoB,EAC1C,UAAU,MAAM,KACf,cAiCF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/build.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,SAAwC,CAAC;AAE9D,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAE7C,eAAO,MAAM,gBAAgB,UAG5B,CAAC"}
|
|
@@ -5,6 +5,7 @@ export declare const CONTENT_DIR: string[];
|
|
|
5
5
|
export declare const MAIN_DIR = ".intlayer/main";
|
|
6
6
|
export declare const DICTIONARIES_DIR = ".intlayer/dictionary";
|
|
7
7
|
export declare const UNMERGED_DICTIONARIES_DIR = ".intlayer/unmerged_dictionary";
|
|
8
|
+
export declare const DYNAMIC_DICTIONARIES_DIR = ".intlayer/dynamic_dictionary";
|
|
8
9
|
export declare const TYPES_DIR = ".intlayer/types";
|
|
9
10
|
export declare const MODULE_AUGMENTATION_DIR = ".intlayer/types";
|
|
10
11
|
export declare const DICTIONARY_OUTPUT: DictionaryOutput[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,eAAe,UAU3B,CAAC;AACF,eAAO,MAAM,cAAc,UAAmB,CAAC;AAE/C,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,eAAO,MAAM,QAAQ,mBAAmB,CAAC;AAEzC,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AAEzE,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAE3C,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAAiB,CAAC;AAElE,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAE7C,eAAO,MAAM,KAAK,SAAyC,CAAC"}
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,eAAe,UAU3B,CAAC;AACF,eAAO,MAAM,cAAc,UAAmB,CAAC;AAE/C,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,eAAO,MAAM,QAAQ,mBAAmB,CAAC;AAEzC,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AAEzE,eAAO,MAAM,wBAAwB,iCAAiC,CAAC;AAEvE,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAE3C,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAAiB,CAAC;AAElE,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAE7C,eAAO,MAAM,KAAK,SAAyC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,sBAAsB,QAAO,yBAuFzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react_app.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react_app.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,0BAA0B,QAAO,yBAuF7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undefined_platform.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"undefined_platform.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,uBAAuB,QAAO,yBAkF1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAGvE,eAAO,MAAM,sBAAsB,QAAO,yBA8FzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/envVariables/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/envVariables/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AAGpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,yBAAyB,KAClC,cA+HF,CAAC"}
|
|
@@ -253,6 +253,57 @@ export type AiConfig = {
|
|
|
253
253
|
*/
|
|
254
254
|
applicationContext?: string;
|
|
255
255
|
};
|
|
256
|
+
export type BuildConfig = {
|
|
257
|
+
/**
|
|
258
|
+
* Indicates if the build should be optimized
|
|
259
|
+
*
|
|
260
|
+
* Default: process.env.NODE_ENV === 'production'
|
|
261
|
+
*
|
|
262
|
+
* If true, the build will be optimized.
|
|
263
|
+
* If false, the build will not be optimized.
|
|
264
|
+
*
|
|
265
|
+
* Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.
|
|
266
|
+
* All imports will stay as static import to avoid async processing when loading the dictionaries.
|
|
267
|
+
*
|
|
268
|
+
* Note:
|
|
269
|
+
* - Intlayer will replace all call of `useIntlayer` with `useDictionary`, `getIntlayer` with `getDictionary`.
|
|
270
|
+
* - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.
|
|
271
|
+
* - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.
|
|
272
|
+
*/
|
|
273
|
+
optimize: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Indicates if the dynamic import should be activated
|
|
276
|
+
*
|
|
277
|
+
* Default: false
|
|
278
|
+
*
|
|
279
|
+
* By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.
|
|
280
|
+
* If this option is set to true, only the current locale’s dictionary content
|
|
281
|
+
* will be fetched via dynamic import. In that case, Intlayer will replace all
|
|
282
|
+
* calls to `useIntlayer` with `useDynamicDictionary`.
|
|
283
|
+
*
|
|
284
|
+
* Note:
|
|
285
|
+
* - Dynamic imports rely on React Suspense and may slightly impact rendering performance. But if desabled all locales will be loaded at once, even if they are not used.
|
|
286
|
+
* - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.
|
|
287
|
+
* - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.
|
|
288
|
+
* - This option will be ignored if `optimize` is disabled.
|
|
289
|
+
*/
|
|
290
|
+
activateDynamicImport: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Pattern to traverse the code to optimize.
|
|
293
|
+
*
|
|
294
|
+
* Allows to avoid to traverse the code that is not relevant to the optimization.
|
|
295
|
+
* Improve build performance.
|
|
296
|
+
*
|
|
297
|
+
* Default: ['**\/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx}', '!**\/node_modules/**']
|
|
298
|
+
*
|
|
299
|
+
* Example: `['src/**\/*.{ts,tsx}', '../ui-library/**\/*.{ts,tsx}', '!**\/node_modules/**']`
|
|
300
|
+
*
|
|
301
|
+
* Note:
|
|
302
|
+
* - This option will be ignored if `optimize` is disabled.
|
|
303
|
+
* - Use glob pattern.
|
|
304
|
+
*/
|
|
305
|
+
traversePattern: string[];
|
|
306
|
+
};
|
|
256
307
|
/**
|
|
257
308
|
* Custom configuration that can be provided to override default settings
|
|
258
309
|
*/
|
|
@@ -281,6 +332,10 @@ export type CustomIntlayerConfig = {
|
|
|
281
332
|
* Custom AI configuration
|
|
282
333
|
*/
|
|
283
334
|
ai?: Partial<AiConfig>;
|
|
335
|
+
/**
|
|
336
|
+
* Custom build configuration
|
|
337
|
+
*/
|
|
338
|
+
build?: Partial<BuildConfig>;
|
|
284
339
|
};
|
|
285
340
|
/**
|
|
286
341
|
* Combined configuration for internationalization, middleware, and content
|
|
@@ -310,6 +365,10 @@ export type IntlayerConfig = {
|
|
|
310
365
|
* AI configuration
|
|
311
366
|
*/
|
|
312
367
|
ai?: Partial<AiConfig>;
|
|
368
|
+
/**
|
|
369
|
+
* Build configuration
|
|
370
|
+
*/
|
|
371
|
+
build: BuildConfig;
|
|
313
372
|
};
|
|
314
373
|
/**
|
|
315
374
|
* Base configuration for content handling
|
|
@@ -409,6 +468,14 @@ export type ResultDirDerivedConfig = {
|
|
|
409
468
|
* Specifies the derived path for dictionaries relative to the result directory.
|
|
410
469
|
*/
|
|
411
470
|
dictionariesDir: string;
|
|
471
|
+
/**
|
|
472
|
+
* Directory where dynamic dictionaries are stored, relative to the result directory
|
|
473
|
+
*
|
|
474
|
+
* Default: .intlayer/dynamic_dictionary
|
|
475
|
+
*
|
|
476
|
+
* Specifies the derived path for dynamic dictionaries relative to the result directory.
|
|
477
|
+
*/
|
|
478
|
+
dynamicDictionariesDir: string;
|
|
412
479
|
/**
|
|
413
480
|
* Directory where dictionaries are stored, relative to the result directory
|
|
414
481
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB;;;;;;;;OAQG;IACH,eAAe,EAAE,OAAO,EAAE,CAAC;IAE3B;;;;;;;OAOG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;OAWG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,EAAE,mBAAmB,CAAC;IAErC;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;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GAAG;IACnC;;;;;;OAMG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAEhC;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;;;;;;;OASG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;;;;;;;;OASG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;;;OAMG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAE9B;;;;;;OAMG;IACH,2BAA2B,EAAE,MAAM,EAAE,CAAC;IAEtC;;;;;;OAMG;IACH,0BAA0B,EAAE,MAAM,CAAC;CACpC,CAAC;AAGF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,iBAAiB,GACjB,sBAAsB,GACtB,qBAAqB,CAAC;AAExB,MAAM,MAAM,SAAS,GAAG;IACtB;;;;;;;;OAQG;IACH,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAEzC;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/config",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.",
|
|
6
6
|
"keywords": [
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"tsup": "^8.4.0",
|
|
85
85
|
"typescript": "^5.8.2",
|
|
86
86
|
"@utils/eslint-config": "1.0.4",
|
|
87
|
+
"@utils/ts-config": "1.0.4",
|
|
87
88
|
"@utils/ts-config-types": "1.0.4",
|
|
88
|
-
"@utils/tsup-config": "1.0.4"
|
|
89
|
-
"@utils/ts-config": "1.0.4"
|
|
89
|
+
"@utils/tsup-config": "1.0.4"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
|
-
"intlayer": "5.5.
|
|
92
|
+
"intlayer": "5.5.5"
|
|
93
93
|
},
|
|
94
94
|
"engines": {
|
|
95
95
|
"node": ">=14.18"
|