@intlayer/config 7.3.1 → 7.3.2-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,8 +24,6 @@
24
24
  <a href="https://github.com/aymericzip/intlayer/blob/main/LICENSE" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/license/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="license"/></a>
25
25
  <a href="https://github.com/aymericzip/intlayer/commits/main" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/last-commit/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="last commit"/>
26
26
  </a>
27
- <a href="https://bountyhub.dev/bounties?repo=intlayer" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/badge/Bounties-on%20BountyHub-yellow?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="Bounties on BountyHub"/>
28
- </a>
29
27
  </p>
30
28
 
31
29
  ![Watch the video](https://github.com/aymericzip/intlayer/blob/main/docs/assets/demo_video.gif)
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_utils_normalizePath = require('../utils/normalizePath.cjs');
3
3
  const require_defaultValues_build = require('../defaultValues/build.cjs');
4
+ const require_defaultValues_compiler = require('../defaultValues/compiler.cjs');
4
5
  const require_defaultValues_content = require('../defaultValues/content.cjs');
5
6
  const require_defaultValues_dictionary = require('../defaultValues/dictionary.cjs');
6
7
  const require_defaultValues_editor = require('../defaultValues/editor.cjs');
@@ -97,6 +98,12 @@ const buildBuildFields = (customConfiguration) => ({
97
98
  cache: customConfiguration?.cache ?? require_defaultValues_build.CACHE,
98
99
  require: customConfiguration?.require
99
100
  });
101
+ const buildCompilerFields = (customConfiguration) => ({
102
+ enabled: customConfiguration?.enabled ?? require_defaultValues_compiler.COMPILER_ENABLED,
103
+ transformPattern: customConfiguration?.transformPattern ?? require_defaultValues_compiler.COMPILER_TRANSFORM_PATTERN,
104
+ excludePattern: customConfiguration?.excludePattern ?? require_defaultValues_compiler.COMPILER_EXCLUDE_PATTERN,
105
+ outputDir: customConfiguration?.outputDir ?? require_defaultValues_compiler.COMPILER_OUTPUT_DIR
106
+ });
100
107
  const buildDictionaryFields = (customConfiguration) => ({ fill: customConfiguration?.fill ?? require_defaultValues_dictionary.FILL });
101
108
  /**
102
109
  * Build the configuration fields by merging the default values with the custom configuration
@@ -110,6 +117,7 @@ const buildConfigurationFields = (customConfiguration, baseDir, logFunctions) =>
110
117
  log: buildLogFields(customConfiguration?.log, logFunctions),
111
118
  ai: buildAiFields(customConfiguration?.ai),
112
119
  build: buildBuildFields(customConfiguration?.build),
120
+ compiler: buildCompilerFields(customConfiguration?.compiler),
113
121
  dictionary: buildDictionaryFields(customConfiguration?.dictionary),
114
122
  plugins: customConfiguration?.plugins,
115
123
  metadata: {
@@ -1 +1 @@
1
- {"version":3,"file":"buildConfigurationFields.cjs","names":["storedConfiguration: IntlayerConfig","LOCALES","REQUIRED_LOCALES","STRICT_MODE","DEFAULT_LOCALE","ROUTING_MODE","STORAGE","BASE_PATH","notDerivedContentConfig: BaseContentConfig","FILE_EXTENSIONS","EXCLUDED_PATHS","WATCH","baseDirDerivedConfiguration: BaseDerivedConfig","CONTENT_DIR","MODULE_AUGMENTATION_DIR","UNMERGED_DICTIONARIES_DIR","REMOTE_DICTIONARIES_DIR","DICTIONARIES_DIR","DYNAMIC_DICTIONARIES_DIR","FETCH_DICTIONARIES_DIR","TYPES_DIR","MAIN_DIR","CONFIG_DIR","CACHE_DIR","patternsConfiguration: PatternsContentConfig","normalizePath","APPLICATION_URL","EDITOR_URL","CMS_URL","BACKEND_URL","PORT","IS_ENABLED","DICTIONARY_PRIORITY_STRATEGY","LIVE_SYNC","LIVE_SYNC_PORT","MODE","PREFIX","IMPORT_MODE","TRAVERSE_PATTERN","OUTPUT_FORMAT","CACHE","FILL","packageJson"],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { isAbsolute, join } from 'node:path';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n ContentConfig,\n CustomIntlayerConfig,\n DictionaryConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n LogFunctions,\n PatternsContentConfig,\n RoutingConfig,\n} from '@intlayer/types';\nimport packageJson from '@intlayer/types/package.json' with { type: 'json' };\nimport {\n CACHE,\n IMPORT_MODE,\n OUTPUT_FORMAT,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n CACHE_DIR,\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 { FILL } from '../defaultValues/dictionary';\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 { BASE_PATH, ROUTING_MODE, STORAGE } from '../defaultValues/routing';\nimport { normalizePath } from '../utils/normalizePath';\n\nlet storedConfiguration: IntlayerConfig;\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 buildRoutingFields = (\n customConfiguration?: Partial<RoutingConfig>\n): RoutingConfig => ({\n /**\n * URL routing mode for locale handling\n *\n * Controls how locales are represented in application URLs:\n * - 'prefix-no-default': Prefix all locales except the default locale (default)\n * - en → /dashboard\n * - fr → /fr/dashboard\n *\n * - 'prefix-all': Prefix all locales including the default locale\n * - en → /en/dashboard\n * - fr → /fr/dashboard\n *\n * - 'search-params': Use search parameters for locale handling\n * - en → /dashboard?locale=en\n * - fr → /fr/dashboard?locale=fr\n *\n * - 'no-prefix': No locale prefixing in URLs\n * - en → /dashboard\n * - fr → /dashboard\n *\n * Default: 'prefix-no-default'\n */\n mode: customConfiguration?.mode ?? ROUTING_MODE,\n\n /**\n * Configuration for storing the locale in the client (localStorage or sessionStorage)\n *\n * If false, the locale will not be stored by the middleware.\n * If true, the locale storage will consider all default values. (cookie and header)\n *\n * Default: ['cookie', 'header']\n *\n */\n storage: customConfiguration?.storage ?? STORAGE,\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\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/**', '**\\/dist/**', '**\\/build/**', '**\\/.intlayer/**', '**\\/.next/**', '**\\/.nuxt/**', '**\\/.expo/**', '**\\/.vercel/**', '**\\/.turbo/**', '**\\/.tanstack/**']\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 * Command to format the content. When intlayer write your .content files locally, this command will be used to format the content.\n * Intlayer will replace the {{file}} with the path of the file to format.\n *\n * If not set, Intlayer will try to detect the format command automatically. By trying to resolve the following commands: prettier, biome, eslint.\n *\n * Example:\n *\n * ```bash\n * npx prettier --write {{file}}\n * ```\n *\n * ```bash\n * bunx biome format {{file}}\n * ```\n *\n * ```bash\n * bun format {{file}}\n * ```\n *\n * ```bash\n * npx eslint --fix {{file}}\n * ```\n *\n * Default: undefined\n */\n formatCommand: customConfiguration?.formatCommand,\n };\n\n const optionalJoinBaseDir = (path: string) => {\n if (isAbsolute(path)) return path;\n\n return join(notDerivedContentConfig.baseDir, path);\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 optionalJoinBaseDir\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: optionalJoinBaseDir(\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(customConfiguration?.typesDir ?? TYPES_DIR),\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: optionalJoinBaseDir(customConfiguration?.mainDir ?? MAIN_DIR),\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: optionalJoinBaseDir(\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n\n /**\n * Directory where the cache files are stored, relative to the result directory\n *\n * Default: .intlayer/cache\n */\n cacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? CACHE_DIR),\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 baseDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\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 logFunctions?: LogFunctions\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'prefix-no-default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n\n /**\n * Functions to log\n */\n error: logFunctions?.error,\n log: logFunctions?.log,\n info: logFunctions?.info,\n warn: logFunctions?.warn,\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,\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 disabled 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 * Cache\n */\n cache: customConfiguration?.cache ?? CACHE,\n\n /**\n * Require function\n */\n require: customConfiguration?.require,\n});\n\nconst buildDictionaryFields = (\n customConfiguration?: Partial<DictionaryConfig>\n): DictionaryConfig => ({\n /**\n * Indicate how the dictionary should be filled using AI.\n *\n * Default: true\n */\n fill: customConfiguration?.fill ?? FILL,\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 logFunctions?: LogFunctions\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const routingConfig = buildRoutingFields(customConfiguration?.routing);\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, logFunctions);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n const dictionaryConfig = buildDictionaryFields(\n customConfiguration?.dictionary\n );\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n routing: routingConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n dictionary: dictionaryConfig,\n plugins: customConfiguration?.plugins,\n metadata: {\n name: 'Intlayer',\n version: packageJson.version,\n doc: `https://intlayer.org/docs`,\n },\n } as IntlayerConfig;\n\n return storedConfiguration;\n};\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,MAAa,4BACX,qBACA,SACA,iBACmB;AAwBnB,uBAAsB;EACpB,sBAxBiC,gCACjC,qBAAqB,qBACtB;EAuBC,SArBoB,mBAAmB,qBAAqB,QAAQ;EAsBpE,SApBoB,mBACpB,qBAAqB,SACrB,QACD;EAkBC,QAhBmB,kBAAkB,qBAAqB,OAAO;EAiBjE,KAfgB,eAAe,qBAAqB,KAAK,aAAa;EAgBtE,IAde,cAAc,qBAAqB,GAAG;EAerD,OAbkB,iBAAiB,qBAAqB,MAAM;EAc9D,YAZuB,sBACvB,qBAAqB,WACtB;EAWC,SAAS,qBAAqB;EAC9B,UAAU;GACR,MAAM;GACN,SAASC,sCAAY;GACrB,KAAK;GACN;EACF;AAED,QAAO"}
1
+ {"version":3,"file":"buildConfigurationFields.cjs","names":["storedConfiguration: IntlayerConfig","LOCALES","REQUIRED_LOCALES","STRICT_MODE","DEFAULT_LOCALE","ROUTING_MODE","STORAGE","BASE_PATH","notDerivedContentConfig: BaseContentConfig","FILE_EXTENSIONS","EXCLUDED_PATHS","WATCH","baseDirDerivedConfiguration: BaseDerivedConfig","CONTENT_DIR","MODULE_AUGMENTATION_DIR","UNMERGED_DICTIONARIES_DIR","REMOTE_DICTIONARIES_DIR","DICTIONARIES_DIR","DYNAMIC_DICTIONARIES_DIR","FETCH_DICTIONARIES_DIR","TYPES_DIR","MAIN_DIR","CONFIG_DIR","CACHE_DIR","patternsConfiguration: PatternsContentConfig","normalizePath","APPLICATION_URL","EDITOR_URL","CMS_URL","BACKEND_URL","PORT","IS_ENABLED","DICTIONARY_PRIORITY_STRATEGY","LIVE_SYNC","LIVE_SYNC_PORT","MODE","PREFIX","IMPORT_MODE","TRAVERSE_PATTERN","OUTPUT_FORMAT","CACHE","COMPILER_ENABLED","COMPILER_TRANSFORM_PATTERN","COMPILER_EXCLUDE_PATTERN","COMPILER_OUTPUT_DIR","FILL","packageJson"],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { isAbsolute, join } from 'node:path';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n CompilerConfig,\n ContentConfig,\n CustomIntlayerConfig,\n DictionaryConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n LogFunctions,\n PatternsContentConfig,\n RoutingConfig,\n} from '@intlayer/types';\nimport packageJson from '@intlayer/types/package.json' with { type: 'json' };\nimport {\n CACHE,\n IMPORT_MODE,\n OUTPUT_FORMAT,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n COMPILER_ENABLED,\n COMPILER_EXCLUDE_PATTERN,\n COMPILER_OUTPUT_DIR,\n COMPILER_TRANSFORM_PATTERN,\n} from '../defaultValues/compiler';\nimport {\n CACHE_DIR,\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 { FILL } from '../defaultValues/dictionary';\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 { BASE_PATH, ROUTING_MODE, STORAGE } from '../defaultValues/routing';\nimport { normalizePath } from '../utils/normalizePath';\n\nlet storedConfiguration: IntlayerConfig;\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 buildRoutingFields = (\n customConfiguration?: Partial<RoutingConfig>\n): RoutingConfig => ({\n /**\n * URL routing mode for locale handling\n *\n * Controls how locales are represented in application URLs:\n * - 'prefix-no-default': Prefix all locales except the default locale (default)\n * - en → /dashboard\n * - fr → /fr/dashboard\n *\n * - 'prefix-all': Prefix all locales including the default locale\n * - en → /en/dashboard\n * - fr → /fr/dashboard\n *\n * - 'search-params': Use search parameters for locale handling\n * - en → /dashboard?locale=en\n * - fr → /fr/dashboard?locale=fr\n *\n * - 'no-prefix': No locale prefixing in URLs\n * - en → /dashboard\n * - fr → /dashboard\n *\n * Default: 'prefix-no-default'\n */\n mode: customConfiguration?.mode ?? ROUTING_MODE,\n\n /**\n * Configuration for storing the locale in the client (localStorage or sessionStorage)\n *\n * If false, the locale will not be stored by the middleware.\n * If true, the locale storage will consider all default values. (cookie and header)\n *\n * Default: ['cookie', 'header']\n *\n */\n storage: customConfiguration?.storage ?? STORAGE,\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\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/**', '**\\/dist/**', '**\\/build/**', '**\\/.intlayer/**', '**\\/.next/**', '**\\/.nuxt/**', '**\\/.expo/**', '**\\/.vercel/**', '**\\/.turbo/**', '**\\/.tanstack/**']\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 * Command to format the content. When intlayer write your .content files locally, this command will be used to format the content.\n * Intlayer will replace the {{file}} with the path of the file to format.\n *\n * If not set, Intlayer will try to detect the format command automatically. By trying to resolve the following commands: prettier, biome, eslint.\n *\n * Example:\n *\n * ```bash\n * npx prettier --write {{file}}\n * ```\n *\n * ```bash\n * bunx biome format {{file}}\n * ```\n *\n * ```bash\n * bun format {{file}}\n * ```\n *\n * ```bash\n * npx eslint --fix {{file}}\n * ```\n *\n * Default: undefined\n */\n formatCommand: customConfiguration?.formatCommand,\n };\n\n const optionalJoinBaseDir = (path: string) => {\n if (isAbsolute(path)) return path;\n\n return join(notDerivedContentConfig.baseDir, path);\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 optionalJoinBaseDir\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: optionalJoinBaseDir(\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(customConfiguration?.typesDir ?? TYPES_DIR),\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: optionalJoinBaseDir(customConfiguration?.mainDir ?? MAIN_DIR),\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: optionalJoinBaseDir(\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n\n /**\n * Directory where the cache files are stored, relative to the result directory\n *\n * Default: .intlayer/cache\n */\n cacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? CACHE_DIR),\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 baseDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\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 logFunctions?: LogFunctions\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'prefix-no-default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n\n /**\n * Functions to log\n */\n error: logFunctions?.error,\n log: logFunctions?.log,\n info: logFunctions?.info,\n warn: logFunctions?.warn,\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,\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 disabled 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 * Cache\n */\n cache: customConfiguration?.cache ?? CACHE,\n\n /**\n * Require function\n */\n require: customConfiguration?.require,\n});\n\nconst buildCompilerFields = (\n customConfiguration?: Partial<CompilerConfig>\n): CompilerConfig => ({\n /**\n * Indicates if the compiler should be enabled\n */\n enabled: customConfiguration?.enabled ?? COMPILER_ENABLED,\n\n /**\n * Pattern to traverse the code to optimize.\n */\n transformPattern:\n customConfiguration?.transformPattern ?? COMPILER_TRANSFORM_PATTERN,\n\n /**\n * Pattern to exclude from the optimization.\n */\n excludePattern:\n customConfiguration?.excludePattern ?? COMPILER_EXCLUDE_PATTERN,\n\n /**\n * Output directory for the optimized dictionaries.\n */\n outputDir: customConfiguration?.outputDir ?? COMPILER_OUTPUT_DIR,\n});\n\nconst buildDictionaryFields = (\n customConfiguration?: Partial<DictionaryConfig>\n): DictionaryConfig => ({\n /**\n * Indicate how the dictionary should be filled using AI.\n *\n * Default: true\n */\n fill: customConfiguration?.fill ?? FILL,\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 logFunctions?: LogFunctions\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const routingConfig = buildRoutingFields(customConfiguration?.routing);\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, logFunctions);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n const compilerConfig = buildCompilerFields(customConfiguration?.compiler);\n\n const dictionaryConfig = buildDictionaryFields(\n customConfiguration?.dictionary\n );\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n routing: routingConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n compiler: compilerConfig,\n dictionary: dictionaryConfig,\n plugins: customConfiguration?.plugins,\n metadata: {\n name: 'Intlayer',\n version: packageJson.version,\n doc: `https://intlayer.org/docs`,\n },\n } as IntlayerConfig;\n\n return storedConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAqEA,IAAIA;AAEJ,MAAM,mCACJ,yBACgC;CAOhC,SAAS,qBAAqB,WAAWC;CAWzC,iBACE,qBAAqB,mBACrB,qBAAqB,WACrBC;CAUF,YAAY,qBAAqB,cAAcC;CAO/C,eAAe,qBAAqB,iBAAiBC;CACtD;AAED,MAAM,sBACJ,yBACmB;CAuBnB,MAAM,qBAAqB,QAAQC;CAWnC,SAAS,qBAAqB,WAAWC;CAazC,UAAU,qBAAqB,YAAYC;CAC5C;AAED,MAAM,sBACJ,qBACA,YACkB;CAClB,MAAMC,0BAA6C;EAYjD,gBAAgB,qBAAqB,kBAAkBC;EAavD,SAAS,qBAAqB,WAAW,WAAW,QAAQ,KAAK;EAOjE,cAAc,qBAAqB,gBAAgBC;EAOnD,OAAO,qBAAqB,SAASC;EA4BrC,eAAe,qBAAqB;EACrC;CAED,MAAM,uBAAuB,SAAiB;AAC5C,gCAAe,KAAK,CAAE,QAAO;AAE7B,6BAAY,wBAAwB,SAAS,KAAK;;CAGpD,MAAMC,8BAAiD;EAcrD,aAAa,qBAAqB,cAAcC,2CAAa,IAC3D,oBACD;EAkBD,uBAAuB,oBACrB,qBAAqB,yBAAyBC,sDAC/C;EAUD,yBAAyB,oBACvB,qBAAqB,2B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jx,svelte,vue}"];
5
+ const COMPILER_EXCLUDE_PATTERN = [
6
+ "**/node_modules/**",
7
+ "**/dist/**",
8
+ "**/.next/**",
9
+ "**/.nuxt/**",
10
+ "**/.expo/**",
11
+ "**/.vercel/**",
12
+ "**/.turbo/**",
13
+ "**/.tanstack/**",
14
+ "**/*.stories.ts",
15
+ "**/*.test.ts"
16
+ ];
17
+ const COMPILER_OUTPUT_DIR = "./compiler";
18
+
19
+ //#endregion
20
+ exports.COMPILER_ENABLED = COMPILER_ENABLED;
21
+ exports.COMPILER_EXCLUDE_PATTERN = COMPILER_EXCLUDE_PATTERN;
22
+ exports.COMPILER_OUTPUT_DIR = COMPILER_OUTPUT_DIR;
23
+ exports.COMPILER_TRANSFORM_PATTERN = COMPILER_TRANSFORM_PATTERN;
24
+ //# sourceMappingURL=compiler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.cjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\nexport const COMPILER_TRANSFORM_PATTERN = [\n '**/*.{ts,tsx,jsx,js,cjs,mjs,mjx,cjx,svelte,vue}',\n];\nexport const COMPILER_EXCLUDE_PATTERN = [\n '**/node_modules/**',\n '**/dist/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n '**/*.stories.ts',\n '**/*.test.ts',\n];\nexport const COMPILER_OUTPUT_DIR = './compiler';\n"],"mappings":";;AAAA,MAAa,mBAAmB;AAChC,MAAa,6BAA6B,CACxC,kDACD;AACD,MAAa,2BAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AACD,MAAa,sBAAsB"}
@@ -51,7 +51,7 @@ const loadExternalFile = async (filePath, options) => {
51
51
  const fileExtension = (0, node_path.extname)(filePath);
52
52
  const safeProjectRequire = options?.projectRequire ?? require_utils_ESMxCJSHelpers.getProjectRequire();
53
53
  try {
54
- if (fileExtension === "json") {
54
+ if (fileExtension === ".json") {
55
55
  delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];
56
56
  return safeProjectRequire(filePath);
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"loadExternalFile.cjs","names":["getProjectRequire","moduleResultString: string | undefined","transpileTSToMJSSync","parseFileContent","transpileTSToMJS","colorizePath"],"sources":["../../../src/loadExternalFile/loadExternalFile.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport type { BuildOptions, Plugin } from 'esbuild';\nimport { colorizePath, logger } from '../logger';\nimport { getProjectRequire } from '../utils/ESMxCJSHelpers';\nimport {\n parseFileContent,\n type SandBoxContextOptions,\n} from './parseFileContent';\nimport { transpileTSToMJS, transpileTSToMJSSync } from './transpileTSToMJS';\n\nexport type ESBuildPlugin = Plugin;\n\nexport type LoadExternalFileOptions = {\n configuration?: IntlayerConfig;\n buildOptions?: BuildOptions;\n} & SandBoxContextOptions;\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFileSync = (\n filePath: string,\n options?: LoadExternalFileOptions\n): any | undefined => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n return safeProjectRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n const code = readFileSync(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = transpileTSToMJSSync(\n code,\n filePath\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${filePath}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFile = async (\n filePath: string,\n options?: LoadExternalFileOptions\n): Promise<any | undefined> => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n return safeProjectRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n const code = await readFile(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = await transpileTSToMJS(\n code,\n filePath,\n options?.buildOptions\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${colorizePath(filePath)}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAa,wBACX,UACA,YACoB;CACpB,MAAM,uCAAwB,SAAS;CACvC,MAAM,qBAAqB,SAAS,kBAAkBA,gDAAmB;AAEzE,KAAI;AACF,MAAI,kBAAkB,QAAQ;AAE5B,UAAO,mBAAmB,MAAM,mBAAmB,QAAQ,SAAS;AA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E,CAChD,EACD,EACE,OAAO,SACR,CACF"}
1
+ {"version":3,"file":"loadExternalFile.cjs","names":["getProjectRequire","moduleResultString: string | undefined","transpileTSToMJSSync","parseFileContent","transpileTSToMJS","colorizePath"],"sources":["../../../src/loadExternalFile/loadExternalFile.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport type { BuildOptions, Plugin } from 'esbuild';\nimport { colorizePath, logger } from '../logger';\nimport { getProjectRequire } from '../utils/ESMxCJSHelpers';\nimport {\n parseFileContent,\n type SandBoxContextOptions,\n} from './parseFileContent';\nimport { transpileTSToMJS, transpileTSToMJSSync } from './transpileTSToMJS';\n\nexport type ESBuildPlugin = Plugin;\n\nexport type LoadExternalFileOptions = {\n configuration?: IntlayerConfig;\n buildOptions?: BuildOptions;\n} & SandBoxContextOptions;\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFileSync = (\n filePath: string,\n options?: LoadExternalFileOptions\n): any | undefined => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n return safeProjectRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n const code = readFileSync(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = transpileTSToMJSSync(\n code,\n filePath\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${filePath}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFile = async (\n filePath: string,\n options?: LoadExternalFileOptions\n): Promise<any | undefined> => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === '.json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n const result = safeProjectRequire(filePath);\n return result;\n }\n\n // Rest is JS, MJS or TS\n const code = await readFile(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = await transpileTSToMJS(\n code,\n filePath,\n options?.buildOptions\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${colorizePath(filePath)}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAa,wBACX,UACA,YACoB;CACpB,MAAM,uCAAwB,SAAS;CACvC,MAAM,qBAAqB,SAAS,kBAAkBA,gDAAmB;AAEzE,KAAI;AACF,MAAI,kBAAkB,QAAQ;AAE5B,UAAO,mBAAmB,MAAM,mBAAmB,QAAQ,SAAS;AAEpE,UAAO,mBAAmB,SAAS;;EAMrC,MAAMC,qBAAyCC,yFAFrB,UAAU,QAAQ,EAI1C,SACD;AAED,MAA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
  import { CACHE, IMPORT_MODE, OUTPUT_FORMAT, TRAVERSE_PATTERN } from "../defaultValues/build.mjs";
3
+ import { COMPILER_ENABLED, COMPILER_EXCLUDE_PATTERN, COMPILER_OUTPUT_DIR, COMPILER_TRANSFORM_PATTERN } from "../defaultValues/compiler.mjs";
3
4
  import { CACHE_DIR, CONFIG_DIR, CONTENT_DIR, DICTIONARIES_DIR, DYNAMIC_DICTIONARIES_DIR, EXCLUDED_PATHS, FETCH_DICTIONARIES_DIR, FILE_EXTENSIONS, MAIN_DIR, MODULE_AUGMENTATION_DIR, REMOTE_DICTIONARIES_DIR, TYPES_DIR, UNMERGED_DICTIONARIES_DIR, WATCH } from "../defaultValues/content.mjs";
4
5
  import { FILL } from "../defaultValues/dictionary.mjs";
5
6
  import { APPLICATION_URL, BACKEND_URL, CMS_URL, DICTIONARY_PRIORITY_STRATEGY, EDITOR_URL, IS_ENABLED, LIVE_SYNC, LIVE_SYNC_PORT, PORT } from "../defaultValues/editor.mjs";
@@ -95,6 +96,12 @@ const buildBuildFields = (customConfiguration) => ({
95
96
  cache: customConfiguration?.cache ?? CACHE,
96
97
  require: customConfiguration?.require
97
98
  });
99
+ const buildCompilerFields = (customConfiguration) => ({
100
+ enabled: customConfiguration?.enabled ?? COMPILER_ENABLED,
101
+ transformPattern: customConfiguration?.transformPattern ?? COMPILER_TRANSFORM_PATTERN,
102
+ excludePattern: customConfiguration?.excludePattern ?? COMPILER_EXCLUDE_PATTERN,
103
+ outputDir: customConfiguration?.outputDir ?? COMPILER_OUTPUT_DIR
104
+ });
98
105
  const buildDictionaryFields = (customConfiguration) => ({ fill: customConfiguration?.fill ?? FILL });
99
106
  /**
100
107
  * Build the configuration fields by merging the default values with the custom configuration
@@ -108,6 +115,7 @@ const buildConfigurationFields = (customConfiguration, baseDir, logFunctions) =>
108
115
  log: buildLogFields(customConfiguration?.log, logFunctions),
109
116
  ai: buildAiFields(customConfiguration?.ai),
110
117
  build: buildBuildFields(customConfiguration?.build),
118
+ compiler: buildCompilerFields(customConfiguration?.compiler),
111
119
  dictionary: buildDictionaryFields(customConfiguration?.dictionary),
112
120
  plugins: customConfiguration?.plugins,
113
121
  metadata: {
@@ -1 +1 @@
1
- {"version":3,"file":"buildConfigurationFields.mjs","names":["storedConfiguration: IntlayerConfig","notDerivedContentConfig: BaseContentConfig","baseDirDerivedConfiguration: BaseDerivedConfig","patternsConfiguration: PatternsContentConfig"],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { isAbsolute, join } from 'node:path';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n ContentConfig,\n CustomIntlayerConfig,\n DictionaryConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n LogFunctions,\n PatternsContentConfig,\n RoutingConfig,\n} from '@intlayer/types';\nimport packageJson from '@intlayer/types/package.json' with { type: 'json' };\nimport {\n CACHE,\n IMPORT_MODE,\n OUTPUT_FORMAT,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n CACHE_DIR,\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 { FILL } from '../defaultValues/dictionary';\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 { BASE_PATH, ROUTING_MODE, STORAGE } from '../defaultValues/routing';\nimport { normalizePath } from '../utils/normalizePath';\n\nlet storedConfiguration: IntlayerConfig;\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 buildRoutingFields = (\n customConfiguration?: Partial<RoutingConfig>\n): RoutingConfig => ({\n /**\n * URL routing mode for locale handling\n *\n * Controls how locales are represented in application URLs:\n * - 'prefix-no-default': Prefix all locales except the default locale (default)\n * - en → /dashboard\n * - fr → /fr/dashboard\n *\n * - 'prefix-all': Prefix all locales including the default locale\n * - en → /en/dashboard\n * - fr → /fr/dashboard\n *\n * - 'search-params': Use search parameters for locale handling\n * - en → /dashboard?locale=en\n * - fr → /fr/dashboard?locale=fr\n *\n * - 'no-prefix': No locale prefixing in URLs\n * - en → /dashboard\n * - fr → /dashboard\n *\n * Default: 'prefix-no-default'\n */\n mode: customConfiguration?.mode ?? ROUTING_MODE,\n\n /**\n * Configuration for storing the locale in the client (localStorage or sessionStorage)\n *\n * If false, the locale will not be stored by the middleware.\n * If true, the locale storage will consider all default values. (cookie and header)\n *\n * Default: ['cookie', 'header']\n *\n */\n storage: customConfiguration?.storage ?? STORAGE,\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\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/**', '**\\/dist/**', '**\\/build/**', '**\\/.intlayer/**', '**\\/.next/**', '**\\/.nuxt/**', '**\\/.expo/**', '**\\/.vercel/**', '**\\/.turbo/**', '**\\/.tanstack/**']\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 * Command to format the content. When intlayer write your .content files locally, this command will be used to format the content.\n * Intlayer will replace the {{file}} with the path of the file to format.\n *\n * If not set, Intlayer will try to detect the format command automatically. By trying to resolve the following commands: prettier, biome, eslint.\n *\n * Example:\n *\n * ```bash\n * npx prettier --write {{file}}\n * ```\n *\n * ```bash\n * bunx biome format {{file}}\n * ```\n *\n * ```bash\n * bun format {{file}}\n * ```\n *\n * ```bash\n * npx eslint --fix {{file}}\n * ```\n *\n * Default: undefined\n */\n formatCommand: customConfiguration?.formatCommand,\n };\n\n const optionalJoinBaseDir = (path: string) => {\n if (isAbsolute(path)) return path;\n\n return join(notDerivedContentConfig.baseDir, path);\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 optionalJoinBaseDir\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: optionalJoinBaseDir(\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(customConfiguration?.typesDir ?? TYPES_DIR),\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: optionalJoinBaseDir(customConfiguration?.mainDir ?? MAIN_DIR),\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: optionalJoinBaseDir(\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n\n /**\n * Directory where the cache files are stored, relative to the result directory\n *\n * Default: .intlayer/cache\n */\n cacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? CACHE_DIR),\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 baseDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\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 logFunctions?: LogFunctions\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'prefix-no-default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n\n /**\n * Functions to log\n */\n error: logFunctions?.error,\n log: logFunctions?.log,\n info: logFunctions?.info,\n warn: logFunctions?.warn,\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,\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 disabled 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 * Cache\n */\n cache: customConfiguration?.cache ?? CACHE,\n\n /**\n * Require function\n */\n require: customConfiguration?.require,\n});\n\nconst buildDictionaryFields = (\n customConfiguration?: Partial<DictionaryConfig>\n): DictionaryConfig => ({\n /**\n * Indicate how the dictionary should be filled using AI.\n *\n * Default: true\n */\n fill: customConfiguration?.fill ?? FILL,\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 logFunctions?: LogFunctions\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const routingConfig = buildRoutingFields(customConfiguration?.routing);\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, logFunctions);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n const dictionaryConfig = buildDictionaryFields(\n customConfiguration?.dictionary\n );\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n routing: routingConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n dictionary: dictionaryConfig,\n plugins: customConfiguration?.plugins,\n metadata: {\n name: 'Intlayer',\n version: packageJson.version,\n doc: `https://intlayer.org/docs`,\n },\n } as IntlayerConfig;\n\n return storedConfiguration;\n};\n"],"mappings":";;;;;;;;;;;;AA8DA,IAAIA;AAEJ,MAAM,mCACJ,yBACgC;CAOhC,SAAS,qBAAqB,WAAW;CAWzC,iBACE,qBAAqB,mBACrB,qBAAqB,WACrB;CAUF,YAAY,qBAAqB,cAAc;CAO/C,eAAe,qBAAqB,iBAAiB;CACtD;AAED,MAAM,sBACJ,yBACmB;CAuBnB,MAAM,qBAAqB,QAAQ;CAWnC,SAAS,qBAAqB,WAAW;CAazC,UAAU,qBAAqB,YAAY;CAC5C;AAED,MAAM,sBACJ,qBACA,YACkB;CAClB,MAAMC,0BAA6C;EAYjD,gBAAgB,qBAAqB,kBAAkB;EAavD,SAAS,qBAAqB,WAAW,WAAW,QAAQ,KAAK;EAOjE,cAAc,qBAAqB,gBAAgB;EAOnD,OAAO,qBAAqB,SAAS;EA4BrC,eAAe,qBAAqB;EACrC;CAED,MAAM,uBAAuB,SAAiB;AAC5C,MAAI,WAAW,KAAK,CAAE,QAAO;AAE7B,SAAO,KAAK,wBAAwB,SAAS,KAAK;;CAGpD,MAAMC,8BAAiD;EAcrD,aAAa,qBAAqB,cAAc,aAAa,IAC3D,oBACD;EAkBD,uBAAuB,oBACrB,qBAAqB,yBAAyB,wBAC/C;EAUD,yBAAyB,oBACvB,qBAAqB,2BAA2B,0BACjD;EASD,uBAAuB,oBACrB,qBAAqB,yBAAyB,wBAC/C;EAiBD,iBAAiB,oBACf,qBAAqB,mBAAmB,iBACzC;EASD,wBAAwB,oBACtB,qBAAqB,0BAA0B,yBAChD;EASD,sBAAsB,oBACpB,qBAAqB,wBAAwB,uBAC9C;EAcD,UAAU,oBAAoB,qBAAqB,YAAY,UAAU;EAezE,SAAS,oBA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,cAAc,qBAAqB,gBAAgB;CAKnD,OAAO,qBAAqB,SAAS;CAKrC,SAAS,qBAAqB;CAC/B;AAED,MAAM,yBACJ,yBACsB,EAMtB,MAAM,qBAAqB,QAAQ,MACpC;;;;AAKD,MAAa,4BACX,qBACA,SACA,iBACmB;AAwBnB,uBAAsB;EACpB,sBAxBiC,gCACjC,qBAAqB,qBACtB;EAuBC,SArBoB,mBAAmB,qBAAqB,QAAQ;EAsBpE,SApBoB,mBACpB,qBAAqB,SACrB,QACD;EAkBC,QAhBmB,kBAAkB,qBAAqB,OAAO;EAiBjE,KAfgB,eAAe,qBAAqB,KAAK,aAAa;EAgBtE,IAde,cAAc,qBAAqB,GAAG;EAerD,OAbkB,iBAAiB,qBAAqB,MAAM;EAc9D,YAZuB,sBACvB,qBAAqB,WACtB;EAWC,SAAS,qBAAqB;EAC9B,UAAU;GACR,MAAM;GACN,SAAS,YAAY;GACrB,KAAK;GACN;EACF;AAED,QAAO"}
1
+ {"version":3,"file":"buildConfigurationFields.mjs","names":["storedConfiguration: IntlayerConfig","notDerivedContentConfig: BaseContentConfig","baseDirDerivedConfiguration: BaseDerivedConfig","patternsConfiguration: PatternsContentConfig"],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { isAbsolute, join } from 'node:path';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n CompilerConfig,\n ContentConfig,\n CustomIntlayerConfig,\n DictionaryConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n LogFunctions,\n PatternsContentConfig,\n RoutingConfig,\n} from '@intlayer/types';\nimport packageJson from '@intlayer/types/package.json' with { type: 'json' };\nimport {\n CACHE,\n IMPORT_MODE,\n OUTPUT_FORMAT,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n COMPILER_ENABLED,\n COMPILER_EXCLUDE_PATTERN,\n COMPILER_OUTPUT_DIR,\n COMPILER_TRANSFORM_PATTERN,\n} from '../defaultValues/compiler';\nimport {\n CACHE_DIR,\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 { FILL } from '../defaultValues/dictionary';\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 { BASE_PATH, ROUTING_MODE, STORAGE } from '../defaultValues/routing';\nimport { normalizePath } from '../utils/normalizePath';\n\nlet storedConfiguration: IntlayerConfig;\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 buildRoutingFields = (\n customConfiguration?: Partial<RoutingConfig>\n): RoutingConfig => ({\n /**\n * URL routing mode for locale handling\n *\n * Controls how locales are represented in application URLs:\n * - 'prefix-no-default': Prefix all locales except the default locale (default)\n * - en → /dashboard\n * - fr → /fr/dashboard\n *\n * - 'prefix-all': Prefix all locales including the default locale\n * - en → /en/dashboard\n * - fr → /fr/dashboard\n *\n * - 'search-params': Use search parameters for locale handling\n * - en → /dashboard?locale=en\n * - fr → /fr/dashboard?locale=fr\n *\n * - 'no-prefix': No locale prefixing in URLs\n * - en → /dashboard\n * - fr → /dashboard\n *\n * Default: 'prefix-no-default'\n */\n mode: customConfiguration?.mode ?? ROUTING_MODE,\n\n /**\n * Configuration for storing the locale in the client (localStorage or sessionStorage)\n *\n * If false, the locale will not be stored by the middleware.\n * If true, the locale storage will consider all default values. (cookie and header)\n *\n * Default: ['cookie', 'header']\n *\n */\n storage: customConfiguration?.storage ?? STORAGE,\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\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/**', '**\\/dist/**', '**\\/build/**', '**\\/.intlayer/**', '**\\/.next/**', '**\\/.nuxt/**', '**\\/.expo/**', '**\\/.vercel/**', '**\\/.turbo/**', '**\\/.tanstack/**']\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 * Command to format the content. When intlayer write your .content files locally, this command will be used to format the content.\n * Intlayer will replace the {{file}} with the path of the file to format.\n *\n * If not set, Intlayer will try to detect the format command automatically. By trying to resolve the following commands: prettier, biome, eslint.\n *\n * Example:\n *\n * ```bash\n * npx prettier --write {{file}}\n * ```\n *\n * ```bash\n * bunx biome format {{file}}\n * ```\n *\n * ```bash\n * bun format {{file}}\n * ```\n *\n * ```bash\n * npx eslint --fix {{file}}\n * ```\n *\n * Default: undefined\n */\n formatCommand: customConfiguration?.formatCommand,\n };\n\n const optionalJoinBaseDir = (path: string) => {\n if (isAbsolute(path)) return path;\n\n return join(notDerivedContentConfig.baseDir, path);\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 optionalJoinBaseDir\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: optionalJoinBaseDir(\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(\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: optionalJoinBaseDir(customConfiguration?.typesDir ?? TYPES_DIR),\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: optionalJoinBaseDir(customConfiguration?.mainDir ?? MAIN_DIR),\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: optionalJoinBaseDir(\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n\n /**\n * Directory where the cache files are stored, relative to the result directory\n *\n * Default: .intlayer/cache\n */\n cacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? CACHE_DIR),\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 baseDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\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 logFunctions?: LogFunctions\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'prefix-no-default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n\n /**\n * Functions to log\n */\n error: logFunctions?.error,\n log: logFunctions?.log,\n info: logFunctions?.info,\n warn: logFunctions?.warn,\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,\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 disabled 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 * Cache\n */\n cache: customConfiguration?.cache ?? CACHE,\n\n /**\n * Require function\n */\n require: customConfiguration?.require,\n});\n\nconst buildCompilerFields = (\n customConfiguration?: Partial<CompilerConfig>\n): CompilerConfig => ({\n /**\n * Indicates if the compiler should be enabled\n */\n enabled: customConfiguration?.enabled ?? COMPILER_ENABLED,\n\n /**\n * Pattern to traverse the code to optimize.\n */\n transformPattern:\n customConfiguration?.transformPattern ?? COMPILER_TRANSFORM_PATTERN,\n\n /**\n * Pattern to exclude from the optimization.\n */\n excludePattern:\n customConfiguration?.excludePattern ?? COMPILER_EXCLUDE_PATTERN,\n\n /**\n * Output directory for the optimized dictionaries.\n */\n outputDir: customConfiguration?.outputDir ?? COMPILER_OUTPUT_DIR,\n});\n\nconst buildDictionaryFields = (\n customConfiguration?: Partial<DictionaryConfig>\n): DictionaryConfig => ({\n /**\n * Indicate how the dictionary should be filled using AI.\n *\n * Default: true\n */\n fill: customConfiguration?.fill ?? FILL,\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 logFunctions?: LogFunctions\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const routingConfig = buildRoutingFields(customConfiguration?.routing);\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, logFunctions);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n const compilerConfig = buildCompilerFields(customConfiguration?.compiler);\n\n const dictionaryConfig = buildDictionaryFields(\n customConfiguration?.dictionary\n );\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n routing: routingConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n compiler: compilerConfig,\n dictionary: dictionaryConfig,\n plugins: customConfiguration?.plugins,\n metadata: {\n name: 'Intlayer',\n version: packageJson.version,\n doc: `https://intlayer.org/docs`,\n },\n } as IntlayerConfig;\n\n return storedConfiguration;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BAAkB;CAKzC,WAAW,qBAAqB,aAAa;CAC9C;AAED,MAAM,yBACJ,yBACsB,EAMtB,MAAM,qBAAqB,QAAQ,MACpC;;;;AAKD,MAAa,4BACX,qBACA,SACA,iBACmB;AA0BnB,uBAAsB;EACpB,sBA1BiC,gCACjC,qBAAqB,qBACtB;EAyBC,SAvBoB,mBAAmB,qBAAqB,QAAQ;EAwBpE,SAtBoB,mBACpB,qBAAqB,SACrB,QACD;EAoBC,QAlBmB,kBAAkB,qBAAqB,OAAO;EAmBjE,KAjBgB,eAAe,qBAAqB,KAAK,aAAa;EAkBtE,IAhBe,cAAc,qBAAqB,GAAG;EAiBrD,OAfkB,iBAAiB,qBAAqB,MAAM;EAgB9D,UAdqB,oBAAoB,qBAAqB,SAAS;EAevE,YAbuB,sBACvB,qBAAqB,WACtB;EAYC,SAAS,qBAAqB;EAC9B,UAAU;GACR,MAAM;GACN,SAAS,YAAY;GACrB,KAAK;GACN;EACF;AAED,QAAO"}
@@ -0,0 +1,20 @@
1
+ //#region src/defaultValues/compiler.ts
2
+ const COMPILER_ENABLED = true;
3
+ const COMPILER_TRANSFORM_PATTERN = ["**/*.{ts,tsx,jsx,js,cjs,mjs,mjx,cjx,svelte,vue}"];
4
+ const COMPILER_EXCLUDE_PATTERN = [
5
+ "**/node_modules/**",
6
+ "**/dist/**",
7
+ "**/.next/**",
8
+ "**/.nuxt/**",
9
+ "**/.expo/**",
10
+ "**/.vercel/**",
11
+ "**/.turbo/**",
12
+ "**/.tanstack/**",
13
+ "**/*.stories.ts",
14
+ "**/*.test.ts"
15
+ ];
16
+ const COMPILER_OUTPUT_DIR = "./compiler";
17
+
18
+ //#endregion
19
+ export { COMPILER_ENABLED, COMPILER_EXCLUDE_PATTERN, COMPILER_OUTPUT_DIR, COMPILER_TRANSFORM_PATTERN };
20
+ //# sourceMappingURL=compiler.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.mjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\nexport const COMPILER_TRANSFORM_PATTERN = [\n '**/*.{ts,tsx,jsx,js,cjs,mjs,mjx,cjx,svelte,vue}',\n];\nexport const COMPILER_EXCLUDE_PATTERN = [\n '**/node_modules/**',\n '**/dist/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n '**/*.stories.ts',\n '**/*.test.ts',\n];\nexport const COMPILER_OUTPUT_DIR = './compiler';\n"],"mappings":";AAAA,MAAa,mBAAmB;AAChC,MAAa,6BAA6B,CACxC,kDACD;AACD,MAAa,2BAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AACD,MAAa,sBAAsB"}
@@ -50,7 +50,7 @@ const loadExternalFile = async (filePath, options) => {
50
50
  const fileExtension = extname(filePath);
51
51
  const safeProjectRequire = options?.projectRequire ?? getProjectRequire();
52
52
  try {
53
- if (fileExtension === "json") {
53
+ if (fileExtension === ".json") {
54
54
  delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];
55
55
  return safeProjectRequire(filePath);
56
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"loadExternalFile.mjs","names":["moduleResultString: string | undefined"],"sources":["../../../src/loadExternalFile/loadExternalFile.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport type { BuildOptions, Plugin } from 'esbuild';\nimport { colorizePath, logger } from '../logger';\nimport { getProjectRequire } from '../utils/ESMxCJSHelpers';\nimport {\n parseFileContent,\n type SandBoxContextOptions,\n} from './parseFileContent';\nimport { transpileTSToMJS, transpileTSToMJSSync } from './transpileTSToMJS';\n\nexport type ESBuildPlugin = Plugin;\n\nexport type LoadExternalFileOptions = {\n configuration?: IntlayerConfig;\n buildOptions?: BuildOptions;\n} & SandBoxContextOptions;\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFileSync = (\n filePath: string,\n options?: LoadExternalFileOptions\n): any | undefined => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n return safeProjectRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n const code = readFileSync(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = transpileTSToMJSSync(\n code,\n filePath\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${filePath}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFile = async (\n filePath: string,\n options?: LoadExternalFileOptions\n): Promise<any | undefined> => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n return safeProjectRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n const code = await readFile(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = await transpileTSToMJS(\n code,\n filePath,\n options?.buildOptions\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${colorizePath(filePath)}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;AAyBA,MAAa,wBACX,UACA,YACoB;CACpB,MAAM,gBAAgB,QAAQ,SAAS;CACvC,MAAM,qBAAqB,SAAS,kBAAkB,mBAAmB;AAEzE,KAAI;AACF,MAAI,kBAAkB,QAAQ;AAE5B,UAAO,mBAAmB,MAAM,mBAAmB,QAAQ,SAAS;AAEpE,UAAO,mBAAmB,SAAS;;EAMrC,MAAMA,qBAAyC,qBAFlC,aAAa,UAAU,QAAQ,EAI1C,SACD;AAED,MAAI,CAAC,oBAAoB;AACvB,UAAO,6BAA6B,EAAE,OAAO,SAAS,CAAC;AACvD;;EAGF,MAAM,cAAc,iBAAiB,oBAAoB;GACvD,gBAAgB,SAAS;GACzB,eAAe,SAAS;GACxB,mBAAmB,SAAS;GAC5B,OAAO,SAAS;GAChB,SAAS,SAAS;GACnB,CAAC;AAEF,MAAI,OAAO,gBAAgB,aAAa;AACtC,UAAO,yCAAyC,WAAW;AAC3D;;AAGF,SAAO;UACA,OAAO;AACd,SACE,CACE,UAAW,MAAgB,QAAQ,MACnC,KAAK,UAAW,MAAgB,OAAO,MAAM,EAAE,CAChD,EACD,EACE,OAAO,SACR,CACF;;;;;;;;AASL,MAAa,mBAAmB,OAC9B,UACA,YAC6B;CAC7B,MAAM,gBAAgB,QAAQ,SAAS;CACvC,MAAM,qBAAqB,SAAS,kBAAkB,mBAAmB;AAEzE,KAAI;AACF,MAAI,kBAAkB,QAAQ;AAE5B,UAAO,mBAAmB,MAAM,mBAAmB,QAAQ,SAAS;AAEpE,UAAO,mBAAmB,SAAS;;EAMrC,MAAMA,qBAAyC,MAAM,iBAFxC,MAAM,SAAS,UAAU,QAAQ,EAI5C,UACA,SAAS,aACV;AAED,MAAI,CAAC,oBAAoB;AACvB,UAAO,6BAA6B,EAAE,OAAO,SAAS,CAAC;AACvD;;EAGF,MAAM,cAAc,iBAAiB,oBAAoB;GACvD,gBAAgB,SAAS;GACzB,eAAe,SAAS;GACxB,mBAAmB,SAAS;GAC5B,OAAO,SAAS;GAChB,SAAS,SAAS;GACnB,CAAC;AAEF,MAAI,OAAO,gBAAgB,aAAa;AACtC,UAAO,yCAAyC,aAAa,SAAS,GAAG;AACzE;;AAGF,SAAO;UACA,OAAO;AACd,SACE,CACE,UAAW,MAAgB,QAAQ,MACnC,KAAK,UAAW,MAAgB,OAAO,MAAM,EAAE,CAChD,EACD,EACE,OAAO,SACR,CACF"}
1
+ {"version":3,"file":"loadExternalFile.mjs","names":["moduleResultString: string | undefined"],"sources":["../../../src/loadExternalFile/loadExternalFile.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport type { BuildOptions, Plugin } from 'esbuild';\nimport { colorizePath, logger } from '../logger';\nimport { getProjectRequire } from '../utils/ESMxCJSHelpers';\nimport {\n parseFileContent,\n type SandBoxContextOptions,\n} from './parseFileContent';\nimport { transpileTSToMJS, transpileTSToMJSSync } from './transpileTSToMJS';\n\nexport type ESBuildPlugin = Plugin;\n\nexport type LoadExternalFileOptions = {\n configuration?: IntlayerConfig;\n buildOptions?: BuildOptions;\n} & SandBoxContextOptions;\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFileSync = (\n filePath: string,\n options?: LoadExternalFileOptions\n): any | undefined => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === 'json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n return safeProjectRequire(filePath);\n }\n\n // Rest is JS, MJS or TS\n const code = readFileSync(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = transpileTSToMJSSync(\n code,\n filePath\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${filePath}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFile = async (\n filePath: string,\n options?: LoadExternalFileOptions\n): Promise<any | undefined> => {\n const fileExtension = extname(filePath);\n const safeProjectRequire = options?.projectRequire ?? getProjectRequire();\n\n try {\n if (fileExtension === '.json') {\n // Remove cache to force getting fresh content\n delete safeProjectRequire.cache[safeProjectRequire.resolve(filePath)];\n // Assume JSON\n const result = safeProjectRequire(filePath);\n return result;\n }\n\n // Rest is JS, MJS or TS\n const code = await readFile(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = await transpileTSToMJS(\n code,\n filePath,\n options?.buildOptions\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File file could not be loaded. Path : ${colorizePath(filePath)}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;AAyBA,MAAa,wBACX,UACA,YACoB;CACpB,MAAM,gBAAgB,QAAQ,SAAS;CACvC,MAAM,qBAAqB,SAAS,kBAAkB,mBAAmB;AAEzE,KAAI;AACF,MAAI,kBAAkB,QAAQ;AAE5B,UAAO,mBAAmB,MAAM,mBAAmB,QAAQ,SAAS;AAEpE,UAAO,mBAAmB,SAAS;;EAMrC,MAAMA,qBAAyC,qBAFlC,aAAa,UAAU,QAAQ,EAI1C,SACD;AAED,MAAI,CAAC,oBAAoB;AACvB,UAAO,6BAA6B,EAAE,OAAO,SAAS,CAAC;AACvD;;EAGF,MAAM,cAAc,iBAAiB,oBAAoB;GACvD,gBAAgB,SAAS;GACzB,eAAe,SAAS;GACxB,mBAAmB,SAAS;GAC5B,OAAO,SAAS;GAChB,SAAS,SAAS;GACnB,CAAC;AAEF,MAAI,OAAO,gBAAgB,aAAa;AACtC,UAAO,yCAAyC,WAAW;AAC3D;;AAGF,SAAO;UACA,OAAO;AACd,SACE,CACE,UAAW,MAAgB,QAAQ,MACnC,KAAK,UAAW,MAAgB,OAAO,MAAM,EAAE,CAChD,EACD,EACE,OAAO,SACR,CACF;;;;;;;;AASL,MAAa,mBAAmB,OAC9B,UACA,YAC6B;CAC7B,MAAM,gBAAgB,QAAQ,SAAS;CACvC,MAAM,qBAAqB,SAAS,kBAAkB,mBAAmB;AAEzE,KAAI;AACF,MAAI,kBAAkB,SAAS;AAE7B,UAAO,mBAAmB,MAAM,mBAAmB,QAAQ,SAAS;AAGpE,UADe,mBAAmB,SAAS;;EAO7C,MAAMA,qBAAyC,MAAM,iBAFxC,MAAM,SAAS,UAAU,QAAQ,EAI5C,UACA,SAAS,aACV;AAED,MAAI,CAAC,oBAAoB;AACvB,UAAO,6BAA6B,EAAE,OAAO,SAAS,CAAC;AACvD;;EAGF,MAAM,cAAc,iBAAiB,oBAAoB;GACvD,gBAAgB,SAAS;GACzB,eAAe,SAAS;GACxB,mBAAmB,SAAS;GAC5B,OAAO,SAAS;GAChB,SAAS,SAAS;GACnB,CAAC;AAEF,MAAI,OAAO,gBAAgB,aAAa;AACtC,UAAO,yCAAyC,aAAa,SAAS,GAAG;AACzE;;AAGF,SAAO;UACA,OAAO;AACd,SACE,CACE,UAAW,MAAgB,QAAQ,MACnC,KAAK,UAAW,MAAgB,OAAO,MAAM,EAAE,CAChD,EACD,EACE,OAAO,SACR,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":[],"mappings":";;;;;;AAktBA;AACwB,cADX,wBACW,EAAA,CAAA,mBAAA,CAAA,EAAA,oBAAA,EAAA,OAAA,CAAA,EAAA,MAAA,EAAA,YAAA,CAAA,EAEP,YAFO,EAAA,GAGrB,cAHqB"}
1
+ {"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":[],"mappings":";;;;;;AAmvBA;AACwB,cADX,wBACW,EAAA,CAAA,mBAAA,CAAA,EAAA,oBAAA,EAAA,OAAA,CAAA,EAAA,MAAA,EAAA,YAAA,CAAA,EAEP,YAFO,EAAA,GAGrB,cAHqB"}
@@ -0,0 +1,8 @@
1
+ //#region src/defaultValues/compiler.d.ts
2
+ declare const COMPILER_ENABLED = true;
3
+ declare const COMPILER_TRANSFORM_PATTERN: string[];
4
+ declare const COMPILER_EXCLUDE_PATTERN: string[];
5
+ declare const COMPILER_OUTPUT_DIR = "./compiler";
6
+ //#endregion
7
+ export { COMPILER_ENABLED, COMPILER_EXCLUDE_PATTERN, COMPILER_OUTPUT_DIR, COMPILER_TRANSFORM_PATTERN };
8
+ //# sourceMappingURL=compiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.d.ts","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":[],"mappings":";cAAa,gBAAA;AAAA,cACA,0BADgB,EAAA,MAAA,EAAA;AAChB,cAGA,wBADZ,EAAA,MAAA,EAAA;AACY,cAYA,mBAAA,GADZ,YAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/config",
3
- "version": "7.3.1",
3
+ "version": "7.3.2-canary.1",
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": [
@@ -78,6 +78,7 @@
78
78
  "./package.json"
79
79
  ],
80
80
  "scripts": {
81
+ "_prepublish": "cp -f ../../../README.md ./README.md",
81
82
  "build": "tsdown --config tsdown.config.ts",
82
83
  "build:ci": "tsdown --config tsdown.config.ts",
83
84
  "clean": "rimraf ./dist .turbo",
@@ -86,7 +87,7 @@
86
87
  "format:fix": "biome format --write .",
87
88
  "lint": "biome lint .",
88
89
  "lint:fix": "biome lint --write .",
89
- "prepublish": "cp -f ../../../README.md ./README.md",
90
+ "prepublish": "echo prepublish temporally disabled to avoid rewrite readme",
90
91
  "publish": "bun publish || true",
91
92
  "publish:canary": "bun publish --access public --tag canary || true",
92
93
  "publish:latest": "bun publish --access public --tag latest || true",
@@ -95,7 +96,7 @@
95
96
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
96
97
  },
97
98
  "dependencies": {
98
- "@intlayer/types": "7.3.1",
99
+ "@intlayer/types": "7.3.2-canary.1",
99
100
  "deepmerge": "4.3.1",
100
101
  "dotenv": "16.6.1",
101
102
  "esbuild": "0.25.2"
@@ -106,12 +107,12 @@
106
107
  "@utils/ts-config-types": "1.0.4",
107
108
  "@utils/tsdown-config": "1.0.4",
108
109
  "rimraf": "6.1.2",
109
- "tsdown": "0.16.6",
110
+ "tsdown": "0.16.8",
110
111
  "typescript": "5.9.3",
111
- "vitest": "4.0.13"
112
+ "vitest": "4.0.14"
112
113
  },
113
114
  "peerDependencies": {
114
- "intlayer": "7.3.1",
115
+ "intlayer": "7.3.2-canary.1",
115
116
  "react": ">=16.0.0"
116
117
  },
117
118
  "peerDependenciesMeta": {