@intlayer/config 6.0.0 → 6.0.2-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 (46) hide show
  1. package/dist/cjs/alias.cjs +3 -2
  2. package/dist/cjs/alias.cjs.map +1 -1
  3. package/dist/cjs/configFile/buildConfigurationFields.cjs +13 -1
  4. package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
  5. package/dist/cjs/defaultValues/build.cjs +3 -0
  6. package/dist/cjs/defaultValues/build.cjs.map +1 -1
  7. package/dist/cjs/index.cjs +6 -0
  8. package/dist/cjs/index.cjs.map +1 -1
  9. package/dist/cjs/logger.cjs +4 -4
  10. package/dist/cjs/logger.cjs.map +1 -1
  11. package/dist/cjs/types/config.cjs.map +1 -1
  12. package/dist/cjs/utils/clearModuleCache.cjs +49 -0
  13. package/dist/cjs/utils/clearModuleCache.cjs.map +1 -0
  14. package/dist/cjs/utils/getExtension.cjs +37 -0
  15. package/dist/cjs/utils/getExtension.cjs.map +1 -0
  16. package/dist/esm/alias.mjs +3 -2
  17. package/dist/esm/alias.mjs.map +1 -1
  18. package/dist/esm/configFile/buildConfigurationFields.mjs +14 -1
  19. package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
  20. package/dist/esm/defaultValues/build.mjs +2 -0
  21. package/dist/esm/defaultValues/build.mjs.map +1 -1
  22. package/dist/esm/index.mjs +4 -0
  23. package/dist/esm/index.mjs.map +1 -1
  24. package/dist/esm/logger.mjs +4 -4
  25. package/dist/esm/logger.mjs.map +1 -1
  26. package/dist/esm/utils/clearModuleCache.mjs +25 -0
  27. package/dist/esm/utils/clearModuleCache.mjs.map +1 -0
  28. package/dist/esm/utils/getExtension.mjs +13 -0
  29. package/dist/esm/utils/getExtension.mjs.map +1 -0
  30. package/dist/types/alias.d.ts.map +1 -1
  31. package/dist/types/built.d.ts +1 -1
  32. package/dist/types/built.d.ts.map +1 -1
  33. package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
  34. package/dist/types/defaultValues/build.d.ts +1 -0
  35. package/dist/types/defaultValues/build.d.ts.map +1 -1
  36. package/dist/types/index.d.ts +2 -0
  37. package/dist/types/index.d.ts.map +1 -1
  38. package/dist/types/logger.d.ts +4 -4
  39. package/dist/types/logger.d.ts.map +1 -1
  40. package/dist/types/types/config.d.ts +11 -0
  41. package/dist/types/types/config.d.ts.map +1 -1
  42. package/dist/types/utils/clearModuleCache.d.ts +5 -0
  43. package/dist/types/utils/clearModuleCache.d.ts.map +1 -0
  44. package/dist/types/utils/getExtension.d.ts +3 -0
  45. package/dist/types/utils/getExtension.d.ts.map +1 -0
  46. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/alias.ts"],"sourcesContent":["import { join, relative } from 'path';\nimport { getConfiguration } from './configFile/getConfiguration';\nimport { IntlayerConfig } from './types/config';\nimport { normalizePath } from './utils/normalizePath';\n\nexport type GetAliasOptions = {\n configuration?: IntlayerConfig;\n format?: 'esm' | 'cjs';\n formatter?: (value: string) => string;\n};\n\nexport const getAlias = ({\n configuration = getConfiguration(),\n format = 'esm',\n formatter = (value: string) => value,\n}: GetAliasOptions = {}) => {\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n const { mainDir, configDir, baseDir } = configuration.content;\n\n /**\n * Dictionaries\n */\n const dictionariesPath = join(mainDir, `dictionaries.${extension}`);\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const normalizedDictionariesPath = formatter(\n normalizePath(relativeDictionariesPath)\n );\n\n /**\n * Unmerged dictionaries\n */\n const unmergedDictionariesPath = join(\n mainDir,\n `unmerged_dictionaries.${extension}`\n );\n const relativeUnmergedDictionariesPath = relative(\n baseDir,\n unmergedDictionariesPath\n );\n const normalizedUnmergedDictionariesPath = formatter(\n normalizePath(relativeUnmergedDictionariesPath)\n );\n\n /**\n * Remote dictionaries\n */\n const remoteDictionariesPath = join(\n mainDir,\n `remote_dictionaries.${extension}`\n );\n const relativeRemoteDictionariesPath = relative(\n baseDir,\n remoteDictionariesPath\n );\n const normalizedRemoteDictionariesPath = formatter(\n normalizePath(relativeRemoteDictionariesPath)\n );\n\n /**\n * Dynamic dictionaries\n */\n const dynamicDictionariesPath = join(\n mainDir,\n `dynamic_dictionaries.${extension}`\n );\n const relativeDynamicDictionariesPath = relative(\n baseDir,\n dynamicDictionariesPath\n );\n const normalizedDynamicDictionariesPath = formatter(\n normalizePath(relativeDynamicDictionariesPath)\n );\n\n /**\n * Fetch dictionaries\n */\n const fetchDictionariesPath = join(\n mainDir,\n `fetch_dictionaries.${extension}`\n );\n const relativeFetchDictionariesPath = relative(\n baseDir,\n fetchDictionariesPath\n );\n const normalizedFetchDictionariesPath = formatter(\n normalizePath(relativeFetchDictionariesPath)\n );\n\n /**\n * Configuration\n */\n const configurationPath = join(configDir, `configuration.json`);\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n const normalizedConfigurationPath = formatter(\n normalizePath(relativeConfigurationPath)\n );\n\n return {\n '@intlayer/dictionaries-entry': normalizedDictionariesPath,\n '@intlayer/unmerged-dictionaries-entry': normalizedUnmergedDictionariesPath,\n '@intlayer/remote-dictionaries-entry': normalizedRemoteDictionariesPath,\n '@intlayer/dynamic-dictionaries-entry': normalizedDynamicDictionariesPath,\n '@intlayer/fetch-dictionaries-entry': normalizedFetchDictionariesPath,\n '@intlayer/config/built': normalizedConfigurationPath,\n };\n};\n"],"mappings":"AAAA,SAAS,MAAM,gBAAgB;AAC/B,SAAS,wBAAwB;AAEjC,SAAS,qBAAqB;AAQvB,MAAM,WAAW,CAAC;AAAA,EACvB,gBAAgB,iBAAiB;AAAA,EACjC,SAAS;AAAA,EACT,YAAY,CAAC,UAAkB;AACjC,IAAqB,CAAC,MAAM;AAC1B,QAAM,YAAY,WAAW,QAAQ,QAAQ;AAC7C,QAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,cAAc;AAKtD,QAAM,mBAAmB,KAAK,SAAS,gBAAgB,SAAS,EAAE;AAClE,QAAM,2BAA2B,SAAS,SAAS,gBAAgB;AACnE,QAAM,6BAA6B;AAAA,IACjC,cAAc,wBAAwB;AAAA,EACxC;AAKA,QAAM,2BAA2B;AAAA,IAC/B;AAAA,IACA,yBAAyB,SAAS;AAAA,EACpC;AACA,QAAM,mCAAmC;AAAA,IACvC;AAAA,IACA;AAAA,EACF;AACA,QAAM,qCAAqC;AAAA,IACzC,cAAc,gCAAgC;AAAA,EAChD;AAKA,QAAM,yBAAyB;AAAA,IAC7B;AAAA,IACA,uBAAuB,SAAS;AAAA,EAClC;AACA,QAAM,iCAAiC;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AACA,QAAM,mCAAmC;AAAA,IACvC,cAAc,8BAA8B;AAAA,EAC9C;AAKA,QAAM,0BAA0B;AAAA,IAC9B;AAAA,IACA,wBAAwB,SAAS;AAAA,EACnC;AACA,QAAM,kCAAkC;AAAA,IACtC;AAAA,IACA;AAAA,EACF;AACA,QAAM,oCAAoC;AAAA,IACxC,cAAc,+BAA+B;AAAA,EAC/C;AAKA,QAAM,wBAAwB;AAAA,IAC5B;AAAA,IACA,sBAAsB,SAAS;AAAA,EACjC;AACA,QAAM,gCAAgC;AAAA,IACpC;AAAA,IACA;AAAA,EACF;AACA,QAAM,kCAAkC;AAAA,IACtC,cAAc,6BAA6B;AAAA,EAC7C;AAKA,QAAM,oBAAoB,KAAK,WAAW,oBAAoB;AAC9D,QAAM,4BAA4B,SAAS,SAAS,iBAAiB;AACrE,QAAM,8BAA8B;AAAA,IAClC,cAAc,yBAAyB;AAAA,EACzC;AAEA,SAAO;AAAA,IACL,gCAAgC;AAAA,IAChC,yCAAyC;AAAA,IACzC,uCAAuC;AAAA,IACvC,wCAAwC;AAAA,IACxC,sCAAsC;AAAA,IACtC,0BAA0B;AAAA,EAC5B;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/alias.ts"],"sourcesContent":["import { join, relative } from 'path';\nimport { getConfiguration } from './configFile/getConfiguration';\nimport { IntlayerConfig } from './types/config';\nimport { getExtension } from './utils/getExtension';\nimport { normalizePath } from './utils/normalizePath';\n\nexport type GetAliasOptions = {\n configuration?: IntlayerConfig;\n format?: 'esm' | 'cjs';\n formatter?: (value: string) => string;\n};\n\nexport const getAlias = ({\n configuration = getConfiguration(),\n format,\n formatter = (value: string) => value,\n}: GetAliasOptions = {}) => {\n const extension = getExtension(configuration, format);\n\n const { mainDir, configDir, baseDir } = configuration.content;\n\n /**\n * Dictionaries\n */\n const dictionariesPath = join(mainDir, `dictionaries.${extension}`);\n const relativeDictionariesPath = relative(baseDir, dictionariesPath);\n const normalizedDictionariesPath = formatter(\n normalizePath(relativeDictionariesPath)\n );\n\n /**\n * Unmerged dictionaries\n */\n const unmergedDictionariesPath = join(\n mainDir,\n `unmerged_dictionaries.${extension}`\n );\n const relativeUnmergedDictionariesPath = relative(\n baseDir,\n unmergedDictionariesPath\n );\n const normalizedUnmergedDictionariesPath = formatter(\n normalizePath(relativeUnmergedDictionariesPath)\n );\n\n /**\n * Remote dictionaries\n */\n const remoteDictionariesPath = join(\n mainDir,\n `remote_dictionaries.${extension}`\n );\n const relativeRemoteDictionariesPath = relative(\n baseDir,\n remoteDictionariesPath\n );\n const normalizedRemoteDictionariesPath = formatter(\n normalizePath(relativeRemoteDictionariesPath)\n );\n\n /**\n * Dynamic dictionaries\n */\n const dynamicDictionariesPath = join(\n mainDir,\n `dynamic_dictionaries.${extension}`\n );\n const relativeDynamicDictionariesPath = relative(\n baseDir,\n dynamicDictionariesPath\n );\n const normalizedDynamicDictionariesPath = formatter(\n normalizePath(relativeDynamicDictionariesPath)\n );\n\n /**\n * Fetch dictionaries\n */\n const fetchDictionariesPath = join(\n mainDir,\n `fetch_dictionaries.${extension}`\n );\n const relativeFetchDictionariesPath = relative(\n baseDir,\n fetchDictionariesPath\n );\n const normalizedFetchDictionariesPath = formatter(\n normalizePath(relativeFetchDictionariesPath)\n );\n\n /**\n * Configuration\n */\n const configurationPath = join(configDir, `configuration.json`);\n const relativeConfigurationPath = relative(baseDir, configurationPath);\n const normalizedConfigurationPath = formatter(\n normalizePath(relativeConfigurationPath)\n );\n\n return {\n '@intlayer/dictionaries-entry': normalizedDictionariesPath,\n '@intlayer/unmerged-dictionaries-entry': normalizedUnmergedDictionariesPath,\n '@intlayer/remote-dictionaries-entry': normalizedRemoteDictionariesPath,\n '@intlayer/dynamic-dictionaries-entry': normalizedDynamicDictionariesPath,\n '@intlayer/fetch-dictionaries-entry': normalizedFetchDictionariesPath,\n '@intlayer/config/built': normalizedConfigurationPath,\n };\n};\n"],"mappings":"AAAA,SAAS,MAAM,gBAAgB;AAC/B,SAAS,wBAAwB;AAEjC,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAQvB,MAAM,WAAW,CAAC;AAAA,EACvB,gBAAgB,iBAAiB;AAAA,EACjC;AAAA,EACA,YAAY,CAAC,UAAkB;AACjC,IAAqB,CAAC,MAAM;AAC1B,QAAM,YAAY,aAAa,eAAe,MAAM;AAEpD,QAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,cAAc;AAKtD,QAAM,mBAAmB,KAAK,SAAS,gBAAgB,SAAS,EAAE;AAClE,QAAM,2BAA2B,SAAS,SAAS,gBAAgB;AACnE,QAAM,6BAA6B;AAAA,IACjC,cAAc,wBAAwB;AAAA,EACxC;AAKA,QAAM,2BAA2B;AAAA,IAC/B;AAAA,IACA,yBAAyB,SAAS;AAAA,EACpC;AACA,QAAM,mCAAmC;AAAA,IACvC;AAAA,IACA;AAAA,EACF;AACA,QAAM,qCAAqC;AAAA,IACzC,cAAc,gCAAgC;AAAA,EAChD;AAKA,QAAM,yBAAyB;AAAA,IAC7B;AAAA,IACA,uBAAuB,SAAS;AAAA,EAClC;AACA,QAAM,iCAAiC;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AACA,QAAM,mCAAmC;AAAA,IACvC,cAAc,8BAA8B;AAAA,EAC9C;AAKA,QAAM,0BAA0B;AAAA,IAC9B;AAAA,IACA,wBAAwB,SAAS;AAAA,EACnC;AACA,QAAM,kCAAkC;AAAA,IACtC;AAAA,IACA;AAAA,EACF;AACA,QAAM,oCAAoC;AAAA,IACxC,cAAc,+BAA+B;AAAA,EAC/C;AAKA,QAAM,wBAAwB;AAAA,IAC5B;AAAA,IACA,sBAAsB,SAAS;AAAA,EACjC;AACA,QAAM,gCAAgC;AAAA,IACpC;AAAA,IACA;AAAA,EACF;AACA,QAAM,kCAAkC;AAAA,IACtC,cAAc,6BAA6B;AAAA,EAC7C;AAKA,QAAM,oBAAoB,KAAK,WAAW,oBAAoB;AAC9D,QAAM,4BAA4B,SAAS,SAAS,iBAAiB;AACrE,QAAM,8BAA8B;AAAA,IAClC,cAAc,yBAAyB;AAAA,EACzC;AAEA,SAAO;AAAA,IACL,gCAAgC;AAAA,IAChC,yCAAyC;AAAA,IACzC,uCAAuC;AAAA,IACvC,wCAAwC;AAAA,IACxC,sCAAsC;AAAA,IACtC,0BAA0B;AAAA,EAC5B;AACF;","names":[]}
