@intlayer/config 5.8.1 → 6.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/cjs/alias.cjs +101 -0
  2. package/dist/cjs/alias.cjs.map +1 -0
  3. package/dist/cjs/client.cjs +24 -2
  4. package/dist/cjs/client.cjs.map +1 -1
  5. package/dist/cjs/configFile/buildConfigurationFields.cjs +46 -4
  6. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  7. package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
  8. package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
  9. package/dist/cjs/defaultValues/content.cjs +9 -0
  10. package/dist/cjs/defaultValues/content.cjs.map +1 -1
  11. package/dist/cjs/defaultValues/editor.cjs +6 -3
  12. package/dist/cjs/defaultValues/editor.cjs.map +1 -1
  13. package/dist/cjs/defaultValues/log.cjs +2 -3
  14. package/dist/cjs/defaultValues/log.cjs.map +1 -1
  15. package/dist/cjs/getSandboxContext.cjs +1 -1
  16. package/dist/cjs/getSandboxContext.cjs.map +1 -1
  17. package/dist/cjs/index.cjs +30 -11
  18. package/dist/cjs/index.cjs.map +1 -1
  19. package/dist/cjs/loadEnvFile.cjs.map +1 -0
  20. package/dist/cjs/loadExternalFile.cjs.map +1 -1
  21. package/dist/cjs/logger.cjs +107 -4
  22. package/dist/cjs/logger.cjs.map +1 -1
  23. package/dist/cjs/types/config.cjs.map +1 -1
  24. package/dist/esm/alias.mjs +77 -0
  25. package/dist/esm/alias.mjs.map +1 -0
  26. package/dist/esm/client.mjs +26 -2
  27. package/dist/esm/client.mjs.map +1 -1
  28. package/dist/esm/configFile/buildConfigurationFields.mjs +50 -5
  29. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  30. package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
  31. package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
  32. package/dist/esm/defaultValues/content.mjs +6 -0
  33. package/dist/esm/defaultValues/content.mjs.map +1 -1
  34. package/dist/esm/defaultValues/editor.mjs +4 -2
  35. package/dist/esm/defaultValues/editor.mjs.map +1 -1
  36. package/dist/esm/defaultValues/log.mjs +2 -3
  37. package/dist/esm/defaultValues/log.mjs.map +1 -1
  38. package/dist/esm/getSandboxContext.mjs +1 -3
  39. package/dist/esm/getSandboxContext.mjs.map +1 -1
  40. package/dist/esm/index.mjs +30 -12
  41. package/dist/esm/index.mjs.map +1 -1
  42. package/dist/esm/loadEnvFile.mjs.map +1 -0
  43. package/dist/esm/loadExternalFile.mjs.map +1 -1
  44. package/dist/esm/logger.mjs +95 -3
  45. package/dist/esm/logger.mjs.map +1 -1
  46. package/dist/types/alias.d.ts +15 -0
  47. package/dist/types/alias.d.ts.map +1 -0
  48. package/dist/types/client.d.ts +1 -1
  49. package/dist/types/client.d.ts.map +1 -1
  50. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  51. package/dist/types/configFile/getConfiguration.d.ts +3 -2
  52. package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
  53. package/dist/types/configFile/loadConfigurationFile.d.ts +1 -1
  54. package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
  55. package/dist/types/defaultValues/content.d.ts +3 -0
  56. package/dist/types/defaultValues/content.d.ts.map +1 -1
  57. package/dist/types/defaultValues/editor.d.ts +2 -1
  58. package/dist/types/defaultValues/editor.d.ts.map +1 -1
  59. package/dist/types/defaultValues/log.d.ts +1 -1
  60. package/dist/types/defaultValues/log.d.ts.map +1 -1
  61. package/dist/types/getSandboxContext.d.ts +1 -1
  62. package/dist/types/getSandboxContext.d.ts.map +1 -1
  63. package/dist/types/index.d.ts +3 -2
  64. package/dist/types/index.d.ts.map +1 -1
  65. package/dist/types/loadEnvFile.d.ts.map +1 -0
  66. package/dist/types/loadExternalFile.d.ts +1 -1
  67. package/dist/types/loadExternalFile.d.ts.map +1 -1
  68. package/dist/types/logger.d.ts +43 -1
  69. package/dist/types/logger.d.ts.map +1 -1
  70. package/dist/types/types/config.d.ts +43 -7
  71. package/dist/types/types/config.d.ts.map +1 -1
  72. package/package.json +8 -7
  73. package/dist/cjs/envVariables/detectPlatform.cjs +0 -55
  74. package/dist/cjs/envVariables/detectPlatform.cjs.map +0 -1
  75. package/dist/cjs/envVariables/extractEnvVariable/index.cjs +0 -44
  76. package/dist/cjs/envVariables/extractEnvVariable/index.cjs.map +0 -1
  77. package/dist/cjs/envVariables/extractEnvVariable/next.cjs +0 -102
  78. package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +0 -1
  79. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +0 -102
  80. package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +0 -1
  81. package/dist/cjs/envVariables/extractEnvVariable/types.cjs +0 -17
  82. package/dist/cjs/envVariables/extractEnvVariable/types.cjs.map +0 -1
  83. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +0 -102
  84. package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +0 -1
  85. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +0 -111
  86. package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +0 -1
  87. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs +0 -18
  88. package/dist/cjs/envVariables/extractEnvVariable/vite_env.d.cjs.map +0 -1
  89. package/dist/cjs/envVariables/formatEnvVariable.cjs +0 -50
  90. package/dist/cjs/envVariables/formatEnvVariable.cjs.map +0 -1
  91. package/dist/cjs/envVariables/getConfiguration.cjs +0 -150
  92. package/dist/cjs/envVariables/getConfiguration.cjs.map +0 -1
  93. package/dist/cjs/envVariables/index.cjs +0 -40
  94. package/dist/cjs/envVariables/index.cjs.map +0 -1
  95. package/dist/cjs/envVariables/loadEnvFile.cjs.map +0 -1
  96. package/dist/cjs/envVariables/removeUndefinedValueObject.cjs +0 -38
  97. package/dist/cjs/envVariables/removeUndefinedValueObject.cjs.map +0 -1
  98. package/dist/cjs/envVariables/utils.cjs +0 -54
  99. package/dist/cjs/envVariables/utils.cjs.map +0 -1
  100. package/dist/esm/envVariables/detectPlatform.mjs +0 -29
  101. package/dist/esm/envVariables/detectPlatform.mjs.map +0 -1
  102. package/dist/esm/envVariables/extractEnvVariable/index.mjs +0 -20
  103. package/dist/esm/envVariables/extractEnvVariable/index.mjs.map +0 -1
  104. package/dist/esm/envVariables/extractEnvVariable/next.mjs +0 -78
  105. package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +0 -1
  106. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +0 -78
  107. package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +0 -1
  108. package/dist/esm/envVariables/extractEnvVariable/types.mjs +0 -1
  109. package/dist/esm/envVariables/extractEnvVariable/types.mjs.map +0 -1
  110. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +0 -78
  111. package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +0 -1
  112. package/dist/esm/envVariables/extractEnvVariable/vite.mjs +0 -86
  113. package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +0 -1
  114. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs +0 -2
  115. package/dist/esm/envVariables/extractEnvVariable/vite_env.d.mjs.map +0 -1
  116. package/dist/esm/envVariables/formatEnvVariable.mjs +0 -26
  117. package/dist/esm/envVariables/formatEnvVariable.mjs.map +0 -1
  118. package/dist/esm/envVariables/getConfiguration.mjs +0 -128
  119. package/dist/esm/envVariables/getConfiguration.mjs.map +0 -1
  120. package/dist/esm/envVariables/index.mjs +0 -12
  121. package/dist/esm/envVariables/index.mjs.map +0 -1
  122. package/dist/esm/envVariables/loadEnvFile.mjs.map +0 -1
  123. package/dist/esm/envVariables/removeUndefinedValueObject.mjs +0 -14
  124. package/dist/esm/envVariables/removeUndefinedValueObject.mjs.map +0 -1
  125. package/dist/esm/envVariables/utils.mjs +0 -30
  126. package/dist/esm/envVariables/utils.mjs.map +0 -1
  127. package/dist/types/envVariables/detectPlatform.d.ts +0 -7
  128. package/dist/types/envVariables/detectPlatform.d.ts.map +0 -1
  129. package/dist/types/envVariables/extractEnvVariable/index.d.ts +0 -7
  130. package/dist/types/envVariables/extractEnvVariable/index.d.ts.map +0 -1
  131. package/dist/types/envVariables/extractEnvVariable/next.d.ts +0 -3
  132. package/dist/types/envVariables/extractEnvVariable/next.d.ts.map +0 -1
  133. package/dist/types/envVariables/extractEnvVariable/react_app.d.ts +0 -3
  134. package/dist/types/envVariables/extractEnvVariable/react_app.d.ts.map +0 -1
  135. package/dist/types/envVariables/extractEnvVariable/types.d.ts +0 -8
  136. package/dist/types/envVariables/extractEnvVariable/types.d.ts.map +0 -1
  137. package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts +0 -3
  138. package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts.map +0 -1
  139. package/dist/types/envVariables/extractEnvVariable/vite.d.ts +0 -3
  140. package/dist/types/envVariables/extractEnvVariable/vite.d.ts.map +0 -1
  141. package/dist/types/envVariables/formatEnvVariable.d.ts +0 -6
  142. package/dist/types/envVariables/formatEnvVariable.d.ts.map +0 -1
  143. package/dist/types/envVariables/getConfiguration.d.ts +0 -9
  144. package/dist/types/envVariables/getConfiguration.d.ts.map +0 -1
  145. package/dist/types/envVariables/index.d.ts +0 -5
  146. package/dist/types/envVariables/index.d.ts.map +0 -1
  147. package/dist/types/envVariables/loadEnvFile.d.ts.map +0 -1
  148. package/dist/types/envVariables/removeUndefinedValueObject.d.ts +0 -2
  149. package/dist/types/envVariables/removeUndefinedValueObject.d.ts.map +0 -1
  150. package/dist/types/envVariables/utils.d.ts +0 -7
  151. package/dist/types/envVariables/utils.d.ts.map +0 -1
  152. /package/dist/cjs/{envVariables/loadEnvFile.cjs → loadEnvFile.cjs} +0 -0
  153. /package/dist/esm/{envVariables/loadEnvFile.mjs → loadEnvFile.mjs} +0 -0
  154. /package/dist/types/{envVariables/loadEnvFile.d.ts → loadEnvFile.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport {\n IMPORT_MODE,\n OPTIMIZE,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n CONFIG_DIR,\n CONTENT_DIR,\n DICTIONARIES_DIR,\n DICTIONARY_OUTPUT,\n DYNAMIC_DICTIONARIES_DIR,\n EXCLUDED_PATHS,\n FILE_EXTENSIONS,\n I18NEXT_DICTIONARIES_DIR,\n MAIN_DIR,\n MODULE_AUGMENTATION_DIR,\n REACT_INTL_MESSAGES_DIR,\n TYPES_DIR,\n UNMERGED_DICTIONARIES_DIR,\n WATCH,\n} from '../defaultValues/content';\nimport {\n APPLICATION_URL,\n BACKEND_URL,\n CMS_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n EDITOR_URL,\n HOT_RELOAD,\n IS_ENABLED,\n PORT,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n REQUIRED_LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport { MODE, PREFIX } from '../defaultValues/log';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n ContentConfig,\n CustomIntlayerConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n} from '../types/config';\nimport { normalizePath } from '../utils/normalizePath';\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 * Locales required by TypeScript to ensure strong implementations of internationalized content using typescript.\n *\n * Default: []\n *\n * If empty, all locales are required in `strict` mode.\n *\n * Ensure required locales are also defined in the `locales` field.\n */\n requiredLocales:\n customConfiguration?.requiredLocales ??\n customConfiguration?.locales ??\n REQUIRED_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 \"inclusive\", 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: \"inclusive\"\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 /**\n * Controls whether locale detection occurs during Next.js prefetch requests\n * - true: Detect and apply locale during prefetch\n * - false: Use default locale during prefetch (recommended)\n *\n * This setting affects how Next.js handles locale prefetching:\n *\n * Example scenario:\n * - User's browser language is 'fr'\n * - Current page is /fr/about\n * - Link prefetches /about\n *\n * With `detectLocaleOnPrefetchNoPrefix:true`\n * - Prefetch detects 'fr' locale from browser\n * - Redirects prefetch to /fr/about\n *\n * With `detectLocaleOnPrefetchNoPrefix:false` (default)\n * - Prefetch uses default locale\n * - Redirects prefetch to /en/about (assuming 'en' is default)\n *\n * When to use true:\n * - Your app uses non-localized internal links (e.g. <a href=\"/about\">)\n * - You want consistent locale detection behavior between regular and prefetch requests\n *\n * When to use false (default):\n * - Your app uses locale-prefixed links (e.g. <a href=\"/fr/about\">)\n * - You want to optimize prefetching performance\n * - You want to avoid potential redirect loops\n *\n * Default: false\n */\n detectLocaleOnPrefetchNoPrefix:\n customConfiguration?.detectLocaleOnPrefetchNoPrefix ??\n DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string\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: '\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 ?? baseDir ?? process.cwd(),\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: ./src\n *\n * Example: '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: (customConfiguration?.contentDir ?? CONTENT_DIR).map(\n (contentDir) => join(notDerivedContentConfig.baseDir, contentDir)\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.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 dictionariesDirName field instead\n */\n dictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\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: .intlayer/types\n *\n * Example: '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\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\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 dictionariesDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the unmerged dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: '.intlayer/unmerged_dictionary'\n *\n */\n unmergedDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.unmergedDictionariesDir ?? UNMERGED_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the final dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dynamic dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dynamic_dictionary\n */\n dynamicDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n customConfiguration?.dynamicDictionariesDir ?? DYNAMIC_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the 18n dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: i18next_resources\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.i18nextResourcesDir ?? I18NEXT_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: intl_messages\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.reactIntlMessagesDir ?? REACT_INTL_MESSAGES_DIR\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/types\n *\n * Example: '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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.typesDir ?? TYPES_DIR\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/main\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.mainDir ?? MAIN_DIR\n ),\n\n /**\n * Directory where the configuration files are stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/config\n *\n * Example: '.intlayer/config'\n *\n * Note:\n *\n * - If the configuration files are not at the result directory level, update the configDirName field instead\n */\n configDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.configDir ?? CONFIG_DIR\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: ['src/**\\/*.content.ts', 'src/**\\/*.content.js', 'src/**\\/*.content.json', 'src/**\\/*.content.cjs', 'src/**\\/*.content.mjs', 'src/**\\/*.content.tsx', 'src/**\\/*.content.jsx']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.flatMap(\n (ext) =>\n baseDirDerivedConfiguration.contentDir.map(\n (contentDir) => `${normalizePath(contentDir)}/**/*${ext}`\n )\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '.intlayer/dictionary/**\\/*.json'\n */\n outputFilesPatternWithPath: `${normalizePath(\n dictionariesDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...dictionariesDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * URL of the application. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n applicationURL: customConfiguration?.applicationURL ?? APPLICATION_URL,\n\n /**\n * URL of the editor server. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n editorURL: customConfiguration?.editorURL ?? EDITOR_URL,\n\n /**\n * URL of the CMS server. Used to restrict the origin of the editor for security reasons.\n */\n cmsURL: customConfiguration?.cmsURL ?? CMS_URL,\n\n /**\n * URL of the editor server\n *\n * Default: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\n /** Port of the editor server\n *\n * Default: 8000\n */\n port: customConfiguration?.port ?? PORT,\n\n /**\n * Indicates if the application interact with the visual editor\n *\n * Default: true;\n *\n * If true, the editor will be able to interact with the application.\n * If false, the editor will not be able to interact with the application.\n * In any case, the editor can only be enabled by the visual editor.\n * Disabling the editor for specific environments is a way to enforce the security.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV !== 'production',\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: 'local_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'local_first' or 'distant_first'.\n * - 'local_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 /**\n * Indicates if the application should hot reload the locale configurations when a change is detected.\n * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.\n *\n * The hot reload is only available for clients of the `enterprise` plan.\n *\n * Default: false\n */\n hotReload: customConfiguration?.hotReload ?? HOT_RELOAD,\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\nconst buildAiFields = (customConfiguration?: Partial<AiConfig>): AiConfig => ({\n /**\n * AI configuration\n */\n provider: customConfiguration?.provider,\n\n /**\n * API key\n */\n apiKey: customConfiguration?.apiKey,\n\n /**\n * API model\n */\n model: customConfiguration?.model,\n\n /**\n * Temperature\n */\n temperature: customConfiguration?.temperature,\n\n /**\n * Application context\n */\n applicationContext: customConfiguration?.applicationContext,\n});\n\nconst buildBuildFields = (\n customConfiguration?: Partial<BuildConfig>\n): BuildConfig => ({\n /**\n * Indicates if the build should be optimized\n *\n * Default: process.env.NODE_ENV === 'production'\n *\n * If true, the build will be optimized.\n * If false, the build will not be optimized.\n *\n * Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.\n * All imports will stay as static import to avoid async processing when loading the dictionaries.\n *\n * Note:\n * - Intlayer will replace all call of `useIntlayer` with the defined mode by the `importMode` option.\n * - Intlayer will replace all call of `getIntlayer` with `getDictionary`.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - In most cases, \"dynamic\" will be used for React applications, \"async\" for Vue.js applications.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n */\n optimize: customConfiguration?.optimize ?? OPTIMIZE,\n\n /**\n * Indicates the mode of import to use for the dictionaries.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionary`.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * - \"async\": The dictionaries are imported dynamically in an asynchronous component.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `await useDictionaryAsync`.\n *\n * Default: \"static\"\n *\n * By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.\n *\n * Note:\n * - Dynamic imports rely on Suspense and may slightly impact rendering performance.\n * - If desabled all locales will be loaded at once, even if they are not used.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n * - This option will be ignored if `optimize` is disabled.\n * - This option will not impact the `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` and `useDictionaryDynamic` functions. You can still use them to refine you code on manual optimization.\n */\n importMode: customConfiguration?.importMode ?? IMPORT_MODE,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * Allows to avoid to traverse the code that is not relevant to the optimization.\n * Improve build performance.\n *\n * Default: ['**\\/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx}', '!**\\/node_modules/**']\n *\n * Example: `['src/**\\/*.{ts,tsx}', '../ui-library/**\\/*.{ts,tsx}']`\n *\n * Note:\n * - This option will be ignored if `optimize` is disabled.\n * - Use glob pattern.\n */\n traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,\n});\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n customConfiguration?: CustomIntlayerConfig,\n baseDir?: string\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir\n );\n\n const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n const logConfig = buildLogFields(customConfiguration?.log);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyB3C,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgB/C,iBAAiB,qBAAqB,mBAAmB;AAC3D;AAKO,MAAM,2BAA2B,CACtC,qBACA,YACmB;AACnB,QAAM,6BAA6B;AAAA,IACjC,qBAAqB;AAAA,EACvB;AAEA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,EACvB;AAEA,QAAM,gBAAgB;AAAA,IACpB,qBAAqB;AAAA,IACrB;AAAA,EACF;AAEA,QAAM,eAAe,kBAAkB,qBAAqB,MAAM;AAElE,QAAM,YAAY,eAAe,qBAAqB,GAAG;AAEzD,QAAM,WAAW,cAAc,qBAAqB,EAAE;AAEtD,QAAM,cAAc,iBAAiB,qBAAqB,KAAK;AAE/D,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport {\n IMPORT_MODE,\n OPTIMIZE,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n CONFIG_DIR,\n CONTENT_DIR,\n DICTIONARIES_DIR,\n DICTIONARY_OUTPUT,\n DYNAMIC_DICTIONARIES_DIR,\n EXCLUDED_PATHS,\n FETCH_DICTIONARIES_DIR,\n FILE_EXTENSIONS,\n I18NEXT_DICTIONARIES_DIR,\n MAIN_DIR,\n MODULE_AUGMENTATION_DIR,\n REACT_INTL_MESSAGES_DIR,\n REMOTE_DICTIONARIES_DIR,\n TYPES_DIR,\n UNMERGED_DICTIONARIES_DIR,\n WATCH,\n} from '../defaultValues/content';\nimport {\n APPLICATION_URL,\n BACKEND_URL,\n CMS_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n EDITOR_URL,\n IS_ENABLED,\n LIVE_SYNC,\n LIVE_SYNC_PORT,\n PORT,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n REQUIRED_LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport { MODE, PREFIX } from '../defaultValues/log';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n ContentConfig,\n CustomIntlayerConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n} from '../types/config';\nimport { normalizePath } from '../utils/normalizePath';\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 * Locales required by TypeScript to ensure strong implementations of internationalized content using typescript.\n *\n * Default: []\n *\n * If empty, all locales are required in `strict` mode.\n *\n * Ensure required locales are also defined in the `locales` field.\n */\n requiredLocales:\n customConfiguration?.requiredLocales ??\n customConfiguration?.locales ??\n REQUIRED_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 \"inclusive\", 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: \"inclusive\"\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 /**\n * Controls whether locale detection occurs during Next.js prefetch requests\n * - true: Detect and apply locale during prefetch\n * - false: Use default locale during prefetch (recommended)\n *\n * This setting affects how Next.js handles locale prefetching:\n *\n * Example scenario:\n * - User's browser language is 'fr'\n * - Current page is /fr/about\n * - Link prefetches /about\n *\n * With `detectLocaleOnPrefetchNoPrefix:true`\n * - Prefetch detects 'fr' locale from browser\n * - Redirects prefetch to /fr/about\n *\n * With `detectLocaleOnPrefetchNoPrefix:false` (default)\n * - Prefetch uses default locale\n * - Redirects prefetch to /en/about (assuming 'en' is default)\n *\n * When to use true:\n * - Your app uses non-localized internal links (e.g. <a href=\"/about\">)\n * - You want consistent locale detection behavior between regular and prefetch requests\n *\n * When to use false (default):\n * - Your app uses locale-prefixed links (e.g. <a href=\"/fr/about\">)\n * - You want to optimize prefetching performance\n * - You want to avoid potential redirect loops\n *\n * Default: false\n */\n detectLocaleOnPrefetchNoPrefix:\n customConfiguration?.detectLocaleOnPrefetchNoPrefix ??\n DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string\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: '\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 ?? baseDir ?? process.cwd(),\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 * Indicate how the content should be automatically filled using AI.\n *\n * Default: undefined\n */\n autoFill: customConfiguration?.autoFill ?? undefined,\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: ./src\n *\n * Example: '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: (customConfiguration?.contentDir ?? CONTENT_DIR).map(\n (contentDir) => join(notDerivedContentConfig.baseDir, contentDir)\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.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 dictionariesDirName field instead\n */\n dictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\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: .intlayer/types\n *\n * Example: '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\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\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 dictionariesDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the unmerged dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: '.intlayer/unmerged_dictionary'\n *\n */\n unmergedDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.unmergedDictionariesDir ?? UNMERGED_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the remote dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: '.intlayer/remote_dictionary'\n */\n remoteDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n customConfiguration?.remoteDictionariesDir ?? REMOTE_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the final dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dynamic dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dynamic_dictionary\n */\n dynamicDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n customConfiguration?.dynamicDictionariesDir ?? DYNAMIC_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the fetch dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/fetch_dictionary\n */\n fetchDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n customConfiguration?.fetchDictionariesDir ?? FETCH_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the 18n dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: i18next_resources\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.i18nextResourcesDir ?? I18NEXT_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: intl_messages\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.reactIntlMessagesDir ?? REACT_INTL_MESSAGES_DIR\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/types\n *\n * Example: '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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.typesDir ?? TYPES_DIR\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/main\n *\n * Example: '.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 notDerivedContentConfig.baseDir,\n\n customConfiguration?.mainDir ?? MAIN_DIR\n ),\n\n /**\n * Directory where the configuration files are stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/config\n *\n * Example: '.intlayer/config'\n *\n * Note:\n *\n * - If the configuration files are not at the result directory level, update the configDirName field instead\n */\n configDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.configDir ?? CONFIG_DIR\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: ['src/**\\/*.content.ts', 'src/**\\/*.content.js', 'src/**\\/*.content.json', 'src/**\\/*.content.cjs', 'src/**\\/*.content.mjs', 'src/**\\/*.content.tsx', 'src/**\\/*.content.jsx']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.flatMap(\n (ext) =>\n baseDirDerivedConfiguration.contentDir.map(\n (contentDir) => `${normalizePath(contentDir)}/**/*${ext}`\n )\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '.intlayer/dictionary/**\\/*.json'\n */\n outputFilesPatternWithPath: `${normalizePath(\n dictionariesDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...dictionariesDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * URL of the application. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n applicationURL: customConfiguration?.applicationURL ?? APPLICATION_URL,\n\n /**\n * URL of the editor server. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n editorURL: customConfiguration?.editorURL ?? EDITOR_URL,\n\n /**\n * URL of the CMS server. Used to restrict the origin of the editor for security reasons.\n */\n cmsURL: customConfiguration?.cmsURL ?? CMS_URL,\n\n /**\n * URL of the editor server\n *\n * Default: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\n /** Port of the editor server\n *\n * Default: 8000\n */\n port: customConfiguration?.port ?? PORT,\n\n /**\n * Indicates if the application interact with the visual editor\n *\n * Default: true;\n *\n * If true, the editor will be able to interact with the application.\n * If false, the editor will not be able to interact with the application.\n * In any case, the editor can only be enabled by the visual editor.\n * Disabling the editor for specific environments is a way to enforce the security.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV !== 'production',\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: 'local_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'local_first' or 'distant_first'.\n * - 'local_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 /**\n * Indicates if the application should hot reload the locale configurations when a change is detected.\n * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.\n *\n * The hot reload is only available for clients of the `enterprise` plan.\n *\n * Default: false\n */\n liveSync: customConfiguration?.liveSync ?? LIVE_SYNC,\n\n /**\n * Port of the live sync server\n *\n * Default: 4000\n */\n liveSyncPort: customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT,\n\n /**\n * URL of the live sync server in case of remote live sync server\n *\n * Default: `http://localhost:${LIVE_SYNC_PORT}`\n */\n liveSyncURL:\n customConfiguration?.liveSyncURL ??\n `http://localhost:${customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT}`,\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\nconst buildAiFields = (customConfiguration?: Partial<AiConfig>): AiConfig => ({\n /**\n * AI configuration\n */\n provider: customConfiguration?.provider,\n\n /**\n * API key\n */\n apiKey: customConfiguration?.apiKey,\n\n /**\n * API model\n */\n model: customConfiguration?.model,\n\n /**\n * Temperature\n */\n temperature: customConfiguration?.temperature,\n\n /**\n * Application context\n */\n applicationContext: customConfiguration?.applicationContext,\n});\n\nconst buildBuildFields = (\n customConfiguration?: Partial<BuildConfig>\n): BuildConfig => ({\n /**\n * Indicates if the build should be optimized\n *\n * Default: process.env.NODE_ENV === 'production'\n *\n * If true, the build will be optimized.\n * If false, the build will not be optimized.\n *\n * Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.\n * All imports will stay as static import to avoid async processing when loading the dictionaries.\n *\n * Note:\n * - Intlayer will replace all call of `useIntlayer` with the defined mode by the `importMode` option.\n * - Intlayer will replace all call of `getIntlayer` with `getDictionary`.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - In most cases, \"dynamic\" will be used for React applications, \"async\" for Vue.js applications.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n */\n optimize: customConfiguration?.optimize ?? OPTIMIZE,\n\n /**\n * Indicates the mode of import to use for the dictionaries.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionary`.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * - \"live\": The dictionaries are imported dynamically using the live sync API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * Live mode will use the live sync API to fetch the dictionaries. If the API call fails, the dictionaries will be imported dynamically as \"dynamic\" mode.\n *\n * Default: \"static\"\n *\n * By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.\n *\n * Note:\n * - Dynamic imports rely on Suspense and may slightly impact rendering performance.\n * - If desabled all locales will be loaded at once, even if they are not used.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n * - This option will be ignored if `optimize` is disabled.\n * - This option will not impact the `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` and `useDictionaryDynamic` functions. You can still use them to refine you code on manual optimization.\n * - The \"live\" allows to sync the dictionaries to the live sync server.\n */\n importMode: customConfiguration?.importMode ?? IMPORT_MODE,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * Allows to avoid to traverse the code that is not relevant to the optimization.\n * Improve build performance.\n *\n * Default: ['**\\/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx}', '!**\\/node_modules/**']\n *\n * Example: `['src/**\\/*.{ts,tsx}', '../ui-library/**\\/*.{ts,tsx}']`\n *\n * Note:\n * - This option will be ignored if `optimize` is disabled.\n * - Use glob pattern.\n */\n traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,\n});\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n customConfiguration?: CustomIntlayerConfig,\n baseDir?: string\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir\n );\n\n const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n const logConfig = buildLogFields(customConfiguration?.log);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":"AAAA,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,MAAM,cAAc;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgBP,SAAS,qBAAqB;AAE9B,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;AAAA,EAWzC,iBACE,qBAAqB,mBACrB,qBAAqB,WACrB;AAAA;AAAA;AAAA;AAA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;AAAA,EACvB;AAEA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,EACvB;AAEA,QAAM,gBAAgB;AAAA,IACpB,qBAAqB;AAAA,IACrB;AAAA,EACF;AAEA,QAAM,eAAe,kBAAkB,qBAAqB,MAAM;AAElE,QAAM,YAAY,eAAe,qBAAqB,GAAG;AAEzD,QAAM,WAAW,cAAc,qBAAqB,EAAE;AAEtD,QAAM,cAAc,iBAAiB,qBAAqB,KAAK;AAE/D,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/configFile/getConfiguration.ts"],"sourcesContent":["import merge from 'deepmerge';\nimport { relative } from 'path';\nimport type { LoadEnvFileOptions } from '../envVariables/loadEnvFile';\nimport { logger } from '../logger';\nimport type { CustomIntlayerConfig, IntlayerConfig } from '../types/config';\nimport { buildConfigurationFields } from './buildConfigurationFields';\nimport { loadConfigurationFile } from './loadConfigurationFile';\nimport { searchConfigurationFile } from './searchConfigurationFile';\n\nlet storedConfiguration: IntlayerConfig | undefined;\nlet storedConfigurationFilePath: string | undefined;\nlet storedNumCustomConfiguration: number | undefined;\n\nexport type GetConfigurationOptions = {\n baseDir?: string;\n override?: CustomIntlayerConfig;\n} & LoadEnvFileOptions;\n\nconst BASE_DIR_PATH = process.cwd();\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfiguration = (\n options?: GetConfigurationOptions\n): IntlayerConfig => {\n const mergedOptions = {\n baseDir: BASE_DIR_PATH,\n ...options,\n };\n\n const { baseDir, env, envFile } = mergedOptions;\n\n if (!storedConfiguration || typeof options !== 'undefined') {\n // Search for configuration files\n const { configurationFilePath, numCustomConfiguration } =\n searchConfigurationFile(baseDir);\n\n // Load the custom configuration\n let customConfiguration: CustomIntlayerConfig | undefined;\n\n if (configurationFilePath) {\n customConfiguration = loadConfigurationFile(configurationFilePath, {\n env,\n envFile,\n });\n }\n\n // Save the configuration to avoid reading the file again\n storedConfiguration = buildConfigurationFields(\n customConfiguration,\n baseDir\n );\n\n storedConfigurationFilePath = configurationFilePath;\n storedNumCustomConfiguration = numCustomConfiguration;\n }\n\n // Log warning if multiple configuration files are found\n if (options?.override?.log?.mode === 'verbose') {\n logConfigFileResult(\n storedNumCustomConfiguration,\n storedConfigurationFilePath\n );\n }\n\n return merge(storedConfiguration, options?.override ?? {}) as IntlayerConfig;\n};\n\nconst logConfigFileResult = (\n numCustomConfiguration?: number,\n configurationFilePath?: string\n) => {\n if (numCustomConfiguration === 0) {\n logger('Configuration file not found, using default configuration.', {\n isVerbose: true,\n });\n } else {\n const relativeOutputPath = relative(BASE_DIR_PATH, configurationFilePath!);\n\n if (numCustomConfiguration === 1) {\n logger(`Configuration file found: ${relativeOutputPath}.`, {\n isVerbose: true,\n });\n } else {\n logger(\n `Multiple configuration files found, using ${relativeOutputPath}.`,\n {\n isVerbose: true,\n }\n );\n }\n }\n};\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AAEzB,SAAS,cAAc;AAEvB,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AAExC,IAAI;AACJ,IAAI;AACJ,IAAI;AAOJ,MAAM,gBAAgB,QAAQ,IAAI;AAK3B,MAAM,mBAAmB,CAC9B,YACmB;AACnB,QAAM,gBAAgB;AAAA,IACpB,SAAS;AAAA,IACT,GAAG;AAAA,EACL;AAEA,QAAM,EAAE,SAAS,KAAK,QAAQ,IAAI;AAElC,MAAI,CAAC,uBAAuB,OAAO,YAAY,aAAa;AAE1D,UAAM,EAAE,uBAAuB,uBAAuB,IACpD,wBAAwB,OAAO;AAGjC,QAAI;AAEJ,QAAI,uBAAuB;AACzB,4BAAsB,sBAAsB,uBAAuB;AAAA,QACjE;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAGA,0BAAsB;AAAA,MACpB;AAAA,MACA;AAAA,IACF;AAEA,kCAA8B;AAC9B,mCAA+B;AAAA,EACjC;AAGA,MAAI,SAAS,UAAU,KAAK,SAAS,WAAW;AAC9C;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO,MAAM,qBAAqB,SAAS,YAAY,CAAC,CAAC;AAC3D;AAEA,MAAM,sBAAsB,CAC1B,wBACA,0BACG;AACH,MAAI,2BAA2B,GAAG;AAChC,WAAO,8DAA8D;AAAA,MACnE,WAAW;AAAA,IACb,CAAC;AAAA,EACH,OAAO;AACL,UAAM,qBAAqB,SAAS,eAAe,qBAAsB;AAEzE,QAAI,2BAA2B,GAAG;AAChC,aAAO,6BAA6B,kBAAkB,KAAK;AAAA,QACzD,WAAW;AAAA,MACb,CAAC;AAAA,IACH,OAAO;AACL;AAAA,QACE,6CAA6C,kBAAkB;AAAA,QAC/D;AAAA,UACE,WAAW;AAAA,QACb;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/configFile/getConfiguration.ts"],"sourcesContent":["import merge from 'deepmerge';\nimport { relative } from 'path';\nimport { logger } from '../logger';\nimport type { CustomIntlayerConfig, IntlayerConfig } from '../types/config';\nimport { buildConfigurationFields } from './buildConfigurationFields';\nimport { loadConfigurationFile } from './loadConfigurationFile';\nimport { searchConfigurationFile } from './searchConfigurationFile';\n\nlet storedConfiguration: IntlayerConfig | undefined;\nlet storedConfigurationFilePath: string | undefined;\nlet storedNumCustomConfiguration: number | undefined;\n\nexport type GetConfigurationOptions = {\n baseDir?: string;\n override?: CustomIntlayerConfig;\n env?: string;\n envFile?: string;\n};\n\nconst BASE_DIR_PATH = process.cwd();\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfiguration = (\n options?: GetConfigurationOptions\n): IntlayerConfig => {\n const mergedOptions = {\n baseDir: BASE_DIR_PATH,\n ...options,\n };\n\n const { baseDir, env, envFile } = mergedOptions;\n\n if (!storedConfiguration || typeof options !== 'undefined') {\n // Search for configuration files\n const { configurationFilePath, numCustomConfiguration } =\n searchConfigurationFile(baseDir);\n\n // Load the custom configuration\n let customConfiguration: CustomIntlayerConfig | undefined;\n\n if (configurationFilePath) {\n customConfiguration = loadConfigurationFile(configurationFilePath, {\n env,\n envFile,\n });\n }\n\n // Save the configuration to avoid reading the file again\n storedConfiguration = buildConfigurationFields(\n customConfiguration,\n baseDir\n );\n\n storedConfigurationFilePath = configurationFilePath;\n storedNumCustomConfiguration = numCustomConfiguration;\n }\n\n // Log warning if multiple configuration files are found\n if (options?.override?.log?.mode === 'verbose') {\n logConfigFileResult(\n storedNumCustomConfiguration,\n storedConfigurationFilePath\n );\n }\n\n return merge(storedConfiguration, options?.override ?? {}) as IntlayerConfig;\n};\n\nconst logConfigFileResult = (\n numCustomConfiguration?: number,\n configurationFilePath?: string\n) => {\n if (numCustomConfiguration === 0) {\n logger('Configuration file not found, using default configuration.', {\n isVerbose: true,\n });\n } else {\n const relativeOutputPath = relative(BASE_DIR_PATH, configurationFilePath!);\n\n if (numCustomConfiguration === 1) {\n logger(`Configuration file found: ${relativeOutputPath}.`, {\n isVerbose: true,\n });\n } else {\n logger(\n `Multiple configuration files found, using ${relativeOutputPath}.`,\n {\n isVerbose: true,\n }\n );\n }\n }\n};\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAEvB,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AAExC,IAAI;AACJ,IAAI;AACJ,IAAI;AASJ,MAAM,gBAAgB,QAAQ,IAAI;AAK3B,MAAM,mBAAmB,CAC9B,YACmB;AACnB,QAAM,gBAAgB;AAAA,IACpB,SAAS;AAAA,IACT,GAAG;AAAA,EACL;AAEA,QAAM,EAAE,SAAS,KAAK,QAAQ,IAAI;AAElC,MAAI,CAAC,uBAAuB,OAAO,YAAY,aAAa;AAE1D,UAAM,EAAE,uBAAuB,uBAAuB,IACpD,wBAAwB,OAAO;AAGjC,QAAI;AAEJ,QAAI,uBAAuB;AACzB,4BAAsB,sBAAsB,uBAAuB;AAAA,QACjE;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAGA,0BAAsB;AAAA,MACpB;AAAA,MACA;AAAA,IACF;AAEA,kCAA8B;AAC9B,mCAA+B;AAAA,EACjC;AAGA,MAAI,SAAS,UAAU,KAAK,SAAS,WAAW;AAC9C;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO,MAAM,qBAAqB,SAAS,YAAY,CAAC,CAAC;AAC3D;AAEA,MAAM,sBAAsB,CAC1B,wBACA,0BACG;AACH,MAAI,2BAA2B,GAAG;AAChC,WAAO,8DAA8D;AAAA,MACnE,WAAW;AAAA,IACb,CAAC;AAAA,EACH,OAAO;AACL,UAAM,qBAAqB,SAAS,eAAe,qBAAsB;AAEzE,QAAI,2BAA2B,GAAG;AAChC,aAAO,6BAA6B,kBAAkB,KAAK;AAAA,QACzD,WAAW;AAAA,MACb,CAAC;AAAA,IACH,OAAO;AACL;AAAA,QACE,6CAA6C,kBAAkB;AAAA,QAC/D;AAAA,UACE,WAAW;AAAA,QACb;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/configFile/loadConfigurationFile.ts"],"sourcesContent":["import { type LoadEnvFileOptions } from '../envVariables/loadEnvFile';\nimport { loadExternalFile } from '../loadExternalFile';\nimport { logger } from '../logger';\nimport type { CustomIntlayerConfig } from '../types/config';\n\nconst filterValidConfiguration = (\n configuration: CustomIntlayerConfig\n): CustomIntlayerConfig => {\n // @TODO Implement filtering of valid configuration\n return configuration;\n};\n\n/**\n * Load the configuration file from the given path\n * Example of configuration file: intlayer.config.js\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadConfigurationFile = (\n configFilePath: string,\n envVarOptions?: LoadEnvFileOptions\n): CustomIntlayerConfig | undefined => {\n try {\n const fileContent = loadExternalFile(configFilePath, envVarOptions);\n\n return filterValidConfiguration(fileContent);\n } catch (error) {\n logger(\n `Error: ${error} ${JSON.stringify((error as Error).stack, null, 2)}`,\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,cAAc;AAGvB,MAAM,2BAA2B,CAC/B,kBACyB;AAEzB,SAAO;AACT;AAQO,MAAM,wBAAwB,CACnC,gBACA,kBACqC;AACrC,MAAI;AACF,UAAM,cAAc,iBAAiB,gBAAgB,aAAa;AAElE,WAAO,yBAAyB,WAAW;AAAA,EAC7C,SAAS,OAAO;AACd;AAAA,MACE,UAAU,KAAK,IAAI,KAAK,UAAW,MAAgB,OAAO,MAAM,CAAC,CAAC;AAAA,MAClE;AAAA,QACE,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/configFile/loadConfigurationFile.ts"],"sourcesContent":["import { type LoadEnvFileOptions } from '../loadEnvFile';\nimport { loadExternalFile } from '../loadExternalFile';\nimport { logger } from '../logger';\nimport type { CustomIntlayerConfig } from '../types/config';\n\nconst filterValidConfiguration = (\n configuration: CustomIntlayerConfig\n): CustomIntlayerConfig => {\n // @TODO Implement filtering of valid configuration\n return configuration;\n};\n\n/**\n * Load the configuration file from the given path\n * Example of configuration file: intlayer.config.js\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadConfigurationFile = (\n configFilePath: string,\n envVarOptions?: LoadEnvFileOptions\n): CustomIntlayerConfig | undefined => {\n try {\n const fileContent = loadExternalFile(configFilePath, envVarOptions);\n\n return filterValidConfiguration(fileContent);\n } catch (error) {\n logger(\n `Error: ${error} ${JSON.stringify((error as Error).stack, null, 2)}`,\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,cAAc;AAGvB,MAAM,2BAA2B,CAC/B,kBACyB;AAEzB,SAAO;AACT;AAQO,MAAM,wBAAwB,CACnC,gBACA,kBACqC;AACrC,MAAI;AACF,UAAM,cAAc,iBAAiB,gBAAgB,aAAa;AAElE,WAAO,yBAAyB,WAAW;AAAA,EAC7C,SAAS,OAAO;AACd;AAAA,MACE,UAAU,KAAK,IAAI,KAAK,UAAW,MAAgB,OAAO,MAAM,CAAC,CAAC;AAAA,MAClE;AAAA,QACE,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -20,8 +20,11 @@ const EXCLUDED_PATHS = [
20
20
  const CONTENT_DIR = ["."];
21
21
  const MAIN_DIR = ".intlayer/main";
22
22
  const DICTIONARIES_DIR = ".intlayer/dictionary";
23
+ const MASKS_DIR = ".intlayer/mask";
24
+ const REMOTE_DICTIONARIES_DIR = ".intlayer/remote_dictionary";
23
25
  const UNMERGED_DICTIONARIES_DIR = ".intlayer/unmerged_dictionary";
24
26
  const DYNAMIC_DICTIONARIES_DIR = ".intlayer/dynamic_dictionary";
27
+ const FETCH_DICTIONARIES_DIR = ".intlayer/fetch_dictionary";
25
28
  const TYPES_DIR = ".intlayer/types";
26
29
  const MODULE_AUGMENTATION_DIR = ".intlayer/types";
27
30
  const DICTIONARY_OUTPUT = ["intlayer"];
@@ -36,11 +39,14 @@ export {
36
39
  DICTIONARY_OUTPUT,
37
40
  DYNAMIC_DICTIONARIES_DIR,
38
41
  EXCLUDED_PATHS,
42
+ FETCH_DICTIONARIES_DIR,
39
43
  FILE_EXTENSIONS,
40
44
  I18NEXT_DICTIONARIES_DIR,
41
45
  MAIN_DIR,
46
+ MASKS_DIR,
42
47
  MODULE_AUGMENTATION_DIR,
43
48
  REACT_INTL_MESSAGES_DIR,
49
+ REMOTE_DICTIONARIES_DIR,
44
50
  TYPES_DIR,
45
51
  UNMERGED_DICTIONARIES_DIR,
46
52
  WATCH
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["import type { DictionaryOutput } from '../types/config';\n\nexport const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.cjx',\n '.content.mjs',\n '.content.mjx',\n '.content.json',\n '.content.tsx',\n '.content.jsx',\n];\nexport const EXCLUDED_PATHS = [\n 'node_modules',\n '.intlayer',\n '.next',\n '.nuxt',\n '.expo',\n 'dist',\n];\n\nexport const CONTENT_DIR = ['.'];\n\nexport const MAIN_DIR = '.intlayer/main';\n\nexport const DICTIONARIES_DIR = '.intlayer/dictionary';\n\nexport const UNMERGED_DICTIONARIES_DIR = '.intlayer/unmerged_dictionary';\n\nexport const DYNAMIC_DICTIONARIES_DIR = '.intlayer/dynamic_dictionary';\n\nexport const TYPES_DIR = '.intlayer/types';\n\nexport const MODULE_AUGMENTATION_DIR = '.intlayer/types';\n\nexport const DICTIONARY_OUTPUT: DictionaryOutput[] = ['intlayer'];\n\nexport const I18NEXT_DICTIONARIES_DIR = 'i18next_resources';\n\nexport const REACT_INTL_MESSAGES_DIR = 'intl_messages';\n\nexport const CONFIG_DIR = '.intlayer/config';\n\nexport const WATCH = process.env.NODE_ENV === 'development';\n"],"mappings":"AAEO,MAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACO,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,cAAc,CAAC,GAAG;AAExB,MAAM,WAAW;AAEjB,MAAM,mBAAmB;AAEzB,MAAM,4BAA4B;AAElC,MAAM,2BAA2B;AAEjC,MAAM,YAAY;AAElB,MAAM,0BAA0B;AAEhC,MAAM,oBAAwC,CAAC,UAAU;AAEzD,MAAM,2BAA2B;AAEjC,MAAM,0BAA0B;AAEhC,MAAM,aAAa;AAEnB,MAAM,QAAQ,QAAQ,IAAI,aAAa;","names":[]}
1
+ {"version":3,"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["import type { DictionaryOutput } from '../types/config';\n\nexport const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.cjx',\n '.content.mjs',\n '.content.mjx',\n '.content.json',\n '.content.tsx',\n '.content.jsx',\n];\nexport const EXCLUDED_PATHS = [\n 'node_modules',\n '.intlayer',\n '.next',\n '.nuxt',\n '.expo',\n 'dist',\n];\n\nexport const CONTENT_DIR = ['.'];\n\nexport const MAIN_DIR = '.intlayer/main';\n\nexport const DICTIONARIES_DIR = '.intlayer/dictionary';\n\nexport const MASKS_DIR = '.intlayer/mask';\n\nexport const REMOTE_DICTIONARIES_DIR = '.intlayer/remote_dictionary';\n\nexport const UNMERGED_DICTIONARIES_DIR = '.intlayer/unmerged_dictionary';\n\nexport const DYNAMIC_DICTIONARIES_DIR = '.intlayer/dynamic_dictionary';\n\nexport const FETCH_DICTIONARIES_DIR = '.intlayer/fetch_dictionary';\n\nexport const TYPES_DIR = '.intlayer/types';\n\nexport const MODULE_AUGMENTATION_DIR = '.intlayer/types';\n\nexport const DICTIONARY_OUTPUT: DictionaryOutput[] = ['intlayer'];\n\nexport const I18NEXT_DICTIONARIES_DIR = 'i18next_resources';\n\nexport const REACT_INTL_MESSAGES_DIR = 'intl_messages';\n\nexport const CONFIG_DIR = '.intlayer/config';\n\nexport const WATCH = process.env.NODE_ENV === 'development';\n"],"mappings":"AAEO,MAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACO,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,cAAc,CAAC,GAAG;AAExB,MAAM,WAAW;AAEjB,MAAM,mBAAmB;AAEzB,MAAM,YAAY;AAElB,MAAM,0BAA0B;AAEhC,MAAM,4BAA4B;AAElC,MAAM,2BAA2B;AAEjC,MAAM,yBAAyB;AAE/B,MAAM,YAAY;AAElB,MAAM,0BAA0B;AAEhC,MAAM,oBAAwC,CAAC,UAAU;AAEzD,MAAM,2BAA2B;AAEjC,MAAM,0BAA0B;AAEhC,MAAM,aAAa;AAEnB,MAAM,QAAQ,QAAQ,IAAI,aAAa;","names":[]}
@@ -4,16 +4,18 @@ const CMS_URL = "https://intlayer.org";
4
4
  const PORT = 8e3;
5
5
  const BACKEND_URL = "https://back.intlayer.org";
6
6
  const IS_ENABLED = true;
7
- const HOT_RELOAD = false;
7
+ const LIVE_SYNC = true;
8
8
  const DICTIONARY_PRIORITY_STRATEGY = "local_first";
9
+ const LIVE_SYNC_PORT = 4e3;
9
10
  export {
10
11
  APPLICATION_URL,
11
12
  BACKEND_URL,
12
13
  CMS_URL,
13
14
  DICTIONARY_PRIORITY_STRATEGY,
14
15
  EDITOR_URL,
15
- HOT_RELOAD,
16
16
  IS_ENABLED,
17
+ LIVE_SYNC,
18
+ LIVE_SYNC_PORT,
17
19
  PORT
18
20
  };
19
21
  //# sourceMappingURL=editor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/defaultValues/editor.ts"],"sourcesContent":["export const APPLICATION_URL = '';\nexport const EDITOR_URL = 'http://localhost:8000';\nexport const CMS_URL = 'https://intlayer.org';\nexport const PORT = 8000;\nexport const BACKEND_URL = 'https://back.intlayer.org';\nexport const IS_ENABLED = true;\nexport const HOT_RELOAD = false;\nexport const DICTIONARY_PRIORITY_STRATEGY = 'local_first';\n"],"mappings":"AAAO,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,MAAM,UAAU;AAChB,MAAM,OAAO;AACb,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,+BAA+B;","names":[]}
1
+ {"version":3,"sources":["../../../src/defaultValues/editor.ts"],"sourcesContent":["export const APPLICATION_URL = '';\nexport const EDITOR_URL = 'http://localhost:8000';\nexport const CMS_URL = 'https://intlayer.org';\nexport const PORT = 8000;\nexport const BACKEND_URL = 'https://back.intlayer.org';\nexport const IS_ENABLED = true;\nexport const LIVE_SYNC = true;\nexport const DICTIONARY_PRIORITY_STRATEGY = 'local_first';\nexport const LIVE_SYNC_PORT = 4000;\n"],"mappings":"AAAO,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,MAAM,UAAU;AAChB,MAAM,OAAO;AACb,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,YAAY;AAClB,MAAM,+BAA+B;AACrC,MAAM,iBAAiB;","names":[]}
@@ -1,7 +1,6 @@
1
+ import { ANSIColors } from "../logger.mjs";
1
2
  const MODE = "default";
2
- const RESET = "\x1B[0m";
3
- const GREY = "\x1B[90m";
4
- const PREFIX = `${GREY}[intlayer] ${RESET}`;
3
+ const PREFIX = `${ANSIColors.GREY_DARK}[intlayer] ${ANSIColors.RESET}`;
5
4
  export {
6
5
  MODE,
7
6
  PREFIX
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/defaultValues/log.ts"],"sourcesContent":["export const MODE = 'default';\n\n// ANSI color codes\nconst RESET = '\\x1b[0m';\nconst GREY = '\\x1b[90m';\n\nexport const PREFIX = `${GREY}[intlayer] ${RESET}`;\n"],"mappings":"AAAO,MAAM,OAAO;AAGpB,MAAM,QAAQ;AACd,MAAM,OAAO;AAEN,MAAM,SAAS,GAAG,IAAI,cAAc,KAAK;","names":[]}
1
+ {"version":3,"sources":["../../../src/defaultValues/log.ts"],"sourcesContent":["import { ANSIColors } from '../logger';\n\nexport const MODE = 'default';\n\nexport const PREFIX = `${ANSIColors.GREY_DARK}[intlayer] ${ANSIColors.RESET}`;\n"],"mappings":"AAAA,SAAS,kBAAkB;AAEpB,MAAM,OAAO;AAEb,MAAM,SAAS,GAAG,WAAW,SAAS,cAAc,WAAW,KAAK;","names":[]}
@@ -1,6 +1,4 @@
1
- import {
2
- loadEnvFile
3
- } from "./envVariables/loadEnvFile.mjs";
1
+ import { loadEnvFile } from "./loadEnvFile.mjs";
4
2
  import { ESMxCJSRequire } from "./utils/ESMxCJSHelpers.mjs";
5
3
  const getSandBoxContext = (envVarOptions, projectRequire = ESMxCJSRequire) => {
6
4
  let additionalGlobalVar = {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getSandboxContext.ts"],"sourcesContent":["import type { Context } from 'vm';\nimport {\n type LoadEnvFileOptions,\n loadEnvFile,\n} from './envVariables/loadEnvFile';\nimport { ESMxCJSRequire } from './utils/ESMxCJSHelpers';\n\nexport const getSandBoxContext = (\n envVarOptions?: LoadEnvFileOptions,\n projectRequire = ESMxCJSRequire\n): Context => {\n let additionalGlobalVar = {};\n\n try {\n // Dynamically try to require React if it's installed in the project\n additionalGlobalVar = {\n React: projectRequire('react'),\n };\n } catch (err) {\n // React is not installed, so we don't inject it\n }\n\n const sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n process: {\n ...process,\n env: {\n ...process.env,\n ...loadEnvFile(envVarOptions),\n },\n },\n console,\n require: projectRequire,\n ...additionalGlobalVar,\n };\n\n // Dynamically inject all global variables\n Object.getOwnPropertyNames(globalThis).forEach((key) => {\n if (!(key in sandboxContext)) {\n sandboxContext[key] = globalThis[key as keyof typeof globalThis];\n }\n });\n\n return sandboxContext;\n};\n"],"mappings":"AACA;AAAA,EAEE;AAAA,OACK;AACP,SAAS,sBAAsB;AAExB,MAAM,oBAAoB,CAC/B,eACA,iBAAiB,mBACL;AACZ,MAAI,sBAAsB,CAAC;AAE3B,MAAI;AAEF,0BAAsB;AAAA,MACpB,OAAO,eAAe,OAAO;AAAA,IAC/B;AAAA,EACF,SAAS,KAAK;AAAA,EAEd;AAEA,QAAM,iBAA0B;AAAA,IAC9B,SAAS;AAAA,MACP,SAAS,CAAC;AAAA,IACZ;AAAA,IACA,QAAQ;AAAA,MACN,SAAS,CAAC;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACP,GAAG;AAAA,MACH,KAAK;AAAA,QACH,GAAG,QAAQ;AAAA,QACX,GAAG,YAAY,aAAa;AAAA,MAC9B;AAAA,IACF;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,GAAG;AAAA,EACL;AAGA,SAAO,oBAAoB,UAAU,EAAE,QAAQ,CAAC,QAAQ;AACtD,QAAI,EAAE,OAAO,iBAAiB;AAC5B,qBAAe,GAAG,IAAI,WAAW,GAA8B;AAAA,IACjE;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/getSandboxContext.ts"],"sourcesContent":["import type { Context } from 'vm';\nimport { type LoadEnvFileOptions, loadEnvFile } from './loadEnvFile';\nimport { ESMxCJSRequire } from './utils/ESMxCJSHelpers';\n\nexport const getSandBoxContext = (\n envVarOptions?: LoadEnvFileOptions,\n projectRequire = ESMxCJSRequire\n): Context => {\n let additionalGlobalVar = {};\n\n try {\n // Dynamically try to require React if it's installed in the project\n additionalGlobalVar = {\n React: projectRequire('react'),\n };\n } catch (err) {\n // React is not installed, so we don't inject it\n }\n\n const sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n process: {\n ...process,\n env: {\n ...process.env,\n ...loadEnvFile(envVarOptions),\n },\n },\n console,\n require: projectRequire,\n ...additionalGlobalVar,\n };\n\n // Dynamically inject all global variables\n Object.getOwnPropertyNames(globalThis).forEach((key) => {\n if (!(key in sandboxContext)) {\n sandboxContext[key] = globalThis[key as keyof typeof globalThis];\n }\n });\n\n return sandboxContext;\n};\n"],"mappings":"AACA,SAAkC,mBAAmB;AACrD,SAAS,sBAAsB;AAExB,MAAM,oBAAoB,CAC/B,eACA,iBAAiB,mBACL;AACZ,MAAI,sBAAsB,CAAC;AAE3B,MAAI;AAEF,0BAAsB;AAAA,MACpB,OAAO,eAAe,OAAO;AAAA,IAC/B;AAAA,EACF,SAAS,KAAK;AAAA,EAEd;AAEA,QAAM,iBAA0B;AAAA,IAC9B,SAAS;AAAA,MACP,SAAS,CAAC;AAAA,IACZ;AAAA,IACA,QAAQ;AAAA,MACN,SAAS,CAAC;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACP,GAAG;AAAA,MACH,KAAK;AAAA,QACH,GAAG,QAAQ;AAAA,QACX,GAAG,YAAY,aAAa;AAAA,MAC9B;AAAA,IACF;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,GAAG;AAAA,EACL;AAGA,SAAO,oBAAoB,UAAU,EAAE,QAAQ,CAAC,QAAQ;AACtD,QAAI,EAAE,OAAO,iBAAiB;AAC5B,qBAAe,GAAG,IAAI,WAAW,GAA8B;AAAA,IACjE;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]}
@@ -1,35 +1,53 @@
1
+ import { getAlias } from "./alias.mjs";
1
2
  import {
2
3
  getConfiguration
3
4
  } from "./configFile/getConfiguration.mjs";
4
- import {
5
- formatEnvVariable,
6
- getConfiguration as getConfiguration2,
7
- getEnvFilePath,
8
- getPlatform,
9
- loadEnvFile
10
- } from "./envVariables/index.mjs";
11
5
  import { getSandBoxContext } from "./getSandboxContext.mjs";
6
+ import { getEnvFilePath, loadEnvFile } from "./loadEnvFile.mjs";
12
7
  import { loadExternalFile } from "./loadExternalFile.mjs";
13
- import { getAppLogger, logger } from "./logger.mjs";
8
+ import {
9
+ ANSIColors,
10
+ clock,
11
+ colon,
12
+ colorize,
13
+ colorizeKey,
14
+ colorizeLocales,
15
+ colorizeNumber,
16
+ colorizePath,
17
+ getAppLogger,
18
+ logger,
19
+ spinnerFrames,
20
+ v,
21
+ x
22
+ } from "./logger.mjs";
14
23
  import { retryManager } from "./retryManager.mjs";
15
24
  import { Locales } from "./types/locales.mjs";
16
25
  import { ESMxCJSRequire, isESModule } from "./utils/ESMxCJSHelpers.mjs";
17
26
  import { normalizePath } from "./utils/normalizePath.mjs";
18
27
  export {
28
+ ANSIColors,
19
29
  ESMxCJSRequire,
20
30
  Locales,
21
- formatEnvVariable,
31
+ clock,
32
+ colon,
33
+ colorize,
34
+ colorizeKey,
35
+ colorizeLocales,
36
+ colorizeNumber,
37
+ colorizePath,
38
+ getAlias,
22
39
  getAppLogger,
23
- getConfiguration2 as getClientConfiguration,
24
40
  getConfiguration,
25
41
  getEnvFilePath,
26
- getPlatform,
27
42
  getSandBoxContext,
28
43
  isESModule,
29
44
  loadEnvFile,
30
45
  loadExternalFile,
31
46
  logger,
32
47
  normalizePath,
33
- retryManager
48
+ retryManager,
49
+ spinnerFrames,
50
+ v,
51
+ x
34
52
  };
35
53
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n getConfiguration,\n type GetConfigurationOptions,\n} from './configFile/getConfiguration';\nexport {\n formatEnvVariable,\n getConfiguration as getClientConfiguration,\n getEnvFilePath,\n getPlatform,\n loadEnvFile,\n} from './envVariables/index';\nexport { getSandBoxContext } from './getSandboxContext';\nexport { loadExternalFile } from './loadExternalFile';\nexport { getAppLogger, logger, type Logger } from './logger';\nexport { retryManager } from './retryManager';\nexport type {\n BaseContentConfig,\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n ServerSetCookieRule,\n StrictMode,\n} from './types/config';\nexport { Locales } from './types/locales';\nexport type { LocalesValues } from './types/locales';\nexport { ESMxCJSRequire, isESModule } from './utils/ESMxCJSHelpers';\nexport { normalizePath } from './utils/normalizePath';\n"],"mappings":"AAAA;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACoB,oBAApBA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,cAAc,cAA2B;AAClD,SAAS,oBAAoB;AAe7B,SAAS,eAAe;AAExB,SAAS,gBAAgB,kBAAkB;AAC3C,SAAS,qBAAqB;","names":["getConfiguration"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getAlias } from './alias';\nexport {\n getConfiguration,\n type GetConfigurationOptions,\n} from './configFile/getConfiguration';\nexport { getSandBoxContext } from './getSandboxContext';\nexport { getEnvFilePath, loadEnvFile } from './loadEnvFile';\nexport { loadExternalFile } from './loadExternalFile';\nexport {\n ANSIColors,\n clock,\n colon,\n colorize,\n colorizeKey,\n colorizeLocales,\n colorizeNumber,\n colorizePath,\n getAppLogger,\n logger,\n spinnerFrames,\n v,\n x,\n type Logger,\n} from './logger';\nexport { retryManager } from './retryManager';\nexport type {\n BaseContentConfig,\n BaseDerivedConfig,\n ContentConfig,\n CustomIntlayerConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n ServerSetCookieRule,\n StrictMode,\n} from './types/config';\nexport { Locales } from './types/locales';\nexport type { LocalesValues } from './types/locales';\nexport { ESMxCJSRequire, isESModule } from './utils/ESMxCJSHelpers';\nexport { normalizePath } from './utils/normalizePath';\n"],"mappings":"AAAA,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,OAEK;AACP,SAAS,yBAAyB;AAClC,SAAS,gBAAgB,mBAAmB;AAC5C,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,oBAAoB;AAe7B,SAAS,eAAe;AAExB,SAAS,gBAAgB,kBAAkB;AAC3C,SAAS,qBAAqB;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/loadEnvFile.ts"],"sourcesContent":["import dotenv from 'dotenv';\nimport { existsSync } from 'fs';\n\nconst DEFAULT_ENV = process.env.NODE_ENV ?? 'development';\n\nexport type LoadEnvFileOptions = {\n env?: string;\n envFile?: string;\n};\n\nexport const getEnvFilePath = (\n env: string = process.env.NODE_ENV ?? 'development',\n envFile?: string\n): string | undefined => {\n const envFiles = envFile\n ? [envFile]\n : [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'];\n\n return envFiles.find(existsSync); // Returns the first existing env file\n};\n\nexport const loadEnvFile = (options?: Partial<LoadEnvFileOptions>) => {\n const env = options?.env ?? DEFAULT_ENV;\n\n const envFiles = options?.envFile\n ? [options.envFile]\n : [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'];\n\n const result = {};\n\n dotenv.config({\n path: envFiles,\n processEnv: result,\n });\n\n return result; // Return the parsed env object\n};\n"],"mappings":"AAAA,OAAO,YAAY;AACnB,SAAS,kBAAkB;AAE3B,MAAM,cAAc,QAAQ,IAAI,YAAY;AAOrC,MAAM,iBAAiB,CAC5B,MAAc,QAAQ,IAAI,YAAY,eACtC,YACuB;AACvB,QAAM,WAAW,UACb,CAAC,OAAO,IACR,CAAC,QAAQ,GAAG,UAAU,QAAQ,GAAG,IAAI,cAAc,MAAM;AAE7D,SAAO,SAAS,KAAK,UAAU;AACjC;AAEO,MAAM,cAAc,CAAC,YAA0C;AACpE,QAAM,MAAM,SAAS,OAAO;AAE5B,QAAM,WAAW,SAAS,UACtB,CAAC,QAAQ,OAAO,IAChB,CAAC,QAAQ,GAAG,UAAU,QAAQ,GAAG,IAAI,cAAc,MAAM;AAE7D,QAAM,SAAS,CAAC;AAEhB,SAAO,OAAO;AAAA,IACZ,MAAM;AAAA,IACN,YAAY;AAAA,EACd,CAAC;AAED,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/loadExternalFile.ts"],"sourcesContent":["import { buildSync, type BuildOptions, type BuildResult } from 'esbuild';\nimport { dirname } from 'path';\nimport { runInNewContext } from 'vm';\nimport { LoadEnvFileOptions } from './envVariables/loadEnvFile';\nimport { getSandBoxContext } from './getSandboxContext';\nimport { logger } from './logger';\nimport { ESMxCJSRequire } from './utils/ESMxCJSHelpers';\n\nconst getTransformationOptions = (filePath: string): BuildOptions => ({\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n '.md': 'text',\n '.mdx': 'text',\n },\n format: 'cjs', // Output format as commonjs\n target: 'es2017',\n packages: 'external',\n write: false,\n bundle: true,\n banner: {\n js: [\n `globalThis.intlayer_file_path = ${JSON.stringify(filePath)};`,\n `globalThis.intlayer_file_dir = ${JSON.stringify(dirname(filePath))};`,\n ].join('\\n'),\n },\n});\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFile = (\n filePath: string,\n envVarOptions?: LoadEnvFileOptions,\n projectRequire = ESMxCJSRequire\n): any | undefined => {\n let fileContent: any | undefined = undefined;\n\n const fileExtension = filePath.split('.').pop() ?? '';\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force reloading\n delete ESMxCJSRequire.cache[ESMxCJSRequire.resolve(filePath)];\n // Assume JSON\n return ESMxCJSRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n\n const moduleResult: BuildResult = buildSync({\n entryPoints: [filePath],\n ...getTransformationOptions(filePath),\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const sandboxContext = getSandBoxContext(envVarOptions, projectRequire);\n\n runInNewContext(moduleResultString, sandboxContext);\n\n if (\n sandboxContext.exports.default &&\n Object.keys(sandboxContext.exports.default).length > 0\n ) {\n // ES Module\n fileContent = sandboxContext.exports.default;\n } else if (\n sandboxContext.module.exports.defaults &&\n Object.keys(sandboxContext.module.exports.defaults).length > 0\n ) {\n // CommonJS\n fileContent = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports.default &&\n Object.keys(sandboxContext.module.exports.default).length > 0\n ) {\n // ES Module\n fileContent = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports &&\n Object.keys(sandboxContext.module.exports).length > 0\n ) {\n // Other\n fileContent = sandboxContext.module.exports;\n }\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${filePath}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n `Error: ${error} ${JSON.stringify((error as Error).stack, null, 2)}`,\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":"AAAA,SAAS,iBAAsD;AAC/D,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB;AAClC,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAE/B,MAAM,2BAA2B,CAAC,cAAoC;AAAA,EACpE,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,IACN,IAAI;AAAA,MACF,mCAAmC,KAAK,UAAU,QAAQ,CAAC;AAAA,MAC3D,kCAAkC,KAAK,UAAU,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACrE,EAAE,KAAK,IAAI;AAAA,EACb;AACF;AAOO,MAAM,mBAAmB,CAC9B,UACA,eACA,iBAAiB,mBACG;AACpB,MAAI,cAA+B;AAEnC,QAAM,gBAAgB,SAAS,MAAM,GAAG,EAAE,IAAI,KAAK;AAEnD,MAAI;AACF,QAAI,kBAAkB,QAAQ;AAE5B,aAAO,eAAe,MAAM,eAAe,QAAQ,QAAQ,CAAC;AAE5D,aAAO,eAAe,QAAQ;AAAA,IAChC;AAIA,UAAM,eAA4B,UAAU;AAAA,MAC1C,aAAa,CAAC,QAAQ;AAAA,MACtB,GAAG,yBAAyB,QAAQ;AAAA,IACtC,CAAC;AAED,UAAM,qBAAqB,aAAa,cAAc,CAAC,EAAE;AAEzD,QAAI,CAAC,oBAAoB;AACvB,aAAO,6BAA6B,EAAE,OAAO,QAAQ,CAAC;AACtD,aAAO;AAAA,IACT;AAEA,UAAM,iBAAiB,kBAAkB,eAAe,cAAc;AAEtE,oBAAgB,oBAAoB,cAAc;AAElD,QACE,eAAe,QAAQ,WACvB,OAAO,KAAK,eAAe,QAAQ,OAAO,EAAE,SAAS,GACrD;AAEA,oBAAc,eAAe,QAAQ;AAAA,IACvC,WACE,eAAe,OAAO,QAAQ,YAC9B,OAAO,KAAK,eAAe,OAAO,QAAQ,QAAQ,EAAE,SAAS,GAC7D;AAEA,oBAAc,eAAe,OAAO,QAAQ;AAAA,IAC9C,WACE,eAAe,OAAO,QAAQ,WAC9B,OAAO,KAAK,eAAe,OAAO,QAAQ,OAAO,EAAE,SAAS,GAC5D;AAEA,oBAAc,eAAe,OAAO,QAAQ;AAAA,IAC9C,WACE,eAAe,OAAO,WACtB,OAAO,KAAK,eAAe,OAAO,OAAO,EAAE,SAAS,GACpD;AAEA,oBAAc,eAAe,OAAO;AAAA,IACtC;AAEA,QAAI,OAAO,gBAAgB,aAAa;AACtC,aAAO,yCAAyC,QAAQ,EAAE;AAC1D,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,SAAS,OAAO;AACd;AAAA,MACE,UAAU,KAAK,IAAI,KAAK,UAAW,MAAgB,OAAO,MAAM,CAAC,CAAC;AAAA,MAClE;AAAA,QACE,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/loadExternalFile.ts"],"sourcesContent":["import { buildSync, type BuildOptions, type BuildResult } from 'esbuild';\nimport { dirname } from 'path';\nimport { runInNewContext } from 'vm';\nimport { getSandBoxContext } from './getSandboxContext';\nimport { LoadEnvFileOptions } from './loadEnvFile';\nimport { logger } from './logger';\nimport { ESMxCJSRequire } from './utils/ESMxCJSHelpers';\n\nconst getTransformationOptions = (filePath: string): BuildOptions => ({\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n '.md': 'text',\n '.mdx': 'text',\n },\n format: 'cjs', // Output format as commonjs\n target: 'es2017',\n packages: 'external',\n write: false,\n bundle: true,\n banner: {\n js: [\n `globalThis.intlayer_file_path = ${JSON.stringify(filePath)};`,\n `globalThis.intlayer_file_dir = ${JSON.stringify(dirname(filePath))};`,\n ].join('\\n'),\n },\n});\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFile = (\n filePath: string,\n envVarOptions?: LoadEnvFileOptions,\n projectRequire = ESMxCJSRequire\n): any | undefined => {\n let fileContent: any | undefined = undefined;\n\n const fileExtension = filePath.split('.').pop() ?? '';\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force reloading\n delete ESMxCJSRequire.cache[ESMxCJSRequire.resolve(filePath)];\n // Assume JSON\n return ESMxCJSRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n\n const moduleResult: BuildResult = buildSync({\n entryPoints: [filePath],\n ...getTransformationOptions(filePath),\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const sandboxContext = getSandBoxContext(envVarOptions, projectRequire);\n\n runInNewContext(moduleResultString, sandboxContext);\n\n if (\n sandboxContext.exports.default &&\n Object.keys(sandboxContext.exports.default).length > 0\n ) {\n // ES Module\n fileContent = sandboxContext.exports.default;\n } else if (\n sandboxContext.module.exports.defaults &&\n Object.keys(sandboxContext.module.exports.defaults).length > 0\n ) {\n // CommonJS\n fileContent = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports.default &&\n Object.keys(sandboxContext.module.exports.default).length > 0\n ) {\n // ES Module\n fileContent = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports &&\n Object.keys(sandboxContext.module.exports).length > 0\n ) {\n // Other\n fileContent = sandboxContext.module.exports;\n }\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${filePath}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n `Error: ${error} ${JSON.stringify((error as Error).stack, null, 2)}`,\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":"AAAA,SAAS,iBAAsD;AAC/D,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAElC,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAE/B,MAAM,2BAA2B,CAAC,cAAoC;AAAA,EACpE,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,IACN,IAAI;AAAA,MACF,mCAAmC,KAAK,UAAU,QAAQ,CAAC;AAAA,MAC3D,kCAAkC,KAAK,UAAU,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACrE,EAAE,KAAK,IAAI;AAAA,EACb;AACF;AAOO,MAAM,mBAAmB,CAC9B,UACA,eACA,iBAAiB,mBACG;AACpB,MAAI,cAA+B;AAEnC,QAAM,gBAAgB,SAAS,MAAM,GAAG,EAAE,IAAI,KAAK;AAEnD,MAAI;AACF,QAAI,kBAAkB,QAAQ;AAE5B,aAAO,eAAe,MAAM,eAAe,QAAQ,QAAQ,CAAC;AAE5D,aAAO,eAAe,QAAQ;AAAA,IAChC;AAIA,UAAM,eAA4B,UAAU;AAAA,MAC1C,aAAa,CAAC,QAAQ;AAAA,MACtB,GAAG,yBAAyB,QAAQ;AAAA,IACtC,CAAC;AAED,UAAM,qBAAqB,aAAa,cAAc,CAAC,EAAE;AAEzD,QAAI,CAAC,oBAAoB;AACvB,aAAO,6BAA6B,EAAE,OAAO,QAAQ,CAAC;AACtD,aAAO;AAAA,IACT;AAEA,UAAM,iBAAiB,kBAAkB,eAAe,cAAc;AAEtE,oBAAgB,oBAAoB,cAAc;AAElD,QACE,eAAe,QAAQ,WACvB,OAAO,KAAK,eAAe,QAAQ,OAAO,EAAE,SAAS,GACrD;AAEA,oBAAc,eAAe,QAAQ;AAAA,IACvC,WACE,eAAe,OAAO,QAAQ,YAC9B,OAAO,KAAK,eAAe,OAAO,QAAQ,QAAQ,EAAE,SAAS,GAC7D;AAEA,oBAAc,eAAe,OAAO,QAAQ;AAAA,IAC9C,WACE,eAAe,OAAO,QAAQ,WAC9B,OAAO,KAAK,eAAe,OAAO,QAAQ,OAAO,EAAE,SAAS,GAC5D;AAEA,oBAAc,eAAe,OAAO,QAAQ;AAAA,IAC9C,WACE,eAAe,OAAO,WACtB,OAAO,KAAK,eAAe,OAAO,OAAO,EAAE,SAAS,GACpD;AAEA,oBAAc,eAAe,OAAO;AAAA,IACtC;AAEA,QAAI,OAAO,gBAAgB,aAAa;AACtC,aAAO,yCAAyC,QAAQ,EAAE;AAC1D,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,SAAS,OAAO;AACd;AAAA,MACE,UAAU,KAAK,IAAI,KAAK,UAAW,MAAgB,OAAO,MAAM,CAAC,CAAC;AAAA,MAClE;AAAA,QACE,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -22,12 +22,104 @@ const logger = (content, details = {
22
22
  }
23
23
  console.log(...flatContent);
24
24
  };
25
- const getAppLogger = (configuration) => (content, details) => logger(content, {
25
+ var ANSIColors = /* @__PURE__ */ ((ANSIColors2) => {
26
+ ANSIColors2["RESET"] = "\x1B[0m";
27
+ ANSIColors2["GREY"] = "\x1B[90m";
28
+ ANSIColors2["GREY_DARK"] = "\x1B[38;5;239m";
29
+ ANSIColors2["BLUE"] = "\x1B[34m";
30
+ ANSIColors2["RED"] = "\x1B[31m";
31
+ ANSIColors2["GREEN"] = "\x1B[32m";
32
+ ANSIColors2["YELLOW"] = "\x1B[33m";
33
+ ANSIColors2["MAGENTA"] = "\x1B[35m";
34
+ ANSIColors2["BEIGE"] = "\x1B[38;5;3m";
35
+ ANSIColors2["CYAN"] = "\x1B[36m";
36
+ ANSIColors2["WHITE"] = "\x1B[37m";
37
+ return ANSIColors2;
38
+ })(ANSIColors || {});
39
+ const spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
40
+ const getAppLogger = (configuration, globalDetails) => (content, details) => logger(content, {
26
41
  ...details ?? {},
27
- config: { ...configuration?.log, ...details?.config ?? {} }
42
+ config: {
43
+ ...configuration?.log,
44
+ ...globalDetails?.config,
45
+ ...details?.config ?? {}
46
+ }
28
47
  });
48
+ const colorize = (s, color) => color ? `${color}${s}${"\x1B[0m" /* RESET */}` : s;
49
+ const colorizeLocales = (locales, color = "\x1B[32m" /* GREEN */) => [locales].flat().map((locale) => colorize(locale, color)).join(`, `);
50
+ const colorizeKey = (keyPath, color = "\x1B[38;5;3m" /* BEIGE */) => [keyPath].flat().map((key) => colorize(key, color)).join(`, `);
51
+ const colorizePath = (path, color = "\x1B[90m" /* GREY */) => [path].flat().map((p) => colorize(p, color)).join(`, `);
52
+ const colorizeNumber = (number, options = {
53
+ zero: "\x1B[34m" /* BLUE */,
54
+ one: "\x1B[34m" /* BLUE */,
55
+ two: "\x1B[34m" /* BLUE */,
56
+ few: "\x1B[34m" /* BLUE */,
57
+ many: "\x1B[34m" /* BLUE */,
58
+ other: "\x1B[34m" /* BLUE */
59
+ }) => {
60
+ if (number === 0) {
61
+ const color2 = options.zero ?? "\x1B[32m" /* GREEN */;
62
+ return colorize(number.toString(), color2);
63
+ }
64
+ const rule = new Intl.PluralRules("en").select(number);
65
+ const color = options[rule];
66
+ return colorize(number.toString(), color);
67
+ };
68
+ const removeColor = (text) => text.replace(/\x1b\[[0-9;]*m/g, "");
69
+ const getLength = (length) => {
70
+ let value = 0;
71
+ if (typeof length === "number") {
72
+ value = length;
73
+ }
74
+ if (typeof length === "string") {
75
+ value = length.length;
76
+ }
77
+ if (Array.isArray(length) && length.every((l) => typeof l === "string")) {
78
+ value = Math.max(...length.map((str) => str.length));
79
+ }
80
+ if (Array.isArray(length) && length.every((l) => typeof l === "number")) {
81
+ value = Math.max(...length);
82
+ }
83
+ return Math.max(value, 0);
84
+ };
85
+ const defaultColonOptions = {
86
+ colSize: 0,
87
+ minSize: 0,
88
+ maxSize: Infinity,
89
+ pad: "right",
90
+ padChar: "0"
91
+ };
92
+ const colon = (text, options) => [text].flat().map((text2) => {
93
+ const { colSize, minSize, maxSize, pad, padChar } = {
94
+ ...defaultColonOptions,
95
+ ...options ?? {}
96
+ };
97
+ const length = getLength(colSize);
98
+ const spacesLength = Math.max(
99
+ minSize,
100
+ Math.min(maxSize, length - removeColor(text2).length)
101
+ );
102
+ if (pad === "left") {
103
+ return `${" ".repeat(spacesLength)}${text2}`;
104
+ }
105
+ return `${text2}${" ".repeat(spacesLength)}`;
106
+ }).join("");
107
+ const x = colorize("\u2717", "\x1B[31m" /* RED */);
108
+ const v = colorize("\u2713", "\x1B[32m" /* GREEN */);
109
+ const clock = colorize("\u23F2", "\x1B[34m" /* BLUE */);
29
110
  export {
111
+ ANSIColors,
112
+ clock,
113
+ colon,
114
+ colorize,
115
+ colorizeKey,
116
+ colorizeLocales,
117
+ colorizeNumber,
118
+ colorizePath,
30
119
  getAppLogger,
31
- logger
120
+ logger,
121
+ spinnerFrames,
122
+ v,
123
+ x
32
124
  };
33
125
  //# sourceMappingURL=logger.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/logger.ts"],"sourcesContent":["import type { CustomIntlayerConfig } from './types/config';\n\nexport type Details = {\n isVerbose?: boolean;\n level?: 'info' | 'warn' | 'error' | 'debug';\n config?: CustomIntlayerConfig['log'];\n};\n\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 = details.config?.mode ?? 'default';\n const prefix = Boolean(details.config?.prefix)\n ? details.config?.prefix\n : undefined;\n\n if (mode === 'disabled') return;\n\n if (details.isVerbose && mode !== 'verbose') return;\n\n const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();\n\n if (details.level === 'debug') {\n return console.debug(...flatContent);\n }\n\n if (details.level === 'info') {\n return console.info(...flatContent);\n }\n\n if (details.level === 'warn') {\n return console.warn(...flatContent);\n }\n\n if (details.level === 'error') {\n return console.error(...flatContent);\n }\n\n console.log(...flatContent);\n};\n\n/**\n * The appLogger function takes the logger and merges it with the configuration from the intlayer config file.\n * It allows overriding the default configuration by passing a config object in the details parameter.\n * The configuration is merged with the default configuration from the intlayer config file.\n */\nexport const getAppLogger =\n (configuration?: CustomIntlayerConfig) => (content: any, details?: Details) =>\n logger(content, {\n ...(details ?? {}),\n config: { ...configuration?.log, ...(details?.config ?? {}) },\n });\n"],"mappings":"AAUO,MAAM,SAAiB,CAC5B,SACA,UAAU;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ,EAAE,MAAM,WAAW,QAAQ,GAAG;AACxC,MACG;AACH,QAAM,OAAO,QAAQ,QAAQ,QAAQ;AACrC,QAAM,SAAS,QAAQ,QAAQ,QAAQ,MAAM,IACzC,QAAQ,QAAQ,SAChB;AAEJ,MAAI,SAAS,WAAY;AAEzB,MAAI,QAAQ,aAAa,SAAS,UAAW;AAE7C,QAAM,cAAc,SAAS,CAAC,QAAQ,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK;AAE5E,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,WAAW;AAAA,EACrC;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,WAAW;AAAA,EACpC;AAEA,MAAI,QAAQ,UAAU,QAAQ;AAC5B,WAAO,QAAQ,KAAK,GAAG,WAAW;AAAA,EACpC;AAEA,MAAI,QAAQ,UAAU,SAAS;AAC7B,WAAO,QAAQ,MAAM,GAAG,WAAW;AAAA,EACrC;AAEA,UAAQ,IAAI,GAAG,WAAW;AAC5B;AAOO,MAAM,eACX,CAAC,kBAAyC,CAAC,SAAc,YACvD,OAAO,SAAS;AAAA,EACd,GAAI,WAAW,CAAC;AAAA,EAChB,QAAQ,EAAE,GAAG,eAAe,KAAK,GAAI,SAAS,UAAU,CAAC,EAAG;AAC9D,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/logger.ts"],"sourcesContent":["import type { CustomIntlayerConfig } from './types/config';\nimport { Locales } from './types/locales';\n\nexport type Details = {\n isVerbose?: boolean;\n level?: 'info' | 'warn' | 'error' | 'debug';\n config?: CustomIntlayerConfig['log'];\n};\n\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 = details.config?.mode ?? 'default';\n const prefix = Boolean(details.config?.prefix)\n ? details.config?.prefix\n : undefined;\n\n if (mode === 'disabled') return;\n\n if (details.isVerbose && mode !== 'verbose') return;\n\n const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();\n\n if (details.level === 'debug') {\n return console.debug(...flatContent);\n }\n\n if (details.level === 'info') {\n return console.info(...flatContent);\n }\n\n if (details.level === 'warn') {\n return console.warn(...flatContent);\n }\n\n if (details.level === 'error') {\n return console.error(...flatContent);\n }\n\n console.log(...flatContent);\n};\n\nexport enum ANSIColors {\n RESET = '\\x1b[0m',\n GREY = '\\x1b[90m',\n GREY_DARK = '\\x1b[38;5;239m',\n BLUE = '\\x1b[34m',\n RED = '\\x1b[31m',\n GREEN = '\\x1b[32m',\n YELLOW = '\\x1b[33m',\n MAGENTA = '\\x1b[35m',\n BEIGE = '\\x1b[38;5;3m',\n CYAN = '\\x1b[36m',\n WHITE = '\\x1b[37m',\n}\n\nexport const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n\n/**\n * The appLogger function takes the logger and merges it with the configuration from the intlayer config file.\n * It allows overriding the default configuration by passing a config object in the details parameter.\n * The configuration is merged with the default configuration from the intlayer config file.\n */\nexport const getAppLogger =\n (configuration?: CustomIntlayerConfig, globalDetails?: Details) =>\n (content: any, details?: Details) =>\n logger(content, {\n ...(details ?? {}),\n config: {\n ...configuration?.log,\n ...globalDetails?.config,\n ...(details?.config ?? {}),\n },\n });\n\nexport const colorize = (s: string, color?: ANSIColors): string =>\n color ? `${color}${s}${ANSIColors.RESET}` : s;\n\nexport const colorizeLocales = (\n locales: Locales | Locales[],\n color = ANSIColors.GREEN\n) =>\n [locales]\n .flat()\n .map((locale) => colorize(locale, color))\n .join(`, `);\n\nexport const colorizeKey = (\n keyPath: string | string[],\n color = ANSIColors.BEIGE\n) =>\n [keyPath]\n .flat()\n .map((key) => colorize(key, color))\n .join(`, `);\n\nexport const colorizePath = (\n path: string | string[],\n color = ANSIColors.GREY\n) =>\n [path]\n .flat()\n .map((p) => colorize(p, color))\n .join(`, `);\n\n/**\n * Colorize numeric value using Intl.NumberFormat and optional ANSI colors.\n *\n * Examples:\n * colorizeNumber(2, [{ pluralRule: 'one' , color: ANSIColors.GREEN}, { pluralRule: 'other' , color: ANSIColors.RED}]) // \"'\\x1b[31m2\\x1b[0m\"\n */\nexport const colorizeNumber = (\n number: number,\n options: Partial<Record<Intl.LDMLPluralRule, ANSIColors>> = {\n zero: ANSIColors.BLUE,\n one: ANSIColors.BLUE,\n two: ANSIColors.BLUE,\n few: ANSIColors.BLUE,\n many: ANSIColors.BLUE,\n other: ANSIColors.BLUE,\n }\n): string => {\n if (number === 0) {\n const color = options.zero ?? ANSIColors.GREEN;\n return colorize(number.toString(), color);\n }\n\n const rule = new Intl.PluralRules('en').select(number);\n const color = options[rule];\n return colorize(number.toString(), color);\n};\n\nconst removeColor = (text: string) => text.replace(/\\x1b\\[[0-9;]*m/g, '');\n\nconst getLength = (length: number | number[] | string | string[]): number => {\n let value: number = 0;\n if (typeof length === 'number') {\n value = length;\n }\n if (typeof length === 'string') {\n value = length.length;\n }\n if (Array.isArray(length) && length.every((l) => typeof l === 'string')) {\n value = Math.max(...length.map((str) => str.length));\n }\n if (Array.isArray(length) && length.every((l) => typeof l === 'number')) {\n value = Math.max(...length);\n }\n return Math.max(value, 0);\n};\n\nconst defaultColonOptions = {\n colSize: 0,\n minSize: 0,\n maxSize: Infinity,\n pad: 'right',\n padChar: '0',\n};\n\n/**\n * Create a string of spaces of a given length.\n *\n * @param colSize - The length of the string to create.\n * @returns A string of spaces.\n */\nexport const colon = (\n text: string | string[],\n options?: {\n colSize?: number | number[] | string | string[];\n minSize?: number;\n maxSize?: number;\n pad?: 'left' | 'right';\n padChar?: string;\n }\n): string =>\n [text]\n .flat()\n .map((text) => {\n const { colSize, minSize, maxSize, pad, padChar } = {\n ...defaultColonOptions,\n ...(options ?? {}),\n };\n\n const length = getLength(colSize);\n const spacesLength = Math.max(\n minSize!,\n Math.min(maxSize!, length - removeColor(text).length)\n );\n\n if (pad === 'left') {\n return `${' '.repeat(spacesLength)}${text}`;\n }\n\n return `${text}${' '.repeat(spacesLength)}`;\n })\n .join('');\n\nexport const x = colorize('✗', ANSIColors.RED);\nexport const v = colorize('✓', ANSIColors.GREEN);\nexport const clock = colorize('⏲', ANSIColors.BLUE);\n"],"mappings":"AAWO,MAAM,SAAiB,CAC5B,SACA,UAAU;AAAA,EACR,WAAW;AAAA,EACX,OAAO;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AA,EACjB;AACA,MAAI,MAAM,QAAQ,MAAM,KAAK,OAAO,MAAM,CAAC,MAAM,OAAO,MAAM,QAAQ,GAAG;AACvE,YAAQ,KAAK,IAAI,GAAG,OAAO,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC;AAAA,EACrD;AACA,MAAI,MAAM,QAAQ,MAAM,KAAK,OAAO,MAAM,CAAC,MAAM,OAAO,MAAM,QAAQ,GAAG;AACvE,YAAQ,KAAK,IAAI,GAAG,MAAM;AAAA,EAC5B;AACA,SAAO,KAAK,IAAI,OAAO,CAAC;AAC1B;AAEA,MAAM,sBAAsB;AAAA,EAC1B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,KAAK;AAAA,EACL,SAAS;AACX;AAQO,MAAM,QAAQ,CACnB,MACA,YAQA,CAAC,IAAI,EACF,KAAK,EACL,IAAI,CAACC,UAAS;AACb,QAAM,EAAE,SAAS,SAAS,SAAS,KAAK,QAAQ,IAAI;AAAA,IAClD,GAAG;AAAA,IACH,GAAI,WAAW,CAAC;AAAA,EAClB;AAEA,QAAM,SAAS,UAAU,OAAO;AAChC,QAAM,eAAe,KAAK;AAAA,IACxB;AAAA,IACA,KAAK,IAAI,SAAU,SAAS,YAAYA,KAAI,EAAE,MAAM;AAAA,EACtD;AAEA,MAAI,QAAQ,QAAQ;AAClB,WAAO,GAAG,IAAI,OAAO,YAAY,CAAC,GAAGA,KAAI;AAAA,EAC3C;AAEA,SAAO,GAAGA,KAAI,GAAG,IAAI,OAAO,YAAY,CAAC;AAC3C,CAAC,EACA,KAAK,EAAE;AAEL,MAAM,IAAI,SAAS,UAAK,oBAAc;AACtC,MAAM,IAAI,SAAS,UAAK,sBAAgB;AACxC,MAAM,QAAQ,SAAS,UAAK,qBAAe;","names":["ANSIColors","color","text"]}
@@ -0,0 +1,15 @@
1
+ import { IntlayerConfig } from './types/config';
2
+ export type GetAliasOptions = {
3
+ configuration?: IntlayerConfig;
4
+ format?: 'esm' | 'cjs';
5
+ formatter?: (value: string) => string;
6
+ };
7
+ export declare const getAlias: ({ configuration, format, formatter, }?: GetAliasOptions) => {
8
+ '@intlayer/dictionaries-entry': string;
9
+ '@intlayer/unmerged-dictionaries-entry': string;
10
+ '@intlayer/remote-dictionaries-entry': string;
11
+ '@intlayer/dynamic-dictionaries-entry': string;
12
+ '@intlayer/fetch-dictionaries-entry': string;
13
+ '@intlayer/config/built': string;
14
+ };
15
+ //# sourceMappingURL=alias.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias.d.ts","sourceRoot":"","sources":["../../src/alias.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,wCAItB,eAAoB;;;;;;;CA0FtB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { logger } from './logger';
1
+ export { ANSIColors, clock, colon, colorizeKey, colorizeLocales, colorizeNumber, colorizePath, getAppLogger, logger, spinnerFrames, v, x, } from './logger';
2
2
  export type { BaseContentConfig, BaseDerivedConfig, CustomIntlayerConfig, IntlayerConfig, PatternsContentConfig, ResultDirDerivedConfig, } from './types/config';
3
3
  export { Locales } from './types/locales';
4
4
  export type { LocalesValues } from './types/locales';
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,aAAa,EACb,CAAC,EACD,CAAC,GACF,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAMV,oBAAoB,EAGpB,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAwqBzB;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,sBAAsB,oBAAoB,EAC1C,UAAU,MAAM,KACf,cAiCF,CAAC"}
1
+ {"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAMV,oBAAoB,EAGpB,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAytBzB;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,sBAAsB,oBAAoB,EAC1C,UAAU,MAAM,KACf,cAiCF,CAAC"}
@@ -1,9 +1,10 @@
1
- import type { LoadEnvFileOptions } from '../envVariables/loadEnvFile';
2
1
  import type { CustomIntlayerConfig, IntlayerConfig } from '../types/config';
3
2
  export type GetConfigurationOptions = {
4
3
  baseDir?: string;
5
4
  override?: CustomIntlayerConfig;
6
- } & LoadEnvFileOptions;
5
+ env?: string;
6
+ envFile?: string;
7
+ };
7
8
  /**
8
9
  * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)
9
10
  */