@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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const extractEmptyEnvVariable = () => {
|
|
2
|
+
const internationalization = {
|
|
3
|
+
locales: void 0,
|
|
4
|
+
defaultLocale: void 0
|
|
5
|
+
};
|
|
6
|
+
const middleware = {
|
|
7
|
+
headerName: void 0,
|
|
8
|
+
cookieName: void 0,
|
|
9
|
+
prefixDefault: void 0,
|
|
10
|
+
basePath: void 0,
|
|
11
|
+
serverSetCookie: void 0,
|
|
12
|
+
noPrefix: void 0
|
|
13
|
+
};
|
|
14
|
+
const content = {
|
|
15
|
+
fileExtensions: void 0,
|
|
16
|
+
baseDir: void 0,
|
|
17
|
+
contentDirName: void 0,
|
|
18
|
+
contentDir: void 0,
|
|
19
|
+
excludedPath: void 0,
|
|
20
|
+
resultDirName: void 0,
|
|
21
|
+
moduleAugmentationDirName: void 0,
|
|
22
|
+
dictionariesDirName: void 0,
|
|
23
|
+
i18nDictionariesDirName: void 0,
|
|
24
|
+
typeDirName: void 0,
|
|
25
|
+
mainDirName: void 0,
|
|
26
|
+
resultDir: void 0,
|
|
27
|
+
moduleAugmentationDir: void 0,
|
|
28
|
+
dictionariesDir: void 0,
|
|
29
|
+
i18nDictionariesDir: void 0,
|
|
30
|
+
typesDir: void 0,
|
|
31
|
+
mainDir: void 0,
|
|
32
|
+
watchedFilesPattern: void 0,
|
|
33
|
+
watchedFilesPatternWithPath: void 0,
|
|
34
|
+
outputFilesPatternWithPath: void 0,
|
|
35
|
+
dictionaryOutput: void 0
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
internationalization,
|
|
39
|
+
middleware,
|
|
40
|
+
content
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
extractEmptyEnvVariable
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=undefined_platform.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"sourcesContent":["import type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n} from '../../types/config';\nimport type { ReplaceValue, IntlayerConfigEnvVariable } from './types';\n\nexport const extractEmptyEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: undefined,\n defaultLocale: undefined,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: undefined,\n cookieName: undefined,\n prefixDefault: undefined,\n basePath: undefined,\n serverSetCookie: undefined,\n noPrefix: undefined,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: undefined,\n baseDir: undefined,\n contentDirName: undefined,\n contentDir: undefined,\n excludedPath: undefined,\n resultDirName: undefined,\n moduleAugmentationDirName: undefined,\n dictionariesDirName: undefined,\n i18nDictionariesDirName: undefined,\n typeDirName: undefined,\n mainDirName: undefined,\n resultDir: undefined,\n moduleAugmentationDir: undefined,\n dictionariesDir: undefined,\n i18nDictionariesDir: undefined,\n typesDir: undefined,\n mainDir: undefined,\n watchedFilesPattern: undefined,\n watchedFilesPatternWithPath: undefined,\n outputFilesPatternWithPath: undefined,\n dictionaryOutput: undefined,\n };\n\n return {\n internationalization,\n middleware,\n content,\n };\n};\n"],"mappings":"AAOO,MAAM,0BAA0B,MAAiC;AACtE,QAAM,uBAAiE;AAAA,IACrE,SAAS;AAAA,IACT,eAAe;AAAA,EACjB;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,UAAU;AAAA,EACZ;AAEA,QAAM,UAAuC;AAAA,IAC3C,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,IACf,2BAA2B;AAAA,IAC3B,qBAAqB;AAAA,IACrB,yBAAyB;AAAA,IACzB,aAAa;AAAA,IACb,aAAa;AAAA,IACb,WAAW;AAAA,IACX,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,UAAU;AAAA,IACV,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,6BAA6B;AAAA,IAC7B,4BAA4B;AAAA,IAC5B,kBAAkB;AAAA,EACpB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { extractEmptyEnvVariable } from './undefined_platform.mjs';
|
|
2
|
+
const extractViteEnvVariable = () => {
|
|
3
|
+
if (!import.meta.env) {
|
|
4
|
+
console.error(
|
|
5
|
+
"Vite env variables cannot be loaded on a commonjs environment."
|
|
6
|
+
);
|
|
7
|
+
return extractEmptyEnvVariable();
|
|
8
|
+
}
|
|
9
|
+
const internationalization = {
|
|
10
|
+
locales: import.meta.env.VITE_INTLAYER_LOCALES,
|
|
11
|
+
defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE
|
|
12
|
+
};
|
|
13
|
+
const middleware = {
|
|
14
|
+
headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,
|
|
15
|
+
cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,
|
|
16
|
+
prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,
|
|
17
|
+
basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,
|
|
18
|
+
serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,
|
|
19
|
+
noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX
|
|
20
|
+
};
|
|
21
|
+
const content = {
|
|
22
|
+
fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,
|
|
23
|
+
baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,
|
|
24
|
+
contentDirName: import.meta.env.VITE_INTLAYER_CONTENT_DIR_NAME,
|
|
25
|
+
contentDir: import.meta.env.VITE_INTLAYER_CONTENT_DIR,
|
|
26
|
+
excludedPath: import.meta.env.VITE_INTLAYER_EXCLUDED_PATH,
|
|
27
|
+
resultDirName: import.meta.env.VITE_INTLAYER_RESULT_DIR_NAME,
|
|
28
|
+
moduleAugmentationDirName: import.meta.env.VITE_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
|
|
29
|
+
dictionariesDirName: import.meta.env.VITE_INTLAYER_DICTIONARIES_DIR_NAME,
|
|
30
|
+
i18nDictionariesDirName: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
|
|
31
|
+
typeDirName: import.meta.env.VITE_INTLAYER_TYPE_DIR_NAME,
|
|
32
|
+
mainDirName: import.meta.env.VITE_INTLAYER_MAIN_DIR_NAME,
|
|
33
|
+
resultDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,
|
|
34
|
+
moduleAugmentationDir: import.meta.env.VITE_INTLAYER_MODULE_AUGMENTATION_DIR,
|
|
35
|
+
dictionariesDir: import.meta.env.VITE_INTLAYER_DICTIONARIES_DIR,
|
|
36
|
+
i18nDictionariesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,
|
|
37
|
+
typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,
|
|
38
|
+
mainDir: import.meta.env.VITE_INTLAYER_MAIN_DIR,
|
|
39
|
+
watchedFilesPattern: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,
|
|
40
|
+
watchedFilesPatternWithPath: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
|
|
41
|
+
outputFilesPatternWithPath: import.meta.env.VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
|
|
42
|
+
dictionaryOutput: import.meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
internationalization,
|
|
46
|
+
middleware,
|
|
47
|
+
content
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
extractViteEnvVariable
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=vite.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"sourcesContent":["import type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\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 console.error(\n 'Vite env variables cannot be loaded on a commonjs environment.'\n );\n return extractEmptyEnvVariable();\n }\n\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: import.meta.env.VITE_INTLAYER_LOCALES,\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 contentDirName: import.meta.env.VITE_INTLAYER_CONTENT_DIR_NAME,\n contentDir: import.meta.env.VITE_INTLAYER_CONTENT_DIR,\n excludedPath: import.meta.env.VITE_INTLAYER_EXCLUDED_PATH,\n resultDirName: import.meta.env.VITE_INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName: import.meta.env\n .VITE_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: import.meta.env.VITE_INTLAYER_DICTIONARIES_DIR_NAME,\n i18nDictionariesDirName: import.meta.env\n .VITE_INTLAYER_I18N_DICTIONARIES_DIR_NAME,\n typeDirName: import.meta.env.VITE_INTLAYER_TYPE_DIR_NAME,\n mainDirName: import.meta.env.VITE_INTLAYER_MAIN_DIR_NAME,\n resultDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,\n moduleAugmentationDir: import.meta.env\n .VITE_INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: import.meta.env.VITE_INTLAYER_DICTIONARIES_DIR,\n i18nDictionariesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,\n typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,\n mainDir: import.meta.env.VITE_INTLAYER_MAIN_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 };\n\n return {\n internationalization,\n middleware,\n content,\n };\n};\n"],"mappings":"AAMA,SAAS,+BAA+B;AAEjC,MAAM,yBAAyB,MAAiC;AACrE,MAAI,CAAC,YAAY,KAAK;AACpB,YAAQ;AAAA,MACN;AAAA,IACF;AACA,WAAO,wBAAwB;AAAA,EACjC;AAEA,QAAM,uBAAiE;AAAA,IACrE,SAAS,YAAY,IAAI;AAAA,IACzB,eAAe,YAAY,IAAI;AAAA,EACjC;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,YAAY,IAAI;AAAA,IAC5B,YAAY,YAAY,IAAI;AAAA,IAC5B,eAAe,YAAY,IAAI;AAAA,IAC/B,UAAU,YAAY,IAAI;AAAA,IAC1B,iBAAiB,YAAY,IAAI;AAAA,IACjC,UAAU,YAAY,IAAI;AAAA,EAC5B;AAEA,QAAM,UAAuC;AAAA,IAC3C,gBAAgB,YAAY,IAAI;AAAA,IAChC,SAAS,YAAY,IAAI;AAAA,IACzB,gBAAgB,YAAY,IAAI;AAAA,IAChC,YAAY,YAAY,IAAI;AAAA,IAC5B,cAAc,YAAY,IAAI;AAAA,IAC9B,eAAe,YAAY,IAAI;AAAA,IAC/B,2BAA2B,YAAY,IACpC;AAAA,IACH,qBAAqB,YAAY,IAAI;AAAA,IACrC,yBAAyB,YAAY,IAClC;AAAA,IACH,aAAa,YAAY,IAAI;AAAA,IAC7B,aAAa,YAAY,IAAI;AAAA,IAC7B,WAAW,YAAY,IAAI;AAAA,IAC3B,uBAAuB,YAAY,IAChC;AAAA,IACH,iBAAiB,YAAY,IAAI;AAAA,IACjC,qBAAqB,YAAY,IAAI;AAAA,IACrC,UAAU,YAAY,IAAI;AAAA,IAC1B,SAAS,YAAY,IAAI;AAAA,IACzB,qBAAqB,YAAY,IAAI;AAAA,IACrC,6BAA6B,YAAY,IACtC;AAAA,IACH,4BAA4B,YAAY,IACrC;AAAA,IACH,kBAAkB,YAAY,IAAI;AAAA,EACpC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=vite_env.d.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntlayerConfig } from '../types/config.mjs';
|
|
2
2
|
import '../types/locales.mjs';
|
|
3
3
|
|
|
4
|
-
declare const intlayerIntlConfiguration: InternationalizationConfig;
|
|
5
|
-
declare const intlayerMiddlewareConfiguration: MiddlewareConfig;
|
|
6
|
-
declare const intlayerContentConfiguration: ContentConfig;
|
|
7
|
-
declare const intlayerConfiguration: IntlayerConfig;
|
|
8
4
|
/**
|
|
9
5
|
* Get all configuration values using environment variables
|
|
10
6
|
* Can be used in the client side as the server side
|
|
@@ -12,4 +8,4 @@ declare const intlayerConfiguration: IntlayerConfig;
|
|
|
12
8
|
*/
|
|
13
9
|
declare const getConfiguration: () => IntlayerConfig;
|
|
14
10
|
|
|
15
|
-
export { getConfiguration
|
|
11
|
+
export { getConfiguration };
|
|
@@ -1,115 +1,83 @@
|
|
|
1
|
-
import { extractEnvVariable } from './extractEnvVariable.mjs';
|
|
1
|
+
import { extractEnvVariable } from './extractEnvVariable/index.mjs';
|
|
2
2
|
import { getEnvValue } from './utils.mjs';
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
env.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
const getConfiguration = () => {
|
|
4
|
+
const env = extractEnvVariable();
|
|
5
|
+
const intlayerIntlConfiguration = {
|
|
6
|
+
locales: getEnvValue(env.internationalization.locales, "array"),
|
|
7
|
+
defaultLocale: getEnvValue(
|
|
8
|
+
env?.internationalization.defaultLocale,
|
|
9
|
+
"string"
|
|
10
|
+
)
|
|
11
|
+
};
|
|
12
|
+
const intlayerMiddlewareConfiguration = {
|
|
13
|
+
headerName: getEnvValue(env.middleware.headerName, "string"),
|
|
14
|
+
cookieName: getEnvValue(env.middleware.cookieName, "string"),
|
|
15
|
+
prefixDefault: getEnvValue(env.middleware.prefixDefault, "boolean"),
|
|
16
|
+
basePath: getEnvValue(env.middleware.basePath, "string"),
|
|
17
|
+
serverSetCookie: getEnvValue(
|
|
18
|
+
env.middleware.serverSetCookie,
|
|
19
|
+
"string"
|
|
20
|
+
),
|
|
21
|
+
noPrefix: getEnvValue(env.middleware.noPrefix, "boolean")
|
|
22
|
+
};
|
|
23
|
+
const intlayerContentConfiguration = {
|
|
24
|
+
fileExtensions: getEnvValue(env.content.fileExtensions, "array"),
|
|
25
|
+
baseDir: getEnvValue(env.content.baseDir, "string"),
|
|
26
|
+
contentDirName: getEnvValue(env.content.contentDirName, "string"),
|
|
27
|
+
contentDir: getEnvValue(env.content.contentDir, "string"),
|
|
28
|
+
excludedPath: getEnvValue(env.content.excludedPath, "array"),
|
|
29
|
+
resultDirName: getEnvValue(env.content.resultDirName, "string"),
|
|
30
|
+
resultDir: getEnvValue(env.content.resultDir, "string"),
|
|
31
|
+
moduleAugmentationDirName: getEnvValue(
|
|
32
|
+
env.content.moduleAugmentationDirName,
|
|
33
|
+
"string"
|
|
34
|
+
),
|
|
35
|
+
moduleAugmentationDir: getEnvValue(
|
|
36
|
+
env.content.moduleAugmentationDir,
|
|
37
|
+
"string"
|
|
38
|
+
),
|
|
39
|
+
dictionaryOutput: getEnvValue(
|
|
40
|
+
env.content.dictionaryOutput,
|
|
41
|
+
"array"
|
|
42
|
+
),
|
|
43
|
+
dictionariesDirName: getEnvValue(
|
|
44
|
+
env.content.dictionariesDirName,
|
|
45
|
+
"string"
|
|
46
|
+
),
|
|
47
|
+
dictionariesDir: getEnvValue(env.content.dictionariesDir, "string"),
|
|
48
|
+
i18nDictionariesDirName: getEnvValue(
|
|
49
|
+
env.content.i18nDictionariesDirName,
|
|
50
|
+
"string"
|
|
51
|
+
),
|
|
52
|
+
i18nDictionariesDir: getEnvValue(
|
|
53
|
+
env.content.i18nDictionariesDir,
|
|
54
|
+
"string"
|
|
55
|
+
),
|
|
56
|
+
typeDirName: getEnvValue(env.content.typeDirName, "string"),
|
|
57
|
+
typesDir: getEnvValue(env.content.typesDir, "string"),
|
|
58
|
+
mainDirName: getEnvValue(env.content.mainDirName, "string"),
|
|
59
|
+
mainDir: getEnvValue(env.content.mainDir, "string"),
|
|
60
|
+
watchedFilesPattern: getEnvValue(
|
|
61
|
+
env.content.watchedFilesPattern,
|
|
62
|
+
"array"
|
|
63
|
+
),
|
|
64
|
+
watchedFilesPatternWithPath: getEnvValue(
|
|
65
|
+
env.content.watchedFilesPatternWithPath,
|
|
66
|
+
"array"
|
|
67
|
+
),
|
|
68
|
+
outputFilesPatternWithPath: getEnvValue(
|
|
69
|
+
env.content.outputFilesPatternWithPath,
|
|
70
|
+
"string"
|
|
71
|
+
)
|
|
72
|
+
};
|
|
73
|
+
const intlayerConfiguration = {
|
|
74
|
+
internationalization: intlayerIntlConfiguration,
|
|
75
|
+
middleware: intlayerMiddlewareConfiguration,
|
|
76
|
+
content: intlayerContentConfiguration
|
|
77
|
+
};
|
|
78
|
+
return intlayerConfiguration;
|
|
13
79
|
};
|
|
14
|
-
const intlayerMiddlewareConfiguration = {
|
|
15
|
-
headerName: getEnvValue(
|
|
16
|
-
env.intlayerMiddlewareConfiguration.headerName,
|
|
17
|
-
"string"
|
|
18
|
-
),
|
|
19
|
-
cookieName: getEnvValue(
|
|
20
|
-
env.intlayerMiddlewareConfiguration.cookieName,
|
|
21
|
-
"string"
|
|
22
|
-
),
|
|
23
|
-
prefixDefault: getEnvValue(
|
|
24
|
-
env.intlayerMiddlewareConfiguration.prefixDefault,
|
|
25
|
-
"boolean"
|
|
26
|
-
),
|
|
27
|
-
basePath: getEnvValue(
|
|
28
|
-
env.intlayerMiddlewareConfiguration.basePath,
|
|
29
|
-
"string"
|
|
30
|
-
),
|
|
31
|
-
serverSetCookie: getEnvValue(
|
|
32
|
-
env.intlayerMiddlewareConfiguration.serverSetCookie,
|
|
33
|
-
"string"
|
|
34
|
-
),
|
|
35
|
-
noPrefix: getEnvValue(
|
|
36
|
-
env.intlayerMiddlewareConfiguration.noPrefix,
|
|
37
|
-
"boolean"
|
|
38
|
-
)
|
|
39
|
-
};
|
|
40
|
-
const intlayerContentConfiguration = {
|
|
41
|
-
fileExtensions: getEnvValue(
|
|
42
|
-
env.intlayerContentConfiguration.fileExtensions,
|
|
43
|
-
"array"
|
|
44
|
-
),
|
|
45
|
-
baseDir: getEnvValue(env.intlayerContentConfiguration.baseDir, "string"),
|
|
46
|
-
contentDirName: getEnvValue(
|
|
47
|
-
env.intlayerContentConfiguration.contentDirName,
|
|
48
|
-
"string"
|
|
49
|
-
),
|
|
50
|
-
contentDir: getEnvValue(
|
|
51
|
-
env.intlayerContentConfiguration.contentDir,
|
|
52
|
-
"string"
|
|
53
|
-
),
|
|
54
|
-
excludedPath: getEnvValue(
|
|
55
|
-
env.intlayerContentConfiguration.excludedPath,
|
|
56
|
-
"array"
|
|
57
|
-
),
|
|
58
|
-
resultDirName: getEnvValue(
|
|
59
|
-
env.intlayerContentConfiguration.resultDirName,
|
|
60
|
-
"string"
|
|
61
|
-
),
|
|
62
|
-
resultDir: getEnvValue(env.intlayerContentConfiguration.resultDir, "string"),
|
|
63
|
-
moduleAugmentationDirName: getEnvValue(
|
|
64
|
-
env.intlayerContentConfiguration.moduleAugmentationDirName,
|
|
65
|
-
"string"
|
|
66
|
-
),
|
|
67
|
-
moduleAugmentationDir: getEnvValue(
|
|
68
|
-
env.intlayerContentConfiguration.moduleAugmentationDir,
|
|
69
|
-
"string"
|
|
70
|
-
),
|
|
71
|
-
dictionariesDirName: getEnvValue(
|
|
72
|
-
env.intlayerContentConfiguration.dictionariesDirName,
|
|
73
|
-
"string"
|
|
74
|
-
),
|
|
75
|
-
dictionariesDir: getEnvValue(
|
|
76
|
-
env.intlayerContentConfiguration.dictionariesDir,
|
|
77
|
-
"string"
|
|
78
|
-
),
|
|
79
|
-
typeDirName: getEnvValue(
|
|
80
|
-
env.intlayerContentConfiguration.typeDirName,
|
|
81
|
-
"string"
|
|
82
|
-
),
|
|
83
|
-
typesDir: getEnvValue(env.intlayerContentConfiguration.typesDir, "string"),
|
|
84
|
-
mainDirName: getEnvValue(
|
|
85
|
-
env.intlayerContentConfiguration.mainDirName,
|
|
86
|
-
"string"
|
|
87
|
-
),
|
|
88
|
-
mainDir: getEnvValue(env.intlayerContentConfiguration.mainDir, "string"),
|
|
89
|
-
watchedFilesPattern: getEnvValue(
|
|
90
|
-
env.intlayerContentConfiguration.watchedFilesPattern,
|
|
91
|
-
"array"
|
|
92
|
-
),
|
|
93
|
-
watchedFilesPatternWithPath: getEnvValue(
|
|
94
|
-
env.intlayerContentConfiguration.watchedFilesPatternWithPath,
|
|
95
|
-
"array"
|
|
96
|
-
),
|
|
97
|
-
outputFilesPatternWithPath: getEnvValue(
|
|
98
|
-
env.intlayerContentConfiguration.outputFilesPatternWithPath,
|
|
99
|
-
"string"
|
|
100
|
-
)
|
|
101
|
-
};
|
|
102
|
-
const intlayerConfiguration = {
|
|
103
|
-
internationalization: intlayerIntlConfiguration,
|
|
104
|
-
middleware: intlayerMiddlewareConfiguration,
|
|
105
|
-
content: intlayerContentConfiguration
|
|
106
|
-
};
|
|
107
|
-
const getConfiguration = () => intlayerConfiguration;
|
|
108
80
|
export {
|
|
109
|
-
getConfiguration
|
|
110
|
-
intlayerConfiguration,
|
|
111
|
-
intlayerContentConfiguration,
|
|
112
|
-
intlayerIntlConfiguration,
|
|
113
|
-
intlayerMiddlewareConfiguration
|
|
81
|
+
getConfiguration
|
|
114
82
|
};
|
|
115
83
|
//# sourceMappingURL=getConfiguration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n ContentConfig,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport { extractEnvVariable } from './extractEnvVariable';\nimport { getEnvValue } from './utils';\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport { extractEnvVariable } 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 = (): IntlayerConfig => {\n const env = extractEnvVariable();\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\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 contentDirName: getEnvValue(env.content.contentDirName, 'string')!,\n contentDir: getEnvValue(env.content.contentDir, 'string')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n resultDirName: getEnvValue(env.content.resultDirName, 'string')!,\n resultDir: getEnvValue(env.content.resultDir, 'string')!,\n moduleAugmentationDirName: getEnvValue(\n env.content.moduleAugmentationDirName,\n 'string'\n )!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n dictionariesDirName: getEnvValue(\n env.content.dictionariesDirName,\n 'string'\n )!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n i18nDictionariesDirName: getEnvValue(\n env.content.i18nDictionariesDirName,\n 'string'\n )!,\n i18nDictionariesDir: getEnvValue(\n env.content.i18nDictionariesDir,\n 'string'\n )!,\n typeDirName: getEnvValue(env.content.typeDirName, 'string')!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDirName: getEnvValue(env.content.mainDirName, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, '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 };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":"AASA,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAOrB,MAAM,mBAAmB,MAAsB;AACpD,QAAM,MAAM,mBAAmB;AAE/B,QAAM,4BAAwD;AAAA,IAC5D,SAAS,YAAqB,IAAI,qBAAqB,SAAS,OAAO;AAAA,IACvE,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,gBAAgB,YAAY,IAAI,QAAQ,gBAAgB,QAAQ;AAAA,IAChE,YAAY,YAAY,IAAI,QAAQ,YAAY,QAAQ;AAAA,IACxD,cAAc,YAAoB,IAAI,QAAQ,cAAc,OAAO;AAAA,IACnE,eAAe,YAAY,IAAI,QAAQ,eAAe,QAAQ;AAAA,IAC9D,WAAW,YAAY,IAAI,QAAQ,WAAW,QAAQ;AAAA,IACtD,2BAA2B;AAAA,MACzB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,uBAAuB;AAAA,MACrB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,iBAAiB,YAAY,IAAI,QAAQ,iBAAiB,QAAQ;AAAA,IAClE,yBAAyB;AAAA,MACvB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,aAAa,YAAY,IAAI,QAAQ,aAAa,QAAQ;AAAA,IAC1D,UAAU,YAAY,IAAI,QAAQ,UAAU,QAAQ;AAAA,IACpD,aAAa,YAAY,IAAI,QAAQ,aAAa,QAAQ;AAAA,IAC1D,SAAS,YAAY,IAAI,QAAQ,SAAS,QAAQ;AAAA,IAClD,qBAAqB;AAAA,MACnB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,6BAA6B;AAAA,MAC3B,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,4BAA4B;AAAA,MAC1B,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,QAAM,wBAAwC;AAAA,IAC5C,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getConfiguration
|
|
1
|
+
export { getConfiguration } from './getConfiguration.mjs';
|
|
2
2
|
export { formatEnvVariable } from './formatEnvVariable.mjs';
|
|
3
3
|
import '../types/config.mjs';
|
|
4
4
|
import '../types/locales.mjs';
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
intlayerIntlConfiguration,
|
|
3
|
-
intlayerMiddlewareConfiguration,
|
|
4
|
-
intlayerContentConfiguration,
|
|
5
|
-
intlayerConfiguration,
|
|
6
|
-
getConfiguration
|
|
7
|
-
} from './getConfiguration.mjs';
|
|
1
|
+
import { getConfiguration } from './getConfiguration.mjs';
|
|
8
2
|
import { formatEnvVariable } from './formatEnvVariable.mjs';
|
|
9
3
|
export {
|
|
10
4
|
formatEnvVariable,
|
|
11
|
-
getConfiguration
|
|
12
|
-
intlayerConfiguration,
|
|
13
|
-
intlayerContentConfiguration,
|
|
14
|
-
intlayerIntlConfiguration,
|
|
15
|
-
intlayerMiddlewareConfiguration
|
|
5
|
+
getConfiguration
|
|
16
6
|
};
|
|
17
7
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/envVariables/index.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"sources":["../../../src/envVariables/index.ts"],"sourcesContent":["export { getConfiguration } from './getConfiguration';\nexport { formatEnvVariable } from './formatEnvVariable';\n"],"mappings":"AAAA,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;","names":[]}
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getConfiguration } from './configFile/getConfiguration.mjs';
|
|
2
2
|
export { BaseContentConfig, BaseDerivedConfig, ContentConfig, CustomIntlayerConfig, InternationalizationConfig, IntlayerConfig, MiddlewareConfig, PatternsContentConfig, ResultDirDerivedConfig, ServerSetCookieRule } from './types/config.mjs';
|
|
3
3
|
export { Locales, LocalesValues } from './types/locales.mjs';
|
|
4
|
-
export { getConfiguration as getClientConfiguration
|
|
4
|
+
export { getConfiguration as getClientConfiguration } from './envVariables/getConfiguration.mjs';
|
|
5
5
|
export { formatEnvVariable } from './envVariables/formatEnvVariable.mjs';
|
|
6
6
|
import './envVariables/detectPlatform.mjs';
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,20 +2,12 @@ import { getConfiguration } from './configFile/getConfiguration.mjs';
|
|
|
2
2
|
import { Locales } from './types/locales.mjs';
|
|
3
3
|
import {
|
|
4
4
|
formatEnvVariable,
|
|
5
|
-
intlayerIntlConfiguration,
|
|
6
|
-
intlayerMiddlewareConfiguration,
|
|
7
|
-
intlayerContentConfiguration,
|
|
8
|
-
intlayerConfiguration,
|
|
9
5
|
getConfiguration as getConfiguration2
|
|
10
6
|
} from './envVariables/index.mjs';
|
|
11
7
|
export {
|
|
12
8
|
Locales,
|
|
13
9
|
formatEnvVariable,
|
|
14
10
|
getConfiguration2 as getClientConfiguration,
|
|
15
|
-
getConfiguration
|
|
16
|
-
intlayerConfiguration,
|
|
17
|
-
intlayerContentConfiguration,
|
|
18
|
-
intlayerIntlConfiguration,
|
|
19
|
-
intlayerMiddlewareConfiguration
|
|
11
|
+
getConfiguration
|
|
20
12
|
};
|
|
21
13
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getConfiguration } from './configFile/getConfiguration';\n\nexport type {\n InternationalizationConfig,\n ServerSetCookieRule,\n MiddlewareConfig,\n CustomIntlayerConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n ResultDirDerivedConfig,\n PatternsContentConfig,\n ContentConfig,\n IntlayerConfig,\n} from './types/config';\nexport type { LocalesValues } from './types/locales';\nexport { Locales } from './types/locales';\nexport {\n formatEnvVariable,\n
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getConfiguration } from './configFile/getConfiguration';\n\nexport type {\n InternationalizationConfig,\n ServerSetCookieRule,\n MiddlewareConfig,\n CustomIntlayerConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n ResultDirDerivedConfig,\n PatternsContentConfig,\n ContentConfig,\n IntlayerConfig,\n} from './types/config';\nexport type { LocalesValues } from './types/locales';\nexport { Locales } from './types/locales';\nexport {\n formatEnvVariable,\n getConfiguration as getClientConfiguration,\n} from './envVariables/index';\n"],"mappings":"AAAA,SAAS,wBAAwB;AAejC,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACoB,oBAApBA;AAAA,OACK;","names":["getConfiguration"]}
|
|
@@ -116,7 +116,7 @@ type BaseContentConfig = {
|
|
|
116
116
|
/**
|
|
117
117
|
* File extensions of content to look for
|
|
118
118
|
*
|
|
119
|
-
* Default: ['.content.ts', '.content.js', '.content.json']
|
|
119
|
+
* Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']
|
|
120
120
|
*
|
|
121
121
|
* List of file extensions to scan for content.
|
|
122
122
|
*/
|
|
@@ -167,8 +167,22 @@ type BaseContentConfig = {
|
|
|
167
167
|
* Default: 'dictionary'
|
|
168
168
|
*
|
|
169
169
|
* The directory for storing localization dictionaries.
|
|
170
|
+
*
|
|
171
|
+
* Note:
|
|
172
|
+
* - Ensure the dictionaries output includes intlayer to build the dictionaries for intlayer
|
|
170
173
|
*/
|
|
171
174
|
dictionariesDirName: string;
|
|
175
|
+
/**
|
|
176
|
+
* Name of the directory where dictionaries are stored
|
|
177
|
+
*
|
|
178
|
+
* Default: 'i18n_dictionary'
|
|
179
|
+
*
|
|
180
|
+
* The directory for storing localization dictionaries.
|
|
181
|
+
*
|
|
182
|
+
* Note:
|
|
183
|
+
* - Ensure the dictionaries output includes 'i18next' to build the dictionaries for i18next
|
|
184
|
+
*/
|
|
185
|
+
i18nDictionariesDirName: string;
|
|
172
186
|
/**
|
|
173
187
|
* Name of the directory where dictionary types are stored
|
|
174
188
|
*
|
|
@@ -186,6 +200,7 @@ type BaseContentConfig = {
|
|
|
186
200
|
*/
|
|
187
201
|
mainDirName: string;
|
|
188
202
|
};
|
|
203
|
+
type DictionaryOutput = 'intlayer' | 'i18next';
|
|
189
204
|
/**
|
|
190
205
|
* Configuration derived based on the base content configuration
|
|
191
206
|
*/
|
|
@@ -214,6 +229,19 @@ type BaseDerivedConfig = {
|
|
|
214
229
|
* Defines the derived path for module augmentation.
|
|
215
230
|
*/
|
|
216
231
|
moduleAugmentationDir: string;
|
|
232
|
+
/**
|
|
233
|
+
* Type of dictionary to use as an output
|
|
234
|
+
*
|
|
235
|
+
* Default: ['intlayer']
|
|
236
|
+
*
|
|
237
|
+
* The type of dictionary to use as an output. It can be either 'intlayer' or 'i18next'.
|
|
238
|
+
*
|
|
239
|
+
* Note:
|
|
240
|
+
* - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.
|
|
241
|
+
* - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer
|
|
242
|
+
*
|
|
243
|
+
*/
|
|
244
|
+
dictionaryOutput: DictionaryOutput[];
|
|
217
245
|
};
|
|
218
246
|
/**
|
|
219
247
|
* Configuration derived based on the result directory
|
|
@@ -227,6 +255,18 @@ type ResultDirDerivedConfig = {
|
|
|
227
255
|
* Specifies the derived path for dictionaries relative to the result directory.
|
|
228
256
|
*/
|
|
229
257
|
dictionariesDir: string;
|
|
258
|
+
/**
|
|
259
|
+
*
|
|
260
|
+
* Directory where dictionaries are stored, relative to the result directory
|
|
261
|
+
*
|
|
262
|
+
* Default: {{resultDir}} / {{i18nDictionariesDirName}}
|
|
263
|
+
*
|
|
264
|
+
* Specifies the derived path for dictionaries relative to the result directory.
|
|
265
|
+
*
|
|
266
|
+
* Note:
|
|
267
|
+
* - Ensure the i18n dictionaries output includes i18next to build the dictionaries for i18next
|
|
268
|
+
*/
|
|
269
|
+
i18nDictionariesDir: string;
|
|
230
270
|
/**
|
|
231
271
|
* Directory where dictionary types are stored, relative to the result directory
|
|
232
272
|
*
|
|
@@ -251,7 +291,7 @@ type PatternsContentConfig = {
|
|
|
251
291
|
/**
|
|
252
292
|
* Patterns of files to watch for changes
|
|
253
293
|
*
|
|
254
|
-
* Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json']
|
|
294
|
+
* Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json', '/**\/*.content.cjs', '/**\/*.content.mjs', '/**\/*.content.tsx', '/**\/*.content.jsx']
|
|
255
295
|
*
|
|
256
296
|
* Defines file patterns for content to watch for changes.
|
|
257
297
|
*/
|
|
@@ -259,7 +299,7 @@ type PatternsContentConfig = {
|
|
|
259
299
|
/**
|
|
260
300
|
* Patterns of files to watch for changes including the relative path
|
|
261
301
|
*
|
|
262
|
-
* Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json']
|
|
302
|
+
* Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json', '{{contentDir}}/**\/*.content.cjs', '{{contentDir}}/**\/*.content.mjs', '{{contentDir}}/**\/*.content.tsx', '{{contentDir}}/**\/*.content.jsx']
|
|
263
303
|
*
|
|
264
304
|
* Specifies the file patterns for content to watch, including relative paths.
|
|
265
305
|
*/
|
|
@@ -278,4 +318,4 @@ type PatternsContentConfig = {
|
|
|
278
318
|
*/
|
|
279
319
|
type ContentConfig = BaseContentConfig & BaseDerivedConfig & ResultDirDerivedConfig & PatternsContentConfig;
|
|
280
320
|
|
|
281
|
-
export type { BaseContentConfig, BaseDerivedConfig, ContentConfig, CustomIntlayerConfig, InternationalizationConfig, IntlayerConfig, MiddlewareConfig, PatternsContentConfig, ResultDirDerivedConfig, ServerSetCookieRule };
|
|
321
|
+
export type { BaseContentConfig, BaseDerivedConfig, ContentConfig, CustomIntlayerConfig, DictionaryOutput, InternationalizationConfig, IntlayerConfig, MiddlewareConfig, PatternsContentConfig, ResultDirDerivedConfig, ServerSetCookieRule };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/config",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared configuration package for IntLayer - Layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
|
|
6
6
|
"keywords": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/node": "^20.12.7",
|
|
58
58
|
"esbuild": "^0.20.2",
|
|
59
59
|
"swc-loader": "^0.2.6",
|
|
60
|
-
"intlayer": "^1.2.
|
|
60
|
+
"intlayer": "^1.2.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"rimraf": "5.0.5",
|
package/src/client.ts
CHANGED
|
@@ -8,10 +8,4 @@ export type {
|
|
|
8
8
|
} from './types/config';
|
|
9
9
|
export type { LocalesValues } from './types/locales';
|
|
10
10
|
export { Locales } from './types/locales';
|
|
11
|
-
export {
|
|
12
|
-
getConfiguration,
|
|
13
|
-
intlayerConfiguration,
|
|
14
|
-
intlayerContentConfiguration,
|
|
15
|
-
intlayerIntlConfiguration,
|
|
16
|
-
intlayerMiddlewareConfiguration,
|
|
17
|
-
} from './envVariables/getConfiguration';
|
|
11
|
+
export { getConfiguration } from './envVariables/getConfiguration';
|