@intlayer/config 1.2.0 → 1.2.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/client.cjs +2 -10
- package/dist/cjs/client.cjs.map +1 -1
- package/dist/cjs/client.d.ts +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs +45 -4
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/defaultValues/server.cjs +15 -1
- package/dist/cjs/defaultValues/server.cjs.map +1 -1
- package/dist/cjs/defaultValues/server.d.ts +6 -1
- package/dist/cjs/envVariables/detectPlatform.cjs +7 -4
- package/dist/cjs/envVariables/detectPlatform.cjs.map +1 -1
- package/dist/cjs/envVariables/detectPlatform.d.ts +1 -4
- package/dist/cjs/envVariables/extractEnvVariable/index.cjs +44 -0
- package/dist/cjs/envVariables/extractEnvVariable/index.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/index.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs +70 -0
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/next.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +70 -0
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/react_app.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/types.cjs +17 -0
- package/dist/cjs/envVariables/extractEnvVariable/types.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/types.d.ts +11 -0
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +70 -0
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +78 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite.d.ts +7 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs +2 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs.map +1 -0
- package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.d.ts +2 -0
- package/dist/cjs/envVariables/getConfiguration.cjs +79 -115
- package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
- package/dist/cjs/envVariables/getConfiguration.d.ts +2 -6
- package/dist/cjs/envVariables/index.cjs +2 -10
- package/dist/cjs/envVariables/index.cjs.map +1 -1
- package/dist/cjs/envVariables/index.d.ts +1 -1
- package/dist/cjs/index.cjs +2 -10
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/types/config.cjs.map +1 -1
- package/dist/cjs/types/config.d.ts +44 -4
- package/dist/esm/client.d.mts +1 -1
- package/dist/esm/client.mjs +2 -12
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +48 -5
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/defaultValues/server.d.mts +6 -1
- package/dist/esm/defaultValues/server.mjs +13 -1
- package/dist/esm/defaultValues/server.mjs.map +1 -1
- package/dist/esm/envVariables/detectPlatform.d.mts +1 -4
- package/dist/esm/envVariables/detectPlatform.mjs +7 -4
- package/dist/esm/envVariables/detectPlatform.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/index.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/index.mjs +20 -0
- package/dist/esm/envVariables/extractEnvVariable/index.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/next.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/next.mjs +46 -0
- package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/react_app.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +46 -0
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/types.d.mts +11 -0
- package/dist/esm/envVariables/extractEnvVariable/types.mjs +1 -0
- package/dist/esm/envVariables/extractEnvVariable/types.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +46 -0
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/vite.d.mts +7 -0
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs +53 -0
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -0
- package/dist/esm/envVariables/extractEnvVariable/vite_env.d.d.mts +2 -0
- package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs +1 -0
- package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs.map +1 -0
- package/dist/esm/envVariables/getConfiguration.d.mts +2 -6
- package/dist/esm/envVariables/getConfiguration.mjs +78 -110
- package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
- package/dist/esm/envVariables/index.d.mts +1 -1
- package/dist/esm/envVariables/index.mjs +2 -12
- package/dist/esm/envVariables/index.mjs.map +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -9
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/types/config.d.mts +44 -4
- package/package.json +2 -2
- package/src/client.ts +1 -7
- package/src/configFile/buildConfigurationFields.ts +52 -3
- package/src/defaultValues/server.ts +15 -1
- package/src/envVariables/detectPlatform.ts +12 -8
- package/src/envVariables/extractEnvVariable/index.ts +20 -0
- package/src/envVariables/extractEnvVariable/next.ts +57 -0
- package/src/envVariables/extractEnvVariable/react_app.ts +57 -0
- package/src/envVariables/extractEnvVariable/types.ts +10 -0
- package/src/envVariables/extractEnvVariable/undefined_platform.ts +52 -0
- package/src/envVariables/extractEnvVariable/vite.ts +65 -0
- package/src/envVariables/extractEnvVariable/vite_env.d.ts +9 -0
- package/src/envVariables/getConfiguration.ts +84 -111
- package/src/envVariables/index.ts +1 -7
- package/src/index.ts +0 -4
- package/src/types/config.ts +47 -3
- package/dist/cjs/envVariables/extractEnvVariable.cjs +0 -211
- package/dist/cjs/envVariables/extractEnvVariable.cjs.map +0 -1
- package/dist/cjs/envVariables/extractEnvVariable.d.ts +0 -13
- package/dist/esm/envVariables/extractEnvVariable.d.mts +0 -13
- package/dist/esm/envVariables/extractEnvVariable.mjs +0 -186
- package/dist/esm/envVariables/extractEnvVariable.mjs.map +0 -1
- package/src/envVariables/extractEnvVariable.ts +0 -224
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
TYPES_DIR_NAME,
|
|
18
18
|
MAIN_DIR_NAME,
|
|
19
19
|
MODULE_AUGMENTATION_DIR_NAME,
|
|
20
|
+
I18N_DICTIONARIES_DIR_NAME,
|
|
21
|
+
DICTIONARY_OUTPUT,
|
|
20
22
|
} from '../defaultValues/server';
|
|
21
23
|
import type {
|
|
22
24
|
BaseDerivedConfig,
|
|
@@ -42,6 +44,7 @@ const buildInternationalizationFields = (
|
|
|
42
44
|
* Locales available in the application
|
|
43
45
|
*
|
|
44
46
|
* Default: ['en']
|
|
47
|
+
*
|
|
45
48
|
*/
|
|
46
49
|
locales: customConfiguration?.locales ?? LOCALES,
|
|
47
50
|
|
|
@@ -122,7 +125,7 @@ const buildContentFields = (
|
|
|
122
125
|
/**
|
|
123
126
|
* File extensions of content to look for to build the dictionaries
|
|
124
127
|
*
|
|
125
|
-
* - Default: ['.content.ts', '.content.js', '.content.json']
|
|
128
|
+
* - Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']
|
|
126
129
|
*
|
|
127
130
|
* - Example: ['.data.ts', '.data.js', '.data.json']
|
|
128
131
|
*
|
|
@@ -207,6 +210,23 @@ const buildContentFields = (
|
|
|
207
210
|
dictionariesDirName:
|
|
208
211
|
customConfiguration?.dictionariesDirName ?? DICTIONARIES_DIR_NAME,
|
|
209
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Related to the intlayer result directory
|
|
215
|
+
*
|
|
216
|
+
* Directory name where the dictionaries will be stored
|
|
217
|
+
*
|
|
218
|
+
* Default: 'dictionary'
|
|
219
|
+
*
|
|
220
|
+
* Example: 'translations'
|
|
221
|
+
*
|
|
222
|
+
* Note:
|
|
223
|
+
* - If this directory is not at the result directory level, update the dictionariesDir field instead
|
|
224
|
+
*
|
|
225
|
+
*/
|
|
226
|
+
i18nDictionariesDirName:
|
|
227
|
+
customConfiguration?.i18nDictionariesDirName ??
|
|
228
|
+
I18N_DICTIONARIES_DIR_NAME,
|
|
229
|
+
|
|
210
230
|
/**
|
|
211
231
|
* Related to the intlayer result directory
|
|
212
232
|
*
|
|
@@ -304,6 +324,18 @@ const buildContentFields = (
|
|
|
304
324
|
notDerivedContentConfig.baseDir,
|
|
305
325
|
notDerivedContentConfig.moduleAugmentationDirName
|
|
306
326
|
),
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Output format of the dictionary
|
|
330
|
+
*
|
|
331
|
+
* Default: ['intlayer']
|
|
332
|
+
*
|
|
333
|
+
* Note:
|
|
334
|
+
* - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.
|
|
335
|
+
* - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer
|
|
336
|
+
*/
|
|
337
|
+
dictionaryOutput:
|
|
338
|
+
customConfiguration?.dictionaryOutput ?? DICTIONARY_OUTPUT,
|
|
307
339
|
};
|
|
308
340
|
|
|
309
341
|
const resultDirDerivedConfiguration: ResultDirDerivedConfig = {
|
|
@@ -327,6 +359,23 @@ const buildContentFields = (
|
|
|
327
359
|
notDerivedContentConfig.dictionariesDirName
|
|
328
360
|
),
|
|
329
361
|
|
|
362
|
+
/**
|
|
363
|
+
* Directory where the 18n dictionaries will be stored
|
|
364
|
+
*
|
|
365
|
+
* Relative to the result directory
|
|
366
|
+
*
|
|
367
|
+
* Default: {{resultDir}} / {{i18nDictionariesDirName}}
|
|
368
|
+
*
|
|
369
|
+
* Example: '/path/to/project/.intlayer/dictionary/i18n'
|
|
370
|
+
*
|
|
371
|
+
* Note:
|
|
372
|
+
* - If the types are not at the result directory level, update the i18nDictionariesDirName field instead
|
|
373
|
+
*/
|
|
374
|
+
i18nDictionariesDir: join(
|
|
375
|
+
baseDirDerivedConfiguration.resultDir,
|
|
376
|
+
notDerivedContentConfig.i18nDictionariesDirName
|
|
377
|
+
),
|
|
378
|
+
|
|
330
379
|
/**
|
|
331
380
|
* Directory where the dictionaries types will be stored
|
|
332
381
|
*
|
|
@@ -367,7 +416,7 @@ const buildContentFields = (
|
|
|
367
416
|
/**
|
|
368
417
|
* Pattern of files to watch
|
|
369
418
|
*
|
|
370
|
-
* Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json']
|
|
419
|
+
* Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json', '/**\/*.content.cjs', '/**\/*.content.mjs', '/**\/*.content.tsx', '/**\/*.content.jsx']
|
|
371
420
|
*/
|
|
372
421
|
watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(
|
|
373
422
|
(ext) => `/**/*${ext}`
|
|
@@ -376,7 +425,7 @@ const buildContentFields = (
|
|
|
376
425
|
/**
|
|
377
426
|
* Pattern of files to watch including the relative path
|
|
378
427
|
*
|
|
379
|
-
* Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json']
|
|
428
|
+
* Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json', '{{contentDir}}/**\/*.content.cjs', '{{contentDir}}/**\/*.content.mjs', '{{contentDir}}/**\/*.content.tsx', '{{contentDir}}/**\/*.content.jsx']
|
|
380
429
|
*/
|
|
381
430
|
watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.map(
|
|
382
431
|
(ext) => `${baseDirDerivedConfiguration.contentDir}/**/*${ext}`
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DictionaryOutput } from '../types/config';
|
|
2
|
+
|
|
3
|
+
export const FILE_EXTENSIONS = [
|
|
4
|
+
'.content.ts',
|
|
5
|
+
'.content.js',
|
|
6
|
+
'.content.cjs',
|
|
7
|
+
'.content.mjs',
|
|
8
|
+
'.content.json',
|
|
9
|
+
'.content.tsx',
|
|
10
|
+
'.content.jsx',
|
|
11
|
+
];
|
|
2
12
|
export const EXCLUDED_PATHS = ['node_modules'];
|
|
3
13
|
|
|
4
14
|
export const CONTENT_DIR_NAME = 'src';
|
|
@@ -7,8 +17,12 @@ export const RESULT_DIR_NAME = '.intlayer';
|
|
|
7
17
|
|
|
8
18
|
export const MODULE_AUGMENTATION_DIR_NAME = 'types';
|
|
9
19
|
|
|
20
|
+
export const DICTIONARY_OUTPUT: DictionaryOutput[] = ['intlayer'];
|
|
21
|
+
|
|
10
22
|
export const DICTIONARIES_DIR_NAME = 'dictionary';
|
|
11
23
|
|
|
24
|
+
export const I18N_DICTIONARIES_DIR_NAME = 'i18n_dictionary';
|
|
25
|
+
|
|
12
26
|
export const TYPES_DIR_NAME = 'types';
|
|
13
27
|
|
|
14
28
|
export const MAIN_DIR_NAME = 'main';
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
export type Platform = 'next' | 'vite' | 'react_app' | 'unknown';
|
|
2
|
-
export type ViteEnvVar = { env: Record<string, string> };
|
|
3
2
|
|
|
4
3
|
export const getPlatform = (): Platform => {
|
|
5
|
-
if (
|
|
4
|
+
if (
|
|
5
|
+
// eslint-disable-next-line
|
|
6
|
+
typeof import.meta !== 'undefined' &&
|
|
7
|
+
typeof import.meta.env !== 'undefined' &&
|
|
8
|
+
typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== 'undefined'
|
|
9
|
+
) {
|
|
10
|
+
// Likely Vite
|
|
11
|
+
return 'vite';
|
|
12
|
+
} else if (
|
|
13
|
+
typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== 'undefined'
|
|
14
|
+
) {
|
|
6
15
|
// Likely Next.js
|
|
7
16
|
return 'next';
|
|
8
17
|
} else if (
|
|
9
|
-
typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE
|
|
18
|
+
typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== 'undefined'
|
|
10
19
|
) {
|
|
11
20
|
// Likely Create React App
|
|
12
21
|
return 'react_app';
|
|
13
|
-
} else if (
|
|
14
|
-
(import.meta as unknown as ViteEnvVar)?.env?.VITE_INTLAYER_DEFAULT_LOCALE
|
|
15
|
-
) {
|
|
16
|
-
// Likely Vite
|
|
17
|
-
return 'vite';
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
return 'unknown';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Platform, getPlatform } from '../detectPlatform';
|
|
2
|
+
import { extractNextEnvVariable } from './next';
|
|
3
|
+
import { extractReactAppEnvVariable } from './react_app';
|
|
4
|
+
import type { IntlayerConfigEnvVariable } from './types';
|
|
5
|
+
import { extractEmptyEnvVariable } from './undefined_platform';
|
|
6
|
+
import { extractViteEnvVariable } from './vite';
|
|
7
|
+
|
|
8
|
+
export const extractEnvVariable = (): IntlayerConfigEnvVariable => {
|
|
9
|
+
const platform: Platform = getPlatform();
|
|
10
|
+
|
|
11
|
+
if (platform === 'vite') {
|
|
12
|
+
return extractViteEnvVariable();
|
|
13
|
+
} else if (platform === 'next') {
|
|
14
|
+
return extractNextEnvVariable();
|
|
15
|
+
} else if (platform === 'react_app') {
|
|
16
|
+
return extractReactAppEnvVariable();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return extractEmptyEnvVariable();
|
|
20
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InternationalizationConfig,
|
|
3
|
+
MiddlewareConfig,
|
|
4
|
+
ContentConfig,
|
|
5
|
+
} from '../../types/config';
|
|
6
|
+
import type { IntlayerConfigEnvVariable, ReplaceValue } from './types';
|
|
7
|
+
|
|
8
|
+
export const extractNextEnvVariable = (): IntlayerConfigEnvVariable => {
|
|
9
|
+
const internationalization: ReplaceValue<InternationalizationConfig> = {
|
|
10
|
+
locales: process.env.NEXT_PUBLIC_INTLAYER_LOCALES,
|
|
11
|
+
defaultLocale: process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const middleware: ReplaceValue<MiddlewareConfig> = {
|
|
15
|
+
headerName: process.env.NEXT_PUBLIC_INTLAYER_HEADER_NAME,
|
|
16
|
+
cookieName: process.env.NEXT_PUBLIC_INTLAYER_COOKIE_NAME,
|
|
17
|
+
prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,
|
|
18
|
+
basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,
|
|
19
|
+
serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,
|
|
20
|
+
noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const content: ReplaceValue<ContentConfig> = {
|
|
24
|
+
fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,
|
|
25
|
+
baseDir: process.env.NEXT_PUBLIC_INTLAYER_BASE_DIR,
|
|
26
|
+
contentDirName: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR_NAME,
|
|
27
|
+
contentDir: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR,
|
|
28
|
+
excludedPath: process.env.NEXT_PUBLIC_INTLAYER_EXCLUDED_PATH,
|
|
29
|
+
resultDirName: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR_NAME,
|
|
30
|
+
moduleAugmentationDirName:
|
|
31
|
+
process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
|
|
32
|
+
dictionariesDirName: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR_NAME,
|
|
33
|
+
i18nDictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR,
|
|
34
|
+
typeDirName: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR_NAME,
|
|
35
|
+
mainDirName: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR_NAME,
|
|
36
|
+
resultDir: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,
|
|
37
|
+
moduleAugmentationDir:
|
|
38
|
+
process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,
|
|
39
|
+
dictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR,
|
|
40
|
+
i18nDictionariesDirName:
|
|
41
|
+
process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
|
|
42
|
+
typesDir: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,
|
|
43
|
+
mainDir: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,
|
|
44
|
+
watchedFilesPattern: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,
|
|
45
|
+
watchedFilesPatternWithPath:
|
|
46
|
+
process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
|
|
47
|
+
outputFilesPatternWithPath:
|
|
48
|
+
process.env.NEXT_PUBLIC_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
|
|
49
|
+
dictionaryOutput: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_OUTPUT,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
internationalization,
|
|
54
|
+
middleware,
|
|
55
|
+
content,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InternationalizationConfig,
|
|
3
|
+
MiddlewareConfig,
|
|
4
|
+
ContentConfig,
|
|
5
|
+
} from '../../types/config';
|
|
6
|
+
import type { IntlayerConfigEnvVariable, ReplaceValue } from './types';
|
|
7
|
+
|
|
8
|
+
export const extractReactAppEnvVariable = (): IntlayerConfigEnvVariable => {
|
|
9
|
+
const internationalization: ReplaceValue<InternationalizationConfig> = {
|
|
10
|
+
locales: process.env.REACT_APP_INTLAYER_LOCALES,
|
|
11
|
+
defaultLocale: process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const middleware: ReplaceValue<MiddlewareConfig> = {
|
|
15
|
+
headerName: process.env.REACT_APP_INTLAYER_HEADER_NAME,
|
|
16
|
+
cookieName: process.env.REACT_APP_INTLAYER_COOKIE_NAME,
|
|
17
|
+
prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,
|
|
18
|
+
basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,
|
|
19
|
+
serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,
|
|
20
|
+
noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const content: ReplaceValue<ContentConfig> = {
|
|
24
|
+
fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,
|
|
25
|
+
baseDir: process.env.REACT_APP_INTLAYER_BASE_DIR,
|
|
26
|
+
contentDirName: process.env.REACT_APP_INTLAYER_CONTENT_DIR_NAME,
|
|
27
|
+
contentDir: process.env.REACT_APP_INTLAYER_CONTENT_DIR,
|
|
28
|
+
excludedPath: process.env.REACT_APP_INTLAYER_EXCLUDED_PATH,
|
|
29
|
+
resultDirName: process.env.REACT_APP_INTLAYER_RESULT_DIR_NAME,
|
|
30
|
+
moduleAugmentationDirName:
|
|
31
|
+
process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
|
|
32
|
+
dictionariesDirName: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR_NAME,
|
|
33
|
+
i18nDictionariesDirName:
|
|
34
|
+
process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
|
|
35
|
+
typeDirName: process.env.REACT_APP_INTLAYER_TYPE_DIR_NAME,
|
|
36
|
+
mainDirName: process.env.REACT_APP_INTLAYER_MAIN_DIR_NAME,
|
|
37
|
+
resultDir: process.env.REACT_APP_INTLAYER_RESULT_DIR,
|
|
38
|
+
moduleAugmentationDir:
|
|
39
|
+
process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,
|
|
40
|
+
dictionariesDir: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR,
|
|
41
|
+
i18nDictionariesDir: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,
|
|
42
|
+
typesDir: process.env.REACT_APP_INTLAYER_TYPE_DIR,
|
|
43
|
+
mainDir: process.env.REACT_APP_INTLAYER_MAIN_DIR,
|
|
44
|
+
watchedFilesPattern: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,
|
|
45
|
+
watchedFilesPatternWithPath:
|
|
46
|
+
process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
|
|
47
|
+
outputFilesPatternWithPath:
|
|
48
|
+
process.env.REACT_APP_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
|
|
49
|
+
dictionaryOutput: process.env.REACT_APP_INTLAYER_DICTIONARY_OUTPUT,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
internationalization,
|
|
54
|
+
middleware,
|
|
55
|
+
content,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IntlayerConfig } from '../../client';
|
|
2
|
+
|
|
3
|
+
// Utility type that replaces all values of a given type with another type
|
|
4
|
+
export type ReplaceValue<T> = {
|
|
5
|
+
[K in keyof T]: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type IntlayerConfigEnvVariable = {
|
|
9
|
+
[K in keyof IntlayerConfig]: ReplaceValue<IntlayerConfig[K]>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InternationalizationConfig,
|
|
3
|
+
MiddlewareConfig,
|
|
4
|
+
ContentConfig,
|
|
5
|
+
} from '../../types/config';
|
|
6
|
+
import type { ReplaceValue, IntlayerConfigEnvVariable } from './types';
|
|
7
|
+
|
|
8
|
+
export const extractEmptyEnvVariable = (): IntlayerConfigEnvVariable => {
|
|
9
|
+
const internationalization: ReplaceValue<InternationalizationConfig> = {
|
|
10
|
+
locales: undefined,
|
|
11
|
+
defaultLocale: undefined,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const middleware: ReplaceValue<MiddlewareConfig> = {
|
|
15
|
+
headerName: undefined,
|
|
16
|
+
cookieName: undefined,
|
|
17
|
+
prefixDefault: undefined,
|
|
18
|
+
basePath: undefined,
|
|
19
|
+
serverSetCookie: undefined,
|
|
20
|
+
noPrefix: undefined,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const content: ReplaceValue<ContentConfig> = {
|
|
24
|
+
fileExtensions: undefined,
|
|
25
|
+
baseDir: undefined,
|
|
26
|
+
contentDirName: undefined,
|
|
27
|
+
contentDir: undefined,
|
|
28
|
+
excludedPath: undefined,
|
|
29
|
+
resultDirName: undefined,
|
|
30
|
+
moduleAugmentationDirName: undefined,
|
|
31
|
+
dictionariesDirName: undefined,
|
|
32
|
+
i18nDictionariesDirName: undefined,
|
|
33
|
+
typeDirName: undefined,
|
|
34
|
+
mainDirName: undefined,
|
|
35
|
+
resultDir: undefined,
|
|
36
|
+
moduleAugmentationDir: undefined,
|
|
37
|
+
dictionariesDir: undefined,
|
|
38
|
+
i18nDictionariesDir: undefined,
|
|
39
|
+
typesDir: undefined,
|
|
40
|
+
mainDir: undefined,
|
|
41
|
+
watchedFilesPattern: undefined,
|
|
42
|
+
watchedFilesPatternWithPath: undefined,
|
|
43
|
+
outputFilesPatternWithPath: undefined,
|
|
44
|
+
dictionaryOutput: undefined,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
internationalization,
|
|
49
|
+
middleware,
|
|
50
|
+
content,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InternationalizationConfig,
|
|
3
|
+
MiddlewareConfig,
|
|
4
|
+
ContentConfig,
|
|
5
|
+
} from '../../types/config';
|
|
6
|
+
import type { IntlayerConfigEnvVariable, ReplaceValue } from './types';
|
|
7
|
+
import { extractEmptyEnvVariable } from './undefined_platform';
|
|
8
|
+
|
|
9
|
+
export const extractViteEnvVariable = (): IntlayerConfigEnvVariable => {
|
|
10
|
+
if (!import.meta.env) {
|
|
11
|
+
console.error(
|
|
12
|
+
'Vite env variables cannot be loaded on a commonjs environment.'
|
|
13
|
+
);
|
|
14
|
+
return extractEmptyEnvVariable();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const internationalization: ReplaceValue<InternationalizationConfig> = {
|
|
18
|
+
locales: import.meta.env.VITE_INTLAYER_LOCALES,
|
|
19
|
+
defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const middleware: ReplaceValue<MiddlewareConfig> = {
|
|
23
|
+
headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,
|
|
24
|
+
cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,
|
|
25
|
+
prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,
|
|
26
|
+
basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,
|
|
27
|
+
serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,
|
|
28
|
+
noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const content: ReplaceValue<ContentConfig> = {
|
|
32
|
+
fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,
|
|
33
|
+
baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,
|
|
34
|
+
contentDirName: import.meta.env.VITE_INTLAYER_CONTENT_DIR_NAME,
|
|
35
|
+
contentDir: import.meta.env.VITE_INTLAYER_CONTENT_DIR,
|
|
36
|
+
excludedPath: import.meta.env.VITE_INTLAYER_EXCLUDED_PATH,
|
|
37
|
+
resultDirName: import.meta.env.VITE_INTLAYER_RESULT_DIR_NAME,
|
|
38
|
+
moduleAugmentationDirName: import.meta.env
|
|
39
|
+
.VITE_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
|
|
40
|
+
dictionariesDirName: import.meta.env.VITE_INTLAYER_DICTIONARIES_DIR_NAME,
|
|
41
|
+
i18nDictionariesDirName: import.meta.env
|
|
42
|
+
.VITE_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
|
|
43
|
+
typeDirName: import.meta.env.VITE_INTLAYER_TYPE_DIR_NAME,
|
|
44
|
+
mainDirName: import.meta.env.VITE_INTLAYER_MAIN_DIR_NAME,
|
|
45
|
+
resultDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,
|
|
46
|
+
moduleAugmentationDir: import.meta.env
|
|
47
|
+
.VITE_INTLAYER_MODULE_AUGMENTATION_DIR,
|
|
48
|
+
dictionariesDir: import.meta.env.VITE_INTLAYER_DICTIONARIES_DIR,
|
|
49
|
+
i18nDictionariesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,
|
|
50
|
+
typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,
|
|
51
|
+
mainDir: import.meta.env.VITE_INTLAYER_MAIN_DIR,
|
|
52
|
+
watchedFilesPattern: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,
|
|
53
|
+
watchedFilesPatternWithPath: import.meta.env
|
|
54
|
+
.VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
|
|
55
|
+
outputFilesPatternWithPath: import.meta.env
|
|
56
|
+
.VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
|
|
57
|
+
dictionaryOutput: import.meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
internationalization,
|
|
62
|
+
middleware,
|
|
63
|
+
content,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -1,126 +1,99 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ContentConfig,
|
|
3
|
+
DictionaryOutput,
|
|
3
4
|
InternationalizationConfig,
|
|
4
5
|
IntlayerConfig,
|
|
5
6
|
MiddlewareConfig,
|
|
6
7
|
ServerSetCookieRule,
|
|
7
8
|
} from '../types/config';
|
|
8
9
|
import type { Locales } from '../types/locales';
|
|
9
|
-
import { extractEnvVariable } from './extractEnvVariable';
|
|
10
|
+
import { extractEnvVariable } from './extractEnvVariable/index';
|
|
10
11
|
import { getEnvValue } from './utils';
|
|
11
12
|
|
|
12
|
-
const env = extractEnvVariable();
|
|
13
|
-
|
|
14
|
-
export const intlayerIntlConfiguration: InternationalizationConfig = {
|
|
15
|
-
locales: getEnvValue<Locales>(
|
|
16
|
-
env.intlayerIntlConfiguration.locales,
|
|
17
|
-
'array'
|
|
18
|
-
)!,
|
|
19
|
-
defaultLocale: getEnvValue<Locales>(
|
|
20
|
-
env.intlayerIntlConfiguration.defaultLocale,
|
|
21
|
-
'string'
|
|
22
|
-
)!,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const intlayerMiddlewareConfiguration: MiddlewareConfig = {
|
|
26
|
-
headerName: getEnvValue(
|
|
27
|
-
env.intlayerMiddlewareConfiguration.headerName,
|
|
28
|
-
'string'
|
|
29
|
-
)!,
|
|
30
|
-
cookieName: getEnvValue(
|
|
31
|
-
env.intlayerMiddlewareConfiguration.cookieName,
|
|
32
|
-
'string'
|
|
33
|
-
)!,
|
|
34
|
-
prefixDefault: getEnvValue(
|
|
35
|
-
env.intlayerMiddlewareConfiguration.prefixDefault,
|
|
36
|
-
'boolean'
|
|
37
|
-
)!,
|
|
38
|
-
basePath: getEnvValue(
|
|
39
|
-
env.intlayerMiddlewareConfiguration.basePath,
|
|
40
|
-
'string'
|
|
41
|
-
)!,
|
|
42
|
-
serverSetCookie: getEnvValue<ServerSetCookieRule>(
|
|
43
|
-
env.intlayerMiddlewareConfiguration.serverSetCookie,
|
|
44
|
-
'string'
|
|
45
|
-
)!,
|
|
46
|
-
noPrefix: getEnvValue(
|
|
47
|
-
env.intlayerMiddlewareConfiguration.noPrefix,
|
|
48
|
-
'boolean'
|
|
49
|
-
)!,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const intlayerContentConfiguration: ContentConfig = {
|
|
53
|
-
fileExtensions: getEnvValue<string>(
|
|
54
|
-
env.intlayerContentConfiguration.fileExtensions,
|
|
55
|
-
'array'
|
|
56
|
-
)!,
|
|
57
|
-
baseDir: getEnvValue(env.intlayerContentConfiguration.baseDir, 'string')!,
|
|
58
|
-
contentDirName: getEnvValue(
|
|
59
|
-
env.intlayerContentConfiguration.contentDirName,
|
|
60
|
-
'string'
|
|
61
|
-
)!,
|
|
62
|
-
contentDir: getEnvValue(
|
|
63
|
-
env.intlayerContentConfiguration.contentDir,
|
|
64
|
-
'string'
|
|
65
|
-
)!,
|
|
66
|
-
excludedPath: getEnvValue<string>(
|
|
67
|
-
env.intlayerContentConfiguration.excludedPath,
|
|
68
|
-
'array'
|
|
69
|
-
)!,
|
|
70
|
-
resultDirName: getEnvValue(
|
|
71
|
-
env.intlayerContentConfiguration.resultDirName,
|
|
72
|
-
'string'
|
|
73
|
-
)!,
|
|
74
|
-
resultDir: getEnvValue(env.intlayerContentConfiguration.resultDir, 'string')!,
|
|
75
|
-
moduleAugmentationDirName: getEnvValue(
|
|
76
|
-
env.intlayerContentConfiguration.moduleAugmentationDirName,
|
|
77
|
-
'string'
|
|
78
|
-
)!,
|
|
79
|
-
moduleAugmentationDir: getEnvValue(
|
|
80
|
-
env.intlayerContentConfiguration.moduleAugmentationDir,
|
|
81
|
-
'string'
|
|
82
|
-
)!,
|
|
83
|
-
dictionariesDirName: getEnvValue(
|
|
84
|
-
env.intlayerContentConfiguration.dictionariesDirName,
|
|
85
|
-
'string'
|
|
86
|
-
)!,
|
|
87
|
-
dictionariesDir: getEnvValue(
|
|
88
|
-
env.intlayerContentConfiguration.dictionariesDir,
|
|
89
|
-
'string'
|
|
90
|
-
)!,
|
|
91
|
-
typeDirName: getEnvValue(
|
|
92
|
-
env.intlayerContentConfiguration.typeDirName,
|
|
93
|
-
'string'
|
|
94
|
-
)!,
|
|
95
|
-
typesDir: getEnvValue(env.intlayerContentConfiguration.typesDir, 'string')!,
|
|
96
|
-
mainDirName: getEnvValue(
|
|
97
|
-
env.intlayerContentConfiguration.mainDirName,
|
|
98
|
-
'string'
|
|
99
|
-
)!,
|
|
100
|
-
mainDir: getEnvValue(env.intlayerContentConfiguration.mainDir, 'string')!,
|
|
101
|
-
watchedFilesPattern: getEnvValue<string>(
|
|
102
|
-
env.intlayerContentConfiguration.watchedFilesPattern,
|
|
103
|
-
'array'
|
|
104
|
-
)!,
|
|
105
|
-
watchedFilesPatternWithPath: getEnvValue<string>(
|
|
106
|
-
env.intlayerContentConfiguration.watchedFilesPatternWithPath,
|
|
107
|
-
'array'
|
|
108
|
-
)!,
|
|
109
|
-
outputFilesPatternWithPath: getEnvValue(
|
|
110
|
-
env.intlayerContentConfiguration.outputFilesPatternWithPath,
|
|
111
|
-
'string'
|
|
112
|
-
)!,
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export const intlayerConfiguration: IntlayerConfig = {
|
|
116
|
-
internationalization: intlayerIntlConfiguration,
|
|
117
|
-
middleware: intlayerMiddlewareConfiguration,
|
|
118
|
-
content: intlayerContentConfiguration,
|
|
119
|
-
};
|
|
120
|
-
|
|
121
13
|
/**
|
|
122
14
|
* Get all configuration values using environment variables
|
|
123
15
|
* Can be used in the client side as the server side
|
|
124
16
|
* To use it, be sure to have the environment variables set
|
|
125
17
|
*/
|
|
126
|
-
export const getConfiguration = (): IntlayerConfig =>
|
|
18
|
+
export const getConfiguration = (): IntlayerConfig => {
|
|
19
|
+
const env = extractEnvVariable();
|
|
20
|
+
|
|
21
|
+
const intlayerIntlConfiguration: InternationalizationConfig = {
|
|
22
|
+
locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,
|
|
23
|
+
defaultLocale: getEnvValue<Locales>(
|
|
24
|
+
env?.internationalization.defaultLocale,
|
|
25
|
+
'string'
|
|
26
|
+
)!,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const intlayerMiddlewareConfiguration: MiddlewareConfig = {
|
|
30
|
+
headerName: getEnvValue(env.middleware.headerName, 'string')!,
|
|
31
|
+
cookieName: getEnvValue(env.middleware.cookieName, 'string')!,
|
|
32
|
+
prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,
|
|
33
|
+
basePath: getEnvValue(env.middleware.basePath, 'string')!,
|
|
34
|
+
serverSetCookie: getEnvValue<ServerSetCookieRule>(
|
|
35
|
+
env.middleware.serverSetCookie,
|
|
36
|
+
'string'
|
|
37
|
+
)!,
|
|
38
|
+
noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const intlayerContentConfiguration: ContentConfig = {
|
|
42
|
+
fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,
|
|
43
|
+
baseDir: getEnvValue(env.content.baseDir, 'string')!,
|
|
44
|
+
contentDirName: getEnvValue(env.content.contentDirName, 'string')!,
|
|
45
|
+
contentDir: getEnvValue(env.content.contentDir, 'string')!,
|
|
46
|
+
excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,
|
|
47
|
+
resultDirName: getEnvValue(env.content.resultDirName, 'string')!,
|
|
48
|
+
resultDir: getEnvValue(env.content.resultDir, 'string')!,
|
|
49
|
+
moduleAugmentationDirName: getEnvValue(
|
|
50
|
+
env.content.moduleAugmentationDirName,
|
|
51
|
+
'string'
|
|
52
|
+
)!,
|
|
53
|
+
moduleAugmentationDir: getEnvValue(
|
|
54
|
+
env.content.moduleAugmentationDir,
|
|
55
|
+
'string'
|
|
56
|
+
)!,
|
|
57
|
+
dictionaryOutput: getEnvValue<DictionaryOutput>(
|
|
58
|
+
env.content.dictionaryOutput,
|
|
59
|
+
'array'
|
|
60
|
+
)!,
|
|
61
|
+
dictionariesDirName: getEnvValue(
|
|
62
|
+
env.content.dictionariesDirName,
|
|
63
|
+
'string'
|
|
64
|
+
)!,
|
|
65
|
+
dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,
|
|
66
|
+
i18nDictionariesDirName: getEnvValue(
|
|
67
|
+
env.content.i18nDictionariesDirName,
|
|
68
|
+
'string'
|
|
69
|
+
)!,
|
|
70
|
+
i18nDictionariesDir: getEnvValue(
|
|
71
|
+
env.content.i18nDictionariesDir,
|
|
72
|
+
'string'
|
|
73
|
+
)!,
|
|
74
|
+
typeDirName: getEnvValue(env.content.typeDirName, 'string')!,
|
|
75
|
+
typesDir: getEnvValue(env.content.typesDir, 'string')!,
|
|
76
|
+
mainDirName: getEnvValue(env.content.mainDirName, 'string')!,
|
|
77
|
+
mainDir: getEnvValue(env.content.mainDir, 'string')!,
|
|
78
|
+
watchedFilesPattern: getEnvValue<string>(
|
|
79
|
+
env.content.watchedFilesPattern,
|
|
80
|
+
'array'
|
|
81
|
+
)!,
|
|
82
|
+
watchedFilesPatternWithPath: getEnvValue<string>(
|
|
83
|
+
env.content.watchedFilesPatternWithPath,
|
|
84
|
+
'array'
|
|
85
|
+
)!,
|
|
86
|
+
outputFilesPatternWithPath: getEnvValue(
|
|
87
|
+
env.content.outputFilesPatternWithPath,
|
|
88
|
+
'string'
|
|
89
|
+
)!,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const intlayerConfiguration: IntlayerConfig = {
|
|
93
|
+
internationalization: intlayerIntlConfiguration,
|
|
94
|
+
middleware: intlayerMiddlewareConfiguration,
|
|
95
|
+
content: intlayerContentConfiguration,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return intlayerConfiguration;
|
|
99
|
+
};
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
intlayerIntlConfiguration,
|
|
3
|
-
intlayerMiddlewareConfiguration,
|
|
4
|
-
intlayerContentConfiguration,
|
|
5
|
-
intlayerConfiguration,
|
|
6
|
-
getConfiguration,
|
|
7
|
-
} from './getConfiguration';
|
|
1
|
+
export { getConfiguration } from './getConfiguration';
|
|
8
2
|
export { formatEnvVariable } from './formatEnvVariable';
|
package/src/index.ts
CHANGED
|
@@ -16,9 +16,5 @@ export type { LocalesValues } from './types/locales';
|
|
|
16
16
|
export { Locales } from './types/locales';
|
|
17
17
|
export {
|
|
18
18
|
formatEnvVariable,
|
|
19
|
-
intlayerIntlConfiguration,
|
|
20
|
-
intlayerMiddlewareConfiguration,
|
|
21
|
-
intlayerContentConfiguration,
|
|
22
|
-
intlayerConfiguration,
|
|
23
19
|
getConfiguration as getClientConfiguration,
|
|
24
20
|
} from './envVariables/index';
|