@@ -2,6 +2,7 @@ import { join } from "path";
2
2
  import {
3
3
  IMPORT_MODE,
4
4
  OPTIMIZE,
5
+ OUTPUT_FORMAT,
5
6
  TRAVERSE_PATTERN
6
7
  } from "../defaultValues/build.mjs";
7
8
  import {
@@ -637,7 +638,19 @@ const buildBuildFields = (customConfiguration) => ({
637
638
  * - This option will be ignored if `optimize` is disabled.
638
639
  * - Use glob pattern.
639
640
  */
640
- traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN
641
+ traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,
642
+ /**
643
+ * Output format of the dictionaries
644
+ *
645
+ * Can be set on large projects to improve build performance.
646
+ *
647
+ * Default: ['cjs', 'esm']
648
+ *
649
+ * The output format of the dictionaries. It can be either 'cjs' or 'esm'.
650
+ * - 'cjs': The dictionaries are outputted as CommonJS modules.
651
+ * - 'esm': The dictionaries are outputted as ES modules.
652
+ */
653
+ outputFormat: customConfiguration?.outputFormat ?? OUTPUT_FORMAT
641
654
  });
642
655
  const buildConfigurationFields = (customConfiguration, baseDir) => {
643
656
  const internationalizationConfig = buildInternationalizationFields(
@@ -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 DYNAMIC_DICTIONARIES_DIR,\n EXCLUDED_PATHS,\n FETCH_DICTIONARIES_DIR,\n FILE_EXTENSIONS,\n MAIN_DIR,\n MODULE_AUGMENTATION_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 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 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,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,eAAe,qBAAqB,iBAAiB;AACvD;AAEA,MAAM,wBAAwB,CAC5B,yBACsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO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,mBAAmB,CACvB,yBACiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBjB,UAAU,qBAAqB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2B3C,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 OUTPUT_FORMAT,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n CONFIG_DIR,\n CONTENT_DIR,\n DICTIONARIES_DIR,\n DYNAMIC_DICTIONARIES_DIR,\n EXCLUDED_PATHS,\n FETCH_DICTIONARIES_DIR,\n FILE_EXTENSIONS,\n MAIN_DIR,\n MODULE_AUGMENTATION_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 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 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 * Output format of the dictionaries\n *\n * Can be set on large projects to improve build performance.\n *\n * Default: ['cjs', 'esm']\n *\n * The output format of the dictionaries. It can be either 'cjs' or 'esm'.\n * - 'cjs': The dictionaries are outputted as CommonJS modules.\n * - 'esm': The dictionaries are outputted as ES modules.\n */\n outputFormat: customConfiguration?.outputFormat ?? OUTPUT_FORMAT,\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,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,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,eAAe,qBAAqB,iBAAiB;AACvD;AAEA,MAAM,wBAAwB,CAC5B,yBACsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/C,YAAY,qBAAqB,cAAc;AAAA;AAAA;A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UTPUT_FORMAT = ["cjs", "esm"];
7
8
  export {
8
9
  IMPORT_MODE,
9
10
  OPTIMIZE,
11
+ OUTPUT_FORMAT,
10
12
  TRAVERSE_PATTERN
11
13
  };
12
14
  //# sourceMappingURL=build.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/defaultValues/build.ts"],"sourcesContent":["export const OPTIMIZE = process.env.NODE_ENV === 'production';\n\nexport const IMPORT_MODE = 'static';\n\nexport const TRAVERSE_PATTERN = [\n '**/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx,vue,svelte,svte}',\n '!**/node_modules/**',\n];\n"],"mappings":"AAAO,MAAM,WAAW,QAAQ,IAAI,aAAa;AAE1C,MAAM,cAAc;AAEpB,MAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/defaultValues/build.ts"],"sourcesContent":["export const OPTIMIZE = process.env.NODE_ENV === 'production';\n\nexport const IMPORT_MODE = 'static';\n\nexport const TRAVERSE_PATTERN = [\n '**/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx,vue,svelte,svte}',\n '!**/node_modules/**',\n];\n\nexport const OUTPUT_FORMAT: ('cjs' | 'esm')[] = ['cjs', 'esm'];\n"],"mappings":"AAAO,MAAM,WAAW,QAAQ,IAAI,aAAa;AAE1C,MAAM,cAAc;AAEpB,MAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AACF;AAEO,MAAM,gBAAmC,CAAC,OAAO,KAAK;","names":[]}
@@ -22,12 +22,15 @@ import {
22
22
  } from "./logger.mjs";
23
23
  import { retryManager } from "./retryManager.mjs";
24
24
  import { Locales } from "./types/locales.mjs";
25
+ import { clearModuleCache } from "./utils/clearModuleCache.mjs";
25
26
  import { ESMxCJSRequire, isESModule } from "./utils/ESMxCJSHelpers.mjs";
27
+ import { getExtension } from "./utils/getExtension.mjs";
26
28
  import { normalizePath } from "./utils/normalizePath.mjs";
27
29
  export {
28
30
  ANSIColors,
29
31
  ESMxCJSRequire,
30
32
  Locales,
33
+ clearModuleCache,
31
34
  clock,
32
35
  colon,
33
36
  colorize,
@@ -39,6 +42,7 @@ export {
39
42
  getAppLogger,
40
43
  getConfiguration,
41
44
  getEnvFilePath,
45
+ getExtension,
42
46
  getSandBoxContext,
43
47
  isESModule,
44
48
  loadEnvFile,
@@ -1 +1 @@
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":[]}
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 { clearModuleCache } from './utils/clearModuleCache';\nexport { ESMxCJSRequire, isESModule } from './utils/ESMxCJSHelpers';\nexport { getExtension } from './utils/getExtension';\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,wBAAwB;AACjC,SAAS,gBAAgB,kBAAkB;AAC3C,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;","names":[]}
@@ -45,10 +45,10 @@ const getAppLogger = (configuration, globalDetails) => (content, details) => log
45
45
  ...details?.config ?? {}
46
46
  }
47
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(`, `);
48
+ const colorize = (s, color, reset) => color ? `${color}${s}${reset ? typeof reset === "boolean" ? "\x1B[0m" /* RESET */ : reset : "\x1B[0m" /* RESET */}` : s;
49
+ const colorizeLocales = (locales, color = "\x1B[32m" /* GREEN */, reset = "\x1B[0m" /* RESET */) => [locales].flat().map((locale) => colorize(locale, color, reset)).join(`, `);
50
+ const colorizeKey = (keyPath, color = "\x1B[38;5;3m" /* BEIGE */, reset = "\x1B[0m" /* RESET */) => [keyPath].flat().map((key) => colorize(key, color, reset)).join(`, `);
51
+ const colorizePath = (path, color = "\x1B[90m" /* GREY */, reset = "\x1B[0m" /* RESET */) => [path].flat().map((p) => colorize(p, color, reset)).join(`, `);
52
52
  const colorizeNumber = (number, options = {
53
53
  zero: "\x1B[34m" /* BLUE */,
54
54
  one: "\x1B[34m" /* BLUE */,
@@ -1 +1 @@
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;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;AAEO,IAAK,aAAL,kBAAKA,gBAAL;AACL,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,eAAY;AACZ,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,SAAM;AACN,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,WAAQ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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"]}
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 = (\n s: string,\n color?: ANSIColors,\n reset?: boolean | ANSIColors\n): string =>\n color\n ? `${color}${s}${reset ? (typeof reset === 'boolean' ? ANSIColors.RESET : reset) : ANSIColors.RESET}`\n : s;\n\nexport const colorizeLocales = (\n locales: Locales | Locales[],\n color = ANSIColors.GREEN,\n reset: boolean | ANSIColors = ANSIColors.RESET\n) =>\n [locales]\n .flat()\n .map((locale) => colorize(locale, color, reset))\n .join(`, `);\n\nexport const colorizeKey = (\n keyPath: string | string[],\n color = ANSIColors.BEIGE,\n reset: boolean | ANSIColors = ANSIColors.RESET\n) =>\n [keyPath]\n .flat()\n .map((key) => colorize(key, color, reset))\n .join(`, `);\n\nexport const colorizePath = (\n path: string | string[],\n color = ANSIColors.GREY,\n reset: boolean | ANSIColors = ANSIColors.RESET\n) =>\n [path]\n .flat()\n .map((p) => colorize(p, color, reset))\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;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,S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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,25 @@
1
+ import { ESMxCJSRequire } from "./ESMxCJSHelpers.mjs";
2
+ const clearModuleCache = (modulePath, visited = /* @__PURE__ */ new Set()) => {
3
+ if (visited.has(modulePath)) {
4
+ return;
5
+ }
6
+ visited.add(modulePath);
7
+ try {
8
+ const resolvedPath = ESMxCJSRequire.resolve(modulePath);
9
+ const cachedModule = ESMxCJSRequire.cache[resolvedPath];
10
+ if (cachedModule) {
11
+ if (cachedModule.children) {
12
+ cachedModule.children.forEach((child) => {
13
+ clearModuleCache(child.filename, visited);
14
+ });
15
+ }
16
+ delete ESMxCJSRequire.cache[resolvedPath];
17
+ }
18
+ } catch (error) {
19
+ console.warn(`Could not clear cache for module: ${modulePath}`, error);
20
+ }
21
+ };
22
+ export {
23
+ clearModuleCache
24
+ };
25
+ //# sourceMappingURL=clearModuleCache.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/clearModuleCache.ts"],"sourcesContent":["import { ESMxCJSRequire } from './ESMxCJSHelpers';\n\n/**\n * Recursively clears the require cache for a module and all its dependencies\n */\nexport const clearModuleCache = (\n modulePath: string,\n visited = new Set<string>()\n) => {\n // Avoid infinite loops\n if (visited.has(modulePath)) {\n return;\n }\n visited.add(modulePath);\n\n try {\n const resolvedPath = ESMxCJSRequire.resolve(modulePath);\n\n // Get the cached module\n const cachedModule = ESMxCJSRequire.cache[resolvedPath];\n\n if (cachedModule) {\n // Clear cache for all children (dependencies) first\n if (cachedModule.children) {\n cachedModule.children.forEach((child) => {\n clearModuleCache(child.filename, visited);\n });\n }\n\n // Clear the cache for this module\n delete ESMxCJSRequire.cache[resolvedPath];\n }\n } catch (error) {\n // Module might not exist or be resolvable, skip it\n console.warn(`Could not clear cache for module: ${modulePath}`, error);\n }\n};\n"],"mappings":"AAAA,SAAS,sBAAsB;AAKxB,MAAM,mBAAmB,CAC9B,YACA,UAAU,oBAAI,IAAY,MACvB;AAEH,MAAI,QAAQ,IAAI,UAAU,GAAG;AAC3B;AAAA,EACF;AACA,UAAQ,IAAI,UAAU;AAEtB,MAAI;AACF,UAAM,eAAe,eAAe,QAAQ,UAAU;AAGtD,UAAM,eAAe,eAAe,MAAM,YAAY;AAEtD,QAAI,cAAc;AAEhB,UAAI,aAAa,UAAU;AACzB,qBAAa,SAAS,QAAQ,CAAC,UAAU;AACvC,2BAAiB,MAAM,UAAU,OAAO;AAAA,QAC1C,CAAC;AAAA,MACH;AAGA,aAAO,eAAe,MAAM,YAAY;AAAA,IAC1C;AAAA,EACF,SAAS,OAAO;AAEd,YAAQ,KAAK,qCAAqC,UAAU,IAAI,KAAK;AAAA,EACvE;AACF;","names":[]}
@@ -0,0 +1,13 @@
1
+ import { getConfiguration } from "@intlayer/config";
2
+ const getExtension = (configuration = getConfiguration(), format) => {
3
+ const outputFormats = configuration.build.outputFormat;
4
+ if (format === "esm") return "mjs";
5
+ if (format === "cjs") return "cjs";
6
+ if (outputFormats.includes("esm")) return "mjs";
7
+ if (outputFormats.includes("cjs")) return "cjs";
8
+ return "mjs";
9
+ };
10
+ export {
11
+ getExtension
12
+ };
13
+ //# sourceMappingURL=getExtension.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/getExtension.ts"],"sourcesContent":["import { type IntlayerConfig, getConfiguration } from '@intlayer/config';\n\nexport const getExtension = (\n configuration: IntlayerConfig = getConfiguration(),\n format?: 'esm' | 'cjs' | undefined\n) => {\n const outputFormats = configuration.build.outputFormat;\n\n if (format === 'esm') return 'mjs';\n if (format === 'cjs') return 'cjs';\n\n if (outputFormats.includes('esm')) return 'mjs';\n if (outputFormats.includes('cjs')) return 'cjs';\n\n return 'mjs';\n};\n"],"mappings":"AAAA,SAA8B,wBAAwB;AAE/C,MAAM,eAAe,CAC1B,gBAAgC,iBAAiB,GACjD,WACG;AACH,QAAM,gBAAgB,cAAc,MAAM;AAE1C,MAAI,WAAW,MAAO,QAAO;AAC7B,MAAI,WAAW,MAAO,QAAO;AAE7B,MAAI,cAAc,SAAS,KAAK,EAAG,QAAO;AAC1C,MAAI,cAAc,SAAS,KAAK,EAAG,QAAO;AAE1C,SAAO;AACT;","names":[]}
@@ -1 +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
+ {"version":3,"file":"alias.d.ts","sourceRoot":"","sources":["../../src/alias.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIhD,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;;;;;;;CA2FtB,CAAC"}
@@ -2,6 +2,6 @@
2
2
  * @intlayer/config/built is a package that only returns the configuration file as a JSON object.
3
3
  * Using an external package allow to alias it in the bundle configuration (such as webpack).
4
4
  */
5
- declare const configuration: import("./client").IntlayerConfig;
5
+ declare const configuration: import(".").IntlayerConfig;
6
6
  export default configuration;
7
7
  //# sourceMappingURL=built.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"built.d.ts","sourceRoot":"","sources":["../../src/built.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,QAAA,MAAM,aAAa,mCAAqB,CAAC;AAEzC,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"built.d.ts","sourceRoot":"","sources":["../../src/built.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,QAAA,MAAM,aAAa,4BAAqB,CAAC;AAEzC,eAAe,aAAa,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;AAyqBzB;;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":"AAiDA,OAAO,KAAK,EAMV,oBAAoB,EAGpB,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAsrBzB;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,sBAAsB,oBAAoB,EAC1C,UAAU,MAAM,KACf,cAiCF,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export declare const OPTIMIZE: boolean;
2
2
  export declare const IMPORT_MODE = "static";
3
3
  export declare const TRAVERSE_PATTERN: string[];
4
+ export declare const OUTPUT_FORMAT: ('cjs' | 'esm')[];
4
5
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/build.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,SAAwC,CAAC;AAE9D,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,eAAO,MAAM,gBAAgB,UAG5B,CAAC"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/build.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,SAAwC,CAAC;AAE9D,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,eAAO,MAAM,gBAAgB,UAG5B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,CAAC"}
@@ -8,6 +8,8 @@ export { retryManager } from './retryManager';
8
8
  export type { BaseContentConfig, BaseDerivedConfig, ContentConfig, CustomIntlayerConfig, InternationalizationConfig, IntlayerConfig, LogConfig, MiddlewareConfig, PatternsContentConfig, ResultDirDerivedConfig, ServerSetCookieRule, StrictMode, } from './types/config';
9
9
  export { Locales } from './types/locales';
10
10
  export type { LocalesValues } from './types/locales';
11
+ export { clearModuleCache } from './utils/clearModuleCache';
11
12
  export { ESMxCJSRequire, isESModule } from './utils/ESMxCJSHelpers';
13
+ export { getExtension } from './utils/getExtension';
12
14
  export { normalizePath } from './utils/normalizePath';
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,aAAa,EACb,CAAC,EACD,CAAC,EACD,KAAK,MAAM,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,c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27,10 @@ export declare const spinnerFrames: string[];
27
27
  * The configuration is merged with the default configuration from the intlayer config file.
28
28
  */
29
29
  export declare const getAppLogger: (configuration?: CustomIntlayerConfig, globalDetails?: Details) => (content: any, details?: Details) => void;
30
- export declare const colorize: (s: string, color?: ANSIColors) => string;
31
- export declare const colorizeLocales: (locales: Locales | Locales[], color?: ANSIColors) => string;
32
- export declare const colorizeKey: (keyPath: string | string[], color?: ANSIColors) => string;
33
- export declare const colorizePath: (path: string | string[], color?: ANSIColors) => string;
30
+ export declare const colorize: (s: string, color?: ANSIColors, reset?: boolean | ANSIColors) => string;
31
+ export declare const colorizeLocales: (locales: Locales | Locales[], color?: ANSIColors, reset?: boolean | ANSIColors) => string;
32
+ export declare const colorizeKey: (keyPath: string | string[], color?: ANSIColors, reset?: boolean | ANSIColors) => string;
33
+ export declare const colorizePath: (path: string | string[], color?: ANSIColors, reset?: boolean | ANSIColors) => string;
34
34
  /**
35
35
  * Colorize numeric value using Intl.NumberFormat and optional ANSI colors.
36
36
  *
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAC5C,MAAM,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE/D,eAAO,MAAM,MAAM,EAAE,MAoCpB,CAAC;AAEF,oBAAY,UAAU;IACpB,KAAK,cAAY;IACjB,IAAI,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AAG,UAA6B,WAKjC,CAAC;AAEhB,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,kBAAwB,EACxB,QAAO,OAAO,GAAG,UAA6B,WAKjC,CAAC;AAEhB,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,GAAG,MAAM,EAAE,EACvB,kBAAuB,EACvB,QAAO,OAAO,GAAG,UAA6B,WAKjC,CAAC;AAEhB;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,UAAS,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAOvD,KACA,MASF,CAAC;AA6BF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,GAAG,MAAM,EAAE,EACvB,UAAU;IACR,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KACA,MAqBU,CAAC;AAEd,eAAO,MAAM,CAAC,QAAgC,CAAC;AAC/C,eAAO,MAAM,CAAC,QAAkC,CAAC;AACjD,eAAO,MAAM,KAAK,QAAiC,CAAC"}
@@ -338,6 +338,7 @@ export type BuildConfig = {
338
338
  * - This option will be ignored if `optimize` is disabled.
339
339
  * - 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.
340
340
  * - The "live" allows to sync the dictionaries to the live sync server.
341
+ * - Require static key to work. Example of invalid code: `const navbarKey = "my-key"; useIntlayer(navbarKey)`.
341
342
  */
342
343
  importMode: 'static' | 'dynamic' | 'live';
343
344
  /**
@@ -355,6 +356,16 @@ export type BuildConfig = {
355
356
  * - Use glob pattern.
356
357
  */
357
358
  traversePattern: string[];
359
+ /**
360
+ * Output format of the dictionaries
361
+ *
362
+ * Default: ['cjs', 'esm']
363
+ *
364
+ * The output format of the dictionaries. It can be either 'cjs' or 'esm'. Even if dictionaries are written in JSON, entry point to access the dictionaries are generated.
365
+ * This function will use the output format defined using this option.
366
+ * The default format is 'cjs' as it allows better interoperability with other libraries, scripts, and applications. But some build tools, such as Vite, require ES modules.
367
+ */
368
+ outputFormat: ('cjs' | 'esm')[];
358
369
  };
359
370
  /**
360
371
  * Custom configuration that can be provided to override default settings
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB;;;;;;;;OAQG;IACH,eAAe,EAAE,OAAO,EAAE,CAAC;IAE3B;;;;;;;OAOG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;OAWG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,EAAE,mBAAmB,CAAC;IAErC;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,C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AC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;;OAMG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAEhC;;;;;;OAMG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;;;;OAMG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;;;OAMG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAE9B;;;;;;OAMG;IACH,2BAA2B,EAAE,MAAM,EAAE,CAAC;IAEtC;;;;;;OAMG;IACH,0BAA0B,EAAE,MAAM,CAAC;CACpC,CAAC;AAGF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,iBAAiB,GACjB,sBAAsB,GACtB,qBAAqB,CAAC;AAExB,MAAM,MAAM,SAAS,GAAG;IACtB;;;;;;;;OAQG;IACH,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAEzC;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Recursively clears the require cache for a module and all its dependencies
3
+ */
4
+ export declare const clearModuleCache: (modulePath: string, visited?: Set<string>) => void;
5
+ //# sourceMappingURL=clearModuleCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clearModuleCache.d.ts","sourceRoot":"","sources":["../../../src/utils/clearModuleCache.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,MAAM,EAClB,qBAA2B,SA6B5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type IntlayerConfig } from '@intlayer/config';
2
+ export declare const getExtension: (configuration?: IntlayerConfig, format?: "esm" | "cjs" | undefined) => "cjs" | "mjs";
3
+ //# sourceMappingURL=getExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getExtension.d.ts","sourceRoot":"","sources":["../../../src/utils/getExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,kBAAkB,CAAC;AAEzE,eAAO,MAAM,YAAY,GACvB,gBAAe,cAAmC,EAClD,SAAS,KAAK,GAAG,KAAK,GAAG,SAAS,kBAWnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/config",
3
- "version": "6.0.0",
3
+ "version": "6.0.2-canary.0",
4
4
  "private": false,
5
5
  "description": "Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.",
6
6
  "keywords": [
@@ -85,13 +85,13 @@
85
85
  "tsup": "^8.5.0",
86
86
  "typescript": "^5.9.2",
87
87
  "vitest": "^3.2.4",
88
- "@utils/tsup-config": "1.0.4",
88
+ "@utils/eslint-config": "1.0.4",
89
89
  "@utils/ts-config": "1.0.4",
90
90
  "@utils/ts-config-types": "1.0.4",
91
- "@utils/eslint-config": "1.0.4"
91
+ "@utils/tsup-config": "1.0.4"
92
92
  },
93
93
  "peerDependencies": {
94
- "intlayer": "6.0.0"
94
+ "intlayer": "6.0.2-canary.0"
95
95
  },
96
96
  "engines": {
97
97
  "node": ">=14.18"