@intlayer/config 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.cjs +2 -10
- package/dist/cjs/client.cjs.map +1 -1
- package/dist/cjs/client.d.ts +2 -2
- package/dist/cjs/configFile/buildConfigurationFields.cjs +65 -5
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/defaultValues/editor.cjs +29 -0
- package/dist/cjs/defaultValues/editor.cjs.map +1 -0
- package/dist/cjs/defaultValues/editor.d.ts +3 -0
- package/dist/cjs/defaultValues/internationalization.cjs +5 -2
- package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
- package/dist/cjs/defaultValues/internationalization.d.ts +3 -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 +75 -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 +75 -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 +75 -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 +83 -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/formatEnvVariable.cjs +2 -1
- package/dist/cjs/envVariables/formatEnvVariable.cjs.map +1 -1
- package/dist/cjs/envVariables/getConfiguration.cjs +87 -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 +2 -2
- package/dist/cjs/types/config.cjs.map +1 -1
- package/dist/cjs/types/config.d.ts +75 -4
- package/dist/esm/client.d.mts +2 -2
- package/dist/esm/client.mjs +2 -12
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +73 -7
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/defaultValues/editor.d.mts +3 -0
- package/dist/esm/defaultValues/editor.mjs +5 -0
- package/dist/esm/defaultValues/editor.mjs.map +1 -0
- package/dist/esm/defaultValues/internationalization.d.mts +3 -1
- package/dist/esm/defaultValues/internationalization.mjs +3 -1
- package/dist/esm/defaultValues/internationalization.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 +51 -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 +51 -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 +51 -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 +58 -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/formatEnvVariable.mjs +2 -1
- package/dist/esm/envVariables/formatEnvVariable.mjs.map +1 -1
- package/dist/esm/envVariables/getConfiguration.d.mts +2 -6
- package/dist/esm/envVariables/getConfiguration.mjs +86 -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 +2 -2
- package/dist/esm/index.mjs +1 -9
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/types/config.d.mts +75 -4
- package/package.json +2 -2
- package/src/client.ts +5 -11
- package/src/configFile/buildConfigurationFields.ts +82 -4
- package/src/defaultValues/editor.ts +1 -0
- package/src/defaultValues/internationalization.ts +3 -0
- 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 +64 -0
- package/src/envVariables/extractEnvVariable/react_app.ts +64 -0
- package/src/envVariables/extractEnvVariable/types.ts +10 -0
- package/src/envVariables/extractEnvVariable/undefined_platform.ts +59 -0
- package/src/envVariables/extractEnvVariable/vite.ts +72 -0
- package/src/envVariables/extractEnvVariable/vite_env.d.ts +9 -0
- package/src/envVariables/formatEnvVariable.ts +1 -0
- package/src/envVariables/getConfiguration.ts +94 -111
- package/src/envVariables/index.ts +1 -7
- package/src/index.ts +1 -4
- package/src/types/config.ts +82 -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
package/dist/cjs/client.cjs
CHANGED
|
@@ -19,11 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var client_exports = {};
|
|
20
20
|
__export(client_exports, {
|
|
21
21
|
Locales: () => import_locales.Locales,
|
|
22
|
-
getConfiguration: () => import_getConfiguration.getConfiguration
|
|
23
|
-
intlayerConfiguration: () => import_getConfiguration.intlayerConfiguration,
|
|
24
|
-
intlayerContentConfiguration: () => import_getConfiguration.intlayerContentConfiguration,
|
|
25
|
-
intlayerIntlConfiguration: () => import_getConfiguration.intlayerIntlConfiguration,
|
|
26
|
-
intlayerMiddlewareConfiguration: () => import_getConfiguration.intlayerMiddlewareConfiguration
|
|
22
|
+
getConfiguration: () => import_getConfiguration.getConfiguration
|
|
27
23
|
});
|
|
28
24
|
module.exports = __toCommonJS(client_exports);
|
|
29
25
|
var import_locales = require('./types/locales.cjs');
|
|
@@ -31,10 +27,6 @@ var import_getConfiguration = require('./envVariables/getConfiguration.cjs');
|
|
|
31
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
28
|
0 && (module.exports = {
|
|
33
29
|
Locales,
|
|
34
|
-
getConfiguration
|
|
35
|
-
intlayerConfiguration,
|
|
36
|
-
intlayerContentConfiguration,
|
|
37
|
-
intlayerIntlConfiguration,
|
|
38
|
-
intlayerMiddlewareConfiguration
|
|
30
|
+
getConfiguration
|
|
39
31
|
});
|
|
40
32
|
//# sourceMappingURL=client.cjs.map
|
package/dist/cjs/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client.ts"],"sourcesContent":["export type {\n CustomIntlayerConfig,\n PatternsContentConfig
|
|
1
|
+
{"version":3,"sources":["../../src/client.ts"],"sourcesContent":["export type {\n CustomIntlayerConfig,\n PatternsContentConfig,\n IntlayerConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n ResultDirDerivedConfig,\n} from './types/config';\nexport type { LocalesValues } from './types/locales';\nexport { Locales } from './types/locales';\nexport { getConfiguration } from './envVariables/getConfiguration';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,qBAAwB;AACxB,8BAAiC;","names":[]}
|
package/dist/cjs/client.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { BaseDerivedConfig
|
|
1
|
+
export { BaseContentConfig, BaseDerivedConfig, CustomIntlayerConfig, IntlayerConfig, PatternsContentConfig, ResultDirDerivedConfig } from './types/config.js';
|
|
2
2
|
export { Locales, LocalesValues } from './types/locales.js';
|
|
3
|
-
export { getConfiguration
|
|
3
|
+
export { getConfiguration } from './envVariables/getConfiguration.js';
|
|
@@ -31,8 +31,18 @@ const buildInternationalizationFields = (customConfiguration) => ({
|
|
|
31
31
|
* Locales available in the application
|
|
32
32
|
*
|
|
33
33
|
* Default: ['en']
|
|
34
|
+
*
|
|
34
35
|
*/
|
|
35
36
|
locales: customConfiguration?.locales ?? import_internationalization.LOCALES,
|
|
37
|
+
/**
|
|
38
|
+
* Ensure strong implementations of internationalized content using typescript.
|
|
39
|
+
* - If set to "strict", the translation `t` function will require each declared locales to be defined. If one locale is missing, or if a locale is not declared in your config, it will throw an error.
|
|
40
|
+
* - If set to "required_only", the translation `t` function will require each declared locales to be defined. If one locale is missing, it will throw a warning. But will accept if a locale is not declared in your config, but exist.
|
|
41
|
+
* - If set to "loose", the translation `t` function will accept any existing locale.
|
|
42
|
+
*
|
|
43
|
+
* Default: "required_only"
|
|
44
|
+
*/
|
|
45
|
+
strictMode: customConfiguration?.strictMode ?? import_internationalization.STRICT_MODE,
|
|
36
46
|
/**
|
|
37
47
|
* Default locale of the application for fallback
|
|
38
48
|
*
|
|
@@ -99,7 +109,7 @@ const buildContentFields = (customConfiguration) => {
|
|
|
99
109
|
/**
|
|
100
110
|
* File extensions of content to look for to build the dictionaries
|
|
101
111
|
*
|
|
102
|
-
* - Default: ['.content.ts', '.content.js', '.content.json']
|
|
112
|
+
* - Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']
|
|
103
113
|
*
|
|
104
114
|
* - Example: ['.data.ts', '.data.js', '.data.json']
|
|
105
115
|
*
|
|
@@ -175,6 +185,20 @@ const buildContentFields = (customConfiguration) => {
|
|
|
175
185
|
*
|
|
176
186
|
*/
|
|
177
187
|
dictionariesDirName: customConfiguration?.dictionariesDirName ?? import_server.DICTIONARIES_DIR_NAME,
|
|
188
|
+
/**
|
|
189
|
+
* Related to the intlayer result directory
|
|
190
|
+
*
|
|
191
|
+
* Directory name where the dictionaries will be stored
|
|
192
|
+
*
|
|
193
|
+
* Default: 'dictionary'
|
|
194
|
+
*
|
|
195
|
+
* Example: 'translations'
|
|
196
|
+
*
|
|
197
|
+
* Note:
|
|
198
|
+
* - If this directory is not at the result directory level, update the dictionariesDir field instead
|
|
199
|
+
*
|
|
200
|
+
*/
|
|
201
|
+
i18nDictionariesDirName: customConfiguration?.i18nDictionariesDirName ?? import_server.I18N_DICTIONARIES_DIR_NAME,
|
|
178
202
|
/**
|
|
179
203
|
* Related to the intlayer result directory
|
|
180
204
|
*
|
|
@@ -266,7 +290,17 @@ const buildContentFields = (customConfiguration) => {
|
|
|
266
290
|
moduleAugmentationDir: (0, import_path.join)(
|
|
267
291
|
notDerivedContentConfig.baseDir,
|
|
268
292
|
notDerivedContentConfig.moduleAugmentationDirName
|
|
269
|
-
)
|
|
293
|
+
),
|
|
294
|
+
/**
|
|
295
|
+
* Output format of the dictionary
|
|
296
|
+
*
|
|
297
|
+
* Default: ['intlayer']
|
|
298
|
+
*
|
|
299
|
+
* Note:
|
|
300
|
+
* - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.
|
|
301
|
+
* - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer
|
|
302
|
+
*/
|
|
303
|
+
dictionaryOutput: customConfiguration?.dictionaryOutput ?? import_server.DICTIONARY_OUTPUT
|
|
270
304
|
};
|
|
271
305
|
const resultDirDerivedConfiguration = {
|
|
272
306
|
/**
|
|
@@ -288,6 +322,22 @@ const buildContentFields = (customConfiguration) => {
|
|
|
288
322
|
baseDirDerivedConfiguration.resultDir,
|
|
289
323
|
notDerivedContentConfig.dictionariesDirName
|
|
290
324
|
),
|
|
325
|
+
/**
|
|
326
|
+
* Directory where the 18n dictionaries will be stored
|
|
327
|
+
*
|
|
328
|
+
* Relative to the result directory
|
|
329
|
+
*
|
|
330
|
+
* Default: {{resultDir}} / {{i18nDictionariesDirName}}
|
|
331
|
+
*
|
|
332
|
+
* Example: '/path/to/project/.intlayer/dictionary/i18n'
|
|
333
|
+
*
|
|
334
|
+
* Note:
|
|
335
|
+
* - If the types are not at the result directory level, update the i18nDictionariesDirName field instead
|
|
336
|
+
*/
|
|
337
|
+
i18nDictionariesDir: (0, import_path.join)(
|
|
338
|
+
baseDirDerivedConfiguration.resultDir,
|
|
339
|
+
notDerivedContentConfig.i18nDictionariesDirName
|
|
340
|
+
),
|
|
291
341
|
/**
|
|
292
342
|
* Directory where the dictionaries types will be stored
|
|
293
343
|
*
|
|
@@ -326,7 +376,7 @@ const buildContentFields = (customConfiguration) => {
|
|
|
326
376
|
/**
|
|
327
377
|
* Pattern of files to watch
|
|
328
378
|
*
|
|
329
|
-
* Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json']
|
|
379
|
+
* Default: ['/**\/*.content.ts', '/**\/*.content.js', '/**\/*.content.json', '/**\/*.content.cjs', '/**\/*.content.mjs', '/**\/*.content.tsx', '/**\/*.content.jsx']
|
|
330
380
|
*/
|
|
331
381
|
watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(
|
|
332
382
|
(ext) => `/**/*${ext}`
|
|
@@ -334,7 +384,7 @@ const buildContentFields = (customConfiguration) => {
|
|
|
334
384
|
/**
|
|
335
385
|
* Pattern of files to watch including the relative path
|
|
336
386
|
*
|
|
337
|
-
* Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json']
|
|
387
|
+
* Default: ['{{contentDir}}/**\/*.content.ts', '{{contentDir}}/**\/*.content.js', '{{contentDir}}/**\/*.content.json', '{{contentDir}}/**\/*.content.cjs', '{{contentDir}}/**\/*.content.mjs', '{{contentDir}}/**\/*.content.tsx', '{{contentDir}}/**\/*.content.jsx']
|
|
338
388
|
*/
|
|
339
389
|
watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.map(
|
|
340
390
|
(ext) => `${baseDirDerivedConfiguration.contentDir}/**/*${ext}`
|
|
@@ -353,6 +403,14 @@ const buildContentFields = (customConfiguration) => {
|
|
|
353
403
|
...patternsConfiguration
|
|
354
404
|
};
|
|
355
405
|
};
|
|
406
|
+
const buildEditorFields = (customConfiguration) => ({
|
|
407
|
+
/**
|
|
408
|
+
* Port of the editor server
|
|
409
|
+
*
|
|
410
|
+
* Default: 4000
|
|
411
|
+
*/
|
|
412
|
+
port: customConfiguration?.port ?? 4e3
|
|
413
|
+
});
|
|
356
414
|
const buildConfigurationFields = (options, customConfiguration) => {
|
|
357
415
|
const internationalizationConfig = buildInternationalizationFields(
|
|
358
416
|
customConfiguration?.internationalization
|
|
@@ -361,10 +419,12 @@ const buildConfigurationFields = (options, customConfiguration) => {
|
|
|
361
419
|
customConfiguration?.middleware
|
|
362
420
|
);
|
|
363
421
|
const contentConfig = buildContentFields(customConfiguration?.content);
|
|
422
|
+
const editorConfig = buildEditorFields(customConfiguration?.editor);
|
|
364
423
|
storedConfiguration = {
|
|
365
424
|
internationalization: internationalizationConfig,
|
|
366
425
|
middleware: middlewareConfig,
|
|
367
|
-
content: contentConfig
|
|
426
|
+
content: contentConfig,
|
|
427
|
+
editor: editorConfig
|
|
368
428
|
};
|
|
369
429
|
return storedConfiguration;
|
|
370
430
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport { DEFAULT_LOCALE, LOCALES } from '../defaultValues/internationalization';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport {\n CONTENT_DIR_NAME,\n DICTIONARIES_DIR_NAME,\n FILE_EXTENSIONS,\n RESULT_DIR_NAME,\n EXCLUDED_PATHS,\n TYPES_DIR_NAME,\n MAIN_DIR_NAME,\n MODULE_AUGMENTATION_DIR_NAME,\n} from '../defaultValues/server';\nimport type {\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n PatternsContentConfig,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n BaseContentConfig,\n ResultDirDerivedConfig,\n} from '../types/config';\nimport type { GetConfigurationOptions } from './getConfiguration';\n\nlet storedConfiguration: IntlayerConfig;\n\n// @TODO - Add possibility of directories configurations to be arrays to allow multiple packages management\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildMiddlewareFields = (\n customConfiguration?: Partial<MiddlewareConfig>\n): MiddlewareConfig => ({\n /**\n * Header name to get the locale\n *\n * Default: 'x-intlayer-locale'\n */\n headerName: customConfiguration?.headerName ?? HEADER_NAME,\n\n /**\n * Cookie name to get the locale\n *\n * Default: 'intlayer-locale'\n */\n cookieName: customConfiguration?.cookieName ?? COOKIE_NAME,\n\n /**\n * Prefix the default locale in the URL\n *\n * Default: true\n */\n prefixDefault: customConfiguration?.prefixDefault ?? PREFIX_DEFAULT,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Rule to set the cookie on the server\n * - 'always': Set the cookie on every request\n * - 'never': Never set the cookie\n */\n serverSetCookie: customConfiguration?.serverSetCookie ?? SERVER_SET_COOKIE,\n\n /**\n * No prefix in the URL\n * - true: No prefix in the URL\n * - false: Prefix in the URL\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n * - If no prefix is set, the URL will be https://example.com/en\n * - If the no prefix is set to true, the URL will be https://example.com\n *\n * Default: false\n */\n noPrefix: customConfiguration?.noPrefix ?? NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>\n): ContentConfig => {\n const notDerivedContentConfig: BaseContentConfig = {\n /**\n * File extensions of content to look for to build the dictionaries\n *\n * - Default: ['.content.ts', '.content.js', '.content.json']\n *\n * - Example: ['.data.ts', '.data.js', '.data.json']\n *\n * Note:\n * - Can exclude unused file extensions to improve performance\n * - Avoid using common file extensions like '.ts', '.js', '.json' to avoid conflicts\n */\n fileExtensions: customConfiguration?.fileExtensions ?? FILE_EXTENSIONS,\n\n /**\n * Absolute path of the directory of the project\n * - Default: process.cwd()\n * - Example: '/path/to/project'\n *\n * Will be used to resolve all intlayer directories\n *\n * Note:\n * - The base directory should be the root of the project\n * - Can be changed to a custom directory to externalize either the content used in the project, or the intlayer application from the project\n */\n baseDir: customConfiguration?.baseDir ?? process.cwd(),\n\n /**\n * Directory name where the content is stored\n *\n * Default: 'src'\n *\n * Example:\n * - 'data' -> '/path/to/project/data'\n * - 'content' -> '/path/to/project/content'\n * - 'locales' -> '/path/to/project/locales'\n *\n * Note: If this directory is not at the base directory level, update the contentDir field instead\n */\n contentDirName: customConfiguration?.contentDirName ?? CONTENT_DIR_NAME,\n\n /**\n * Directory name where the result will be stored\n *\n * Default: '.intlayer'\n *\n * Example:\n * - '.next'\n * - 'outputOFIntlayer'\n *\n * Note: If this directory is not at the base directory level, update the resultDir field instead\n */\n resultDirName: customConfiguration?.resultDirName ?? RESULT_DIR_NAME,\n\n /**\n *\n * Directory name where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If this directory is not at the base directory level, update the moduleAugmentationDir field instead\n */\n moduleAugmentationDirName:\n customConfiguration?.moduleAugmentationDirName ??\n MODULE_AUGMENTATION_DIR_NAME,\n // @TODO: Make Module Augmentation optional by adding a flag in the configuration\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries will be stored\n *\n * Default: 'dictionary'\n *\n * Example: 'translations'\n *\n * Note:\n * - If this directory is not at the result directory level, update the dictionariesDir field instead\n *\n */\n dictionariesDirName:\n customConfiguration?.dictionariesDirName ?? DICTIONARIES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries types will be stored\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this directory is not at the result directory level, update the typesDir field instead\n *\n */\n typeDirName: customConfiguration?.typeDirName ?? TYPES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the main files will be stored\n *\n * Default: 'main'\n *\n * Example: 'intlayer-main'\n *\n * Note:\n * - If this directory is not at the result directory level, update the mainDir field instead\n */\n mainDirName: customConfiguration?.mainDirName ?? MAIN_DIR_NAME,\n\n /**\n * Should exclude some directories from the content search\n *\n * Default: ['node_modules']\n *\n * Not used yet\n * @TODO Implement the exclusion or remove it\n */\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n };\n\n const baseDirDerivedConfiguration: BaseDerivedConfig = {\n /**\n * Directory where the content is stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{contentDirName}}\n *\n * Example: '/path/to/project/src'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the content used in the project\n * - If the content is not at the base directory level, update the contentDirName field instead\n */\n contentDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.contentDirName\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{resultDirName}}\n *\n * Example: '/path/to/project/.intlayer'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the intlayer application from the project\n * - If the result is not at the base directory level, update the resultDirName field instead\n */\n resultDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.resultDirName\n ),\n\n /**\n * Directory where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{moduleAugmentationDirName}}\n *\n * Example: '/path/to/project/types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If the module augmentation is not at the base directory level, update the moduleAugmentationDirName field instead\n *\n */\n moduleAugmentationDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.moduleAugmentationDirName\n ),\n };\n\n const resultDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{dictionariesDirName}}\n *\n * Example: '/path/to/project/.intlayer/dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n * - The dictionaries are stored in JSON format\n * - The dictionaries are used to translate the content\n * - The dictionaries are built from the content files\n */\n dictionariesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.dictionariesDirName\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{typeDirName}}\n *\n * Example: '/path/to/project/.intlayer/types'\n *\n * Note:\n * - If the types are not at the result directory level, update the typesDirName field instead\n */\n typesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.typeDirName\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{mainDirName}}\n *\n * Example: '/path/to/project/.intlayer/main'\n *\n * Note:\n *\n * - If the main files are not at the result directory level, update the mainDirName field instead\n */\n mainDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.mainDirName\n ),\n };\n\n const patternsConfiguration: PatternsContentConfig = {\n /**\n * Pattern of files to watch\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json']\n */\n watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(\n (ext) => `/**/*${ext}`\n ),\n\n /**\n * Pattern of files to watch including the relative path\n *\n * Default: ['{{contentDir}}/**\\/*.content.ts', '{{contentDir}}/**\\/*.content.js', '{{contentDir}}/**\\/*.content.json']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.map(\n (ext) => `${baseDirDerivedConfiguration.contentDir}/**/*${ext}`\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '{{dictionariesDir}}/**\\/*.json'\n */\n outputFilesPatternWithPath: `${resultDirDerivedConfiguration.dictionariesDir}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...resultDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n options: GetConfigurationOptions,\n customConfiguration?: CustomIntlayerConfig\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(customConfiguration?.content);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AACrB,kCAAwC;AACxC,wBAOO;AACP,oBASO;AAcP,IAAI;AAIJ,MAAM,kCAAkC,CACtC,yBACgC;AAAA;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,IAcA,cAAU;AAAA,MACR,4BAA4B;AAAA,MAC5B,wBAAwB;AAAA,IAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAeA,aAAS;AAAA,MACP,4BAA4B;AAAA,MAC5B,wBAAwB;AAAA,IAC1B;AAAA,EACF;AAEA,QAAM,wBAA+C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnD,qBAAqB,wBAAwB,eAAe;AAAA,MAC1D,CAAC,QAAQ,QAAQ,GAAG;AAAA,IACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,6BAA6B,wBAAwB,eAAe;AAAA,MAClE,CAAC,QAAQ,GAAG,4BAA4B,UAAU,QAAQ,GAAG;AAAA,IAC/D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,4BAA4B,GAAG,8BAA8B,eAAe;AAAA,EAC9E;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACF;AAKO,MAAM,2BAA2B,CACtC,SACA,wBACmB;AACnB,QAAM,6BAA6B;AAAA,IACjC,qBAAqB;AAAA,EACvB;AAEA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,EACvB;AAEA,QAAM,gBAAgB,mBAAmB,qBAAqB,OAAO;AAErE,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AAEA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport {\n CONTENT_DIR_NAME,\n DICTIONARIES_DIR_NAME,\n FILE_EXTENSIONS,\n RESULT_DIR_NAME,\n EXCLUDED_PATHS,\n TYPES_DIR_NAME,\n MAIN_DIR_NAME,\n MODULE_AUGMENTATION_DIR_NAME,\n I18N_DICTIONARIES_DIR_NAME,\n DICTIONARY_OUTPUT,\n} from '../defaultValues/server';\nimport type {\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n PatternsContentConfig,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n BaseContentConfig,\n ResultDirDerivedConfig,\n EditorConfig,\n} from '../types/config';\nimport type { GetConfigurationOptions } from './getConfiguration';\n\nlet storedConfiguration: IntlayerConfig;\n\n// @TODO - Add possibility of directories configurations to be arrays to allow multiple packages management\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n *\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Ensure strong implementations of internationalized content using typescript.\n * - If set to \"strict\", the translation `t` function will require each declared locales to be defined. If one locale is missing, or if a locale is not declared in your config, it will throw an error.\n * - If set to \"required_only\", the translation `t` function will require each declared locales to be defined. If one locale is missing, it will throw a warning. But will accept if a locale is not declared in your config, but exist.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"required_only\"\n */\n strictMode: customConfiguration?.strictMode ?? STRICT_MODE,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildMiddlewareFields = (\n customConfiguration?: Partial<MiddlewareConfig>\n): MiddlewareConfig => ({\n /**\n * Header name to get the locale\n *\n * Default: 'x-intlayer-locale'\n */\n headerName: customConfiguration?.headerName ?? HEADER_NAME,\n\n /**\n * Cookie name to get the locale\n *\n * Default: 'intlayer-locale'\n */\n cookieName: customConfiguration?.cookieName ?? COOKIE_NAME,\n\n /**\n * Prefix the default locale in the URL\n *\n * Default: true\n */\n prefixDefault: customConfiguration?.prefixDefault ?? PREFIX_DEFAULT,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Rule to set the cookie on the server\n * - 'always': Set the cookie on every request\n * - 'never': Never set the cookie\n */\n serverSetCookie: customConfiguration?.serverSetCookie ?? SERVER_SET_COOKIE,\n\n /**\n * No prefix in the URL\n * - true: No prefix in the URL\n * - false: Prefix in the URL\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n * - If no prefix is set, the URL will be https://example.com/en\n * - If the no prefix is set to true, the URL will be https://example.com\n *\n * Default: false\n */\n noPrefix: customConfiguration?.noPrefix ?? NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>\n): ContentConfig => {\n const notDerivedContentConfig: BaseContentConfig = {\n /**\n * File extensions of content to look for to build the dictionaries\n *\n * - Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']\n *\n * - Example: ['.data.ts', '.data.js', '.data.json']\n *\n * Note:\n * - Can exclude unused file extensions to improve performance\n * - Avoid using common file extensions like '.ts', '.js', '.json' to avoid conflicts\n */\n fileExtensions: customConfiguration?.fileExtensions ?? FILE_EXTENSIONS,\n\n /**\n * Absolute path of the directory of the project\n * - Default: process.cwd()\n * - Example: '/path/to/project'\n *\n * Will be used to resolve all intlayer directories\n *\n * Note:\n * - The base directory should be the root of the project\n * - Can be changed to a custom directory to externalize either the content used in the project, or the intlayer application from the project\n */\n baseDir: customConfiguration?.baseDir ?? process.cwd(),\n\n /**\n * Directory name where the content is stored\n *\n * Default: 'src'\n *\n * Example:\n * - 'data' -> '/path/to/project/data'\n * - 'content' -> '/path/to/project/content'\n * - 'locales' -> '/path/to/project/locales'\n *\n * Note: If this directory is not at the base directory level, update the contentDir field instead\n */\n contentDirName: customConfiguration?.contentDirName ?? CONTENT_DIR_NAME,\n\n /**\n * Directory name where the result will be stored\n *\n * Default: '.intlayer'\n *\n * Example:\n * - '.next'\n * - 'outputOFIntlayer'\n *\n * Note: If this directory is not at the base directory level, update the resultDir field instead\n */\n resultDirName: customConfiguration?.resultDirName ?? RESULT_DIR_NAME,\n\n /**\n *\n * Directory name where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If this directory is not at the base directory level, update the moduleAugmentationDir field instead\n */\n moduleAugmentationDirName:\n customConfiguration?.moduleAugmentationDirName ??\n MODULE_AUGMENTATION_DIR_NAME,\n // @TODO: Make Module Augmentation optional by adding a flag in the configuration\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries will be stored\n *\n * Default: 'dictionary'\n *\n * Example: 'translations'\n *\n * Note:\n * - If this directory is not at the result directory level, update the dictionariesDir field instead\n *\n */\n dictionariesDirName:\n customConfiguration?.dictionariesDirName ?? DICTIONARIES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries will be stored\n *\n * Default: 'dictionary'\n *\n * Example: 'translations'\n *\n * Note:\n * - If this directory is not at the result directory level, update the dictionariesDir field instead\n *\n */\n i18nDictionariesDirName:\n customConfiguration?.i18nDictionariesDirName ??\n I18N_DICTIONARIES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the dictionaries types will be stored\n *\n * Default: 'types'\n *\n * Example: 'intlayer-types'\n *\n * Note:\n * - If this directory is not at the result directory level, update the typesDir field instead\n *\n */\n typeDirName: customConfiguration?.typeDirName ?? TYPES_DIR_NAME,\n\n /**\n * Related to the intlayer result directory\n *\n * Directory name where the main files will be stored\n *\n * Default: 'main'\n *\n * Example: 'intlayer-main'\n *\n * Note:\n * - If this directory is not at the result directory level, update the mainDir field instead\n */\n mainDirName: customConfiguration?.mainDirName ?? MAIN_DIR_NAME,\n\n /**\n * Should exclude some directories from the content search\n *\n * Default: ['node_modules']\n *\n * Not used yet\n * @TODO Implement the exclusion or remove it\n */\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n };\n\n const baseDirDerivedConfiguration: BaseDerivedConfig = {\n /**\n * Directory where the content is stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{contentDirName}}\n *\n * Example: '/path/to/project/src'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the content used in the project\n * - If the content is not at the base directory level, update the contentDirName field instead\n */\n contentDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.contentDirName\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{resultDirName}}\n *\n * Example: '/path/to/project/.intlayer'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the intlayer application from the project\n * - If the result is not at the base directory level, update the resultDirName field instead\n */\n resultDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.resultDirName\n ),\n\n /**\n * Directory where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Relative to the base directory of the project\n *\n * Default: {{baseDir}} / {{moduleAugmentationDirName}}\n *\n * Example: '/path/to/project/types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If the module augmentation is not at the base directory level, update the moduleAugmentationDirName field instead\n *\n */\n moduleAugmentationDir: join(\n notDerivedContentConfig.baseDir,\n notDerivedContentConfig.moduleAugmentationDirName\n ),\n\n /**\n * Output format of the dictionary\n *\n * Default: ['intlayer']\n *\n * Note:\n * - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.\n * - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer\n */\n dictionaryOutput:\n customConfiguration?.dictionaryOutput ?? DICTIONARY_OUTPUT,\n };\n\n const resultDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{dictionariesDirName}}\n *\n * Example: '/path/to/project/.intlayer/dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n * - The dictionaries are stored in JSON format\n * - The dictionaries are used to translate the content\n * - The dictionaries are built from the content files\n */\n dictionariesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.dictionariesDirName\n ),\n\n /**\n * Directory where the 18n dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{i18nDictionariesDirName}}\n *\n * Example: '/path/to/project/.intlayer/dictionary/i18n'\n *\n * Note:\n * - If the types are not at the result directory level, update the i18nDictionariesDirName field instead\n */\n i18nDictionariesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.i18nDictionariesDirName\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{typeDirName}}\n *\n * Example: '/path/to/project/.intlayer/types'\n *\n * Note:\n * - If the types are not at the result directory level, update the typesDirName field instead\n */\n typesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.typeDirName\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{mainDirName}}\n *\n * Example: '/path/to/project/.intlayer/main'\n *\n * Note:\n *\n * - If the main files are not at the result directory level, update the mainDirName field instead\n */\n mainDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.mainDirName\n ),\n };\n\n const patternsConfiguration: PatternsContentConfig = {\n /**\n * Pattern of files to watch\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json', '/**\\/*.content.cjs', '/**\\/*.content.mjs', '/**\\/*.content.tsx', '/**\\/*.content.jsx']\n */\n watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(\n (ext) => `/**/*${ext}`\n ),\n\n /**\n * Pattern of files to watch including the relative path\n *\n * Default: ['{{contentDir}}/**\\/*.content.ts', '{{contentDir}}/**\\/*.content.js', '{{contentDir}}/**\\/*.content.json', '{{contentDir}}/**\\/*.content.cjs', '{{contentDir}}/**\\/*.content.mjs', '{{contentDir}}/**\\/*.content.tsx', '{{contentDir}}/**\\/*.content.jsx']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.map(\n (ext) => `${baseDirDerivedConfiguration.contentDir}/**/*${ext}`\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '{{dictionariesDir}}/**\\/*.json'\n */\n outputFilesPatternWithPath: `${resultDirDerivedConfiguration.dictionariesDir}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...resultDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * Port of the editor server\n *\n * Default: 4000\n */\n port: customConfiguration?.port ?? 4000,\n});\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n options: GetConfigurationOptions,\n customConfiguration?: CustomIntlayerConfig\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(customConfiguration?.content);\n\n const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;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AA,EACL;AACF;AAEA,MAAM,oBAAoB,CACxB,yBACkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlB,MAAM,qBAAqB,QAAQ;AACrC;AAKO,MAAM,2BAA2B,CACtC,SACA,wBACmB;AACnB,QAAM,6BAA6B;AAAA,IACjC,qBAAqB;AAAA,EACvB;AAEA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,EACvB;AAEA,QAAM,gBAAgB,mBAAmB,qBAAqB,OAAO;AAErE,QAAM,eAAe,kBAAkB,qBAAqB,MAAM;AAElE,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var editor_exports = {};
|
|
20
|
+
__export(editor_exports, {
|
|
21
|
+
PORT: () => PORT
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(editor_exports);
|
|
24
|
+
const PORT = 4e3;
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
PORT
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=editor.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/defaultValues/editor.ts"],"sourcesContent":["export const PORT = 4000;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,OAAO;","names":[]}
|
|
@@ -19,15 +19,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var internationalization_exports = {};
|
|
20
20
|
__export(internationalization_exports, {
|
|
21
21
|
DEFAULT_LOCALE: () => DEFAULT_LOCALE,
|
|
22
|
-
LOCALES: () => LOCALES
|
|
22
|
+
LOCALES: () => LOCALES,
|
|
23
|
+
STRICT_MODE: () => STRICT_MODE
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(internationalization_exports);
|
|
25
26
|
var import_locales = require('../types/locales.cjs');
|
|
26
27
|
const LOCALES = [import_locales.Locales.ENGLISH];
|
|
27
28
|
const DEFAULT_LOCALE = import_locales.Locales.ENGLISH;
|
|
29
|
+
const STRICT_MODE = "required_only";
|
|
28
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
31
|
0 && (module.exports = {
|
|
30
32
|
DEFAULT_LOCALE,
|
|
31
|
-
LOCALES
|
|
33
|
+
LOCALES,
|
|
34
|
+
STRICT_MODE
|
|
32
35
|
});
|
|
33
36
|
//# sourceMappingURL=internationalization.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/defaultValues/internationalization.ts"],"sourcesContent":["import { Locales } from '../types/locales';\n\nexport const LOCALES: Locales[] = [Locales.ENGLISH];\n\nexport const DEFAULT_LOCALE: Locales = Locales.ENGLISH;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AAEjB,MAAM,UAAqB,CAAC,uBAAQ,OAAO;AAE3C,MAAM,iBAA0B,uBAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/defaultValues/internationalization.ts"],"sourcesContent":["import type { StrictMode } from '../types/config';\nimport { Locales } from '../types/locales';\n\nexport const LOCALES: Locales[] = [Locales.ENGLISH];\n\nexport const DEFAULT_LOCALE: Locales = Locales.ENGLISH;\n\nexport const STRICT_MODE: StrictMode = 'required_only';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAwB;AAEjB,MAAM,UAAqB,CAAC,uBAAQ,OAAO;AAE3C,MAAM,iBAA0B,uBAAQ;AAExC,MAAM,cAA0B;","names":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { StrictMode } from '../types/config.js';
|
|
1
2
|
import { Locales } from '../types/locales.js';
|
|
2
3
|
|
|
3
4
|
declare const LOCALES: Locales[];
|
|
4
5
|
declare const DEFAULT_LOCALE: Locales;
|
|
6
|
+
declare const STRICT_MODE: StrictMode;
|
|
5
7
|
|
|
6
|
-
export { DEFAULT_LOCALE, LOCALES };
|
|
8
|
+
export { DEFAULT_LOCALE, LOCALES, STRICT_MODE };
|
|
@@ -20,28 +20,42 @@ var server_exports = {};
|
|
|
20
20
|
__export(server_exports, {
|
|
21
21
|
CONTENT_DIR_NAME: () => CONTENT_DIR_NAME,
|
|
22
22
|
DICTIONARIES_DIR_NAME: () => DICTIONARIES_DIR_NAME,
|
|
23
|
+
DICTIONARY_OUTPUT: () => DICTIONARY_OUTPUT,
|
|
23
24
|
EXCLUDED_PATHS: () => EXCLUDED_PATHS,
|
|
24
25
|
FILE_EXTENSIONS: () => FILE_EXTENSIONS,
|
|
26
|
+
I18N_DICTIONARIES_DIR_NAME: () => I18N_DICTIONARIES_DIR_NAME,
|
|
25
27
|
MAIN_DIR_NAME: () => MAIN_DIR_NAME,
|
|
26
28
|
MODULE_AUGMENTATION_DIR_NAME: () => MODULE_AUGMENTATION_DIR_NAME,
|
|
27
29
|
RESULT_DIR_NAME: () => RESULT_DIR_NAME,
|
|
28
30
|
TYPES_DIR_NAME: () => TYPES_DIR_NAME
|
|
29
31
|
});
|
|
30
32
|
module.exports = __toCommonJS(server_exports);
|
|
31
|
-
const FILE_EXTENSIONS = [
|
|
33
|
+
const FILE_EXTENSIONS = [
|
|
34
|
+
".content.ts",
|
|
35
|
+
".content.js",
|
|
36
|
+
".content.cjs",
|
|
37
|
+
".content.mjs",
|
|
38
|
+
".content.json",
|
|
39
|
+
".content.tsx",
|
|
40
|
+
".content.jsx"
|
|
41
|
+
];
|
|
32
42
|
const EXCLUDED_PATHS = ["node_modules"];
|
|
33
43
|
const CONTENT_DIR_NAME = "src";
|
|
34
44
|
const RESULT_DIR_NAME = ".intlayer";
|
|
35
45
|
const MODULE_AUGMENTATION_DIR_NAME = "types";
|
|
46
|
+
const DICTIONARY_OUTPUT = ["intlayer"];
|
|
36
47
|
const DICTIONARIES_DIR_NAME = "dictionary";
|
|
48
|
+
const I18N_DICTIONARIES_DIR_NAME = "i18n_dictionary";
|
|
37
49
|
const TYPES_DIR_NAME = "types";
|
|
38
50
|
const MAIN_DIR_NAME = "main";
|
|
39
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
52
|
0 && (module.exports = {
|
|
41
53
|
CONTENT_DIR_NAME,
|
|
42
54
|
DICTIONARIES_DIR_NAME,
|
|
55
|
+
DICTIONARY_OUTPUT,
|
|
43
56
|
EXCLUDED_PATHS,
|
|
44
57
|
FILE_EXTENSIONS,
|
|
58
|
+
I18N_DICTIONARIES_DIR_NAME,
|
|
45
59
|
MAIN_DIR_NAME,
|
|
46
60
|
MODULE_AUGMENTATION_DIR_NAME,
|
|
47
61
|
RESULT_DIR_NAME,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/defaultValues/server.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../src/defaultValues/server.ts"],"sourcesContent":["import type { DictionaryOutput } from '../types/config';\n\nexport const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.mjs',\n '.content.json',\n '.content.tsx',\n '.content.jsx',\n];\nexport const EXCLUDED_PATHS = ['node_modules'];\n\nexport const CONTENT_DIR_NAME = 'src';\n\nexport const RESULT_DIR_NAME = '.intlayer';\n\nexport const MODULE_AUGMENTATION_DIR_NAME = 'types';\n\nexport const DICTIONARY_OUTPUT: DictionaryOutput[] = ['intlayer'];\n\nexport const DICTIONARIES_DIR_NAME = 'dictionary';\n\nexport const I18N_DICTIONARIES_DIR_NAME = 'i18n_dictionary';\n\nexport const TYPES_DIR_NAME = 'types';\n\nexport const MAIN_DIR_NAME = 'main';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACO,MAAM,iBAAiB,CAAC,cAAc;AAEtC,MAAM,mBAAmB;AAEzB,MAAM,kBAAkB;AAExB,MAAM,+BAA+B;AAErC,MAAM,oBAAwC,CAAC,UAAU;AAEzD,MAAM,wBAAwB;AAE9B,MAAM,6BAA6B;AAEnC,MAAM,iBAAiB;AAEvB,MAAM,gBAAgB;","names":[]}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { DictionaryOutput } from '../types/config.js';
|
|
2
|
+
import '../types/locales.js';
|
|
3
|
+
|
|
1
4
|
declare const FILE_EXTENSIONS: string[];
|
|
2
5
|
declare const EXCLUDED_PATHS: string[];
|
|
3
6
|
declare const CONTENT_DIR_NAME = "src";
|
|
4
7
|
declare const RESULT_DIR_NAME = ".intlayer";
|
|
5
8
|
declare const MODULE_AUGMENTATION_DIR_NAME = "types";
|
|
9
|
+
declare const DICTIONARY_OUTPUT: DictionaryOutput[];
|
|
6
10
|
declare const DICTIONARIES_DIR_NAME = "dictionary";
|
|
11
|
+
declare const I18N_DICTIONARIES_DIR_NAME = "i18n_dictionary";
|
|
7
12
|
declare const TYPES_DIR_NAME = "types";
|
|
8
13
|
declare const MAIN_DIR_NAME = "main";
|
|
9
14
|
|
|
10
|
-
export { CONTENT_DIR_NAME, DICTIONARIES_DIR_NAME, EXCLUDED_PATHS, FILE_EXTENSIONS, MAIN_DIR_NAME, MODULE_AUGMENTATION_DIR_NAME, RESULT_DIR_NAME, TYPES_DIR_NAME };
|
|
15
|
+
export { CONTENT_DIR_NAME, DICTIONARIES_DIR_NAME, DICTIONARY_OUTPUT, EXCLUDED_PATHS, FILE_EXTENSIONS, I18N_DICTIONARIES_DIR_NAME, MAIN_DIR_NAME, MODULE_AUGMENTATION_DIR_NAME, RESULT_DIR_NAME, TYPES_DIR_NAME };
|
|
@@ -24,12 +24,15 @@ __export(detectPlatform_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(detectPlatform_exports);
|
|
25
25
|
const import_meta = {};
|
|
26
26
|
const getPlatform = () => {
|
|
27
|
-
if (
|
|
27
|
+
if (
|
|
28
|
+
// eslint-disable-next-line
|
|
29
|
+
typeof import_meta !== "undefined" && typeof import_meta.env !== "undefined" && typeof import_meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== "undefined"
|
|
30
|
+
) {
|
|
31
|
+
return "vite";
|
|
32
|
+
} else if (typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== "undefined") {
|
|
28
33
|
return "next";
|
|
29
|
-
} else if (typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE
|
|
34
|
+
} else if (typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== "undefined") {
|
|
30
35
|
return "react_app";
|
|
31
|
-
} else if (import_meta?.env?.VITE_INTLAYER_DEFAULT_LOCALE) {
|
|
32
|
-
return "vite";
|
|
33
36
|
}
|
|
34
37
|
return "unknown";
|
|
35
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["export type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\
|
|
1
|
+
{"version":3,"sources":["../../../src/envVariables/detectPlatform.ts"],"sourcesContent":["export type Platform = 'next' | 'vite' | 'react_app' | 'unknown';\n\nexport const getPlatform = (): Platform => {\n if (\n // eslint-disable-next-line\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n typeof import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Vite\n return 'vite';\n } else if (\n typeof process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Next.js\n return 'next';\n } else if (\n typeof process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE !== 'undefined'\n ) {\n // Likely Create React App\n return 'react_app';\n }\n\n return 'unknown';\n};\n\n/**\n * Get the prefix for the environment variables to be used in the platform\n */\nexport const getPrefix = (platform: Platform): string => {\n switch (platform) {\n case 'next':\n return 'NEXT_PUBLIC_INTLAYER_';\n case 'vite':\n return 'VITE_INTLAYER_';\n case 'react_app':\n return 'REACT_APP_INTLAYER_';\n default:\n return '';\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,cAAc,MAAgB;AACzC;AAAA;AAAA,IAEE,OAAO,gBAAgB,eACvB,OAAO,YAAY,QAAQ,eAC3B,OAAO,YAAY,IAAI,iCAAiC;AAAA,IACxD;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,wCAAwC,aAC3D;AAEA,WAAO;AAAA,EACT,WACE,OAAO,QAAQ,IAAI,sCAAsC,aACzD;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAKO,MAAM,YAAY,CAAC,aAA+B;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
type Platform = 'next' | 'vite' | 'react_app' | 'unknown';
|
|
2
|
-
type ViteEnvVar = {
|
|
3
|
-
env: Record<string, string>;
|
|
4
|
-
};
|
|
5
2
|
declare const getPlatform: () => Platform;
|
|
6
3
|
/**
|
|
7
4
|
* Get the prefix for the environment variables to be used in the platform
|
|
8
5
|
*/
|
|
9
6
|
declare const getPrefix: (platform: Platform) => string;
|
|
10
7
|
|
|
11
|
-
export { type Platform,
|
|
8
|
+
export { type Platform, getPlatform, getPrefix };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var extractEnvVariable_exports = {};
|
|
20
|
+
__export(extractEnvVariable_exports, {
|
|
21
|
+
extractEnvVariable: () => extractEnvVariable
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(extractEnvVariable_exports);
|
|
24
|
+
var import_detectPlatform = require('../detectPlatform.cjs');
|
|
25
|
+
var import_next = require('./next.cjs');
|
|
26
|
+
var import_react_app = require('./react_app.cjs');
|
|
27
|
+
var import_undefined_platform = require('./undefined_platform.cjs');
|
|
28
|
+
var import_vite = require('./vite.cjs');
|
|
29
|
+
const extractEnvVariable = () => {
|
|
30
|
+
const platform = (0, import_detectPlatform.getPlatform)();
|
|
31
|
+
if (platform === "vite") {
|
|
32
|
+
return (0, import_vite.extractViteEnvVariable)();
|
|
33
|
+
} else if (platform === "next") {
|
|
34
|
+
return (0, import_next.extractNextEnvVariable)();
|
|
35
|
+
} else if (platform === "react_app") {
|
|
36
|
+
return (0, import_react_app.extractReactAppEnvVariable)();
|
|
37
|
+
}
|
|
38
|
+
return (0, import_undefined_platform.extractEmptyEnvVariable)();
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
extractEnvVariable
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/index.ts"],"sourcesContent":["import { type Platform, getPlatform } from '../detectPlatform';\nimport { extractNextEnvVariable } from './next';\nimport { extractReactAppEnvVariable } from './react_app';\nimport type { IntlayerConfigEnvVariable } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\nimport { extractViteEnvVariable } from './vite';\n\nexport const extractEnvVariable = (): IntlayerConfigEnvVariable => {\n const platform: Platform = getPlatform();\n\n if (platform === 'vite') {\n return extractViteEnvVariable();\n } else if (platform === 'next') {\n return extractNextEnvVariable();\n } else if (platform === 'react_app') {\n return extractReactAppEnvVariable();\n }\n\n return extractEmptyEnvVariable();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2C;AAC3C,kBAAuC;AACvC,uBAA2C;AAE3C,gCAAwC;AACxC,kBAAuC;AAEhC,MAAM,qBAAqB,MAAiC;AACjE,QAAM,eAAqB,mCAAY;AAEvC,MAAI,aAAa,QAAQ;AACvB,eAAO,oCAAuB;AAAA,EAChC,WAAW,aAAa,QAAQ;AAC9B,eAAO,oCAAuB;AAAA,EAChC,WAAW,aAAa,aAAa;AACnC,eAAO,6CAA2B;AAAA,EACpC;AAEA,aAAO,mDAAwB;AACjC;","names":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var next_exports = {};
|
|
20
|
+
__export(next_exports, {
|
|
21
|
+
extractNextEnvVariable: () => extractNextEnvVariable
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(next_exports);
|
|
24
|
+
const extractNextEnvVariable = () => {
|
|
25
|
+
const internationalization = {
|
|
26
|
+
locales: process.env.NEXT_PUBLIC_INTLAYER_LOCALES,
|
|
27
|
+
strictMode: process.env.NEXT_PUBLIC_INTLAYER_STRICT_MODE,
|
|
28
|
+
defaultLocale: process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE
|
|
29
|
+
};
|
|
30
|
+
const middleware = {
|
|
31
|
+
headerName: process.env.NEXT_PUBLIC_INTLAYER_HEADER_NAME,
|
|
32
|
+
cookieName: process.env.NEXT_PUBLIC_INTLAYER_COOKIE_NAME,
|
|
33
|
+
prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,
|
|
34
|
+
basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,
|
|
35
|
+
serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,
|
|
36
|
+
noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX
|
|
37
|
+
};
|
|
38
|
+
const content = {
|
|
39
|
+
fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,
|
|
40
|
+
baseDir: process.env.NEXT_PUBLIC_INTLAYER_BASE_DIR,
|
|
41
|
+
contentDirName: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR_NAME,
|
|
42
|
+
contentDir: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR,
|
|
43
|
+
excludedPath: process.env.NEXT_PUBLIC_INTLAYER_EXCLUDED_PATH,
|
|
44
|
+
resultDirName: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR_NAME,
|
|
45
|
+
moduleAugmentationDirName: process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
|
|
46
|
+
dictionariesDirName: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR_NAME,
|
|
47
|
+
i18nDictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR,
|
|
48
|
+
typeDirName: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR_NAME,
|
|
49
|
+
mainDirName: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR_NAME,
|
|
50
|
+
resultDir: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,
|
|
51
|
+
moduleAugmentationDir: process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,
|
|
52
|
+
dictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR,
|
|
53
|
+
i18nDictionariesDirName: process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
|
|
54
|
+
typesDir: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,
|
|
55
|
+
mainDir: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,
|
|
56
|
+
watchedFilesPattern: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,
|
|
57
|
+
watchedFilesPatternWithPath: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
|
|
58
|
+
outputFilesPatternWithPath: process.env.NEXT_PUBLIC_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
|
|
59
|
+
dictionaryOutput: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_OUTPUT
|
|
60
|
+
};
|
|
61
|
+
const editor = {
|
|
62
|
+
port: process.env.NEXT_PUBLIC_INTLAYER_PORT
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
internationalization,
|
|
66
|
+
middleware,
|
|
67
|
+
content,
|
|
68
|
+
editor
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
extractNextEnvVariable
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=next.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"sourcesContent":["import type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractNextEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.NEXT_PUBLIC_INTLAYER_LOCALES,\n strictMode: process.env.NEXT_PUBLIC_INTLAYER_STRICT_MODE,\n defaultLocale: process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.NEXT_PUBLIC_INTLAYER_HEADER_NAME,\n cookieName: process.env.NEXT_PUBLIC_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.NEXT_PUBLIC_INTLAYER_BASE_DIR,\n contentDirName: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR_NAME,\n contentDir: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.NEXT_PUBLIC_INTLAYER_EXCLUDED_PATH,\n resultDirName: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName:\n process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR_NAME,\n i18nDictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR,\n typeDirName: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR_NAME,\n mainDirName: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR_NAME,\n resultDir: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,\n moduleAugmentationDir:\n process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR,\n i18nDictionariesDirName:\n process.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR_NAME,\n typesDir: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,\n mainDir: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,\n watchedFilesPattern: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_OUTPUT,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n port: process.env.NEXT_PUBLIC_INTLAYER_PORT,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,MAAM,yBAAyB,MAAiC;AACrE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,IAC3B,UAAU,QAAQ,IAAI;AAAA,IACtB,iBAA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