@intlayer/config 5.7.3 → 5.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/configFile/buildConfigurationFields.cjs +33 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/defaultValues/middleware.cjs +3 -0
- package/dist/cjs/defaultValues/middleware.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs +2 -1
- package/dist/cjs/envVariables/extractEnvVariable/next.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs +2 -1
- package/dist/cjs/envVariables/extractEnvVariable/react_app.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs +2 -1
- package/dist/cjs/envVariables/extractEnvVariable/undefined_platform.cjs.map +1 -1
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs +2 -1
- package/dist/cjs/envVariables/extractEnvVariable/vite.cjs.map +1 -1
- package/dist/cjs/envVariables/getConfiguration.cjs +5 -1
- package/dist/cjs/envVariables/getConfiguration.cjs.map +1 -1
- package/dist/cjs/types/config.cjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +34 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/defaultValues/middleware.mjs +2 -0
- package/dist/esm/defaultValues/middleware.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/next.mjs +2 -1
- package/dist/esm/envVariables/extractEnvVariable/next.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs +2 -1
- package/dist/esm/envVariables/extractEnvVariable/react_app.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs +2 -1
- package/dist/esm/envVariables/extractEnvVariable/undefined_platform.mjs.map +1 -1
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs +2 -1
- package/dist/esm/envVariables/extractEnvVariable/vite.mjs.map +1 -1
- package/dist/esm/envVariables/getConfiguration.mjs +5 -1
- package/dist/esm/envVariables/getConfiguration.mjs.map +1 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/defaultValues/middleware.d.ts +1 -0
- package/dist/types/defaultValues/middleware.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/next.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/react_app.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/undefined_platform.d.ts.map +1 -1
- package/dist/types/envVariables/extractEnvVariable/vite.d.ts.map +1 -1
- package/dist/types/envVariables/getConfiguration.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +32 -0
- package/dist/types/types/config.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport {\n IMPORT_MODE,\n OPTIMIZE,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n CONFIG_DIR,\n CONTENT_DIR,\n DICTIONARIES_DIR,\n DICTIONARY_OUTPUT,\n DYNAMIC_DICTIONARIES_DIR,\n EXCLUDED_PATHS,\n FILE_EXTENSIONS,\n I18NEXT_DICTIONARIES_DIR,\n MAIN_DIR,\n MODULE_AUGMENTATION_DIR,\n REACT_INTL_MESSAGES_DIR,\n TYPES_DIR,\n UNMERGED_DICTIONARIES_DIR,\n WATCH,\n} from '../defaultValues/content';\nimport {\n APPLICATION_URL,\n BACKEND_URL,\n CMS_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n EDITOR_URL,\n HOT_RELOAD,\n IS_ENABLED,\n PORT,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n REQUIRED_LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport { MODE, PREFIX } from '../defaultValues/log';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n ContentConfig,\n CustomIntlayerConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n} from '../types/config';\nimport { normalizePath } from '../utils/normalizePath';\n\nlet storedConfiguration: IntlayerConfig;\n\n// @TODO - Add possibility of directories configurations to be arrays to allow multiple packages management\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n *\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Locales required by TypeScript to ensure strong implementations of internationalized content using typescript.\n *\n * Default: []\n *\n * If empty, all locales are required in `strict` mode.\n *\n * Ensure required locales are also defined in the `locales` field.\n */\n requiredLocales:\n customConfiguration?.requiredLocales ??\n customConfiguration?.locales ??\n REQUIRED_LOCALES,\n\n /**\n * Ensure strong implementations of internationalized content using typescript.\n * - If set to \"strict\", the translation `t` function will require each declared locales to be defined. If one locale is missing, or if a locale is not declared in your config, it will throw an error.\n * - If set to \"inclusive\", the translation `t` function will require each declared locales to be defined. If one locale is missing, it will throw a warning. But will accept if a locale is not declared in your config, but exist.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"inclusive\"\n */\n strictMode: customConfiguration?.strictMode ?? STRICT_MODE,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildMiddlewareFields = (\n customConfiguration?: Partial<MiddlewareConfig>\n): MiddlewareConfig => ({\n /**\n * Header name to get the locale\n *\n * Default: 'x-intlayer-locale'\n */\n headerName: customConfiguration?.headerName ?? HEADER_NAME,\n\n /**\n * Cookie name to get the locale\n *\n * Default: 'intlayer-locale'\n */\n cookieName: customConfiguration?.cookieName ?? COOKIE_NAME,\n\n /**\n * Prefix default prefix the default locale to the path as other locales.\n *\n * Example with prefixDefault = true and defaultLocale = 'en':\n * path = /en/dashboard or /fr/dashboard\n *\n * Example with prefixDefault = false and defaultLocale = 'en':\n * path = /dashboard or /fr/dashboard\n *\n *\n * Default: false\n */\n prefixDefault: customConfiguration?.prefixDefault ?? PREFIX_DEFAULT,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Rule to set the cookie on the server\n * - 'always': Set the cookie on every request\n * - 'never': Never set the cookie\n */\n serverSetCookie: customConfiguration?.serverSetCookie ?? SERVER_SET_COOKIE,\n\n /**\n * No prefix in the URL\n * - true: No prefix in the URL\n * - false: Prefix in the URL\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n * - If no prefix is set, the URL will be https://example.com/en\n * - If the no prefix is set to true, the URL will be https://example.com\n *\n * Default: false\n */\n noPrefix: customConfiguration?.noPrefix ?? NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string\n): ContentConfig => {\n const notDerivedContentConfig: BaseContentConfig = {\n /**\n * File extensions of content to look for to build the dictionaries\n *\n * - Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']\n *\n * - Example: ['.data.ts', '.data.js', '.data.json']\n *\n * Note:\n * - Can exclude unused file extensions to improve performance\n * - Avoid using common file extensions like '.ts', '.js', '.json' to avoid conflicts\n */\n fileExtensions: customConfiguration?.fileExtensions ?? FILE_EXTENSIONS,\n\n /**\n * Absolute path of the directory of the project\n * - Default: process.cwd()\n * - Example: '\n *\n * Will be used to resolve all intlayer directories\n *\n * Note:\n * - The base directory should be the root of the project\n * - Can be changed to a custom directory to externalize either the content used in the project, or the intlayer application from the project\n */\n baseDir: customConfiguration?.baseDir ?? baseDir ?? process.cwd(),\n\n /**\n * Should exclude some directories from the content search\n *\n * Default: ['node_modules']\n *\n * Not used yet\n * @TODO Implement the exclusion or remove it\n */\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n\n /**\n * Indicates if Intlayer should watch for changes in the content declaration files in the app to rebuild the related dictionaries.\n *\n * Default: process.env.NODE_ENV === 'development'\n */\n watch: customConfiguration?.watch ?? WATCH,\n };\n\n const baseDirDerivedConfiguration: BaseDerivedConfig = {\n /**\n * Directory where the content is stored\n *\n * Relative to the base directory of the project\n *\n * Default: ./src\n *\n * Example: 'src'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the content used in the project\n * - If the content is not at the base directory level, update the contentDirName field instead\n */\n contentDir: (customConfiguration?.contentDir ?? CONTENT_DIR).map(\n (contentDir) => join(notDerivedContentConfig.baseDir, contentDir)\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.intlayer'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the intlayer application from the project\n * - If the result is not at the base directory level, update the dictionariesDirName field instead\n */\n dictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Relative to the base directory of the project\n *\n * Default: .intlayer/types\n *\n * Example: 'types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If the module augmentation is not at the base directory level, update the moduleAugmentationDirName field instead\n *\n */\n moduleAugmentationDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n\n /**\n * Output format of the dictionary\n *\n * Default: ['intlayer']\n *\n * Note:\n * - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.\n * - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer\n */\n dictionaryOutput:\n customConfiguration?.dictionaryOutput ?? DICTIONARY_OUTPUT,\n };\n\n const dictionariesDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the unmerged dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: '.intlayer/unmerged_dictionary'\n *\n */\n unmergedDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.unmergedDictionariesDir ?? UNMERGED_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the final dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.intlayer/dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n * - The dictionaries are stored in JSON format\n * - The dictionaries are used to translate the content\n * - The dictionaries are built from the content files\n */\n dictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dynamic dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dynamic_dictionary\n */\n dynamicDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n customConfiguration?.dynamicDictionariesDir ?? DYNAMIC_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the 18n dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: i18next_resources\n *\n * Example: '.intlayer/dictionary/i18n'\n *\n * Note:\n * - If the types are not at the result directory level, update the i18nextResourcesDirName field instead\n */\n i18nextResourcesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.i18nextResourcesDir ?? I18NEXT_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: intl_messages\n *\n * Example: '.intlayer/react-intl_dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n */\n reactIntlMessagesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.reactIntlMessagesDir ?? REACT_INTL_MESSAGES_DIR\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/types\n *\n * Example: 'types'\n *\n * Note:\n * - If the types are not at the result directory level, update the typesDirName field instead\n */\n typesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.typesDir ?? TYPES_DIR\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/main\n *\n * Example: '.intlayer/main'\n *\n * Note:\n *\n * - If the main files are not at the result directory level, update the mainDirName field instead\n */\n mainDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.mainDir ?? MAIN_DIR\n ),\n\n /**\n * Directory where the configuration files are stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/config\n *\n * Example: '.intlayer/config'\n *\n * Note:\n *\n * - If the configuration files are not at the result directory level, update the configDirName field instead\n */\n configDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n };\n\n const patternsConfiguration: PatternsContentConfig = {\n /**\n * Pattern of files to watch\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json', '/**\\/*.content.cjs', '/**\\/*.content.mjs', '/**\\/*.content.tsx', '/**\\/*.content.jsx']\n */\n watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(\n (ext) => `/**/*${ext}`\n ),\n\n /**\n * Pattern of files to watch including the relative path\n *\n * Default: ['src/**\\/*.content.ts', 'src/**\\/*.content.js', 'src/**\\/*.content.json', 'src/**\\/*.content.cjs', 'src/**\\/*.content.mjs', 'src/**\\/*.content.tsx', 'src/**\\/*.content.jsx']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.flatMap(\n (ext) =>\n baseDirDerivedConfiguration.contentDir.map(\n (contentDir) => `${normalizePath(contentDir)}/**/*${ext}`\n )\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '.intlayer/dictionary/**\\/*.json'\n */\n outputFilesPatternWithPath: `${normalizePath(\n dictionariesDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...dictionariesDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * URL of the application. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n applicationURL: customConfiguration?.applicationURL ?? APPLICATION_URL,\n\n /**\n * URL of the editor server. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n editorURL: customConfiguration?.editorURL ?? EDITOR_URL,\n\n /**\n * URL of the CMS server. Used to restrict the origin of the editor for security reasons.\n */\n cmsURL: customConfiguration?.cmsURL ?? CMS_URL,\n\n /**\n * URL of the editor server\n *\n * Default: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\n /** Port of the editor server\n *\n * Default: 8000\n */\n port: customConfiguration?.port ?? PORT,\n\n /**\n * Indicates if the application interact with the visual editor\n *\n * Default: true;\n *\n * If true, the editor will be able to interact with the application.\n * If false, the editor will not be able to interact with the application.\n * In any case, the editor can only be enabled by the visual editor.\n * Disabling the editor for specific environments is a way to enforce the security.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV !== 'production',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientId: customConfiguration?.clientId ?? undefined,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientSecret: customConfiguration?.clientSecret ?? undefined,\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'local_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'local_first' or 'distant_first'.\n * - 'local_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy:\n customConfiguration?.dictionaryPriorityStrategy ??\n DICTIONARY_PRIORITY_STRATEGY,\n\n /**\n * Indicates if the application should hot reload the locale configurations when a change is detected.\n * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.\n *\n * The hot reload is only available for clients of the `enterprise` plan.\n *\n * Default: false\n */\n hotReload: customConfiguration?.hotReload ?? HOT_RELOAD,\n});\n\nconst buildLogFields = (\n customConfiguration?: Partial<LogConfig>\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n});\n\nconst buildAiFields = (customConfiguration?: Partial<AiConfig>): AiConfig => ({\n /**\n * AI configuration\n */\n provider: customConfiguration?.provider,\n\n /**\n * API key\n */\n apiKey: customConfiguration?.apiKey,\n\n /**\n * API model\n */\n model: customConfiguration?.model,\n\n /**\n * Temperature\n */\n temperature: customConfiguration?.temperature,\n\n /**\n * Application context\n */\n applicationContext: customConfiguration?.applicationContext,\n});\n\nconst buildBuildFields = (\n customConfiguration?: Partial<BuildConfig>\n): BuildConfig => ({\n /**\n * Indicates if the build should be optimized\n *\n * Default: process.env.NODE_ENV === 'production'\n *\n * If true, the build will be optimized.\n * If false, the build will not be optimized.\n *\n * Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.\n * All imports will stay as static import to avoid async processing when loading the dictionaries.\n *\n * Note:\n * - Intlayer will replace all call of `useIntlayer` with the defined mode by the `importMode` option.\n * - Intlayer will replace all call of `getIntlayer` with `getDictionary`.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - In most cases, \"dynamic\" will be used for React applications, \"async\" for Vue.js applications.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n */\n optimize: customConfiguration?.optimize ?? OPTIMIZE,\n\n /**\n * Indicates the mode of import to use for the dictionaries.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionary`.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * - \"async\": The dictionaries are imported dynamically in an asynchronous component.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `await useDictionaryAsync`.\n *\n * Default: \"static\"\n *\n * By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.\n *\n * Note:\n * - Dynamic imports rely on Suspense and may slightly impact rendering performance.\n * - If desabled all locales will be loaded at once, even if they are not used.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n * - This option will be ignored if `optimize` is disabled.\n * - This option will not impact the `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` and `useDictionaryDynamic` functions. You can still use them to refine you code on manual optimization.\n */\n importMode: customConfiguration?.importMode ?? IMPORT_MODE,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * Allows to avoid to traverse the code that is not relevant to the optimization.\n * Improve build performance.\n *\n * Default: ['**\\/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx}', '!**\\/node_modules/**']\n *\n * Example: `['src/**\\/*.{ts,tsx}', '../ui-library/**\\/*.{ts,tsx}']`\n *\n * Note:\n * - This option will be ignored if `optimize` is disabled.\n * - Use glob pattern.\n */\n traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,\n});\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n customConfiguration?: CustomIntlayerConfig,\n baseDir?: string\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir\n );\n\n const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n const logConfig = buildLogFields(customConfiguration?.log);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":"AAAA,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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rB;AAAA,EACF;AAEA,QAAM,eAAe,kBAAkB,qBAAqB,MAAM;AAElE,QAAM,YAAY,eAAe,qBAAqB,GAAG;AAEzD,QAAM,WAAW,cAAc,qBAAqB,EAAE;AAEtD,QAAM,cAAc,iBAAiB,qBAAqB,KAAK;AAE/D,wBAAsB;AAAA,IACpB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":["import { join } from 'path';\nimport {\n IMPORT_MODE,\n OPTIMIZE,\n TRAVERSE_PATTERN,\n} from '../defaultValues/build';\nimport {\n CONFIG_DIR,\n CONTENT_DIR,\n DICTIONARIES_DIR,\n DICTIONARY_OUTPUT,\n DYNAMIC_DICTIONARIES_DIR,\n EXCLUDED_PATHS,\n FILE_EXTENSIONS,\n I18NEXT_DICTIONARIES_DIR,\n MAIN_DIR,\n MODULE_AUGMENTATION_DIR,\n REACT_INTL_MESSAGES_DIR,\n TYPES_DIR,\n UNMERGED_DICTIONARIES_DIR,\n WATCH,\n} from '../defaultValues/content';\nimport {\n APPLICATION_URL,\n BACKEND_URL,\n CMS_URL,\n DICTIONARY_PRIORITY_STRATEGY,\n EDITOR_URL,\n HOT_RELOAD,\n IS_ENABLED,\n PORT,\n} from '../defaultValues/editor';\nimport {\n DEFAULT_LOCALE,\n LOCALES,\n REQUIRED_LOCALES,\n STRICT_MODE,\n} from '../defaultValues/internationalization';\nimport { MODE, PREFIX } from '../defaultValues/log';\nimport {\n BASE_PATH,\n COOKIE_NAME,\n DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n HEADER_NAME,\n NO_PREFIX,\n PREFIX_DEFAULT,\n SERVER_SET_COOKIE,\n} from '../defaultValues/middleware';\nimport type {\n AiConfig,\n BaseContentConfig,\n BaseDerivedConfig,\n BuildConfig,\n ContentConfig,\n CustomIntlayerConfig,\n EditorConfig,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n PatternsContentConfig,\n ResultDirDerivedConfig,\n} from '../types/config';\nimport { normalizePath } from '../utils/normalizePath';\n\nlet storedConfiguration: IntlayerConfig;\n\n// @TODO - Add possibility of directories configurations to be arrays to allow multiple packages management\n\nconst buildInternationalizationFields = (\n customConfiguration?: Partial<InternationalizationConfig>\n): InternationalizationConfig => ({\n /**\n * Locales available in the application\n *\n * Default: ['en']\n *\n */\n locales: customConfiguration?.locales ?? LOCALES,\n\n /**\n * Locales required by TypeScript to ensure strong implementations of internationalized content using typescript.\n *\n * Default: []\n *\n * If empty, all locales are required in `strict` mode.\n *\n * Ensure required locales are also defined in the `locales` field.\n */\n requiredLocales:\n customConfiguration?.requiredLocales ??\n customConfiguration?.locales ??\n REQUIRED_LOCALES,\n\n /**\n * Ensure strong implementations of internationalized content using typescript.\n * - If set to \"strict\", the translation `t` function will require each declared locales to be defined. If one locale is missing, or if a locale is not declared in your config, it will throw an error.\n * - If set to \"inclusive\", the translation `t` function will require each declared locales to be defined. If one locale is missing, it will throw a warning. But will accept if a locale is not declared in your config, but exist.\n * - If set to \"loose\", the translation `t` function will accept any existing locale.\n *\n * Default: \"inclusive\"\n */\n strictMode: customConfiguration?.strictMode ?? STRICT_MODE,\n\n /**\n * Default locale of the application for fallback\n *\n * Default: 'en'\n */\n defaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE,\n});\n\nconst buildMiddlewareFields = (\n customConfiguration?: Partial<MiddlewareConfig>\n): MiddlewareConfig => ({\n /**\n * Header name to get the locale\n *\n * Default: 'x-intlayer-locale'\n */\n headerName: customConfiguration?.headerName ?? HEADER_NAME,\n\n /**\n * Cookie name to get the locale\n *\n * Default: 'intlayer-locale'\n */\n cookieName: customConfiguration?.cookieName ?? COOKIE_NAME,\n\n /**\n * Prefix default prefix the default locale to the path as other locales.\n *\n * Example with prefixDefault = true and defaultLocale = 'en':\n * path = /en/dashboard or /fr/dashboard\n *\n * Example with prefixDefault = false and defaultLocale = 'en':\n * path = /dashboard or /fr/dashboard\n *\n *\n * Default: false\n */\n prefixDefault: customConfiguration?.prefixDefault ?? PREFIX_DEFAULT,\n\n /**\n * Base path of the application URL\n *\n * Default: ''\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n */\n basePath: customConfiguration?.basePath ?? BASE_PATH,\n\n /**\n * Rule to set the cookie on the server\n * - 'always': Set the cookie on every request\n * - 'never': Never set the cookie\n */\n serverSetCookie: customConfiguration?.serverSetCookie ?? SERVER_SET_COOKIE,\n\n /**\n * No prefix in the URL\n * - true: No prefix in the URL\n * - false: Prefix in the URL\n *\n * Example:\n * - If the application is hosted at https://example.com/my-app\n * - The base path is '/my-app'\n * - The URL will be https://example.com/my-app/en\n * - If the base path is not set, the URL will be https://example.com/en\n * - If no prefix is set, the URL will be https://example.com/en\n * - If the no prefix is set to true, the URL will be https://example.com\n *\n * Default: false\n */\n noPrefix: customConfiguration?.noPrefix ?? NO_PREFIX,\n\n /**\n * Controls whether locale detection occurs during Next.js prefetch requests\n * - true: Detect and apply locale during prefetch\n * - false: Use default locale during prefetch (recommended)\n *\n * This setting affects how Next.js handles locale prefetching:\n *\n * Example scenario:\n * - User's browser language is 'fr'\n * - Current page is /fr/about\n * - Link prefetches /about\n *\n * With `detectLocaleOnPrefetchNoPrefix:true`\n * - Prefetch detects 'fr' locale from browser\n * - Redirects prefetch to /fr/about\n *\n * With `detectLocaleOnPrefetchNoPrefix:false` (default)\n * - Prefetch uses default locale\n * - Redirects prefetch to /en/about (assuming 'en' is default)\n *\n * When to use true:\n * - Your app uses non-localized internal links (e.g. <a href=\"/about\">)\n * - You want consistent locale detection behavior between regular and prefetch requests\n *\n * When to use false (default):\n * - Your app uses locale-prefixed links (e.g. <a href=\"/fr/about\">)\n * - You want to optimize prefetching performance\n * - You want to avoid potential redirect loops\n *\n * Default: false\n */\n detectLocaleOnPrefetchNoPrefix:\n customConfiguration?.detectLocaleOnPrefetchNoPrefix ??\n DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n});\n\nconst buildContentFields = (\n customConfiguration?: Partial<ContentConfig>,\n baseDir?: string\n): ContentConfig => {\n const notDerivedContentConfig: BaseContentConfig = {\n /**\n * File extensions of content to look for to build the dictionaries\n *\n * - Default: ['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']\n *\n * - Example: ['.data.ts', '.data.js', '.data.json']\n *\n * Note:\n * - Can exclude unused file extensions to improve performance\n * - Avoid using common file extensions like '.ts', '.js', '.json' to avoid conflicts\n */\n fileExtensions: customConfiguration?.fileExtensions ?? FILE_EXTENSIONS,\n\n /**\n * Absolute path of the directory of the project\n * - Default: process.cwd()\n * - Example: '\n *\n * Will be used to resolve all intlayer directories\n *\n * Note:\n * - The base directory should be the root of the project\n * - Can be changed to a custom directory to externalize either the content used in the project, or the intlayer application from the project\n */\n baseDir: customConfiguration?.baseDir ?? baseDir ?? process.cwd(),\n\n /**\n * Should exclude some directories from the content search\n *\n * Default: ['node_modules']\n *\n * Not used yet\n * @TODO Implement the exclusion or remove it\n */\n excludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n\n /**\n * Indicates if Intlayer should watch for changes in the content declaration files in the app to rebuild the related dictionaries.\n *\n * Default: process.env.NODE_ENV === 'development'\n */\n watch: customConfiguration?.watch ?? WATCH,\n };\n\n const baseDirDerivedConfiguration: BaseDerivedConfig = {\n /**\n * Directory where the content is stored\n *\n * Relative to the base directory of the project\n *\n * Default: ./src\n *\n * Example: 'src'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the content used in the project\n * - If the content is not at the base directory level, update the contentDirName field instead\n */\n contentDir: (customConfiguration?.contentDir ?? CONTENT_DIR).map(\n (contentDir) => join(notDerivedContentConfig.baseDir, contentDir)\n ),\n\n /**\n * Directory where the result will be stored\n *\n * Relative to the base directory of the project\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.intlayer'\n *\n * Note:\n * - Can be changed to a custom directory to externalize the intlayer application from the project\n * - If the result is not at the base directory level, update the dictionariesDirName field instead\n */\n dictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the module augmentation will be stored\n *\n * Module augmentation allow better IDE suggestions and type checking\n *\n * Relative to the base directory of the project\n *\n * Default: .intlayer/types\n *\n * Example: 'types'\n *\n * Note:\n * - If this path changed, be sure to include it from the tsconfig.json file\n * - If the module augmentation is not at the base directory level, update the moduleAugmentationDirName field instead\n *\n */\n moduleAugmentationDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR\n ),\n\n /**\n * Output format of the dictionary\n *\n * Default: ['intlayer']\n *\n * Note:\n * - 'i18next' is not yet ensure a 1:1 mapping with the i18next library.\n * - Removing 'intlayer' will break the compatibility with react-intlayer or next-intlayer\n */\n dictionaryOutput:\n customConfiguration?.dictionaryOutput ?? DICTIONARY_OUTPUT,\n };\n\n const dictionariesDirDerivedConfiguration: ResultDirDerivedConfig = {\n /**\n * Directory where the unmerged dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: '.intlayer/unmerged_dictionary'\n *\n */\n unmergedDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.unmergedDictionariesDir ?? UNMERGED_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the final dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dictionary\n *\n * Example: '.intlayer/dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n * - The dictionaries are stored in JSON format\n * - The dictionaries are used to translate the content\n * - The dictionaries are built from the content files\n */\n dictionariesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dynamic dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/dynamic_dictionary\n */\n dynamicDictionariesDir: join(\n notDerivedContentConfig.baseDir,\n customConfiguration?.dynamicDictionariesDir ?? DYNAMIC_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the 18n dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: i18next_resources\n *\n * Example: '.intlayer/dictionary/i18n'\n *\n * Note:\n * - If the types are not at the result directory level, update the i18nextResourcesDirName field instead\n */\n i18nextResourcesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.i18nextResourcesDir ?? I18NEXT_DICTIONARIES_DIR\n ),\n\n /**\n * Directory where the dictionaries will be stored\n *\n * Relative to the result directory\n *\n * Default: intl_messages\n *\n * Example: '.intlayer/react-intl_dictionary'\n *\n * Note:\n * - If the types are not at the result directory level, update the dictionariesDirName field instead\n */\n reactIntlMessagesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.reactIntlMessagesDir ?? REACT_INTL_MESSAGES_DIR\n ),\n\n /**\n * Directory where the dictionaries types will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/types\n *\n * Example: 'types'\n *\n * Note:\n * - If the types are not at the result directory level, update the typesDirName field instead\n */\n typesDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.typesDir ?? TYPES_DIR\n ),\n\n /**\n * Directory where the main files will be stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/main\n *\n * Example: '.intlayer/main'\n *\n * Note:\n *\n * - If the main files are not at the result directory level, update the mainDirName field instead\n */\n mainDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.mainDir ?? MAIN_DIR\n ),\n\n /**\n * Directory where the configuration files are stored\n *\n * Relative to the result directory\n *\n * Default: .intlayer/config\n *\n * Example: '.intlayer/config'\n *\n * Note:\n *\n * - If the configuration files are not at the result directory level, update the configDirName field instead\n */\n configDir: join(\n notDerivedContentConfig.baseDir,\n\n customConfiguration?.configDir ?? CONFIG_DIR\n ),\n };\n\n const patternsConfiguration: PatternsContentConfig = {\n /**\n * Pattern of files to watch\n *\n * Default: ['/**\\/*.content.ts', '/**\\/*.content.js', '/**\\/*.content.json', '/**\\/*.content.cjs', '/**\\/*.content.mjs', '/**\\/*.content.tsx', '/**\\/*.content.jsx']\n */\n watchedFilesPattern: notDerivedContentConfig.fileExtensions.map(\n (ext) => `/**/*${ext}`\n ),\n\n /**\n * Pattern of files to watch including the relative path\n *\n * Default: ['src/**\\/*.content.ts', 'src/**\\/*.content.js', 'src/**\\/*.content.json', 'src/**\\/*.content.cjs', 'src/**\\/*.content.mjs', 'src/**\\/*.content.tsx', 'src/**\\/*.content.jsx']\n */\n watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.flatMap(\n (ext) =>\n baseDirDerivedConfiguration.contentDir.map(\n (contentDir) => `${normalizePath(contentDir)}/**/*${ext}`\n )\n ),\n\n /**\n * Pattern of dictionary to interpret\n *\n * Default: '.intlayer/dictionary/**\\/*.json'\n */\n outputFilesPatternWithPath: `${normalizePath(\n dictionariesDirDerivedConfiguration.dictionariesDir\n )}/**/*.json`,\n };\n\n return {\n ...notDerivedContentConfig,\n ...baseDirDerivedConfiguration,\n ...dictionariesDirDerivedConfiguration,\n ...patternsConfiguration,\n };\n};\n\nconst buildEditorFields = (\n customConfiguration?: Partial<EditorConfig>\n): EditorConfig => ({\n /**\n * URL of the application. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n applicationURL: customConfiguration?.applicationURL ?? APPLICATION_URL,\n\n /**\n * URL of the editor server. Used to restrict the origin of the editor for security reasons.\n *\n * > '*' means that the editor is accessible from any origin\n *\n * Default: '*'\n */\n editorURL: customConfiguration?.editorURL ?? EDITOR_URL,\n\n /**\n * URL of the CMS server. Used to restrict the origin of the editor for security reasons.\n */\n cmsURL: customConfiguration?.cmsURL ?? CMS_URL,\n\n /**\n * URL of the editor server\n *\n * Default: 'https://back.intlayer.org'\n */\n backendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\n /** Port of the editor server\n *\n * Default: 8000\n */\n port: customConfiguration?.port ?? PORT,\n\n /**\n * Indicates if the application interact with the visual editor\n *\n * Default: true;\n *\n * If true, the editor will be able to interact with the application.\n * If false, the editor will not be able to interact with the application.\n * In any case, the editor can only be enabled by the visual editor.\n * Disabling the editor for specific environments is a way to enforce the security.\n *\n * Usage:\n * ```js\n * {\n * // Other configurations\n * editor: {\n * enabled: process.env.NODE_ENV !== 'production',\n * }\n * };\n * ```\n */\n enabled: customConfiguration?.enabled ?? IS_ENABLED,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientId: customConfiguration?.clientId ?? undefined,\n\n /**\n * clientId and clientSecret allow the intlayer packages to authenticate with the backend using oAuth2 authentication.\n * An access token is use to authenticate the user related to the project.\n * To get an access token, go to https://intlayer.org/dashboard/project and create an account.\n *\n * Default: undefined\n *\n * > Important: The clientId and clientSecret should be kept secret and not shared publicly. Please ensure to keep them in a secure location, such as environment variables.\n */\n clientSecret: customConfiguration?.clientSecret ?? undefined,\n\n /**\n * Strategy for prioritizing dictionaries. If a dictionary is both present online and locally, the content will be merge.\n * However, is a field is defined in both dictionary, this setting determines which fields takes the priority over the other.\n *\n * Default: 'local_first'\n *\n * The strategy for prioritizing dictionaries. It can be either 'local_first' or 'distant_first'.\n * - 'local_first': The first dictionary found in the locale is used.\n * - 'distant_first': The first dictionary found in the distant locales is used.\n */\n dictionaryPriorityStrategy:\n customConfiguration?.dictionaryPriorityStrategy ??\n DICTIONARY_PRIORITY_STRATEGY,\n\n /**\n * Indicates if the application should hot reload the locale configurations when a change is detected.\n * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.\n *\n * The hot reload is only available for clients of the `enterprise` plan.\n *\n * Default: false\n */\n hotReload: customConfiguration?.hotReload ?? HOT_RELOAD,\n});\n\nconst buildLogFields = (\n customConfiguration?: Partial<LogConfig>\n): LogConfig => ({\n /**\n * Indicates if the logger is enabled\n *\n * Default: 'default'\n *\n * If 'default', the logger is enabled and can be used.\n * If 'verbose', the logger will be enabled and can be used, but will log more information.\n * If 'disabled', the logger is disabled and cannot be used.\n */\n mode: customConfiguration?.mode ?? MODE,\n\n /**\n * Prefix of the logger\n *\n * Default: '[intlayer]'\n *\n * The prefix of the logger.\n */\n prefix: customConfiguration?.prefix ?? PREFIX,\n});\n\nconst buildAiFields = (customConfiguration?: Partial<AiConfig>): AiConfig => ({\n /**\n * AI configuration\n */\n provider: customConfiguration?.provider,\n\n /**\n * API key\n */\n apiKey: customConfiguration?.apiKey,\n\n /**\n * API model\n */\n model: customConfiguration?.model,\n\n /**\n * Temperature\n */\n temperature: customConfiguration?.temperature,\n\n /**\n * Application context\n */\n applicationContext: customConfiguration?.applicationContext,\n});\n\nconst buildBuildFields = (\n customConfiguration?: Partial<BuildConfig>\n): BuildConfig => ({\n /**\n * Indicates if the build should be optimized\n *\n * Default: process.env.NODE_ENV === 'production'\n *\n * If true, the build will be optimized.\n * If false, the build will not be optimized.\n *\n * Intlayer will replace all calls of dictionaries to optimize chunking. That way the final bundle will import only the dictionaries that are used.\n * All imports will stay as static import to avoid async processing when loading the dictionaries.\n *\n * Note:\n * - Intlayer will replace all call of `useIntlayer` with the defined mode by the `importMode` option.\n * - Intlayer will replace all call of `getIntlayer` with `getDictionary`.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - In most cases, \"dynamic\" will be used for React applications, \"async\" for Vue.js applications.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n */\n optimize: customConfiguration?.optimize ?? OPTIMIZE,\n\n /**\n * Indicates the mode of import to use for the dictionaries.\n *\n * Available modes:\n * - \"static\": The dictionaries are imported statically.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionary`.\n * - \"dynamic\": The dictionaries are imported dynamically in a synchronous component using the suspense API.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `useDictionaryDynamic`.\n * - \"async\": The dictionaries are imported dynamically in an asynchronous component.\n * In that case, Intlayer will replace all calls to `useIntlayer` with `await useDictionaryAsync`.\n *\n * Default: \"static\"\n *\n * By default, when a dictionary is loaded, it imports content for all locales as it's imported statically.\n *\n * Note:\n * - Dynamic imports rely on Suspense and may slightly impact rendering performance.\n * - If desabled all locales will be loaded at once, even if they are not used.\n * - This option relies on the `@intlayer/babel` and `@intlayer/swc` plugins.\n * - Ensure all keys are declared statically in the `useIntlayer` calls. e.g. `useIntlayer('navbar')`.\n * - This option will be ignored if `optimize` is disabled.\n * - This option will not impact the `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` and `useDictionaryDynamic` functions. You can still use them to refine you code on manual optimization.\n */\n importMode: customConfiguration?.importMode ?? IMPORT_MODE,\n\n /**\n * Pattern to traverse the code to optimize.\n *\n * Allows to avoid to traverse the code that is not relevant to the optimization.\n * Improve build performance.\n *\n * Default: ['**\\/*.{js,ts,mjs,cjs,jsx,tsx,mjx,cjx}', '!**\\/node_modules/**']\n *\n * Example: `['src/**\\/*.{ts,tsx}', '../ui-library/**\\/*.{ts,tsx}']`\n *\n * Note:\n * - This option will be ignored if `optimize` is disabled.\n * - Use glob pattern.\n */\n traversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,\n});\n\n/**\n * Build the configuration fields by merging the default values with the custom configuration\n */\nexport const buildConfigurationFields = (\n customConfiguration?: CustomIntlayerConfig,\n baseDir?: string\n): IntlayerConfig => {\n const internationalizationConfig = buildInternationalizationFields(\n customConfiguration?.internationalization\n );\n\n const middlewareConfig = buildMiddlewareFields(\n customConfiguration?.middleware\n );\n\n const contentConfig = buildContentFields(\n customConfiguration?.content,\n baseDir\n );\n\n const editorConfig = buildEditorFields(customConfiguration?.editor);\n\n const logConfig = buildLogFields(customConfiguration?.log);\n\n const aiConfig = buildAiFields(customConfiguration?.ai);\n\n const buildConfig = buildBuildFields(customConfiguration?.build);\n\n storedConfiguration = {\n internationalization: internationalizationConfig,\n middleware: middlewareConfig,\n content: contentConfig,\n editor: editorConfig,\n log: logConfig,\n ai: aiConfig,\n build: buildConfig,\n };\n\n return storedConfiguration;\n};\n"],"mappings":"AAAA,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,MAAM,cAAc;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgBP,SAAS,qBAAqB;AAE9B,IAAI;AAIJ,MAAM,kCAAkC,CACtC,yBACgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,SAAS,qBAAqB,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWzC,iBACE,qBAAqB,mBACrB,qBAAqB,WACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,YAAY,qBAAqB,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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
|
|
6
6
|
const NO_PREFIX = false;
|
|
7
|
+
const DETECT_LOCALE_ON_PREFETCH_NO_PREFIX = false;
|
|
7
8
|
export {
|
|
8
9
|
BASE_PATH,
|
|
9
10
|
COOKIE_NAME,
|
|
11
|
+
DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,
|
|
10
12
|
HEADER_NAME,
|
|
11
13
|
NO_PREFIX,
|
|
12
14
|
PREFIX_DEFAULT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/defaultValues/middleware.ts"],"sourcesContent":["export const HEADER_NAME = 'x-intlayer-locale';\n\nexport const COOKIE_NAME = 'INTLAYER_LOCALE';\n\nexport const PREFIX_DEFAULT = false;\n\nexport const BASE_PATH = '';\n\nexport const SERVER_SET_COOKIE = 'always';\n\nexport const NO_PREFIX = false;\n"],"mappings":"AAAO,MAAM,cAAc;AAEpB,MAAM,cAAc;AAEpB,MAAM,iBAAiB;AAEvB,MAAM,YAAY;AAElB,MAAM,oBAAoB;AAE1B,MAAM,YAAY;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/defaultValues/middleware.ts"],"sourcesContent":["export const HEADER_NAME = 'x-intlayer-locale';\n\nexport const COOKIE_NAME = 'INTLAYER_LOCALE';\n\nexport const PREFIX_DEFAULT = false;\n\nexport const BASE_PATH = '';\n\nexport const SERVER_SET_COOKIE = 'always';\n\nexport const NO_PREFIX = false;\n\nexport const DETECT_LOCALE_ON_PREFETCH_NO_PREFIX = false;\n"],"mappings":"AAAO,MAAM,cAAc;AAEpB,MAAM,cAAc;AAEpB,MAAM,iBAAiB;AAEvB,MAAM,YAAY;AAElB,MAAM,oBAAoB;AAE1B,MAAM,YAAY;AAElB,MAAM,sCAAsC;","names":[]}
|
|
@@ -11,7 +11,8 @@ const extractNextEnvVariable = () => {
|
|
|
11
11
|
prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,
|
|
12
12
|
basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,
|
|
13
13
|
serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,
|
|
14
|
-
noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX
|
|
14
|
+
noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX,
|
|
15
|
+
detectLocaleOnPrefetchNoPrefix: process.env.NEXT_PUBLIC_INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX
|
|
15
16
|
};
|
|
16
17
|
const content = {
|
|
17
18
|
fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractNextEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.NEXT_PUBLIC_INTLAYER_LOCALES,\n requiredLocales: process.env.NEXT_PUBLIC_INTLAYER_REQUIRED_LOCALES,\n strictMode: process.env.NEXT_PUBLIC_INTLAYER_STRICT_MODE,\n defaultLocale: process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.NEXT_PUBLIC_INTLAYER_HEADER_NAME,\n cookieName: process.env.NEXT_PUBLIC_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.NEXT_PUBLIC_INTLAYER_BASE_DIR,\n contentDir: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.NEXT_PUBLIC_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,\n dynamicDictionariesDir:\n process.env.NEXT_PUBLIC_INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n unmergedDictionariesDir:\n process.env.NEXT_PUBLIC_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n moduleAugmentationDir:\n process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,\n i18nextResourcesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_RESOURCES_DIR,\n reactIntlMessagesDir:\n process.env.NEXT_PUBLIC_INTLAYER_REACT_INTL_MESSAGES_DIR,\n mainDir: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,\n configDir: process.env.NEXT_PUBLIC_INTLAYER_CONFIG_DIR,\n typesDir: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,\n watchedFilesPattern: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.NEXT_PUBLIC_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: process.env.NEXT_PUBLIC_INTLAYER_APPLICATION_URL,\n editorURL: process.env.NEXT_PUBLIC_INTLAYER_EDITOR_URL,\n cmsURL: process.env.NEXT_PUBLIC_INTLAYER_CMS_URL,\n backendURL: process.env.NEXT_PUBLIC_INTLAYER_BACKEND_URL,\n enabled: process.env.NEXT_PUBLIC_INTLAYER_ENABLED,\n port: process.env.NEXT_PUBLIC_INTLAYER_PORT,\n clientId: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_ID,\n clientSecret: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: process.env.NEXT_PUBLIC_INTLAYER_HOT_RELOAD,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: process.env.NEXT_PUBLIC_INTLAYER_AI_PROVIDER,\n model: process.env.NEXT_PUBLIC_INTLAYER_AI_MODEL,\n temperature: process.env.NEXT_PUBLIC_INTLAYER_AI_TEMPERATURE,\n apiKey: process.env.NEXT_PUBLIC_INTLAYER_AI_API_KEY,\n applicationContext: process.env.NEXT_PUBLIC_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.NEXT_PUBLIC_INTLAYER_LOG_MODE,\n prefix: process.env.NEXT_PUBLIC_INTLAYER_LOG_PREFIX,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: process.env.NEXT_PUBLIC_INTLAYER_BUILD_OPTIMIZE,\n importMode: process.env.NEXT_PUBLIC_INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: process.env.NEXT_PUBLIC_INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAWO,MAAM,yBAAyB,MAAiC;AACrE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,IAC3B,UAAU,QAAQ,IAAI;AAAA,IACtB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,UAAU,QAAQ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractNextEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.NEXT_PUBLIC_INTLAYER_LOCALES,\n requiredLocales: process.env.NEXT_PUBLIC_INTLAYER_REQUIRED_LOCALES,\n strictMode: process.env.NEXT_PUBLIC_INTLAYER_STRICT_MODE,\n defaultLocale: process.env.NEXT_PUBLIC_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.NEXT_PUBLIC_INTLAYER_HEADER_NAME,\n cookieName: process.env.NEXT_PUBLIC_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.NEXT_PUBLIC_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.NEXT_PUBLIC_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.NEXT_PUBLIC_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.NEXT_PUBLIC_INTLAYER_NO_PREFIX,\n detectLocaleOnPrefetchNoPrefix:\n process.env.NEXT_PUBLIC_INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.NEXT_PUBLIC_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.NEXT_PUBLIC_INTLAYER_BASE_DIR,\n contentDir: process.env.NEXT_PUBLIC_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.NEXT_PUBLIC_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: process.env.NEXT_PUBLIC_INTLAYER_RESULT_DIR,\n dynamicDictionariesDir:\n process.env.NEXT_PUBLIC_INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n unmergedDictionariesDir:\n process.env.NEXT_PUBLIC_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n moduleAugmentationDir:\n process.env.NEXT_PUBLIC_INTLAYER_MODULE_AUGMENTATION_DIR,\n i18nextResourcesDir: process.env.NEXT_PUBLIC_INTLAYER_I18N_RESOURCES_DIR,\n reactIntlMessagesDir:\n process.env.NEXT_PUBLIC_INTLAYER_REACT_INTL_MESSAGES_DIR,\n mainDir: process.env.NEXT_PUBLIC_INTLAYER_MAIN_DIR,\n configDir: process.env.NEXT_PUBLIC_INTLAYER_CONFIG_DIR,\n typesDir: process.env.NEXT_PUBLIC_INTLAYER_TYPE_DIR,\n watchedFilesPattern: process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.NEXT_PUBLIC_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.NEXT_PUBLIC_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: process.env.NEXT_PUBLIC_INTLAYER_APPLICATION_URL,\n editorURL: process.env.NEXT_PUBLIC_INTLAYER_EDITOR_URL,\n cmsURL: process.env.NEXT_PUBLIC_INTLAYER_CMS_URL,\n backendURL: process.env.NEXT_PUBLIC_INTLAYER_BACKEND_URL,\n enabled: process.env.NEXT_PUBLIC_INTLAYER_ENABLED,\n port: process.env.NEXT_PUBLIC_INTLAYER_PORT,\n clientId: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_ID,\n clientSecret: process.env.NEXT_PUBLIC_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.NEXT_PUBLIC_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: process.env.NEXT_PUBLIC_INTLAYER_HOT_RELOAD,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: process.env.NEXT_PUBLIC_INTLAYER_AI_PROVIDER,\n model: process.env.NEXT_PUBLIC_INTLAYER_AI_MODEL,\n temperature: process.env.NEXT_PUBLIC_INTLAYER_AI_TEMPERATURE,\n apiKey: process.env.NEXT_PUBLIC_INTLAYER_AI_API_KEY,\n applicationContext: process.env.NEXT_PUBLIC_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.NEXT_PUBLIC_INTLAYER_LOG_MODE,\n prefix: process.env.NEXT_PUBLIC_INTLAYER_LOG_PREFIX,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: process.env.NEXT_PUBLIC_INTLAYER_BUILD_OPTIMIZE,\n importMode: process.env.NEXT_PUBLIC_INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: process.env.NEXT_PUBLIC_INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAWO,MAAM,yBAAyB,MAAiC;AACrE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;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Q,IAAI;AAAA,IACpB,oBAAoB,QAAQ,IAAI;AAAA,EAClC;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,QAAQ,IAAI;AAAA,IAClB,QAAQ,QAAQ,IAAI;AAAA,EACtB;AAEA,QAAM,QAAmC;AAAA,IACvC,UAAU,QAAQ,IAAI;AAAA,IACtB,YAAY,QAAQ,IAAI;AAAA,IACxB,iBAAiB,QAAQ,IAAI;AAAA,EAC/B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -11,7 +11,8 @@ const extractReactAppEnvVariable = () => {
|
|
|
11
11
|
prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,
|
|
12
12
|
basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,
|
|
13
13
|
serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,
|
|
14
|
-
noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX
|
|
14
|
+
noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX,
|
|
15
|
+
detectLocaleOnPrefetchNoPrefix: process.env.REACT_APP_INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX
|
|
15
16
|
};
|
|
16
17
|
const content = {
|
|
17
18
|
fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractReactAppEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.REACT_APP_INTLAYER_LOCALES,\n requiredLocales: process.env.REACT_APP_INTLAYER_REQUIRED_LOCALES,\n strictMode: process.env.REACT_APP_INTLAYER_STRICT_MODE,\n defaultLocale: process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.REACT_APP_INTLAYER_HEADER_NAME,\n cookieName: process.env.REACT_APP_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.REACT_APP_INTLAYER_BASE_DIR,\n contentDir: process.env.REACT_APP_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.REACT_APP_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: process.env.REACT_APP_INTLAYER_RESULT_DIR,\n unmergedDictionariesDir:\n process.env.REACT_APP_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n dynamicDictionariesDir:\n process.env.REACT_APP_INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n moduleAugmentationDir:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,\n i18nextResourcesDir: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir:\n process.env.REACT_APP_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: process.env.REACT_APP_INTLAYER_TYPE_DIR,\n mainDir: process.env.REACT_APP_INTLAYER_MAIN_DIR,\n configDir: process.env.REACT_APP_INTLAYER_CONFIG_DIR,\n watchedFilesPattern: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.REACT_APP_INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.REACT_APP_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: process.env.REACT_APP_INTLAYER_APPLICATION_URL,\n editorURL: process.env.REACT_APP_INTLAYER_EDITOR_URL,\n cmsURL: process.env.REACT_APP_INTLAYER_CMS_URL,\n backendURL: process.env.REACT_APP_INTLAYER_BACKEND_URL,\n port: process.env.REACT_APP_INTLAYER_PORT,\n enabled: process.env.REACT_APP_INTLAYER_ENABLED,\n clientId: process.env.REACT_APP_INTLAYER_CLIENT_ID,\n clientSecret: process.env.REACT_APP_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.REACT_APP_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: process.env.REACT_APP_INTLAYER_HOT_RELOAD,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.REACT_APP_INTLAYER_LOG_MODE,\n prefix: process.env.REACT_APP_INTLAYER_LOG_PREFIX,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: process.env.REACT_APP_INTLAYER_AI_PROVIDER,\n model: process.env.REACT_APP_INTLAYER_AI_MODEL,\n temperature: process.env.REACT_APP_INTLAYER_AI_TEMPERATURE,\n apiKey: process.env.REACT_APP_INTLAYER_AI_API_KEY,\n applicationContext: process.env.REACT_APP_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: process.env.REACT_APP_INTLAYER_BUILD_OPTIMIZE,\n importMode: process.env.REACT_APP_INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: process.env.REACT_APP_INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAWO,MAAM,6BAA6B,MAAiC;AACzE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,IAC3B,UAAU,QAAQ,IAAI;AAAA,IACtB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,UAAU,QAAQ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractReactAppEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.REACT_APP_INTLAYER_LOCALES,\n requiredLocales: process.env.REACT_APP_INTLAYER_REQUIRED_LOCALES,\n strictMode: process.env.REACT_APP_INTLAYER_STRICT_MODE,\n defaultLocale: process.env.REACT_APP_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.REACT_APP_INTLAYER_HEADER_NAME,\n cookieName: process.env.REACT_APP_INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.REACT_APP_INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.REACT_APP_INTLAYER_BASE_PATH,\n serverSetCookie: process.env.REACT_APP_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.REACT_APP_INTLAYER_NO_PREFIX,\n detectLocaleOnPrefetchNoPrefix:\n process.env.REACT_APP_INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.REACT_APP_INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.REACT_APP_INTLAYER_BASE_DIR,\n contentDir: process.env.REACT_APP_INTLAYER_CONTENT_DIR,\n excludedPath: process.env.REACT_APP_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: process.env.REACT_APP_INTLAYER_RESULT_DIR,\n unmergedDictionariesDir:\n process.env.REACT_APP_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n dynamicDictionariesDir:\n process.env.REACT_APP_INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n moduleAugmentationDir:\n process.env.REACT_APP_INTLAYER_MODULE_AUGMENTATION_DIR,\n i18nextResourcesDir: process.env.REACT_APP_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir:\n process.env.REACT_APP_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: process.env.REACT_APP_INTLAYER_TYPE_DIR,\n mainDir: process.env.REACT_APP_INTLAYER_MAIN_DIR,\n configDir: process.env.REACT_APP_INTLAYER_CONFIG_DIR,\n watchedFilesPattern: process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.REACT_APP_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.REACT_APP_INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.REACT_APP_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: process.env.REACT_APP_INTLAYER_APPLICATION_URL,\n editorURL: process.env.REACT_APP_INTLAYER_EDITOR_URL,\n cmsURL: process.env.REACT_APP_INTLAYER_CMS_URL,\n backendURL: process.env.REACT_APP_INTLAYER_BACKEND_URL,\n port: process.env.REACT_APP_INTLAYER_PORT,\n enabled: process.env.REACT_APP_INTLAYER_ENABLED,\n clientId: process.env.REACT_APP_INTLAYER_CLIENT_ID,\n clientSecret: process.env.REACT_APP_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.REACT_APP_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: process.env.REACT_APP_INTLAYER_HOT_RELOAD,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.REACT_APP_INTLAYER_LOG_MODE,\n prefix: process.env.REACT_APP_INTLAYER_LOG_PREFIX,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: process.env.REACT_APP_INTLAYER_AI_PROVIDER,\n model: process.env.REACT_APP_INTLAYER_AI_MODEL,\n temperature: process.env.REACT_APP_INTLAYER_AI_TEMPERATURE,\n apiKey: process.env.REACT_APP_INTLAYER_AI_API_KEY,\n applicationContext: process.env.REACT_APP_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: process.env.REACT_APP_INTLAYER_BUILD_OPTIMIZE,\n importMode: process.env.REACT_APP_INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: process.env.REACT_APP_INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAWO,MAAM,6BAA6B,MAAiC;AACzE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,IAC3B,UAAU,QAAQ,IAAI;AAAA,IACtB,iBAAiB,QAAQ,IAAI;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IAAI;AAAA,IACzB,QAAQ,QAAQ,IAAI;AAAA,IACpB,oBAAoB,QAAQ,IAAI;AAAA,EAClC;AAEA,QAAM,QAAmC;AAAA,IACvC,UAAU,QAAQ,IAAI;AAAA,IACtB,YAAY,QAAQ,IAAI;AAAA,IACxB,iBAAiB,QAAQ,IAAI;AAAA,EAC/B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -11,7 +11,8 @@ const extractEmptyEnvVariable = () => {
|
|
|
11
11
|
prefixDefault: process.env.INTLAYER_PREFIX_DEFAULT,
|
|
12
12
|
basePath: process.env.INTLAYER_BASE_PATH,
|
|
13
13
|
serverSetCookie: process.env.INTLAYER_SERVER_SET_COOKIE,
|
|
14
|
-
noPrefix: process.env.INTLAYER_NO_PREFIX
|
|
14
|
+
noPrefix: process.env.INTLAYER_NO_PREFIX,
|
|
15
|
+
detectLocaleOnPrefetchNoPrefix: process.env.INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX
|
|
15
16
|
};
|
|
16
17
|
const content = {
|
|
17
18
|
fileExtensions: process.env.INTLAYER_FILE_EXTENSIONS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractEmptyEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.INTLAYER_LOCALES,\n requiredLocales: process.env.INTLAYER_REQUIRED_LOCALES,\n strictMode: process.env.INTLAYER_STRICT_MODE,\n defaultLocale: process.env.INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.INTLAYER_HEADER_NAME,\n cookieName: process.env.INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.INTLAYER_BASE_PATH,\n serverSetCookie: process.env.INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.INTLAYER_BASE_DIR,\n contentDir: process.env.INTLAYER_CONTENT_DIR,\n excludedPath: process.env.INTLAYER_EXCLUDED_PATH,\n dictionariesDir: process.env.INTLAYER_RESULT_DIR,\n unmergedDictionariesDir: process.env.INTLAYER_UNMERGED_DICTIONARIES_DIR,\n dynamicDictionariesDir: process.env.INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n moduleAugmentationDir: process.env.INTLAYER_MODULE_AUGMENTATION_DIR,\n i18nextResourcesDir: process.env.INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: process.env.INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: process.env.INTLAYER_TYPE_DIR,\n mainDir: process.env.INTLAYER_MAIN_DIR,\n configDir: process.env.INTLAYER_CONFIG_DIR,\n watchedFilesPattern: process.env.INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: process.env.INTLAYER_APPLICATION_URL,\n editorURL: process.env.INTLAYER_EDITOR_URL,\n cmsURL: process.env.INTLAYER_CMS_URL,\n backendURL: process.env.INTLAYER_BACKEND_URL,\n port: process.env.INTLAYER_PORT,\n enabled: process.env.INTLAYER_ENABLED,\n clientId: process.env.INTLAYER_CLIENT_ID,\n clientSecret: process.env.INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: process.env.INTLAYER_HOT_RELOAD,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: process.env.INTLAYER_AI_PROVIDER,\n model: process.env.INTLAYER_AI_MODEL,\n temperature: process.env.INTLAYER_AI_TEMPERATURE,\n apiKey: process.env.INTLAYER_AI_API_KEY,\n applicationContext: process.env.INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.INTLAYER_LOG_MODE,\n prefix: process.env.INTLAYER_LOG_PREFIX,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: process.env.INTLAYER_BUILD_OPTIMIZE,\n importMode: process.env.INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: process.env.INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAWO,MAAM,0BAA0B,MAAiC;AACtE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,EAC7B;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,QAAQ,IAAI;AAAA,IACxB,YAAY,QAAQ,IAAI;AAAA,IACxB,eAAe,QAAQ,IAAI;AAAA,IAC3B,UAAU,QAAQ,IAAI;AAAA,IACtB,iBAAiB,QAAQ,IAAI;AAAA,IAC7B,UAAU,QAAQ,IAAI;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\n\nexport const extractEmptyEnvVariable = (): IntlayerConfigEnvVariable => {\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: process.env.INTLAYER_LOCALES,\n requiredLocales: process.env.INTLAYER_REQUIRED_LOCALES,\n strictMode: process.env.INTLAYER_STRICT_MODE,\n defaultLocale: process.env.INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: process.env.INTLAYER_HEADER_NAME,\n cookieName: process.env.INTLAYER_COOKIE_NAME,\n prefixDefault: process.env.INTLAYER_PREFIX_DEFAULT,\n basePath: process.env.INTLAYER_BASE_PATH,\n serverSetCookie: process.env.INTLAYER_SERVER_SET_COOKIE,\n noPrefix: process.env.INTLAYER_NO_PREFIX,\n detectLocaleOnPrefetchNoPrefix:\n process.env.INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: process.env.INTLAYER_FILE_EXTENSIONS,\n baseDir: process.env.INTLAYER_BASE_DIR,\n contentDir: process.env.INTLAYER_CONTENT_DIR,\n excludedPath: process.env.INTLAYER_EXCLUDED_PATH,\n dictionariesDir: process.env.INTLAYER_RESULT_DIR,\n unmergedDictionariesDir: process.env.INTLAYER_UNMERGED_DICTIONARIES_DIR,\n dynamicDictionariesDir: process.env.INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n moduleAugmentationDir: process.env.INTLAYER_MODULE_AUGMENTATION_DIR,\n i18nextResourcesDir: process.env.INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: process.env.INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: process.env.INTLAYER_TYPE_DIR,\n mainDir: process.env.INTLAYER_MAIN_DIR,\n configDir: process.env.INTLAYER_CONFIG_DIR,\n watchedFilesPattern: process.env.INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath:\n process.env.INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath:\n process.env.INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: process.env.INTLAYER_DICTIONARY_OUTPUT,\n watch: process.env.INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: process.env.INTLAYER_APPLICATION_URL,\n editorURL: process.env.INTLAYER_EDITOR_URL,\n cmsURL: process.env.INTLAYER_CMS_URL,\n backendURL: process.env.INTLAYER_BACKEND_URL,\n port: process.env.INTLAYER_PORT,\n enabled: process.env.INTLAYER_ENABLED,\n clientId: process.env.INTLAYER_CLIENT_ID,\n clientSecret: process.env.INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy:\n process.env.INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: process.env.INTLAYER_HOT_RELOAD,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: process.env.INTLAYER_AI_PROVIDER,\n model: process.env.INTLAYER_AI_MODEL,\n temperature: process.env.INTLAYER_AI_TEMPERATURE,\n apiKey: process.env.INTLAYER_AI_API_KEY,\n applicationContext: process.env.INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: process.env.INTLAYER_LOG_MODE,\n prefix: process.env.INTLAYER_LOG_PREFIX,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: process.env.INTLAYER_BUILD_OPTIMIZE,\n importMode: process.env.INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: process.env.INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAWO,MAAM,0BAA0B,MAAiC;AACtE,QAAM,uBAAiE;AAAA,IACrE,SAAS,QAAQ,IAAI;AAAA,IACrB,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c,QAAQ,IAAI;AAAA,IAC1B,4BACE,QAAQ,IAAI;AAAA,IACd,WAAW,QAAQ,IAAI;AAAA,EACzB;AAEA,QAAM,KAA6B;AAAA,IACjC,UAAU,QAAQ,IAAI;AAAA,IACtB,OAAO,QAAQ,IAAI;AAAA,IACnB,aAAa,QAAQ,IAAI;AAAA,IACzB,QAAQ,QAAQ,IAAI;AAAA,IACpB,oBAAoB,QAAQ,IAAI;AAAA,EAClC;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,QAAQ,IAAI;AAAA,IAClB,QAAQ,QAAQ,IAAI;AAAA,EACtB;AAEA,QAAM,QAAmC;AAAA,IACvC,UAAU,QAAQ,IAAI;AAAA,IACtB,YAAY,QAAQ,IAAI;AAAA,IACxB,iBAAiB,QAAQ,IAAI;AAAA,EAC/B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -19,7 +19,8 @@ const extractViteEnvVariable = () => {
|
|
|
19
19
|
prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,
|
|
20
20
|
basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,
|
|
21
21
|
serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,
|
|
22
|
-
noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX
|
|
22
|
+
noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,
|
|
23
|
+
detectLocaleOnPrefetchNoPrefix: import.meta.env.VITE_INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX
|
|
23
24
|
};
|
|
24
25
|
const content = {
|
|
25
26
|
fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"sourcesContent":["import { logger } from '../../logger';\nimport type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\n\nexport const extractViteEnvVariable = (): IntlayerConfigEnvVariable => {\n if (!import.meta.env) {\n logger('Vite env variables cannot be loaded on a commonjs environment.', {\n level: 'error',\n });\n return extractEmptyEnvVariable();\n }\n\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: import.meta.env.VITE_INTLAYER_LOCALES,\n requiredLocales: import.meta.env.VITE_INTLAYER_REQUIRED_LOCALES,\n strictMode: import.meta.env.VITE_INTLAYER_STRICT_MODE,\n defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,\n cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,\n prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,\n basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,\n serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,\n baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,\n contentDir: import.meta.env.VITE_INTLAYER_CONTENT_DIR,\n excludedPath: import.meta.env.VITE_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,\n moduleAugmentationDir: import.meta.env\n .VITE_INTLAYER_MODULE_AUGMENTATION_DIR,\n unmergedDictionariesDir: import.meta.env\n .VITE_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n dynamicDictionariesDir: import.meta.env\n .VITE_INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n i18nextResourcesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: import.meta.env\n .VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,\n mainDir: import.meta.env.VITE_INTLAYER_MAIN_DIR,\n configDir: import.meta.env.VITE_INTLAYER_CONFIG_DIR,\n watchedFilesPattern: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: import.meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT,\n watch: import.meta.env.VITE_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: import.meta.env.VITE_INTLAYER_APPLICATION_URL,\n editorURL: import.meta.env.VITE_INTLAYER_EDITOR_URL,\n cmsURL: import.meta.env.VITE_INTLAYER_CMS_URL,\n backendURL: import.meta.env.VITE_INTLAYER_BACKEND_URL,\n port: import.meta.env.VITE_INTLAYER_PORT,\n enabled: import.meta.env.VITE_INTLAYER_ENABLED,\n clientId: import.meta.env.VITE_INTLAYER_CLIENT_ID,\n clientSecret: import.meta.env.VITE_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy: import.meta.env\n .VITE_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: import.meta.env.VITE_INTLAYER_HOT_RELOAD,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: import.meta.env.VITE_INTLAYER_LOG_MODE,\n prefix: import.meta.env.VITE_INTLAYER_LOG_PREFIX,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: import.meta.env.VITE_INTLAYER_AI_PROVIDER,\n model: import.meta.env.VITE_INTLAYER_AI_MODEL,\n temperature: import.meta.env.VITE_INTLAYER_AI_TEMPERATURE,\n apiKey: import.meta.env.VITE_INTLAYER_AI_API_KEY,\n applicationContext: import.meta.env.VITE_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: import.meta.env.VITE_INTLAYER_BUILD_OPTIMIZE,\n importMode: import.meta.env.VITE_INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: import.meta.env.VITE_INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAAA,SAAS,cAAc;AAWvB,SAAS,+BAA+B;AAEjC,MAAM,yBAAyB,MAAiC;AACrE,MAAI,CAAC,YAAY,KAAK;AACpB,WAAO,kEAAkE;AAAA,MACvE,OAAO;AAAA,IACT,CAAC;AACD,WAAO,wBAAwB;AAAA,EACjC;AAEA,QAAM,uBAAiE;AAAA,IACrE,SAAS,YAAY,IAAI;AAAA,IACzB,iBAAiB,YAAY,IAAI;AAAA,IACjC,YAAY,YAAY,IAAI;AAAA,IAC5B,eAAe,YAAY,IAAI;AAAA,EACjC;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,YAAY,IAAI;AAAA,IAC5B,YAAY,YAAY,IAAI;AAAA,IAC5B,eAAe,YAAY,IAAI;AAAA,IAC/B,UAAU,YAAY,IAAI;AAAA,IAC1B,iBAAiB,YAAY,IAAI;AAAA,IACjC,UAAU,YAAY,IAAI;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"sourcesContent":["import { logger } from '../../logger';\nimport type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n EditorConfig,\n InternationalizationConfig,\n LogConfig,\n MiddlewareConfig,\n} from '../../types/config';\nimport type { IntlayerConfigEnvVariable, ReplaceValue } from './types';\nimport { extractEmptyEnvVariable } from './undefined_platform';\n\nexport const extractViteEnvVariable = (): IntlayerConfigEnvVariable => {\n if (!import.meta.env) {\n logger('Vite env variables cannot be loaded on a commonjs environment.', {\n level: 'error',\n });\n return extractEmptyEnvVariable();\n }\n\n const internationalization: ReplaceValue<InternationalizationConfig> = {\n locales: import.meta.env.VITE_INTLAYER_LOCALES,\n requiredLocales: import.meta.env.VITE_INTLAYER_REQUIRED_LOCALES,\n strictMode: import.meta.env.VITE_INTLAYER_STRICT_MODE,\n defaultLocale: import.meta.env.VITE_INTLAYER_DEFAULT_LOCALE,\n };\n\n const middleware: ReplaceValue<MiddlewareConfig> = {\n headerName: import.meta.env.VITE_INTLAYER_HEADER_NAME,\n cookieName: import.meta.env.VITE_INTLAYER_COOKIE_NAME,\n prefixDefault: import.meta.env.VITE_INTLAYER_PREFIX_DEFAULT,\n basePath: import.meta.env.VITE_INTLAYER_BASE_PATH,\n serverSetCookie: import.meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,\n noPrefix: import.meta.env.VITE_INTLAYER_NO_PREFIX,\n detectLocaleOnPrefetchNoPrefix: import.meta.env\n .VITE_INTLAYER_DETECT_LOCALE_ON_PREFETCH_NO_PREFIX,\n };\n\n const content: ReplaceValue<ContentConfig> = {\n fileExtensions: import.meta.env.VITE_INTLAYER_FILE_EXTENSIONS,\n baseDir: import.meta.env.VITE_INTLAYER_BASE_DIR,\n contentDir: import.meta.env.VITE_INTLAYER_CONTENT_DIR,\n excludedPath: import.meta.env.VITE_INTLAYER_EXCLUDED_PATH,\n dictionariesDir: import.meta.env.VITE_INTLAYER_RESULT_DIR,\n moduleAugmentationDir: import.meta.env\n .VITE_INTLAYER_MODULE_AUGMENTATION_DIR,\n unmergedDictionariesDir: import.meta.env\n .VITE_INTLAYER_UNMERGED_DICTIONARIES_DIR,\n dynamicDictionariesDir: import.meta.env\n .VITE_INTLAYER_DYNAMIC_DICTIONARIES_DIR,\n i18nextResourcesDir: import.meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,\n reactIntlMessagesDir: import.meta.env\n .VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,\n typesDir: import.meta.env.VITE_INTLAYER_TYPE_DIR,\n mainDir: import.meta.env.VITE_INTLAYER_MAIN_DIR,\n configDir: import.meta.env.VITE_INTLAYER_CONFIG_DIR,\n watchedFilesPattern: import.meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,\n watchedFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,\n outputFilesPatternWithPath: import.meta.env\n .VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,\n dictionaryOutput: import.meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT,\n watch: import.meta.env.VITE_INTLAYER_WATCH,\n };\n\n const editor: ReplaceValue<EditorConfig> = {\n applicationURL: import.meta.env.VITE_INTLAYER_APPLICATION_URL,\n editorURL: import.meta.env.VITE_INTLAYER_EDITOR_URL,\n cmsURL: import.meta.env.VITE_INTLAYER_CMS_URL,\n backendURL: import.meta.env.VITE_INTLAYER_BACKEND_URL,\n port: import.meta.env.VITE_INTLAYER_PORT,\n enabled: import.meta.env.VITE_INTLAYER_ENABLED,\n clientId: import.meta.env.VITE_INTLAYER_CLIENT_ID,\n clientSecret: import.meta.env.VITE_INTLAYER_CLIENT_SECRET,\n dictionaryPriorityStrategy: import.meta.env\n .VITE_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,\n hotReload: import.meta.env.VITE_INTLAYER_HOT_RELOAD,\n };\n\n const log: ReplaceValue<LogConfig> = {\n mode: import.meta.env.VITE_INTLAYER_LOG_MODE,\n prefix: import.meta.env.VITE_INTLAYER_LOG_PREFIX,\n };\n\n const ai: ReplaceValue<AiConfig> = {\n provider: import.meta.env.VITE_INTLAYER_AI_PROVIDER,\n model: import.meta.env.VITE_INTLAYER_AI_MODEL,\n temperature: import.meta.env.VITE_INTLAYER_AI_TEMPERATURE,\n apiKey: import.meta.env.VITE_INTLAYER_AI_API_KEY,\n applicationContext: import.meta.env.VITE_INTLAYER_AI_APPLICATION_CONTEXT,\n };\n\n const build: ReplaceValue<BuildConfig> = {\n optimize: import.meta.env.VITE_INTLAYER_BUILD_OPTIMIZE,\n importMode: import.meta.env.VITE_INTLAYER_BUILD_IMPORT_MODE,\n traversePattern: import.meta.env.VITE_INTLAYER_BUILD_TRAVERSE_PATTERN,\n };\n\n return {\n internationalization,\n middleware,\n content,\n editor,\n log,\n ai,\n build,\n };\n};\n"],"mappings":"AAAA,SAAS,cAAc;AAWvB,SAAS,+BAA+B;AAEjC,MAAM,yBAAyB,MAAiC;AACrE,MAAI,CAAC,YAAY,KAAK;AACpB,WAAO,kEAAkE;AAAA,MACvE,OAAO;AAAA,IACT,CAAC;AACD,WAAO,wBAAwB;AAAA,EACjC;AAEA,QAAM,uBAAiE;AAAA,IACrE,SAAS,YAAY,IAAI;AAAA,IACzB,iBAAiB,YAAY,IAAI;AAAA,IACjC,YAAY,YAAY,IAAI;AAAA,IAC5B,eAAe,YAAY,IAAI;AAAA,EACjC;AAEA,QAAM,aAA6C;AAAA,IACjD,YAAY,YAAY,IAAI;AAAA,IAC5B,YAAY,YAAY,IAAI;AAAA,IAC5B,eAAe,YAAY,IAAI;AAAA,IAC/B,UAAU,YAAY,IAAI;AAAA,IAC1B,iBAAiB,YAAY,IAAI;AAAA,IACjC,UAAU,YAAY,IAAI;AAAA,IAC1B,gCAAgC,YAAY,IACzC;AAAA,EACL;AAEA,QAAM,UAAuC;AAAA,IAC3C,gBAAgB,YAAY,IAAI;AAAA,IAChC,SAAS,YAAY,IAAI;AAAA,IACzB,YAAY,YAAY,IAAI;AAAA,IAC5B,cAAc,YAAY,IAAI;AAAA,IAC9B,iBAAiB,YAAY,IAAI;AAAA,IACjC,uBAAuB,YAAY,IAChC;AAAA,IACH,yBAAyB,YAAY,IAClC;AAAA,IACH,wBAAwB,YAAY,IACjC;AAAA,IACH,qBAAqB,YAAY,IAAI;AAAA,IACrC,sBAAsB,YAAY,IAC/B;AAAA,IACH,UAAU,YAAY,IAAI;AAAA,IAC1B,SAAS,YAAY,IAAI;AAAA,IACzB,WAAW,YAAY,IAAI;AAAA,IAC3B,qBAAqB,YAAY,IAAI;AAAA,IACrC,6BAA6B,YAAY,IACtC;AAAA,IACH,4BAA4B,YAAY,IACrC;AAAA,IACH,kBAAkB,YAAY,IAAI;AAAA,IAClC,OAAO,YAAY,IAAI;AAAA,EACzB;AAEA,QAAM,SAAqC;AAAA,IACzC,gBAAgB,YAAY,IAAI;AAAA,IAChC,WAAW,YAAY,IAAI;AAAA,IAC3B,QAAQ,YAAY,IAAI;AAAA,IACxB,YAAY,YAAY,IAAI;AAAA,IAC5B,MAAM,YAAY,IAAI;AAAA,IACtB,SAAS,YAAY,IAAI;AAAA,IACzB,UAAU,YAAY,IAAI;AAAA,IAC1B,cAAc,YAAY,IAAI;AAAA,IAC9B,4BAA4B,YAAY,IACrC;AAAA,IACH,WAAW,YAAY,IAAI;AAAA,EAC7B;AAEA,QAAM,MAA+B;AAAA,IACnC,MAAM,YAAY,IAAI;AAAA,IACtB,QAAQ,YAAY,IAAI;AAAA,EAC1B;AAEA,QAAM,KAA6B;AAAA,IACjC,UAAU,YAAY,IAAI;AAAA,IAC1B,OAAO,YAAY,IAAI;AAAA,IACvB,aAAa,YAAY,IAAI;AAAA,IAC7B,QAAQ,YAAY,IAAI;AAAA,IACxB,oBAAoB,YAAY,IAAI;AAAA,EACtC;AAEA,QAAM,QAAmC;AAAA,IACvC,UAAU,YAAY,IAAI;AAAA,IAC1B,YAAY,YAAY,IAAI;AAAA,IAC5B,iBAAiB,YAAY,IAAI;AAAA,EACnC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -28,7 +28,11 @@ const getConfiguration = (options) => {
|
|
|
28
28
|
env.middleware.serverSetCookie,
|
|
29
29
|
"string"
|
|
30
30
|
),
|
|
31
|
-
noPrefix: getEnvValue(env.middleware.noPrefix, "boolean")
|
|
31
|
+
noPrefix: getEnvValue(env.middleware.noPrefix, "boolean"),
|
|
32
|
+
detectLocaleOnPrefetchNoPrefix: getEnvValue(
|
|
33
|
+
env.middleware.detectLocaleOnPrefetchNoPrefix,
|
|
34
|
+
"boolean"
|
|
35
|
+
)
|
|
32
36
|
};
|
|
33
37
|
const intlayerContentConfiguration = {
|
|
34
38
|
fileExtensions: getEnvValue(env.content.fileExtensions, "array"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n StrictMode,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport {\n extractEnvVariable,\n type ExtractEnvVariableOptions,\n} from './extractEnvVariable/index';\nimport { getEnvValue } from './utils';\n\n/**\n * Get all configuration values using environment variables\n * Can be used in the client side as the server side\n * To use it, be sure to have the environment variables set\n */\nexport const getConfiguration = (\n options?: ExtractEnvVariableOptions\n): IntlayerConfig => {\n const env = extractEnvVariable(options);\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\n requiredLocales: getEnvValue<Locales>(\n env.internationalization.requiredLocales,\n 'array'\n )!,\n strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n contentDir: getEnvValue<string>(env.content.contentDir, 'array')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n unmergedDictionariesDir: getEnvValue(\n env.content.unmergedDictionariesDir,\n 'string'\n )!,\n dynamicDictionariesDir: getEnvValue(\n env.content.dynamicDictionariesDir,\n 'string'\n )!,\n i18nextResourcesDir: getEnvValue(\n env.content.i18nextResourcesDir,\n 'string'\n )!,\n reactIntlMessagesDir: getEnvValue(\n env.content.reactIntlMessagesDir,\n 'string'\n )!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, 'string')!,\n configDir: getEnvValue(env.content.configDir, 'string')!,\n watchedFilesPattern: getEnvValue<string>(\n env.content.watchedFilesPattern,\n 'array'\n )!,\n watchedFilesPatternWithPath: getEnvValue<string>(\n env.content.watchedFilesPatternWithPath,\n 'array'\n )!,\n outputFilesPatternWithPath: getEnvValue(\n env.content.outputFilesPatternWithPath,\n 'string'\n )!,\n watch: getEnvValue(env.content.watch, 'boolean')!,\n };\n\n const intlayerEditorConfiguration = {\n applicationURL: getEnvValue(env.editor.applicationURL, 'string')!,\n editorURL: getEnvValue(env.editor.editorURL, 'string')!,\n cmsURL: getEnvValue(env.editor.cmsURL, 'string')!,\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n port: getEnvValue(env.editor.port, 'number')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'local_first' | 'distant_first',\n hotReload: getEnvValue(env.editor.hotReload, 'boolean')!,\n };\n\n const logConfiguration: LogConfig = {\n mode: getEnvValue(env.log.mode, 'string')!,\n prefix: getEnvValue(env.log.prefix, 'string')!,\n };\n\n const aiConfiguration: AiConfig = {\n provider: getEnvValue(env.ai?.provider, 'string')!,\n model: getEnvValue(env.ai?.model, 'string')!,\n temperature: getEnvValue(env.ai?.temperature, 'number')!,\n apiKey: getEnvValue(env.ai?.apiKey, 'string')!,\n };\n\n const buildConfiguration: BuildConfig = {\n optimize: getEnvValue(env.build.optimize, 'boolean')!,\n importMode: getEnvValue(env.build.importMode, 'string')!,\n traversePattern: getEnvValue<string>(env.build.traversePattern, 'array')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n log: logConfiguration,\n ai: aiConfiguration,\n build: buildConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":"AAaA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,mBAAmB;AAOrB,MAAM,mBAAmB,CAC9B,YACmB;AACnB,QAAM,MAAM,mBAAmB,OAAO;AAEtC,QAAM,4BAAwD;AAAA,IAC5D,SAAS,YAAqB,IAAI,qBAAqB,SAAS,OAAO;AAAA,IACvE,iBAAiB;AAAA,MACf,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,eAAe;AAAA,MACb,KAAK,qBAAqB;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kCAAoD;AAAA,IACxD,YAAY,YAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,YAAY,YAAY,IAAI,WAAW,YAAY,QAAQ;AAAA,IAC3D,eAAe,YAAY,IAAI,WAAW,eAAe,SAAS;AAAA,IAClE,UAAU,YAAY,IAAI,WAAW,UAAU,QAAQ;AAAA,IACvD,iBAAiB;AAAA,MACf,IAAI,WAAW;AAAA,MACf;AAAA,IACF;AAAA,IACA,UAAU,YAAY,IAAI,WAAW,UAAU,SAAS;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/envVariables/getConfiguration.ts"],"sourcesContent":["import type {\n AiConfig,\n BuildConfig,\n ContentConfig,\n DictionaryOutput,\n InternationalizationConfig,\n IntlayerConfig,\n LogConfig,\n MiddlewareConfig,\n ServerSetCookieRule,\n StrictMode,\n} from '../types/config';\nimport type { Locales } from '../types/locales';\nimport {\n extractEnvVariable,\n type ExtractEnvVariableOptions,\n} from './extractEnvVariable/index';\nimport { getEnvValue } from './utils';\n\n/**\n * Get all configuration values using environment variables\n * Can be used in the client side as the server side\n * To use it, be sure to have the environment variables set\n */\nexport const getConfiguration = (\n options?: ExtractEnvVariableOptions\n): IntlayerConfig => {\n const env = extractEnvVariable(options);\n\n const intlayerIntlConfiguration: InternationalizationConfig = {\n locales: getEnvValue<Locales>(env.internationalization.locales, 'array')!,\n requiredLocales: getEnvValue<Locales>(\n env.internationalization.requiredLocales,\n 'array'\n )!,\n strictMode: getEnvValue<StrictMode>(\n env.internationalization.strictMode,\n 'string'\n )!,\n defaultLocale: getEnvValue<Locales>(\n env?.internationalization.defaultLocale,\n 'string'\n )!,\n };\n\n const intlayerMiddlewareConfiguration: MiddlewareConfig = {\n headerName: getEnvValue(env.middleware.headerName, 'string')!,\n cookieName: getEnvValue(env.middleware.cookieName, 'string')!,\n prefixDefault: getEnvValue(env.middleware.prefixDefault, 'boolean')!,\n basePath: getEnvValue(env.middleware.basePath, 'string')!,\n serverSetCookie: getEnvValue<ServerSetCookieRule>(\n env.middleware.serverSetCookie,\n 'string'\n )!,\n noPrefix: getEnvValue(env.middleware.noPrefix, 'boolean')!,\n detectLocaleOnPrefetchNoPrefix: getEnvValue(\n env.middleware.detectLocaleOnPrefetchNoPrefix,\n 'boolean'\n )!,\n };\n\n const intlayerContentConfiguration: ContentConfig = {\n fileExtensions: getEnvValue<string>(env.content.fileExtensions, 'array')!,\n baseDir: getEnvValue(env.content.baseDir, 'string')!,\n contentDir: getEnvValue<string>(env.content.contentDir, 'array')!,\n excludedPath: getEnvValue<string>(env.content.excludedPath, 'array')!,\n dictionariesDir: getEnvValue(env.content.dictionariesDir, 'string')!,\n moduleAugmentationDir: getEnvValue(\n env.content.moduleAugmentationDir,\n 'string'\n )!,\n dictionaryOutput: getEnvValue<DictionaryOutput>(\n env.content.dictionaryOutput,\n 'array'\n )!,\n unmergedDictionariesDir: getEnvValue(\n env.content.unmergedDictionariesDir,\n 'string'\n )!,\n dynamicDictionariesDir: getEnvValue(\n env.content.dynamicDictionariesDir,\n 'string'\n )!,\n i18nextResourcesDir: getEnvValue(\n env.content.i18nextResourcesDir,\n 'string'\n )!,\n reactIntlMessagesDir: getEnvValue(\n env.content.reactIntlMessagesDir,\n 'string'\n )!,\n typesDir: getEnvValue(env.content.typesDir, 'string')!,\n mainDir: getEnvValue(env.content.mainDir, 'string')!,\n configDir: getEnvValue(env.content.configDir, 'string')!,\n watchedFilesPattern: getEnvValue<string>(\n env.content.watchedFilesPattern,\n 'array'\n )!,\n watchedFilesPatternWithPath: getEnvValue<string>(\n env.content.watchedFilesPatternWithPath,\n 'array'\n )!,\n outputFilesPatternWithPath: getEnvValue(\n env.content.outputFilesPatternWithPath,\n 'string'\n )!,\n watch: getEnvValue(env.content.watch, 'boolean')!,\n };\n\n const intlayerEditorConfiguration = {\n applicationURL: getEnvValue(env.editor.applicationURL, 'string')!,\n editorURL: getEnvValue(env.editor.editorURL, 'string')!,\n cmsURL: getEnvValue(env.editor.cmsURL, 'string')!,\n backendURL: getEnvValue(env.editor.backendURL, 'string')!,\n port: getEnvValue(env.editor.port, 'number')!,\n enabled: getEnvValue(env.editor.enabled, 'boolean')!,\n clientId: getEnvValue(env.editor.clientId, 'string')!,\n clientSecret: getEnvValue(env.editor.clientSecret, 'string')!,\n dictionaryPriorityStrategy: getEnvValue(\n env.editor.dictionaryPriorityStrategy,\n 'string'\n )! as 'local_first' | 'distant_first',\n hotReload: getEnvValue(env.editor.hotReload, 'boolean')!,\n };\n\n const logConfiguration: LogConfig = {\n mode: getEnvValue(env.log.mode, 'string')!,\n prefix: getEnvValue(env.log.prefix, 'string')!,\n };\n\n const aiConfiguration: AiConfig = {\n provider: getEnvValue(env.ai?.provider, 'string')!,\n model: getEnvValue(env.ai?.model, 'string')!,\n temperature: getEnvValue(env.ai?.temperature, 'number')!,\n apiKey: getEnvValue(env.ai?.apiKey, 'string')!,\n };\n\n const buildConfiguration: BuildConfig = {\n optimize: getEnvValue(env.build.optimize, 'boolean')!,\n importMode: getEnvValue(env.build.importMode, 'string')!,\n traversePattern: getEnvValue<string>(env.build.traversePattern, 'array')!,\n };\n\n const intlayerConfiguration: IntlayerConfig = {\n internationalization: intlayerIntlConfiguration,\n middleware: intlayerMiddlewareConfiguration,\n content: intlayerContentConfiguration,\n editor: intlayerEditorConfiguration,\n log: logConfiguration,\n ai: aiConfiguration,\n build: buildConfiguration,\n };\n\n return intlayerConfiguration;\n};\n"],"mappings":"AAaA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,mBAAmB;AAOrB,MAAM,mBAAmB,CAC9B,YACmB;AACnB,QAAM,MAAM,mBAAmB,OAAO;AAEtC,QAAM,4BAAwD;AAAA,IAC5D,SAAS,YAAqB,IAAI,qBAAqB,SAAS,OAAO;AAAA,IACvE,iBAAiB;AAAA,MACf,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,IAAI,qBAAqB;AAAA,MACzB;AAAA,IACF;AAAA,IACA,eAAe;AAAA,MACb,KAAK,qBAAqB;AAAA,MAC1B;AAAA,I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BAAkC;AAAA,IACtC,UAAU,YAAY,IAAI,MAAM,UAAU,SAAS;AAAA,IACnD,YAAY,YAAY,IAAI,MAAM,YAAY,QAAQ;AAAA,IACtD,iBAAiB,YAAoB,IAAI,MAAM,iBAAiB,OAAO;AAAA,EACzE;AAEA,QAAM,wBAAwC;AAAA,IAC5C,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.d.ts","sourceRoot":"","sources":["../../../src/configFile/buildConfigurationFields.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAMV,oBAAoB,EAGpB,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAwqBzB;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,sBAAsB,oBAAoB,EAC1C,UAAU,MAAM,KACf,cAiCF,CAAC"}
|
|
@@ -4,4 +4,5 @@ export declare const PREFIX_DEFAULT = false;
|
|
|
4
4
|
export declare const BASE_PATH = "";
|
|
5
5
|
export declare const SERVER_SET_COOKIE = "always";
|
|
6
6
|
export declare const NO_PREFIX = false;
|
|
7
|
+
export declare const DETECT_LOCALE_ON_PREFETCH_NO_PREFIX = false;
|
|
7
8
|
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/middleware.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAE7C,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,SAAS,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/defaultValues/middleware.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAE7C,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,SAAS,QAAQ,CAAC;AAE/B,eAAO,MAAM,mCAAmC,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,sBAAsB,QAAO,
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/next.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,sBAAsB,QAAO,yBAwFzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react_app.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,0BAA0B,QAAO,
|
|
1
|
+
{"version":3,"file":"react_app.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/react_app.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,0BAA0B,QAAO,yBAwF7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undefined_platform.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,uBAAuB,QAAO,
|
|
1
|
+
{"version":3,"file":"undefined_platform.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/undefined_platform.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,uBAAuB,QAAO,yBAoF1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAGvE,eAAO,MAAM,sBAAsB,QAAO,
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../../src/envVariables/extractEnvVariable/vite.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,MAAM,SAAS,CAAC;AAGvE,eAAO,MAAM,sBAAsB,QAAO,yBA+FzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/envVariables/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AAGpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,yBAAyB,KAClC,
|
|
1
|
+
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/envVariables/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,cAAc,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AAGpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,yBAAyB,KAClC,cAgIF,CAAC"}
|
|
@@ -98,6 +98,38 @@ export type MiddlewareConfig = {
|
|
|
98
98
|
* If true, no locale-based prefix is used in the URL.
|
|
99
99
|
*/
|
|
100
100
|
noPrefix: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Controls whether locale detection occurs during Next.js prefetch requests
|
|
103
|
+
* - true: Detect and apply locale during prefetch
|
|
104
|
+
* - false: Use default locale during prefetch (recommended)
|
|
105
|
+
*
|
|
106
|
+
* This setting affects how Next.js handles locale prefetching:
|
|
107
|
+
*
|
|
108
|
+
* Example scenario:
|
|
109
|
+
* - User's browser language is 'fr'
|
|
110
|
+
* - Current page is /fr/about
|
|
111
|
+
* - Link prefetches /about
|
|
112
|
+
*
|
|
113
|
+
* With `detectLocaleOnPrefetchNoPrefix:true`
|
|
114
|
+
* - Prefetch detects 'fr' locale from browser
|
|
115
|
+
* - Redirects prefetch to /fr/about
|
|
116
|
+
*
|
|
117
|
+
* With `detectLocaleOnPrefetchNoPrefix:false` (default)
|
|
118
|
+
* - Prefetch uses default locale
|
|
119
|
+
* - Redirects prefetch to /en/about (assuming 'en' is default)
|
|
120
|
+
*
|
|
121
|
+
* When to use true:
|
|
122
|
+
* - Your app uses non-localized internal links (e.g. <a href="/about">)
|
|
123
|
+
* - You want consistent locale detection behavior between regular and prefetch requests
|
|
124
|
+
*
|
|
125
|
+
* When to use false (default):
|
|
126
|
+
* - Your app uses locale-prefixed links (e.g. <a href="/fr/about">)
|
|
127
|
+
* - You want to optimize prefetching performance
|
|
128
|
+
* - You want to avoid potential redirect loops
|
|
129
|
+
*
|
|
130
|
+
* Default: false
|
|
131
|
+
*/
|
|
132
|
+
detectLocaleOnPrefetchNoPrefix: boolean;
|
|
101
133
|
};
|
|
102
134
|
/**
|
|
103
135
|
* Configuration for intlayer editor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB;;;;;;;;OAQG;IACH,eAAe,EAAE,OAAO,EAAE,CAAC;IAE3B;;;;;;;OAOG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;;;;;OAMG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;OAWG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,EAAE,mBAAmB,CAAC;IAErC;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1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;;;;OASG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;;;OAMG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAE9B;;;;;;OAMG;IACH,2BAA2B,EAAE,MAAM,EAAE,CAAC;IAEtC;;;;;;OAMG;IACH,0BAA0B,EAAE,MAAM,CAAC;CACpC,CAAC;AAGF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,iBAAiB,GACjB,sBAAsB,GACtB,qBAAqB,CAAC;AAExB,MAAM,MAAM,SAAS,GAAG;IACtB;;;;;;;;OAQG;IACH,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAEzC;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/config",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.5",
|
|
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": [
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
"tsup": "^8.5.0",
|
|
85
85
|
"typescript": "^5.8.3",
|
|
86
86
|
"vitest": "^3.2.2",
|
|
87
|
-
"@utils/eslint-config": "1.0.4",
|
|
88
87
|
"@utils/ts-config": "1.0.4",
|
|
89
88
|
"@utils/ts-config-types": "1.0.4",
|
|
90
|
-
"@utils/tsup-config": "1.0.4"
|
|
89
|
+
"@utils/tsup-config": "1.0.4",
|
|
90
|
+
"@utils/eslint-config": "1.0.4"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"intlayer": "5.7.
|
|
93
|
+
"intlayer": "5.7.5"
|
|
94
94
|
},
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": ">=14.18"
|