@intlayer/config 3.5.5 → 3.5.6

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.
Files changed (44) hide show
  1. package/dist/cjs/configFile/buildConfigurationFields.cjs +39 -9
  2. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  3. package/dist/cjs/defaultValues/content.cjs +6 -3
  4. package/dist/cjs/defaultValues/content.cjs.map +1 -1
  5. package/dist/cjs/envVariables/extractEnvVariable/next.cjs +4 -2
  6. package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -1
  7. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +4 -2
  8. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -1
  9. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +4 -2
  10. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -1
  11. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +4 -2
  12. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -1
  13. package/dist/cjs/envVariables/getConfiguration.cjs +12 -4
  14. package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
  15. package/dist/cjs/logger.cjs.map +1 -1
  16. package/dist/cjs/types/config.cjs.map +1 -1
  17. package/dist/esm/configFile/buildConfigurationFields.mjs +42 -11
  18. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  19. package/dist/esm/defaultValues/content.mjs +4 -2
  20. package/dist/esm/defaultValues/content.mjs.map +1 -1
  21. package/dist/esm/envVariables/extractEnvVariable/next.mjs +4 -2
  22. package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -1
  23. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +4 -2
  24. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -1
  25. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +4 -2
  26. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -1
  27. package/dist/esm/envVariables/extractEnvVariable/vite.mjs +4 -2
  28. package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -1
  29. package/dist/esm/envVariables/getConfiguration.mjs +12 -4
  30. package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
  31. package/dist/esm/logger.mjs.map +1 -1
  32. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  33. package/dist/types/defaultValues/content.d.ts +2 -1
  34. package/dist/types/defaultValues/content.d.ts.map +1 -1
  35. package/dist/types/envVariables/extractEnvVariable/next.d.ts.map +1 -1
  36. package/dist/types/envVariables/extractEnvVariable/react_app.d.ts.map +1 -1
  37. package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts.map +1 -1
  38. package/dist/types/envVariables/extractEnvVariable/vite.d.ts.map +1 -1
  39. package/dist/types/envVariables/getConfiguration.d.ts.map +1 -1
  40. package/dist/types/logger.d.ts +1 -1
  41. package/dist/types/logger.d.ts.map +1 -1
  42. package/dist/types/types/config.d.ts +29 -8
  43. package/dist/types/types/config.d.ts.map +1 -1
  44. package/package.json +4 -4
@@ -25,8 +25,8 @@ var import_path = require("path");
25
25
  var import_content = require('../defaultValues/content.cjs');
26
26
  var import_editor = require('../defaultValues/editor.cjs');
27
27
  var import_internationalization = require('../defaultValues/internationalization.cjs');
28
- var import_middleware = require('../defaultValues/middleware.cjs');
29
28
  var import_log = require('../defaultValues/log.cjs');
29
+ var import_middleware = require('../defaultValues/middleware.cjs');
30
30
  let storedConfiguration;
31
31
  const buildInternationalizationFields = (customConfiguration) => ({
32
32
  /**
@@ -207,7 +207,21 @@ const buildContentFields = (customConfiguration) => {
207
207
  * - If this directory is not at the result directory level, update the dictionariesDir field instead
208
208
  *
209
209
  */
210
- i18nDictionariesDirName: customConfiguration?.i18nDictionariesDirName ?? import_content.I18N_DICTIONARIES_DIR_NAME,
210
+ i18nextResourcesDirName: customConfiguration?.i18nextResourcesDirName ?? import_content.I18NEXT_DICTIONARIES_DIR_NAME,
211
+ /**
212
+ * Related to the intlayer result directory
213
+ *
214
+ * Directory name where the dictionaries will be stored
215
+ *
216
+ * Default: 'react-intl_dictionary'
217
+ *
218
+ * Example: 'translations'
219
+ *
220
+ * Note:
221
+ * - If this directory is not at the result directory level, update the dictionariesDir field instead
222
+ *
223
+ */
224
+ reactIntlMessagesDirName: customConfiguration?.reactIntlMessagesDirName ?? import_content.REACT_INTL_MESSAGES_DIR_NAME,
211
225
  /**
212
226
  * Related to the intlayer result directory
213
227
  *
@@ -342,16 +356,32 @@ const buildContentFields = (customConfiguration) => {
342
356
  *
343
357
  * Relative to the result directory
344
358
  *
345
- * Default: {{resultDir}} / {{i18nDictionariesDirName}}
359
+ * Default: {{resultDir}} / {{i18nextResourcesDirName}}
346
360
  *
347
361
  * Example: '/path/to/project/.intlayer/dictionary/i18n'
348
362
  *
349
363
  * Note:
350
- * - If the types are not at the result directory level, update the i18nDictionariesDirName field instead
364
+ * - If the types are not at the result directory level, update the i18nextResourcesDirName field instead
351
365
  */
352
- i18nDictionariesDir: (0, import_path.join)(
366
+ i18nextResourcesDir: (0, import_path.join)(
353
367
  baseDirDerivedConfiguration.resultDir,
354
- notDerivedContentConfig.i18nDictionariesDirName
368
+ notDerivedContentConfig.i18nextResourcesDirName
369
+ ),
370
+ /**
371
+ * Directory where the dictionaries will be stored
372
+ *
373
+ * Relative to the result directory
374
+ *
375
+ * Default: {{resultDir}} / {{reactIntlMessagesDirName}}
376
+ *
377
+ * Example: '/path/to/project/.intlayer/react-intl_dictionary'
378
+ *
379
+ * Note:
380
+ * - If the types are not at the result directory level, update the dictionariesDirName field instead
381
+ */
382
+ reactIntlMessagesDir: (0, import_path.join)(
383
+ baseDirDerivedConfiguration.resultDir,
384
+ notDerivedContentConfig.reactIntlMessagesDirName
355
385
  ),
356
386
  /**
357
387
  * Directory where the dictionaries types will be stored
@@ -360,7 +390,7 @@ const buildContentFields = (customConfiguration) => {
360
390
  *
361
391
  * Default: {{resultDir}} / {{typeDirName}}
362
392
  *
363
- * Example: '/path/to/project/.intlayer/types'
393
+ * Example: '/path/to/project/types'
364
394
  *
365
395
  * Note:
366
396
  * - If the types are not at the result directory level, update the typesDirName field instead
@@ -447,7 +477,7 @@ const buildEditorFields = (customConfiguration) => ({
447
477
  /**
448
478
  * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.
449
479
  * An access token is use to authenticate the user related to the project.
450
- * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.
480
+ * To get an access token, go to https://intlayer.org/dashboard/project and create an account.
451
481
  *
452
482
  * Default: undefined
453
483
  *
@@ -457,7 +487,7 @@ const buildEditorFields = (customConfiguration) => ({
457
487
  /**
458
488
  * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.
459
489
  * An access token is use to authenticate the user related to the project.
460
- * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.
490
+ * To get an access token, go to https://intlayer.org/dashboard/project and create an account.
461
491
  *
462
492
  * Default: undefined
463
493
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\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 WATCH,\n} from '../defaultValues/content';\nimport {\n BACKEND_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n IS_ENABLED,\n} from '../defaultValues/editor';\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 { MODE, PREFIX } from '../defaultValues/log';\nimport type {\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n PatternsContentConfig,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n BaseContentConfig,\n ResultDirDerivedConfig,\n EditorConfig,\n LogConfig,\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 default prefix the default locale to the path as other locales.\n *\n * Example with prefixDefault = true and defaultLocale = 'en':\n * path = /en/dashboard or /fr/dashboard\n *\n * Example with prefixDefault = false and defaultLocale = 'en':\n * path = /dashboard or /fr/dashboard\n *\n *\n * Default: false\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 * Indicates if Intlayer should watch for changes in the content declaration files in the app to rebuild the related dictionaries.\n *\n * Default: process.env.NODE_ENV === 'development'\n */\n watch: customConfiguration?.watch ?? WATCH,\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: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\n /**\n * Indicates if the editor is active\n *\n * Default: true;\n *\n * If true, the editor is active and can be accessed.\n * If false, the editor is inactive and cannot be accessed.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV === 'development',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientId: customConfiguration?.clientId ?? undefined,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://back.intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientSecret: customConfiguration?.clientSecret ?? undefined,\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'locale_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'locale_first' or 'distant_first'.\n * - 'locale_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy:\n customConfiguration?.dictionaryPriorityStrategy ??\n DICTIONARY_PRIORITY_STRATEGY,\n});\n\nconst buildLogFields = (\n customConfiguration?: Partial<LogConfig>\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\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 const logConfig = buildLogFields(customConfiguration?.log);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AACrB,qBAYO;AACP,oBAIO;AACP,kCAIO;AACP,wBAOO;AACP,iBAA6B;AAgB7B,IAAI;AAIJ,MAAM,kCAAkC,CACtC,yBACgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,SAAS,qBAAqB,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUzC,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,eAAe,qBAAqB,iBAAiB;AACvD;AAEA,MAAM,wBAAwB,CAC5B,yBACsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc/C,eAAe,qBAAqB,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAarD,UAAU,qBAAqB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3C,iBAAiB,qBAAqB,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBzD,UAAU,qBAAqB,YAAY;AAC7C;AAEA,MAAM,qBAAqB,CACzB,wBACkB;AAClB,QAAM,0BAA6C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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mB,qBAAqB,OAAO;AAErE,QAAM,eAAe,kBAAkB,qBAAqB,MAAM;AAElE,QAAM,YAAY,eAAe,qBAAqB,GAAG;AAEzD,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,EACP;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\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 I18NEXT_DICTIONARIES_DIR_NAME,\n DICTIONARY_OUTPUT,\n WATCH,\n REACT_INTL_MESSAGES_DIR_NAME,\n} from '../defaultValues/content';\nimport {\n BACKEND_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n IS_ENABLED,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport { MODE, PREFIX } from '../defaultValues/log';\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 type {\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n PatternsContentConfig,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n BaseContentConfig,\n ResultDirDerivedConfig,\n EditorConfig,\n LogConfig,\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 default prefix the default locale to the path as other locales.\n *\n * Example with prefixDefault = true and defaultLocale = 'en':\n * path = /en/dashboard or /fr/dashboard\n *\n * Example with prefixDefault = false and defaultLocale = 'en':\n * path = /dashboard or /fr/dashboard\n *\n *\n * Default: false\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 i18nextResourcesDirName:\n customConfiguration?.i18nextResourcesDirName ??\n I18NEXT_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: 'react-intl_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 reactIntlMessagesDirName:\n customConfiguration?.reactIntlMessagesDirName ??\n REACT_INTL_MESSAGES_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 * Indicates if Intlayer should watch for changes in the content declaration files in the app to rebuild the related dictionaries.\n *\n * Default: process.env.NODE_ENV === 'development'\n */\n watch: customConfiguration?.watch ?? WATCH,\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}} / {{i18nextResourcesDirName}}\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 i18nextResourcesDirName field instead\n */\n i18nextResourcesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.i18nextResourcesDirName\n ),\n\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: {{resultDir}} / {{reactIntlMessagesDirName}}\n *\n * Example: '/path/to/project/.intlayer/react-intl_dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n */\n reactIntlMessagesDir: join(\n baseDirDerivedConfiguration.resultDir,\n notDerivedContentConfig.reactIntlMessagesDirName\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/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: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\n /**\n * Indicates if the editor is active\n *\n * Default: true;\n *\n * If true, the editor is active and can be accessed.\n * If false, the editor is inactive and cannot be accessed.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV === 'development',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientId: customConfiguration?.clientId ?? undefined,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientSecret: customConfiguration?.clientSecret ?? undefined,\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'locale_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'locale_first' or 'distant_first'.\n * - 'locale_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy:\n customConfiguration?.dictionaryPriorityStrategy ??\n DICTIONARY_PRIORITY_STRATEGY,\n});\n\nconst buildLogFields = (\n customConfiguration?: Partial<LogConfig>\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\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 const logConfig = buildLogFields(customConfiguration?.log);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AACrB,qBAaO;AACP,oBAIO;AACP,kCAIO;AACP,iBAA6B;AAC7B,wBAOO;AAgBP,IAAI;AAIJ,MAAM,kCAAkC,CACtC,yBACgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,SAAS,qBAAqB,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUzC,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,eAAe,qBAAqB,iBAAiB;AACvD;AAEA,MAAM,wBAAwB,CAC5B,yBACsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc/C,eAAe,qBAAqB,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAarD,UAAU,qBAAqB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3C,iBAAiB,qBAAqB,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBzD,UAAU,qBAAqB,YAAY;AAC7C;AAEA,MAAM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rB,yBACe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUf,MAAM,qBAAqB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASnC,QAAQ,qBAAqB,UAAU;AACzC;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,QAAM,YAAY,eAAe,qBAAqB,GAAG;AAEzD,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,EACP;AAEA,SAAO;AACT;","names":[]}
@@ -33,9 +33,10 @@ __export(content_exports, {
33
33
  DICTIONARY_OUTPUT: () => DICTIONARY_OUTPUT,
34
34
  EXCLUDED_PATHS: () => EXCLUDED_PATHS,
35
35
  FILE_EXTENSIONS: () => FILE_EXTENSIONS,
36
- I18N_DICTIONARIES_DIR_NAME: () => I18N_DICTIONARIES_DIR_NAME,
36
+ I18NEXT_DICTIONARIES_DIR_NAME: () => I18NEXT_DICTIONARIES_DIR_NAME,
37
37
  MAIN_DIR_NAME: () => MAIN_DIR_NAME,
38
38
  MODULE_AUGMENTATION_DIR_NAME: () => MODULE_AUGMENTATION_DIR_NAME,
39
+ REACT_INTL_MESSAGES_DIR_NAME: () => REACT_INTL_MESSAGES_DIR_NAME,
39
40
  RESULT_DIR_NAME: () => RESULT_DIR_NAME,
40
41
  TYPES_DIR_NAME: () => TYPES_DIR_NAME,
41
42
  WATCH: () => WATCH
@@ -57,7 +58,8 @@ const RESULT_DIR_NAME = ".intlayer";
57
58
  const MODULE_AUGMENTATION_DIR_NAME = "types";
58
59
  const DICTIONARY_OUTPUT = ["intlayer"];
59
60
  const DICTIONARIES_DIR_NAME = "dictionary";
60
- const I18N_DICTIONARIES_DIR_NAME = "i18n_dictionary";
61
+ const I18NEXT_DICTIONARIES_DIR_NAME = "i18next_resources";
62
+ const REACT_INTL_MESSAGES_DIR_NAME = "intl_messages";
61
63
  const TYPES_DIR_NAME = "types";
62
64
  const MAIN_DIR_NAME = "main";
63
65
  const WATCH = import_process.default.env.NODE_ENV === "development";
@@ -68,9 +70,10 @@ const WATCH = import_process.default.env.NODE_ENV === "development";
68
70
  DICTIONARY_OUTPUT,
69
71
  EXCLUDED_PATHS,
70
72
  FILE_EXTENSIONS,
71
- I18N_DICTIONARIES_DIR_NAME,
73
+ I18NEXT_DICTIONARIES_DIR_NAME,
72
74
  MAIN_DIR_NAME,
73
75
  MODULE_AUGMENTATION_DIR_NAME,
76
+ REACT_INTL_MESSAGES_DIR_NAME,
74
77
  RESULT_DIR_NAME,
75
78
  TYPES_DIR_NAME,
76
79
  WATCH
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["import process from 'process';\nimport 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\nexport const WATCH = process.env.NODE_ENV === 'development';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAGb,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;AAEtB,MAAM,QAAQ,eAAAA,QAAQ,IAAI,aAAa;","names":["process"]}
1
+ {"version":3,"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["import process from 'process';\nimport 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 I18NEXT_DICTIONARIES_DIR_NAME = 'i18next_resources';\n\nexport const REACT_INTL_MESSAGES_DIR_NAME = 'intl_messages';\n\nexport const TYPES_DIR_NAME = 'types';\n\nexport const MAIN_DIR_NAME = 'main';\n\nexport const WATCH = process.env.NODE_ENV === 'development';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAGb,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,gCAAgC;AAEtC,MAAM,+BAA+B;AAErC,MAAM,iBAAiB;AAEvB,MAAM,gBAAgB;AAEtB,MAAM,QAAQ,eAAAA,QAAQ,IAAI,aAAa;","names":["process"]}
@@ -55,13 +55,15 @@ const extractNextEnvVariable = () => {
55
55
  resultDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR_NAME,
56
56
  moduleAugmentationDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
57
57
  dictionariesDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR_NAME,
58
- i18nDictionariesDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR,
58
+ i18nextResourcesDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_I18N_RESOURCES_DIR,
59
+ reactIntlMessagesDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_REACT_INTL_MESSAGES_DIR,
59
60
  typeDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR_NAME,
60
61
  mainDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR_NAME,
61
62
  resultDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,
62
63
  moduleAugmentationDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,
63
64
  dictionariesDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_DICTIONARIES_DIR,
64
- i18nDictionariesDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
65
+ i18nextResourcesDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_I18N_RESOURCES_DIR_NAME,
66
+ reactIntlMessagesDirName: import_process.default.env.NEXT_PUBLIC_INTLAYER_REACT_INTL_MESSAGES_DIR_NAME,
65
67
  typesDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,
66
68
  mainDir: import_process.default.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,
67
69
  watchedFilesPattern: import_process.default.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"sourcesContent":["import process from 'process';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\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 watch: process.env.NEXT_PUBLIC_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: process.env.NEXT_PUBLIC_INTLAYER_BACKEND_URL,\n enabled: process.env.NEXT_PUBLIC_INTLAYER_ENABLED,\n clientId: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_ID,\n clientSecret: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.NEXT_PUBLIC_INTLAYER_LOG_MODE,\n prefix: process.env.NEXT_PUBLIC_INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAUb,MAAM,yBAAyB,MAAiC;AACrE,QAAM,uBAAiE;AAAA,IACrE,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,eAAe,eAAAA,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,eAAe,eAAAA,QAAQ,IAAI;AAAA,IAC3B,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,iBAAiB,eAAAA,QAAQ,IAAI;AAAA,IAC7B,UAAU,eAAAA,QAAQ,IAAI;AAAA,EACxB;AAEA,QAAM,UAAuC;AAAA,IAC3C,gBAAgB,eAAAA,QAAQ,IAAI;AAAA,IAC5B,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,gBAAgB,eAAAA,QAAQ,IAAI;AAAA,IAC5B,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,eAAe,eAAAA,QAAQ,IAAI;AAAA,IAC3B,2BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,aAAa,eAAAA,QAAQ,IAAI;AAAA,IACzB,aAAa,eAAAA,QAAQ,IAAI;AAAA,IACzB,WAAW,eAAAA,QAAQ,IAAI;AAAA,IACvB,uBACE,eAAAA,QAAQ,IAAI;AAAA,IACd,iBAAiB,eAAAA,QAAQ,IAAI;AAAA,IAC7B,yBACE,eAAAA,QAAQ,IAAI;AAAA,IACd,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,6BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,4BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,kBAAkB,eAAAA,QAAQ,IAAI;AAAA,IAC9B,OAAO,eAAAA,QAAQ,IAAI;AAAA,EACrB;AAEA,QAAM,SAAqC;AAAA,IACzC,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,4BACE,eAAAA,QAAQ,IAAI;AAAA,EAChB;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,eAAAA,QAAQ,IAAI;AAAA,IAClB,QAAQ,eAAAA,QAAQ,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["process"]}
1
+ {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"sourcesContent":["import process from 'process';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\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 i18nextResourcesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_RESOURCES_DIR,\n reactIntlMessagesDir:\n process.env.NEXT_PUBLIC_INTLAYER_REACT_INTL_MESSAGES_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 i18nextResourcesDirName:\n process.env.NEXT_PUBLIC_INTLAYER_I18N_RESOURCES_DIR_NAME,\n reactIntlMessagesDirName:\n process.env.NEXT_PUBLIC_INTLAYER_REACT_INTL_MESSAGES_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 watch: process.env.NEXT_PUBLIC_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: process.env.NEXT_PUBLIC_INTLAYER_BACKEND_URL,\n enabled: process.env.NEXT_PUBLIC_INTLAYER_ENABLED,\n clientId: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_ID,\n clientSecret: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.NEXT_PUBLIC_INTLAYER_LOG_MODE,\n prefix: process.env.NEXT_PUBLIC_INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };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ACd,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,6BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,4BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,kBAAkB,eAAAA,QAAQ,IAAI;AAAA,IAC9B,OAAO,eAAAA,QAAQ,IAAI;AAAA,EACrB;AAEA,QAAM,SAAqC;AAAA,IACzC,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,4BACE,eAAAA,QAAQ,IAAI;AAAA,EAChB;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,eAAAA,QAAQ,IAAI;AAAA,IAClB,QAAQ,eAAAA,QAAQ,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["process"]}
@@ -55,13 +55,15 @@ const extractReactAppEnvVariable = () => {
55
55
  resultDirName: import_process.default.env.REACT_APP_INTLAYER_RESULT_DIR_NAME,
56
56
  moduleAugmentationDirName: import_process.default.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
57
57
  dictionariesDirName: import_process.default.env.REACT_APP_INTLAYER_DICTIONARIES_DIR_NAME,
58
- i18nDictionariesDirName: import_process.default.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
58
+ i18nextResourcesDirName: import_process.default.env.REACT_APP_INTLAYER_I18N_RESOURCES_DIR_NAME,
59
+ reactIntlMessagesDirName: import_process.default.env.REACT_APP_INTLAYER_REACT_INTL_MESSAGES_DIR_NAME,
59
60
  typeDirName: import_process.default.env.REACT_APP_INTLAYER_TYPE_DIR_NAME,
60
61
  mainDirName: import_process.default.env.REACT_APP_INTLAYER_MAIN_DIR_NAME,
61
62
  resultDir: import_process.default.env.REACT_APP_INTLAYER_RESULT_DIR,
62
63
  moduleAugmentationDir: import_process.default.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,
63
64
  dictionariesDir: import_process.default.env.REACT_APP_INTLAYER_DICTIONARIES_DIR,
64
- i18nDictionariesDir: import_process.default.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,
65
+ i18nextResourcesDir: import_process.default.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,
66
+ reactIntlMessagesDir: import_process.default.env.REACT_APP_INTLAYER_REACT_INTL_DICTIONARIES_DIR,
65
67
  typesDir: import_process.default.env.REACT_APP_INTLAYER_TYPE_DIR,
66
68
  mainDir: import_process.default.env.REACT_APP_INTLAYER_MAIN_DIR,
67
69
  watchedFilesPattern: import_process.default.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"sourcesContent":["import process from 'process';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractReactAppEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.REACT_APP_INTLAYER_LOCALES,\n strictMode: process.env.REACT_APP_INTLAYER_STRICT_MODE,\n defaultLocale: process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.REACT_APP_INTLAYER_HEADER_NAME,\n cookieName: process.env.REACT_APP_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.REACT_APP_INTLAYER_BASE_DIR,\n contentDirName: process.env.REACT_APP_INTLAYER_CONTENT_DIR_NAME,\n contentDir: process.env.REACT_APP_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.REACT_APP_INTLAYER_EXCLUDED_PATH,\n resultDirName: process.env.REACT_APP_INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR_NAME,\n i18nDictionariesDirName:\n process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR_NAME,\n typeDirName: process.env.REACT_APP_INTLAYER_TYPE_DIR_NAME,\n mainDirName: process.env.REACT_APP_INTLAYER_MAIN_DIR_NAME,\n resultDir: process.env.REACT_APP_INTLAYER_RESULT_DIR,\n moduleAugmentationDir:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR,\n i18nDictionariesDir: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,\n typesDir: process.env.REACT_APP_INTLAYER_TYPE_DIR,\n mainDir: process.env.REACT_APP_INTLAYER_MAIN_DIR,\n watchedFilesPattern: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.REACT_APP_INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.REACT_APP_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: process.env.REACT_APP_INTLAYER_BACKEND_URL,\n enabled: process.env.REACT_APP_INTLAYER_ENABLED,\n clientId: process.env.REACT_APP_INTLAYER_CLIENT_ID,\n clientSecret: process.env.REACT_APP_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.REACT_APP_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.REACT_APP_INTLAYER_LOG_MODE,\n prefix: process.env.REACT_APP_INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAUb,MAAM,6BAA6B,MAAiC;AACzE,QAAM,uBAAiE;AAAA,IACrE,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,eAAe,eAAAA,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,eAAe,eAAAA,QAAQ,IAAI;AAAA,IAC3B,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,iBAAiB,eAAAA,QAAQ,IAAI;AAAA,IAC7B,UAAU,eAAAA,QAAQ,IAAI;AAAA,EACxB;AAEA,QAAM,UAAuC;AAAA,IAC3C,gBAAgB,eAAAA,QAAQ,IAAI;AAAA,IAC5B,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,gBAAgB,eAAAA,QAAQ,IAAI;AAAA,IAC5B,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,eAAe,eAAAA,QAAQ,IAAI;AAAA,IAC3B,2BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,yBACE,eAAAA,QAAQ,IAAI;AAAA,IACd,aAAa,eAAAA,QAAQ,IAAI;AAAA,IACzB,aAAa,eAAAA,QAAQ,IAAI;AAAA,IACzB,WAAW,eAAAA,QAAQ,IAAI;AAAA,IACvB,uBACE,eAAAA,QAAQ,IAAI;AAAA,IACd,iBAAiB,eAAAA,QAAQ,IAAI;AAAA,IAC7B,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,6BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,4BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,kBAAkB,eAAAA,QAAQ,IAAI;AAAA,IAC9B,OAAO,eAAAA,QAAQ,IAAI;AAAA,EACrB;AAEA,QAAM,SAAqC;AAAA,IACzC,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,4BACE,eAAAA,QAAQ,IAAI;AAAA,EAChB;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,eAAAA,QAAQ,IAAI;AAAA,IAClB,QAAQ,eAAAA,QAAQ,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["process"]}
1
+ {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"sourcesContent":["import process from 'process';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractReactAppEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.REACT_APP_INTLAYER_LOCALES,\n strictMode: process.env.REACT_APP_INTLAYER_STRICT_MODE,\n defaultLocale: process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.REACT_APP_INTLAYER_HEADER_NAME,\n cookieName: process.env.REACT_APP_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.REACT_APP_INTLAYER_BASE_DIR,\n contentDirName: process.env.REACT_APP_INTLAYER_CONTENT_DIR_NAME,\n contentDir: process.env.REACT_APP_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.REACT_APP_INTLAYER_EXCLUDED_PATH,\n resultDirName: process.env.REACT_APP_INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR_NAME,\n i18nextResourcesDirName:\n process.env.REACT_APP_INTLAYER_I18N_RESOURCES_DIR_NAME,\n reactIntlMessagesDirName:\n process.env.REACT_APP_INTLAYER_REACT_INTL_MESSAGES_DIR_NAME,\n typeDirName: process.env.REACT_APP_INTLAYER_TYPE_DIR_NAME,\n mainDirName: process.env.REACT_APP_INTLAYER_MAIN_DIR_NAME,\n resultDir: process.env.REACT_APP_INTLAYER_RESULT_DIR,\n moduleAugmentationDir:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: process.env.REACT_APP_INTLAYER_DICTIONARIES_DIR,\n i18nextResourcesDir: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir:\n process.env.REACT_APP_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: process.env.REACT_APP_INTLAYER_TYPE_DIR,\n mainDir: process.env.REACT_APP_INTLAYER_MAIN_DIR,\n watchedFilesPattern: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.REACT_APP_INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.REACT_APP_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: process.env.REACT_APP_INTLAYER_BACKEND_URL,\n enabled: process.env.REACT_APP_INTLAYER_ENABLED,\n clientId: process.env.REACT_APP_INTLAYER_CLIENT_ID,\n clientSecret: process.env.REACT_APP_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.REACT_APP_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.REACT_APP_INTLAYER_LOG_MODE,\n prefix: process.env.REACT_APP_INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAUb,MAAM,6BAA6B,MAAiC;AACzE,QAAM,uBAAiE;AAAA,IACrE,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,eAAe,eAAAA,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,eAAAA,QAAQ,IAAI;AAAA,EACrB;AAEA,QAAM,SAAqC;AAAA,IACzC,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,4BACE,eAAAA,QAAQ,IAAI;AAAA,EAChB;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,eAAAA,QAAQ,IAAI;AAAA,IAClB,QAAQ,eAAAA,QAAQ,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["process"]}
@@ -55,13 +55,15 @@ const extractEmptyEnvVariable = () => {
55
55
  resultDirName: import_process.default.env.INTLAYER_RESULT_DIR_NAME,
56
56
  moduleAugmentationDirName: import_process.default.env.INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
57
57
  dictionariesDirName: import_process.default.env.INTLAYER_DICTIONARIES_DIR_NAME,
58
- i18nDictionariesDirName: import_process.default.env.INTLAYER_I18N_DICTIONARIES_DIR_NAME,
58
+ i18nextResourcesDirName: import_process.default.env.INTLAYER_I18N_RESOURCES_DIR_NAME,
59
+ reactIntlMessagesDirName: import_process.default.env.INTLAYER_REACT_INTL_MESSAGES_DIR_NAME,
59
60
  typeDirName: import_process.default.env.INTLAYER_TYPE_DIR_NAME,
60
61
  mainDirName: import_process.default.env.INTLAYER_MAIN_DIR_NAME,
61
62
  resultDir: import_process.default.env.INTLAYER_RESULT_DIR,
62
63
  moduleAugmentationDir: import_process.default.env.INTLAYER_MODULE_AUGMENTATION_DIR,
63
64
  dictionariesDir: import_process.default.env.INTLAYER_DICTIONARIES_DIR,
64
- i18nDictionariesDir: import_process.default.env.INTLAYER_I18N_DICTIONARIES_DIR,
65
+ i18nextResourcesDir: import_process.default.env.INTLAYER_I18N_DICTIONARIES_DIR,
66
+ reactIntlMessagesDir: import_process.default.env.INTLAYER_REACT_INTL_DICTIONARIES_DIR,
65
67
  typesDir: import_process.default.env.INTLAYER_TYPE_DIR,
66
68
  mainDir: import_process.default.env.INTLAYER_MAIN_DIR,
67
69
  watchedFilesPattern: import_process.default.env.INTLAYER_WATCHED_FILES_PATTERN,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"sourcesContent":["import process from 'process';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\n} from '../../types/config';\nimport type { ReplaceValue, IntlayerConfigEnvVariable } from './types';\n\nexport const extractEmptyEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.INTLAYER_LOCALES,\n strictMode: process.env.INTLAYER_STRICT_MODE,\n defaultLocale: process.env.INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.INTLAYER_HEADER_NAME,\n cookieName: process.env.INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.INTLAYER_BASE_PATH,\n serverSetCookie: process.env.INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.INTLAYER_BASE_DIR,\n contentDirName: process.env.INTLAYER_CONTENT_DIR_NAME,\n contentDir: process.env.INTLAYER_CONTENT_DIR,\n excludedPath: process.env.INTLAYER_EXCLUDED_PATH,\n resultDirName: process.env.INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName:\n process.env.INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: process.env.INTLAYER_DICTIONARIES_DIR_NAME,\n i18nDictionariesDirName: process.env.INTLAYER_I18N_DICTIONARIES_DIR_NAME,\n typeDirName: process.env.INTLAYER_TYPE_DIR_NAME,\n mainDirName: process.env.INTLAYER_MAIN_DIR_NAME,\n resultDir: process.env.INTLAYER_RESULT_DIR,\n moduleAugmentationDir: process.env.INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: process.env.INTLAYER_DICTIONARIES_DIR,\n i18nDictionariesDir: process.env.INTLAYER_I18N_DICTIONARIES_DIR,\n typesDir: process.env.INTLAYER_TYPE_DIR,\n mainDir: process.env.INTLAYER_MAIN_DIR,\n watchedFilesPattern: process.env.INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: process.env.INTLAYER_BACKEND_URL,\n enabled: process.env.INTLAYER_ENABLED,\n clientId: process.env.INTLAYER_CLIENT_ID,\n clientSecret: process.env.INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.INTLAYER_LOG_MODE,\n prefix: process.env.INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAUb,MAAM,0BAA0B,MAAiC;AACtE,QAAM,uBAAiE;AAAA,IACrE,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,eAAe,eAAAA,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,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AQ,IAAI;AAAA,IACrB,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,4BACE,eAAAA,QAAQ,IAAI;AAAA,EAChB;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,eAAAA,QAAQ,IAAI;AAAA,IAClB,QAAQ,eAAAA,QAAQ,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["process"]}
1
+ {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"sourcesContent":["import process from 'process';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\n} from '../../types/config';\nimport type { ReplaceValue, IntlayerConfigEnvVariable } from './types';\n\nexport const extractEmptyEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.INTLAYER_LOCALES,\n strictMode: process.env.INTLAYER_STRICT_MODE,\n defaultLocale: process.env.INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.INTLAYER_HEADER_NAME,\n cookieName: process.env.INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.INTLAYER_BASE_PATH,\n serverSetCookie: process.env.INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.INTLAYER_BASE_DIR,\n contentDirName: process.env.INTLAYER_CONTENT_DIR_NAME,\n contentDir: process.env.INTLAYER_CONTENT_DIR,\n excludedPath: process.env.INTLAYER_EXCLUDED_PATH,\n resultDirName: process.env.INTLAYER_RESULT_DIR_NAME,\n moduleAugmentationDirName:\n process.env.INTLAYER_MODULE_AUGMENTATION_DIR_NAME,\n dictionariesDirName: process.env.INTLAYER_DICTIONARIES_DIR_NAME,\n i18nextResourcesDirName: process.env.INTLAYER_I18N_RESOURCES_DIR_NAME,\n reactIntlMessagesDirName: process.env.INTLAYER_REACT_INTL_MESSAGES_DIR_NAME,\n typeDirName: process.env.INTLAYER_TYPE_DIR_NAME,\n mainDirName: process.env.INTLAYER_MAIN_DIR_NAME,\n resultDir: process.env.INTLAYER_RESULT_DIR,\n moduleAugmentationDir: process.env.INTLAYER_MODULE_AUGMENTATION_DIR,\n dictionariesDir: process.env.INTLAYER_DICTIONARIES_DIR,\n i18nextResourcesDir: process.env.INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: process.env.INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: process.env.INTLAYER_TYPE_DIR,\n mainDir: process.env.INTLAYER_MAIN_DIR,\n watchedFilesPattern: process.env.INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: process.env.INTLAYER_BACKEND_URL,\n enabled: process.env.INTLAYER_ENABLED,\n clientId: process.env.INTLAYER_CLIENT_ID,\n clientSecret: process.env.INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.INTLAYER_LOG_MODE,\n prefix: process.env.INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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B,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,qBAAqB,eAAAA,QAAQ,IAAI;AAAA,IACjC,6BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,4BACE,eAAAA,QAAQ,IAAI;AAAA,IACd,kBAAkB,eAAAA,QAAQ,IAAI;AAAA,IAC9B,OAAO,eAAAA,QAAQ,IAAI;AAAA,EACrB;AAEA,QAAM,SAAqC;AAAA,IACzC,YAAY,eAAAA,QAAQ,IAAI;AAAA,IACxB,SAAS,eAAAA,QAAQ,IAAI;AAAA,IACrB,UAAU,eAAAA,QAAQ,IAAI;AAAA,IACtB,cAAc,eAAAA,QAAQ,IAAI;AAAA,IAC1B,4BACE,eAAAA,QAAQ,IAAI;AAAA,EAChB;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,eAAAA,QAAQ,IAAI;AAAA,IAClB,QAAQ,eAAAA,QAAQ,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["process"]}
@@ -53,13 +53,15 @@ const extractViteEnvVariable = () => {
53
53
  resultDirName: import_meta.env.VITE_INTLAYER_RESULT_DIR_NAME,
54
54
  moduleAugmentationDirName: import_meta.env.VITE_INTLAYER_MODULE_AUGMENTATION_DIR_NAME,
55
55
  dictionariesDirName: import_meta.env.VITE_INTLAYER_DICTIONARIES_DIR_NAME,
56
- i18nDictionariesDirName: import_meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR_NAME,
56
+ i18nextResourcesDirName: import_meta.env.VITE_INTLAYER_I18N_RESOURCES_DIR_NAME,
57
+ reactIntlMessagesDirName: import_meta.env.VITE_INTLAYER_REACT_INTL_MESSAGES_DIR_NAME,
57
58
  typeDirName: import_meta.env.VITE_INTLAYER_TYPE_DIR_NAME,
58
59
  mainDirName: import_meta.env.VITE_INTLAYER_MAIN_DIR_NAME,
59
60
  resultDir: import_meta.env.VITE_INTLAYER_RESULT_DIR,
60
61
  moduleAugmentationDir: import_meta.env.VITE_INTLAYER_MODULE_AUGMENTATION_DIR,
61
62
  dictionariesDir: import_meta.env.VITE_INTLAYER_DICTIONARIES_DIR,
62
- i18nDictionariesDir: import_meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,
63
+ i18nextResourcesDir: import_meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,
64
+ reactIntlMessagesDir: import_meta.env.VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,
63
65
  typesDir: import_meta.env.VITE_INTLAYER_TYPE_DIR,
64
66
  mainDir: import_meta.env.VITE_INTLAYER_MAIN_DIR,
65
67
  watchedFilesPattern: import_meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"sourcesContent":["import { logger } from '../../logger';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\n\nexport const extractViteEnvVariable = (): IntlayerConfigEnvVariable => {\n if (!import.meta.env) {\n logger('Vite env variables cannot be loaded on a commonjs environment.', {\n level: 'error',\n });\n return extractEmptyEnvVariable();\n }\n\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: import.meta.env.VITE_INTLAYER_LOCALES,\n strictMode: import.meta.env.VITE_INTLAYER_STRICT_MODE,\n defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,\n cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,\n prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,\n basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,\n serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,\n baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,\n 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 watch: import.meta.env.VITE_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: import.meta.env.VITE_INTLAYER_BACKEND_URL,\n enabled: import.meta.env.VITE_INTLAYER_ENABLED,\n clientId: import.meta.env.VITE_INTLAYER_CLIENT_ID,\n clientSecret: import.meta.env.VITE_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy: import.meta.env\n .VITE_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: import.meta.env.VITE_INTLAYER_LOG_MODE,\n prefix: import.meta.env.VITE_INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AASvB,gCAAwC;AATxC;AAWO,MAAM,yBAAyB,MAAiC;AACrE,MAAI,CAAC,YAAY,KAAK;AACpB,8BAAO,kEAAkE;AAAA,MACvE,OAAO;AAAA,IACT,CAAC;AACD,eAAO,mDAAwB;AAAA,EACjC;AAEA,QAAM,uBAAiE;AAAA,IACrE,SAAS,YAAY,IAAI;AAAA,IACzB,YAAY,YAAY,IAAI;AAAA,IAC5B,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,IAClC,OAAO,YAAY,IAAI;AAAA,EACzB;AAEA,QAAM,SAAqC;AAAA,IACzC,YAAY,YAAY,IAAI;AAAA,IAC5B,SAAS,YAAY,IAAI;AAAA,IACzB,UAAU,YAAY,IAAI;AAAA,IAC1B,cAAc,YAAY,IAAI;AAAA,IAC9B,4BAA4B,YAAY,IACrC;AAAA,EACL;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,YAAY,IAAI;AAAA,IACtB,QAAQ,YAAY,IAAI;AAAA,EAC1B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"sourcesContent":["import { logger } from '../../logger';\nimport type {\n InternationalizationConfig,\n MiddlewareConfig,\n ContentConfig,\n EditorConfig,\n LogConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\n\nexport const extractViteEnvVariable = (): IntlayerConfigEnvVariable => {\n if (!import.meta.env) {\n logger('Vite env variables cannot be loaded on a commonjs environment.', {\n level: 'error',\n });\n return extractEmptyEnvVariable();\n }\n\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: import.meta.env.VITE_INTLAYER_LOCALES,\n strictMode: import.meta.env.VITE_INTLAYER_STRICT_MODE,\n defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,\n cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,\n prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,\n basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,\n serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,\n baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,\n 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 i18nextResourcesDirName: import.meta.env\n .VITE_INTLAYER_I18N_RESOURCES_DIR_NAME,\n reactIntlMessagesDirName: import.meta.env\n .VITE_INTLAYER_REACT_INTL_MESSAGES_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 i18nextResourcesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: import.meta.env\n .VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,\n mainDir: import.meta.env.VITE_INTLAYER_MAIN_DIR,\n watchedFilesPattern: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: import.meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT,\n watch: import.meta.env.VITE_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n backendURL: import.meta.env.VITE_INTLAYER_BACKEND_URL,\n enabled: import.meta.env.VITE_INTLAYER_ENABLED,\n clientId: import.meta.env.VITE_INTLAYER_CLIENT_ID,\n clientSecret: import.meta.env.VITE_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy: import.meta.env\n .VITE_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: import.meta.env.VITE_INTLAYER_LOG_MODE,\n prefix: import.meta.env.VITE_INTLAYER_LOG_PREFIX,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AASvB,gCAAwC;AATxC;AAWO,MAAM,yBAAyB,MAAiC;AACrE,MAAI,CAAC,YAAY,KAAK;AACpB,8BAAO,kEAAkE;AAAA,MACvE,OAAO;AAAA,IACT,CAAC;AACD,eAAO,mDAAwB;AAAA,EACjC;AAEA,QAAM,uBAAiE;AAAA,IACrE,SAAS,YAAY,IA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A,IAC9B,4BAA4B,YAAY,IACrC;AAAA,EACL;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,YAAY,IAAI;AAAA,IACtB,QAAQ,YAAY,IAAI;AAAA,EAC1B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -72,12 +72,20 @@ const getConfiguration = () => {
72
72
  "string"
73
73
  ),
74
74
  dictionariesDir: (0, import_utils.getEnvValue)(env.content.dictionariesDir, "string"),
75
- i18nDictionariesDirName: (0, import_utils.getEnvValue)(
76
- env.content.i18nDictionariesDirName,
75
+ i18nextResourcesDirName: (0, import_utils.getEnvValue)(
76
+ env.content.i18nextResourcesDirName,
77
77
  "string"
78
78
  ),
79
- i18nDictionariesDir: (0, import_utils.getEnvValue)(
80
- env.content.i18nDictionariesDir,
79
+ i18nextResourcesDir: (0, import_utils.getEnvValue)(
80
+ env.content.i18nextResourcesDir,
81
+ "string"
82
+ ),
83
+ reactIntlMessagesDirName: (0, import_utils.getEnvValue)(
84
+ env.content.reactIntlMessagesDirName,
85
+ "string"
86
+ ),
87
+ reactIntlMessagesDir: (0, import_utils.getEnvValue)(
88
+ env.content.reactIntlMessagesDir,
81
89
  "string"
82
90
  ),
83
91
  typeDirName: (0, import_utils.getEnvValue)(env.content.typeDirName, "string"),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n LogConfig,\n ServerSetCookieRule,\n StrictMode,\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 strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n 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 watch: getEnvValue(env.content.watch, 'boolean')!,\n };\n\n const intlayerEditorConfiguration = {\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'locale_first' | 'distant_first',\n };\n\n const logConfiguration: LogConfig = {\n mode: getEnvValue(env.log.mode, 'string')!,\n prefix: getEnvValue(env.log.prefix, 'string')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n log: logConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,gCAAmC;AACnC,mBAA4B;AAOrB,MAAM,mBAAmB,MAAsB;AACpD,QAAM,UAAM,8CAAmB;AAE/B,QAAM,4BAAwD;AAAA,IAC5D,aAAS,0BAAqB,IAAI,qBAAqB,SAAS,OAAO;AAAA,IACvE,gBAAY;AAAA,MACV,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,mBAAe;AAAA,MACb,KAAK,qBAAqB;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kCAAoD;AAAA,IACxD,gBAAY,0BAAY,IAA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,0BAAY,IAAI,QAAQ,UAAU,QAAQ;AAAA,IACpD,iBAAa,0BAAY,IAAI,QAAQ,aAAa,QAAQ;AAAA,IAC1D,aAAS,0BAAY,IAAI,QAAQ,SAAS,QAAQ;AAAA,IAClD,yBAAqB;AAAA,MACnB,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,iCAA6B;AAAA,MAC3B,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,gCAA4B;AAAA,MAC1B,IAAI,QAAQ;AAAA,MACZ;AAAA,IACF;AAAA,IACA,WAAO,0BAAY,IAAI,QAAQ,OAAO,SAAS;AAAA,EACjD;AAEA,QAAM,8BAA8B;AAAA,IAClC,gBAAY,0BAAY,IAAI,OAAO,YAAY,QAAQ;AAAA,IACvD,aAAS,0BAAY,IAAI,OAAO,SAAS,SAAS;AAAA,IAClD,cAAU,0BAAY,IAAI,OAAO,UAAU,QAAQ;AAAA,IACnD,kBAAc,0BAAY,IAAI,OAAO,cAAc,QAAQ;AAAA,IAC3D,gCAA4B;AAAA,MAC1B,IAAI,OAAO;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAEA,QAAM,mBAA8B;AAAA,IAClC,UAAM,0BAAY,IAAI,IAAI,MAAM,QAAQ;AAAA,IACxC,YAAQ,0BAAY,IAAI,IAAI,QAAQ,QAAQ;AAAA,EAC9C;AAEA,QAAM,wBAAwC;AAAA,IAC5C,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,EACP;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n MiddlewareConfig,\n LogConfig,\n ServerSetCookieRule,\n StrictMode,\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 strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n 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 i18nextResourcesDirName: getEnvValue(\n env.content.i18nextResourcesDirName,\n 'string'\n )!,\n i18nextResourcesDir: getEnvValue(\n env.content.i18nextResourcesDir,\n 'string'\n )!,\n reactIntlMessagesDirName: getEnvValue(\n env.content.reactIntlMessagesDirName,\n 'string'\n )!,\n reactIntlMessagesDir: getEnvValue(\n env.content.reactIntlMessagesDir,\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 watch: getEnvValue(env.content.watch, 'boolean')!,\n };\n\n const intlayerEditorConfiguration = {\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'locale_first' | 'distant_first',\n };\n\n const logConfiguration: LogConfig = {\n mode: getEnvValue(env.log.mode, 'string')!,\n prefix: getEnvValue(env.log.prefix, 'string')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n log: logConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,gCAAmC;AACnC,mBAA4B;AAOrB,MAAM,mBAAmB,MAAsB;AACpD,QAAM,UAAM,8CAAmB;AAE/B,QA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AAAA,EAC9C;AAEA,QAAM,wBAAwC;AAAA,IAC5C,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,EACP;AAEA,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/logger.ts"],"sourcesContent":["import { IntlayerConfig, getConfiguration } from './index';\n\nexport type Details = {\n isVerbose?: boolean;\n level?: 'info' | 'warn' | 'error' | 'debug';\n config?: Partial<IntlayerConfig['log']>;\n};\n\n// @ts-ignore expected any, but it's not possible to type it correctly\nexport type Logger = (content: any, details?: Details) => void;\n\nexport const logger: Logger = (\n content,\n details = {\n isVerbose: false,\n level: undefined,\n config: { mode: 'default', prefix: '' },\n }\n) => {\n const { mode, prefix } = details.config ?? {};\n\n if (mode === 'disabled') return;\n\n if (details.isVerbose && mode !== 'verbose') return;\n\n if (details.level === 'debug') {\n return console.debug(`${prefix}${content}`);\n }\n\n if (details.level === 'info') {\n return console.info(`${prefix}${content}`);\n }\n\n if (details.level === 'warn') {\n return console.warn(`${prefix}${content}`);\n }\n\n if (details.level === 'error') {\n return console.error(`${prefix}${content}`);\n }\n\n console.log(`${prefix}${content}`);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,MAAM,SAAiB,CAC5B,SACA,UAAU;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ,EAAE,MAAM,WAAW,QAAQ,GAAG;AACxC,MACG;AACH,QAAM,EAAE,MAAM,OAAO,IAAI,QAAQ,UAAU,CAAC;AAE5C,MAAI,SAAS,WAAY;AAEzB,MAAI,QAAQ,aAAa,SAAS,UAAW;AAE7C,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC5C;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC3C;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC3C;AAEA,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC5C;AAEA,UAAQ,IAAI,GAAG,MAAM,GAAG,OAAO,EAAE;AACnC;","names":[]}
1
+ {"version":3,"sources":["../../src/logger.ts"],"sourcesContent":["import { IntlayerConfig } from './types/config';\n\nexport type Details = {\n isVerbose?: boolean;\n level?: 'info' | 'warn' | 'error' | 'debug';\n config?: Partial<IntlayerConfig['log']>;\n};\n\n// @ts-ignore expected any, but it's not possible to type it correctly\nexport type Logger = (content: any, details?: Details) => void;\n\nexport const logger: Logger = (\n content,\n details = {\n isVerbose: false,\n level: undefined,\n config: { mode: 'default', prefix: '' },\n }\n) => {\n const { mode, prefix } = details.config ?? {};\n\n if (mode === 'disabled') return;\n\n if (details.isVerbose && mode !== 'verbose') return;\n\n if (details.level === 'debug') {\n return console.debug(`${prefix}${content}`);\n }\n\n if (details.level === 'info') {\n return console.info(`${prefix}${content}`);\n }\n\n if (details.level === 'warn') {\n return console.warn(`${prefix}${content}`);\n }\n\n if (details.level === 'error') {\n return console.error(`${prefix}${content}`);\n }\n\n console.log(`${prefix}${content}`);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,MAAM,SAAiB,CAC5B,SACA,UAAU;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ,EAAE,MAAM,WAAW,QAAQ,GAAG;AACxC,MACG;AACH,QAAM,EAAE,MAAM,OAAO,IAAI,QAAQ,UAAU,CAAC;AAE5C,MAAI,SAAS,WAAY;AAEzB,MAAI,QAAQ,aAAa,SAAS,UAAW;AAE7C,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC5C;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC3C;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC3C;AAEA,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE;AAAA,EAC5C;AAEA,UAAQ,IAAI,GAAG,MAAM,GAAG,OAAO,EAAE;AACnC;","names":[]}