@intlayer/engine 9.5.12 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/installSkills/skills/cli.md +28 -1
- package/dist/assets/installSkills/skills/compat.md +1 -1
- package/dist/assets/installSkills/skills/dev-tools.md +8 -6
- package/dist/cjs/cli.cjs +2 -0
- package/dist/cjs/init/index.cjs +12 -2
- package/dist/cjs/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/packageManager.cjs +1 -1
- package/dist/cjs/init/utils/packageManager.cjs.map +1 -1
- package/dist/cjs/installMCP/installMCP.cjs +35 -25
- package/dist/cjs/installMCP/installMCP.cjs.map +1 -1
- package/dist/cjs/installSkills/index.cjs +26 -1
- package/dist/cjs/installSkills/index.cjs.map +1 -1
- package/dist/cjs/listGitFiles.cjs +3 -5
- package/dist/cjs/listGitFiles.cjs.map +1 -1
- package/dist/cjs/listProjects.cjs +1 -2
- package/dist/cjs/listProjects.cjs.map +1 -1
- package/dist/esm/cli.mjs +3 -3
- package/dist/esm/init/index.mjs +12 -2
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/packageManager.mjs +1 -1
- package/dist/esm/init/utils/packageManager.mjs.map +1 -1
- package/dist/esm/installMCP/installMCP.mjs +35 -25
- package/dist/esm/installMCP/installMCP.mjs.map +1 -1
- package/dist/esm/installSkills/index.mjs +27 -3
- package/dist/esm/installSkills/index.mjs.map +1 -1
- package/dist/esm/listGitFiles.mjs +1 -1
- package/dist/esm/listGitFiles.mjs.map +1 -1
- package/dist/esm/listProjects.mjs +1 -1
- package/dist/esm/listProjects.mjs.map +1 -1
- package/dist/esm/utils/runParallel/pidTree.mjs +3 -3
- package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
- package/dist/esm/utils/runParallel/ps.mjs +2 -2
- package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
- package/dist/esm/utils/runParallel/wmic.mjs +2 -2
- package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
- package/dist/types/cli.d.ts +3 -3
- package/dist/types/init/index.d.ts.map +1 -1
- package/dist/types/init/utils/packageManager.d.ts +5 -0
- package/dist/types/init/utils/packageManager.d.ts.map +1 -1
- package/dist/types/installMCP/installMCP.d.ts +4 -0
- package/dist/types/installMCP/installMCP.d.ts.map +1 -1
- package/dist/types/installSkills/index.d.ts +6 -0
- package/dist/types/installSkills/index.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: intlayer-cli
|
|
3
|
-
description:
|
|
3
|
+
description: Sets up Intlayer and manages its dictionaries and configuration via the Command Line Interface. Use when the user asks to "set up Intlayer", "audit translations", "build dictionaries", "sync content", or run "intlayer" commands.
|
|
4
4
|
metadata:
|
|
5
5
|
author: Intlayer
|
|
6
6
|
url: https://intlayer.org
|
|
@@ -22,6 +22,33 @@ The `intlayer-cli` package provides a set of commands to manage Intlayer diction
|
|
|
22
22
|
npm install intlayer-cli
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Set Up Intlayer
|
|
26
|
+
|
|
27
|
+
`npx intlayer init` installs the Intlayer packages and sets up the framework (config file, tsconfig, bundler plugin, middleware/proxy, providers). Every other setup step is opt-in, through its own sub-command:
|
|
28
|
+
|
|
29
|
+
| Command | Sets up |
|
|
30
|
+
| --------------------------------------------------------- | --------------------------------------------------------- |
|
|
31
|
+
| `npx intlayer init packages` | Missing Intlayer packages, and upgrades the outdated ones |
|
|
32
|
+
| `npx intlayer init project --routing <routing>` | The framework only (no install) |
|
|
33
|
+
| `npx intlayer init github-actions` | The `fill` and `test` GitHub Actions workflows |
|
|
34
|
+
| `npx intlayer init vscode-extension` | The VS Code extension recommendation |
|
|
35
|
+
| `npx intlayer init lsp` | The language server settings |
|
|
36
|
+
| `npx intlayer init eslint` | The lint rules, when the project already lints |
|
|
37
|
+
| `npx intlayer init skills --platform <p> --skills <s…>` | The Intlayer skills for an AI agent |
|
|
38
|
+
| `npx intlayer init mcp --platform <p> --transport stdio` | The Intlayer MCP server, inside the project |
|
|
39
|
+
| `npx intlayer init extension --browser chrome` | Opens the browser extension store page |
|
|
40
|
+
| `npx intlayer init cms` | CMS login through the browser (needs a person) |
|
|
41
|
+
| `npx intlayer init infra --mode <desktop/docker/compose>` | Desktop app or self-hosted stack |
|
|
42
|
+
|
|
43
|
+
`--routing` accepts `prefix-no-default` (default), `prefix-all`, `no-prefix`, `search-params` or `none`.
|
|
44
|
+
|
|
45
|
+
### As an AI agent
|
|
46
|
+
|
|
47
|
+
- Never run `npx intlayer init --interactive`: its checklist needs a terminal. Without one it exits with code 1 and lists the sub-commands above.
|
|
48
|
+
- Run `npx intlayer init`, then only the sub-commands the user asked for.
|
|
49
|
+
- Pass the values as flags so nothing is prompted. When omitted without a terminal: `--skills` defaults to the project stack, `--platform` to the detected agent (e.g. `Claude` for Claude Code), `--transport` to `stdio`; `init infra` requires `--mode`.
|
|
50
|
+
- Leave `init cms` and `init extension` to the user: both finish in their browser.
|
|
51
|
+
|
|
25
52
|
## Main CLI Commands
|
|
26
53
|
|
|
27
54
|
| Command | Description |
|
|
@@ -18,7 +18,7 @@ Compat adapters expose the **exact same public API** as an existing i18n library
|
|
|
18
18
|
|
|
19
19
|
## How it works
|
|
20
20
|
|
|
21
|
-
1. Run `npx intlayer init
|
|
21
|
+
1. Run `npx intlayer init`: it creates `intlayer.config.ts`, installs the adapter and can keep existing JSON catalogs as the source of truth via a sync plugin.
|
|
22
22
|
2. Register the adapter's bundler plugin (`<adapter>/plugin`). It aliases the original imports to the adapter at build time, so no import is rewritten by hand.
|
|
23
23
|
|
|
24
24
|
## Adapters
|
|
@@ -22,7 +22,7 @@ metadata:
|
|
|
22
22
|
npm install --save-dev eslint-plugin-intlayer
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Then spread `intlayer.configs.recommended` in your `eslint.config.mjs` (oxlint is also supported).
|
|
25
|
+
Then spread `intlayer.configs.recommended` in your `eslint.config.mjs` (oxlint is also supported). `npx intlayer init eslint` installs the plugin and wires the oxlint config for you (for an ESLint flat config, it prints the snippet to add).
|
|
26
26
|
|
|
27
27
|
| Config | `no-raw-text` | `static-dictionary-key` | `no-dynamic-field-access` |
|
|
28
28
|
| --------------- | ------------- | ----------------------- | ------------------------- |
|
|
@@ -38,25 +38,27 @@ Then spread `intlayer.configs.recommended` in your `eslint.config.mjs` (oxlint i
|
|
|
38
38
|
npm install --save-dev @intlayer/lsp
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
`npx intlayer init lsp` writes the language server settings to `.vscode/settings.json`.
|
|
42
|
+
|
|
41
43
|
## VS Code Extension
|
|
42
44
|
|
|
43
|
-
Jump from a dictionary key to its content file, extract content from a component, and run build, fill, test, push and pull from the command palette.
|
|
45
|
+
Jump from a dictionary key to its content file, extract content from a component, and run build, fill, test, push and pull from the command palette. `npx intlayer init vscode-extension` recommends it in `.vscode/extensions.json`.
|
|
44
46
|
|
|
45
47
|
## MCP Server
|
|
46
48
|
|
|
47
49
|
Gives AI assistants access to the Intlayer documentation and CLI.
|
|
48
50
|
|
|
49
51
|
```bash
|
|
50
|
-
npx intlayer init mcp
|
|
52
|
+
npx intlayer init mcp --platform Claude --transport stdio
|
|
51
53
|
```
|
|
52
54
|
|
|
53
|
-
This writes the MCP configuration for your IDE (local `@intlayer/mcp` over stdio
|
|
55
|
+
This writes the MCP configuration inside the project for your IDE or agent (`.mcp.json` for Claude Code, `.cursor/mcp.json`, `.vscode/mcp.json`, …), using the local `@intlayer/mcp` over stdio or the hosted `https://mcp.intlayer.org` over SSE. Both flags are optional: without them the platform is detected and the transport is prompted for, or defaults to `stdio` when there is no terminal.
|
|
54
56
|
|
|
55
57
|
A WebMCP is also available for the main website and documentation at `https://intlayer.org`.
|
|
56
58
|
|
|
57
59
|
## CI/CD
|
|
58
60
|
|
|
59
|
-
Fill missing translations with AI on each change, and fail the build on missing ones:
|
|
61
|
+
Fill missing translations with AI on each change, and fail the build on missing ones. `npx intlayer init github-actions` scaffolds both workflows:
|
|
60
62
|
|
|
61
63
|
```bash
|
|
62
64
|
npx intlayer fill --git-diff --mode complete
|
|
@@ -65,7 +67,7 @@ npx intlayer test
|
|
|
65
67
|
|
|
66
68
|
## Chrome Extension
|
|
67
69
|
|
|
68
|
-
Inspect the i18n setup of any website: framework, i18n library, locales, hreflang and SEO tags.
|
|
70
|
+
Inspect the i18n setup of any website: framework, i18n library, locales, hreflang and SEO tags. `npx intlayer init extension --browser chrome` opens its store page.
|
|
69
71
|
|
|
70
72
|
## References
|
|
71
73
|
|
package/dist/cjs/cli.cjs
CHANGED
|
@@ -23,6 +23,7 @@ const require_listGitFiles = require('./listGitFiles.cjs');
|
|
|
23
23
|
|
|
24
24
|
exports.COMPAT_I18N_LIBRARIES = require_init_utils_packageManager.COMPAT_I18N_LIBRARIES;
|
|
25
25
|
exports.DocumentationRouter = require_init_documentationRouter.DocumentationRouter;
|
|
26
|
+
exports.MCP_TRANSPORTS = require_installMCP_installMCP.MCP_TRANSPORTS;
|
|
26
27
|
exports.NEXT_INTLAYER_BABEL_CONFIG_CONTENT = require_init_utils_nextCompilerBabel.NEXT_INTLAYER_BABEL_CONFIG_CONTENT;
|
|
27
28
|
exports.PLATFORMS = require_installSkills_index.PLATFORMS;
|
|
28
29
|
exports.PLATFORMS_METADATA = require_installSkills_index.PLATFORMS_METADATA;
|
|
@@ -32,6 +33,7 @@ exports.detectCompatI18nLibraries = require_init_utils_packageManager.detectComp
|
|
|
32
33
|
exports.detectExportedComponentName = require_writeContentDeclaration_detectExportedComponentName.detectExportedComponentName;
|
|
33
34
|
exports.detectFormatCommand = require_detectFormatCommand.detectFormatCommand;
|
|
34
35
|
exports.detectPackageManager = require_init_utils_packageManager.detectPackageManager;
|
|
36
|
+
exports.detectPlatform = require_installSkills_index.detectPlatform;
|
|
35
37
|
exports.enableEditorInConfig = require_init_cms.enableEditorInConfig;
|
|
36
38
|
exports.findLockFileDir = require_init_utils_packageManager.findLockFileDir;
|
|
37
39
|
exports.getContentDeclarationFileTemplate = require_getContentDeclarationFileTemplate_getContentDeclarationFileTemplate.getContentDeclarationFileTemplate;
|
package/dist/cjs/init/index.cjs
CHANGED
|
@@ -63,7 +63,7 @@ const initIntlayer = async (rootDir, options) => {
|
|
|
63
63
|
...packageJson.dependencies ?? {},
|
|
64
64
|
...packageJson.devDependencies ?? {}
|
|
65
65
|
};
|
|
66
|
-
const movedPackages = require_init_utils_packageManager.moveCompatPackagesToDevDependencies(packageJson);
|
|
66
|
+
const movedPackages = options?.noInstallPackages ? [] : require_init_utils_packageManager.moveCompatPackagesToDevDependencies(packageJson);
|
|
67
67
|
if (movedPackages.length > 0) {
|
|
68
68
|
const indentation = packageJsonContent.match(/^[ \t]+(?=")/m)?.[0] ?? 2;
|
|
69
69
|
const trailingNewline = packageJsonContent.endsWith("\n") ? "\n" : "";
|
|
@@ -77,7 +77,8 @@ const initIntlayer = async (rootDir, options) => {
|
|
|
77
77
|
const { packagesToInstall, devPackagesToInstall, compatSyncConfig, compatVitePluginConfig, pendingCompatAdapters } = require_init_utils_packageManager.detectMissingIntlayerPackages(allDeps, {
|
|
78
78
|
linguiCatalogFormat,
|
|
79
79
|
dependencies: packageJson.dependencies,
|
|
80
|
-
devDependencies: packageJson.devDependencies
|
|
80
|
+
devDependencies: packageJson.devDependencies,
|
|
81
|
+
skipLintPlugin: options?.noEslint
|
|
81
82
|
});
|
|
82
83
|
/** Whether the compat adapter for a library is not released yet. */
|
|
83
84
|
const isCompatAdapterPending = (adapterPackage) => pendingCompatAdapters.includes(adapterPackage);
|
|
@@ -175,6 +176,15 @@ const initIntlayer = async (rootDir, options) => {
|
|
|
175
176
|
}
|
|
176
177
|
if (!options?.noEslint && require_init_utils_packageManager.hasLegacyEslint(allDeps)) (0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.x} ${(0, _intlayer_config_logger.colorize)(require_init_utils_lintConfig.LINT_PLUGIN_PACKAGE_NAME, _intlayer_config_colors.MAGENTA)} needs ESLint ${9}+ (flat config) — skipped the Intlayer lint rules. Upgrade ESLint to enable them: ${(0, _intlayer_config_logger.colorizePath)(require_init_documentationRouter.DocumentationRouter.ESLint)}`, { level: "warn" });
|
|
177
178
|
if (!options?.noEslint && require_init_utils_packageManager.hasLintTooling(allDeps)) {
|
|
179
|
+
if (options?.noInstallPackages && !allDeps["eslint-plugin-intlayer"]) {
|
|
180
|
+
const lintPluginSpecifier = options.upgradeToVersion ? `${require_init_utils_lintConfig.LINT_PLUGIN_PACKAGE_NAME}@${options.upgradeToVersion}` : require_init_utils_lintConfig.LINT_PLUGIN_PACKAGE_NAME;
|
|
181
|
+
try {
|
|
182
|
+
require_init_utils_packageManager.installPackages(rootDir, [lintPluginSpecifier], packageManager, true);
|
|
183
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Installed: ${(0, _intlayer_config_logger.colorize)(require_init_utils_lintConfig.LINT_PLUGIN_PACKAGE_NAME, _intlayer_config_colors.MAGENTA)}`);
|
|
184
|
+
} catch {
|
|
185
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.x} Failed to install ${require_init_utils_lintConfig.LINT_PLUGIN_PACKAGE_NAME}. Please install it manually.`, { level: "warn" });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
178
188
|
const oxlintConfigPath = ".oxlintrc.json";
|
|
179
189
|
const hasOxlintConfig = await require_init_utils_fileSystem.exists(rootDir, oxlintConfigPath);
|
|
180
190
|
const shouldCreateOxlintConfig = !hasOxlintConfig && Boolean(allDeps.oxlint) && !allDeps.eslint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["colorize","ANSIColors","exists","x","colorizePath","readFileFromRoot","getDocumentationUrl","moveCompatPackagesToDevDependencies","writeFileToRoot","v","detectPackageManager","detectLinguiCatalogPattern","detectMissingIntlayerPackages","isIntlayerPackageName","upgradeIntlayerPackages","resolveGithubWorkflowsContext","getGithubWorkflows","ensureDirectory","join","parseJSONWithComments","hasLegacyEslint","LINT_PLUGIN_PACKAGE_NAME","DocumentationRouter","hasLintTooling","addIntlayerRulesToOxlintConfig","findTsConfigFiles","detectJsonLocalePattern","initConfig","setCompilerOutputInConfig","detectNextIntlMessagesPattern","updateIntlayerConfigWithSyncPlugin","hasUrlRoutingFramework","detectCompatI18nLibraries","setRoutingStorageOnlyInConfig","ROUTING_MODE","setRoutingModeInConfig","setEnableProxyInConfig","replaceViteConfigPluginImportSource","updateViteConfigForCompatPlugin","hasIntlayerVitePlugin","updateViteConfig","updateNextConfigForNextI18next","updateNextConfigForNextIntl","updateNextConfigForNextTranslate","updateNextConfig","setupNextCompilerBabelConfig","updateAstroConfig","updateNuxtConfigForNuxtjsI18n","updateNuxtConfig","updateMetroConfig","getMetroConfigTemplate","BACKEND_INTLAYER_PACKAGES","getConfiguration","getAlias","setupFramework"],"sources":["../../../src/init/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { ROUTING_MODE } from '@intlayer/config/defaultValues';\nimport { colorize, colorizePath, logger, v, x } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { initConfig } from '../initConfig';\nimport {\n setCompilerOutputInConfig,\n setEnableProxyInConfig,\n setRoutingModeInConfig,\n setRoutingStorageOnlyInConfig,\n} from './cms';\nimport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n} from './documentationRouter';\nimport { setupFramework } from './frameworkSetup';\nimport { upgradeIntlayerPackages } from './upgradeIntlayerPackages';\nimport type { CompatSyncConfig, RoutingMode } from './utils';\nimport {\n addIntlayerRulesToOxlintConfig,\n BACKEND_INTLAYER_PACKAGES,\n detectCompatI18nLibraries,\n detectJsonLocalePattern,\n detectLinguiCatalogPattern,\n detectMissingIntlayerPackages,\n detectNextIntlMessagesPattern,\n detectPackageManager,\n ensureDirectory,\n exists,\n findTsConfigFiles,\n getGithubWorkflows,\n getMetroConfigTemplate,\n hasIntlayerVitePlugin,\n hasLegacyEslint,\n hasLintTooling,\n hasUrlRoutingFramework,\n installPackages,\n isIntlayerPackageName,\n LINT_PLUGIN_PACKAGE_NAME,\n MINIMUM_ESLINT_MAJOR,\n moveCompatPackagesToDevDependencies,\n type OxlintConfig,\n parseJSONWithComments,\n readFileFromRoot,\n replaceViteConfigPluginImportSource,\n resolveGithubWorkflowsContext,\n setupNextCompilerBabelConfig,\n updateAstroConfig,\n updateIntlayerConfigWithSyncPlugin,\n updateMetroConfig,\n updateNextConfig,\n updateNextConfigForNextI18next,\n updateNextConfigForNextIntl,\n updateNextConfigForNextTranslate,\n updateNuxtConfig,\n updateNuxtConfigForNuxtjsI18n,\n updateViteConfig,\n updateViteConfigForCompatPlugin,\n writeFileToRoot,\n} from './utils';\n\nexport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n};\n\n/**\n * Resolves the default dev-server URL of the detected framework, used as the\n * `editor.applicationURL` of the generated configuration file. Frameworks that\n * embed Vite (Astro, SvelteKit, …) are checked before the bare Vite fallback so\n * their own dev port wins.\n */\nexport const getDefaultApplicationURL = (\n dependencies: Record<string, string>\n): string => {\n if (dependencies.next) return 'http://localhost:3000';\n if (dependencies.astro) return 'http://localhost:4321';\n if (dependencies['@angular/core']) return 'http://localhost:4200';\n if (dependencies.nuxt) return 'http://localhost:3000';\n if (dependencies['@sveltejs/kit']) return 'http://localhost:5173';\n if (dependencies['react-scripts']) return 'http://localhost:3000';\n if (dependencies.vite) return 'http://localhost:5173';\n\n return 'http://localhost:3000';\n};\n\n/**\n * How the interactive init organizes autogenerated content (compiler output /\n * autofill):\n * - `per-component` — multilingual `.content` files co-located with components\n * (the configuration template default).\n * - `centralized` — per-locale JSON dictionaries under `/locales/{locale}/`.\n * - `json-namespaces` — plain per-locale JSON namespace files kept in sync\n * through `@intlayer/sync-json-plugin`.\n */\nexport type ContentStrategy =\n | 'per-component'\n | 'centralized'\n | 'json-namespaces';\n\n/**\n * OPTIONS\n */\nexport type InitOptions = {\n noGitignore?: boolean;\n /** Skip scaffolding the `fill` and `test` GitHub Actions workflows. */\n noGithubActions?: boolean;\n /**\n * Skip installing missing Intlayer dependencies and upgrading the Intlayer\n * packages of every `package.json` to their latest version.\n */\n noInstallPackages?: boolean;\n /** Skip adding the Intlayer extension to `.vscode/extensions.json`. */\n noVscodeExtension?: boolean;\n /** Skip writing the Intlayer LSP configuration to `.vscode/settings.json`. */\n noLsp?: boolean;\n /** Skip enabling the Intlayer lint rules (ESLint / oxlint). */\n noEslint?: boolean;\n /**\n * Skip the project setup: tsconfig types/aliases, the Intlayer config file,\n * bundler/framework configs and framework-specific\n * scaffolding (middleware/proxy, providers in layout/page). Defaults to\n * enabled.\n */\n noFrameworkSetup?: boolean;\n /** Skip logging the final success message and documentation link. */\n skipFinalMessage?: boolean;\n /**\n * Version to install the missing Intlayer packages at (typically the running\n * CLI version). Already declared Intlayer packages are upgraded to the latest\n * published version instead.\n */\n upgradeToVersion?: string;\n /**\n * Locale routing strategy to write to `routing.mode` in the generated/existing\n * Intlayer configuration file. When omitted, the configuration default\n * (`prefix-no-default`) is kept.\n */\n routingMode?: RoutingMode;\n /**\n * Whether the app routes by locale through the Intlayer proxy (middleware).\n * Written to `routing.enableProxy` in the configuration file and drives the\n * framework scaffolding: `false` skips the proxy file and any locale route\n * segment. When omitted, the configured value is kept (unset means enabled).\n */\n enableProxy?: boolean;\n /**\n * Content organization strategy chosen by the interactive init prompt. Drives\n * the `compiler.output` template (`centralized`) or the injection of the\n * syncJSON plugin (`json-namespaces`). When omitted (or `per-component`), the\n * configuration template default is kept.\n */\n contentStrategy?: ContentStrategy;\n};\n\n/**\n * MAIN LOGIC\n */\nexport const initIntlayer = async (rootDir: string, options?: InitOptions) => {\n logger(colorize('Checking Intlayer configuration...', ANSIColors.CYAN));\n\n // READ PACKAGE.JSON\n const packageJsonPath = 'package.json';\n if (!(await exists(rootDir, packageJsonPath))) {\n logger(\n `${x} No ${colorizePath('package.json')} found. Please run this script from the project root.`,\n { level: 'error' }\n );\n process.exit(1);\n }\n\n const packageJsonContent = await readFileFromRoot(rootDir, packageJsonPath);\n let packageJson: Record<string, any>;\n try {\n packageJson = JSON.parse(packageJsonContent);\n } catch {\n logger(`${x} Could not parse ${colorizePath('package.json')}.`, {\n level: 'error',\n });\n process.exit(1);\n }\n\n // Determine the correct documentation URL based on dependencies\n const guideUrl = getDocumentationUrl(packageJson);\n\n const allDeps: Record<string, string> = {\n ...(packageJson.dependencies ?? {}),\n ...(packageJson.devDependencies ?? {}),\n };\n\n // MOVE COMPAT PACKAGES (e.g. next-intl) REPLACED BY @INTLAYER/* TO DEVDEPENDENCIES\n const movedPackages = moveCompatPackagesToDevDependencies(packageJson);\n if (movedPackages.length > 0) {\n const indentation = packageJsonContent.match(/^[ \\t]+(?=\")/m)?.[0] ?? 2;\n const trailingNewline = packageJsonContent.endsWith('\\n') ? '\\n' : '';\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n `${JSON.stringify(packageJson, null, indentation)}${trailingNewline}`\n );\n for (const pkg of movedPackages) {\n logger(\n `${v} Moved ${colorize(pkg, ANSIColors.MAGENTA)} from dependencies to devDependencies`\n );\n }\n }\n\n // INSTALL MISSING INTLAYER DEPENDENCIES\n const packageManager = detectPackageManager(rootDir);\n\n // lingui keeps its catalogs as `.po` (default) or `.json`. Detect which so the\n // matching sync plugin (`syncPO` / `syncJSON`) + dev dependency are chosen.\n const linguiPresent = Boolean(\n allDeps['@lingui/core'] ||\n allDeps['@lingui/react'] ||\n allDeps['@intlayer/lingui']\n );\n\n const linguiCatalog = linguiPresent\n ? await detectLinguiCatalogPattern(rootDir)\n : null;\n\n // `linguiCatalogFormat` resolution:\n // 1. Filesystem scan result (authoritative when catalogs already exist)\n // 2. Fallback: 'po' (lingui's default) when lingui is installed but no\n // catalogs have been generated yet.\n const linguiCatalogFormat: 'po' | 'json' | null =\n linguiCatalog?.format ?? (linguiPresent ? 'po' : null);\n\n const {\n packagesToInstall,\n devPackagesToInstall,\n compatSyncConfig,\n compatVitePluginConfig,\n pendingCompatAdapters,\n } = detectMissingIntlayerPackages(allDeps, {\n linguiCatalogFormat,\n dependencies: packageJson.dependencies,\n devDependencies: packageJson.devDependencies,\n });\n\n /** Whether the compat adapter for a library is not released yet. */\n const isCompatAdapterPending = (adapterPackage: string): boolean =>\n pendingCompatAdapters.includes(adapterPackage);\n\n if (pendingCompatAdapters.length > 0) {\n logger(\n `${x} No released Intlayer adapter yet for ${pendingCompatAdapters\n .map((adapterPackage) => colorize(adapterPackage, ANSIColors.MAGENTA))\n .join(\n ', '\n )} — keeping your current i18n library and only syncing its catalogs with Intlayer.`,\n { level: 'warn' }\n );\n }\n\n // The `json-namespaces` content strategy uses the same syncJSON pipeline as\n // the compat libraries: plain per-locale JSON namespace files synced through\n // `@intlayer/sync-json-plugin`. A detected compat library keeps precedence —\n // its own catalog format/template is authoritative.\n const wantsJsonNamespaces =\n options?.contentStrategy === 'json-namespaces' && !compatSyncConfig;\n\n if (\n wantsJsonNamespaces &&\n !allDeps['@intlayer/sync-json-plugin'] &&\n !devPackagesToInstall.includes('@intlayer/sync-json-plugin')\n ) {\n devPackagesToInstall.push('@intlayer/sync-json-plugin');\n }\n\n if (!options?.noInstallPackages) {\n const withVersion = (packages: string[]): string[] =>\n options?.upgradeToVersion\n ? packages.map((pkg) =>\n isIntlayerPackageName(pkg)\n ? `${pkg}@${options.upgradeToVersion}`\n : pkg\n )\n : packages;\n\n if (packagesToInstall.length > 0) {\n logger(\n colorize('Installing missing Intlayer dependencies...', ANSIColors.CYAN)\n );\n try {\n installPackages(\n rootDir,\n withVersion(packagesToInstall),\n packageManager\n );\n logger(\n `${v} Installed: ${packagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install packages. Please install manually: ${packagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n if (devPackagesToInstall.length > 0) {\n logger(\n colorize(\n 'Installing missing Intlayer dev dependencies...',\n ANSIColors.CYAN\n )\n );\n try {\n installPackages(\n rootDir,\n withVersion(devPackagesToInstall),\n packageManager,\n true\n );\n logger(\n `${v} Installed: ${devPackagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install dev packages. Please install manually: ${devPackagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n // UPGRADE INTLAYER DEPENDENCIES TO LATEST\n await upgradeIntlayerPackages(rootDir);\n }\n\n // CHECK .GITIGNORE\n const gitignorePath = '.gitignore';\n if (\n !options?.noGitignore &&\n !options?.noFrameworkSetup &&\n (await exists(rootDir, gitignorePath))\n ) {\n const gitignoreContent = await readFileFromRoot(rootDir, gitignorePath);\n\n if (!gitignoreContent.includes('intlayer')) {\n const newContent = `${gitignoreContent}\\n# Intlayer\\n.intlayer\\n`;\n await writeFileToRoot(rootDir, gitignorePath, newContent);\n logger(\n `${v} Added ${colorizePath('.intlayer')} to ${colorizePath(gitignorePath)}`\n );\n } else {\n logger(`${v} ${colorizePath(gitignorePath)} already includes .intlayer`);\n }\n }\n\n // SCAFFOLD GITHUB ACTIONS WORKFLOWS (fill + test)\n // Generate two workflows whose commands match the detected package manager:\n // - intlayer-fill.yml: auto-fills missing translations on pull requests\n // - intlayer-test.yml: fails the PR when required locales are missing\n // Every command runs with `--ci`, which iterates over the Intlayer\n // project(s) of the repository. GitHub only triggers workflows stored at the\n // repository root, so in a monorepo the files are written to the git root\n // (see resolveGithubWorkflowsContext).\n if (!options?.noGithubActions) {\n const workflowsContext = await resolveGithubWorkflowsContext(\n rootDir,\n packageManager\n );\n const workflows = getGithubWorkflows(\n workflowsContext.packageManager,\n workflowsContext.options\n );\n\n for (const workflow of workflows) {\n if (await exists(workflowsContext.workflowsRootDir, workflow.filePath)) {\n logger(`${v} ${colorizePath(workflow.filePath)} already exists`);\n continue;\n }\n\n try {\n await ensureDirectory(\n workflowsContext.workflowsRootDir,\n join('.github', 'workflows')\n );\n await writeFileToRoot(\n workflowsContext.workflowsRootDir,\n workflow.filePath,\n workflow.content\n );\n logger(\n `${v} Added GitHub Actions workflow ${colorizePath(workflow.filePath)}`\n );\n } catch {\n logger(\n `${x} Could not create ${colorizePath(workflow.filePath)}. You may need to add it manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // CHECK VS CODE EXTENSION RECOMMENDATIONS\n const vscodeDir = '.vscode';\n const extensionsJsonPath = join(vscodeDir, 'extensions.json');\n const extensionId = 'intlayer.intlayer-vs-code-extension';\n\n if (!options?.noVscodeExtension) {\n try {\n let extensionsConfig: { recommendations: string[] } = {\n recommendations: [],\n };\n\n if (await exists(rootDir, extensionsJsonPath)) {\n const content = await readFileFromRoot(rootDir, extensionsJsonPath);\n extensionsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n if (!extensionsConfig.recommendations) {\n extensionsConfig.recommendations = [];\n }\n\n if (!extensionsConfig.recommendations.includes(extensionId)) {\n extensionsConfig.recommendations.push(extensionId);\n await writeFileToRoot(\n rootDir,\n extensionsJsonPath,\n JSON.stringify(extensionsConfig, null, 2)\n );\n logger(\n `${v} Added ${colorize(extensionId, ANSIColors.MAGENTA)} to ${colorizePath(extensionsJsonPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(extensionsJsonPath)} already includes ${colorize(extensionId, ANSIColors.MAGENTA)}`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(extensionsJsonPath)}. You may need to add ${colorize(extensionId, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK VS CODE LSP SETTINGS\n const settingsJsonPath = join(vscodeDir, 'settings.json');\n\n if (!options?.noLsp) {\n try {\n let settingsConfig: Record<string, unknown> = {};\n\n if (await exists(rootDir, settingsJsonPath)) {\n const content = await readFileFromRoot(rootDir, settingsJsonPath);\n settingsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n let settingsUpdated = false;\n\n if (!settingsConfig['intlayer.languageServer.command']) {\n settingsConfig['intlayer.languageServer.command'] = 'npx';\n settingsUpdated = true;\n }\n\n if (!settingsConfig['intlayer.languageServer.args']) {\n settingsConfig['intlayer.languageServer.args'] = ['@intlayer/lsp'];\n settingsUpdated = true;\n }\n\n if (settingsUpdated) {\n await writeFileToRoot(\n rootDir,\n settingsJsonPath,\n JSON.stringify(settingsConfig, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(settingsJsonPath)} with LSP configuration`\n );\n } else {\n logger(\n `${v} ${colorizePath(settingsJsonPath)} already includes LSP configuration`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(settingsJsonPath)}. You may need to add the LSP settings manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK LINT RULES (eslint-plugin-intlayer)\n //\n // Gated on the project already having a linter installed: with no ESLint or\n // oxlint there is nothing to plug the rules into, and the guidance below\n // would just be noise. The same check gates the install in\n // `detectMissingIntlayerPackages`, so the two never disagree.\n //\n // Only the oxlint config is patched here: `.oxlintrc.json` is plain JSON and\n // safe to edit, whereas an ESLint flat config is arbitrary JavaScript that\n // cannot be rewritten reliably — that one is left to the user, with the\n // snippet printed below.\n if (!options?.noEslint && hasLegacyEslint(allDeps)) {\n logger(\n `${x} ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} needs ESLint ${MINIMUM_ESLINT_MAJOR}+ (flat config) — skipped the Intlayer lint rules. Upgrade ESLint to enable them: ${colorizePath(DocumentationRouter.ESLint)}`,\n { level: 'warn' }\n );\n }\n\n if (!options?.noEslint && hasLintTooling(allDeps)) {\n const oxlintConfigPath = '.oxlintrc.json';\n const hasOxlintConfig = await exists(rootDir, oxlintConfigPath);\n // An oxlint-only project without a config gets one; with ESLint around,\n // the rules go into the ESLint config instead.\n const shouldCreateOxlintConfig =\n !hasOxlintConfig && Boolean(allDeps.oxlint) && !allDeps.eslint;\n\n if (hasOxlintConfig || shouldCreateOxlintConfig) {\n try {\n const oxlintConfig: OxlintConfig = hasOxlintConfig\n ? parseJSONWithComments(\n await readFileFromRoot(rootDir, oxlintConfigPath)\n )\n : {};\n\n if (addIntlayerRulesToOxlintConfig(oxlintConfig)) {\n await writeFileToRoot(\n rootDir,\n oxlintConfigPath,\n JSON.stringify(oxlintConfig, null, 2)\n );\n logger(\n `${v} ${hasOxlintConfig ? 'Added the Intlayer lint rules to' : 'Created'} ${colorizePath(oxlintConfigPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(oxlintConfigPath)} already includes the Intlayer lint rules`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(oxlintConfigPath)}. You may need to add ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n } else {\n // ESLint flat config — print the snippet instead of rewriting the file.\n logger([\n colorize('Intlayer lint rules →', ANSIColors.MAGENTA),\n colorize(\n `Add the ${LINT_PLUGIN_PACKAGE_NAME} preset to the array your ESLint flat config exports, to catch hardcoded text and dynamic calls the compiler cannot optimize:`,\n ANSIColors.GREY_LIGHT\n ),\n colorize(\n ` import intlayer from '${LINT_PLUGIN_PACKAGE_NAME}';\\n\\n export default [\\n // ...your existing config\\n ...intlayer.configs.recommended,\\n ];`,\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(DocumentationRouter.ESLint),\n ]);\n }\n }\n\n // PROJECT SETUP\n // Everything below edits the project itself: tsconfig types and aliases, the\n // Intlayer config file, bundler/framework configs and the\n // framework scaffolding. It only runs with the framework setup step, so\n // picking e.g. only the CI or editor steps never creates project files.\n if (!options?.noFrameworkSetup) {\n // CHECK TSCONFIGS\n const tsConfigFiles = await findTsConfigFiles(rootDir);\n let hasTsConfig = false;\n\n for (const fileName of tsConfigFiles) {\n if (await exists(rootDir, fileName)) {\n hasTsConfig = true;\n try {\n const fileContent = await readFileFromRoot(rootDir, fileName);\n const config = parseJSONWithComments(fileContent);\n const typeDefinition = './.intlayer/**/*.ts';\n\n let updated = false;\n\n if (!config.include) {\n // Skip if no include array (solution-style)\n } else if (\n Array.isArray(config.include) &&\n !(config.include as string[]).some((pattern: string) =>\n pattern.includes('.intlayer')\n )\n ) {\n config.include.push(typeDefinition);\n updated = true;\n } else if (config.include.includes(typeDefinition)) {\n logger(\n `${v} ${colorizePath(fileName)} already includes intlayer types`\n );\n }\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n fileName,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(fileName)} to include intlayer types`\n );\n }\n } catch {\n logger(\n `${x} Could not parse or update ${colorizePath(fileName)}. You may need to add ${colorizePath('.intlayer/types/**/*.ts')} manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // INITIALIZE CONFIG FILE\n const format = hasTsConfig ? 'intlayer.config.ts' : 'intlayer.config.mjs';\n\n // Detect the locale JSON file pattern already in the project so we can\n // insert the matching locales into the config and produce the most\n // accurate source template for compat libraries.\n const detectedPattern = await detectJsonLocalePattern(rootDir);\n\n const isConfigCreated = await initConfig(format, rootDir, {\n locales: detectedPattern?.locales,\n applicationURL: getDefaultApplicationURL(allDeps),\n });\n\n // APPLY CONTENT STRATEGY — CENTRALIZED\n // Point `compiler.output` at per-locale JSON dictionaries under `/locales/`\n // instead of the per-component template default.\n if (options?.contentStrategy === 'centralized') {\n await setCompilerOutputInConfig(\n rootDir,\n '/locales/{{locale}}/{{key}}.content.json'\n );\n }\n\n // INJECT SYNC-JSON PLUGIN FOR COMPAT LIBRARIES / JSON-NAMESPACES STRATEGY\n const syncConfigToInject: CompatSyncConfig | undefined =\n compatSyncConfig ??\n (wantsJsonNamespaces\n ? {\n format: 'i18next',\n sourceTemplate:\n detectedPattern?.template ?? './locales/${locale}/${key}.json',\n }\n : undefined);\n\n if (syncConfigToInject) {\n // For next-intl / use-intl, the messages path is authoritatively declared\n // in `i18n/request.ts` (e.g. `import(`../messages/${locale}.json`)`), so we\n // read it directly. It usually resolves to a single file per locale (no\n // `${key}` segment), whose first-level keys are namespaces — so the compat\n // config carries `splitKeys: true` to emit one dictionary per namespace.\n // Falls back to file-system globbing otherwise.\n const nextIntlMessagesPattern =\n allDeps['next-intl'] ||\n allDeps['@intlayer/next-intl'] ||\n allDeps['use-intl'] ||\n allDeps['@intlayer/use-intl']\n ? await detectNextIntlMessagesPattern(rootDir)\n : null;\n\n // lingui authoritatively resolves to `…/{locale}/messages.{po,json}`, where\n // the `messages` filename becomes the dictionary key. Prefer it so a `.po`\n // project gets `syncPO` (the generic JSON glob only sees `.json`).\n const sourceTemplate =\n linguiCatalog?.template ??\n nextIntlMessagesPattern?.template ??\n detectedPattern?.template;\n\n const resolvedSyncConfig = {\n ...syncConfigToInject,\n ...(sourceTemplate ? { sourceTemplate } : {}),\n };\n\n const syncPluginPackage =\n resolvedSyncConfig.plugin === 'po'\n ? '@intlayer/sync-po-plugin'\n : '@intlayer/sync-json-plugin';\n const syncPluginName =\n resolvedSyncConfig.plugin === 'po' ? 'syncPO' : 'syncJSON';\n\n // `splitKeys` only makes sense for a single file holding several namespaces.\n // If the resolved template addresses one namespace per file (`${key}`\n // segment), each file is already a single namespace — drop the flag so\n // syncJSON keeps one dictionary per file.\n if (\n resolvedSyncConfig.splitKeys &&\n resolvedSyncConfig.sourceTemplate.includes('${key}')\n ) {\n resolvedSyncConfig.splitKeys = false;\n }\n\n const intlayerConfigCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.mjs',\n 'intlayer.config.js',\n 'intlayer.config.cjs',\n ];\n\n for (const configFile of intlayerConfigCandidates) {\n if (await exists(rootDir, configFile)) {\n const configContent = await readFileFromRoot(rootDir, configFile);\n\n if (!configContent.includes(syncPluginPackage)) {\n const extension = configFile.split('.').pop()!;\n const updatedConfigContent = updateIntlayerConfigWithSyncPlugin(\n configContent,\n extension,\n resolvedSyncConfig\n );\n await writeFileToRoot(rootDir, configFile, updatedConfigContent);\n logger(\n `${v} Updated ${colorizePath(configFile)} with ${syncPluginName} compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(configFile)} already includes ${syncPluginName} plugin`\n );\n }\n break;\n }\n }\n }\n\n // APPLY ROUTING\n // An explicit choice (interactive prompt / `--routing`) is written to\n // `routing.mode` + `routing.enableProxy`. Without one, a freshly created\n // config is adapted to the project: frontends get prefix routing through\n // the proxy (the template ships it disabled), projects without URL routing\n // (backend, React Native…) keep only `routing.storage`. An existing config\n // is never rewritten without an explicit choice. A compat i18n library\n // owns the app routing, so its config keeps the template's disabled proxy:\n // compat bundler plugins wrap `intlayer()`, which would register it.\n const hasUrlRouting = hasUrlRoutingFramework(allDeps);\n const hasCompatI18nLibrary = detectCompatI18nLibraries(allDeps).length > 0;\n const shouldApplyDefaultRouting =\n isConfigCreated &&\n options?.routingMode === undefined &&\n !hasCompatI18nLibrary;\n\n if (shouldApplyDefaultRouting && !hasUrlRouting) {\n await setRoutingStorageOnlyInConfig(rootDir);\n }\n\n const routingMode =\n options?.routingMode ??\n (shouldApplyDefaultRouting && hasUrlRouting ? ROUTING_MODE : undefined);\n const enableProxy =\n options?.enableProxy ??\n (shouldApplyDefaultRouting && hasUrlRouting ? true : undefined);\n\n if (routingMode) {\n await setRoutingModeInConfig(rootDir, routingMode);\n }\n\n if (enableProxy !== undefined) {\n await setEnableProxyInConfig(rootDir, enableProxy);\n }\n\n let hasAliasConfiguration = false;\n\n // CHECK VITE CONFIG\n const viteConfigs = ['vite.config.ts', 'vite.config.js', 'vite.config.mjs'];\n\n for (const file of viteConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (compatVitePluginConfig) {\n const { replacesVitePlugin } = compatVitePluginConfig;\n\n if (content.includes(compatVitePluginConfig.pluginPackageSource)) {\n logger(\n `${v} ${colorizePath(file)} already includes ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else if (\n replacesVitePlugin &&\n content.includes(replacesVitePlugin.fromPackageSource)\n ) {\n // Drop-in replacement: rewrite the original i18n vite plugin's import\n // source, keeping its binding and call site (e.g. lingui).\n const updatedContent = replaceViteConfigPluginImportSource(\n content,\n replacesVitePlugin.importName,\n replacesVitePlugin.fromPackageSource,\n compatVitePluginConfig.pluginPackageSource\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to import ${replacesVitePlugin.importName} from ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else {\n const updatedContent = updateViteConfigForCompatPlugin(\n content,\n extension,\n compatVitePluginConfig\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include ${compatVitePluginConfig.pluginFunctionName} compat plugin`\n );\n }\n } else if (hasIntlayerVitePlugin(content)) {\n // A compat adapter plugin (e.g. `reactI18nextVitePlugin`) already wraps\n // `intlayer()` internally, so skip adding a redundant standalone plugin.\n logger(\n `${v} ${colorizePath(file)} already includes an Intlayer plugin`\n );\n } else {\n const updatedContent = updateViteConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT CONFIG\n const nextConfigs = ['next.config.js', 'next.config.mjs', 'next.config.ts'];\n let isNextJsProject = false;\n\n for (const file of nextConfigs) {\n if (await exists(rootDir, file)) {\n isNextJsProject = true;\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (allDeps['next-i18next'] || allDeps['@intlayer/next-i18next']) {\n if (!content.includes('@intlayer/next-i18next')) {\n const updatedContent = updateNextConfigForNextI18next(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-i18next compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-i18next`\n );\n }\n } else if (allDeps['next-intl'] || allDeps['@intlayer/next-intl']) {\n if (!content.includes('@intlayer/next-intl/plugin')) {\n const updatedContent = updateNextConfigForNextIntl(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-intl compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-intl/plugin`\n );\n }\n } else if (isCompatAdapterPending('@intlayer/next-translate')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (next-translate stays in charge)`\n );\n } else if (\n allDeps['next-translate'] ||\n allDeps['@intlayer/next-translate']\n ) {\n if (!content.includes('@intlayer/next-translate')) {\n const updatedContent = updateNextConfigForNextTranslate(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-translate compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-translate`\n );\n }\n } else if (!content.includes('next-intlayer')) {\n const updatedContent = updateNextConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT.JS COMPILER (BABEL)\n // When a Next.js project already uses Babel, install @intlayer/babel and print\n // the compiler + build-optimization plugins (extract, purge, minify, optimize)\n // to add. SWC projects need no setup: withIntlayer injects @intlayer/swc.\n if (isNextJsProject) {\n await setupNextCompilerBabelConfig({\n rootDir,\n packageManager,\n allDeps,\n skipInstall: Boolean(options?.noInstallPackages),\n });\n }\n\n // CHECK OTHER FRAMEWORKS CONFIG\n const astroConfigs = [\n 'astro.config.mjs',\n 'astro.config.js',\n 'astro.config.ts',\n 'astro.config.cjs',\n ];\n\n for (const file of astroConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n if (file.startsWith('astro.config.')) {\n const content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('astro-intlayer')) {\n const extension = file.split('.').pop()!;\n const updatedContent = updateAstroConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer integration`\n );\n }\n }\n break;\n }\n }\n\n const nuxtConfigs = ['nuxt.config.js', 'nuxt.config.ts'];\n for (const file of nuxtConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n const content = await readFileFromRoot(rootDir, file);\n\n if (isCompatAdapterPending('@intlayer/nuxtjs-i18n')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (@nuxtjs/i18n stays in charge)`\n );\n } else if (allDeps['@nuxtjs/i18n']) {\n if (!content.includes('@intlayer/nuxtjs-i18n')) {\n const updatedContent = updateNuxtConfigForNuxtjsI18n(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include @intlayer/nuxtjs-i18n module`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/nuxtjs-i18n`\n );\n }\n } else if (!content.includes('nuxt-intlayer')) {\n const updatedContent = updateNuxtConfig(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer module`\n );\n }\n break;\n }\n }\n\n // CHECK METRO CONFIG (React Native / Expo)\n // Metro is the React Native bundler. The Intlayer Metro plugin\n // (`react-native-intlayer/metro`) handles dictionary aliasing and building.\n // When no config exists we scaffold one; when one exists we safely wrap its\n // exported config with `configMetroIntlayerSync`, leaving custom async\n // (IIFE) configs untouched so existing setups are never broken.\n const isReactNativeProject = Boolean(\n allDeps['react-native'] || allDeps.expo\n );\n\n if (isReactNativeProject) {\n // Metro resolves Intlayer aliases itself, so skip the alias fallback below.\n hasAliasConfiguration = true;\n\n const metroConfigs = [\n 'metro.config.js',\n 'metro.config.cjs',\n 'metro.config.mjs',\n 'metro.config.ts',\n ];\n\n let metroConfigFile: string | undefined;\n\n for (const file of metroConfigs) {\n if (await exists(rootDir, file)) {\n metroConfigFile = file;\n break;\n }\n }\n\n if (metroConfigFile) {\n const content = await readFileFromRoot(rootDir, metroConfigFile);\n\n if (content.includes('react-native-intlayer')) {\n logger(\n `${v} ${colorizePath(metroConfigFile)} already includes the Intlayer Metro plugin`\n );\n } else {\n const extension = metroConfigFile.split('.').pop()!;\n const updatedContent = updateMetroConfig(content, extension);\n\n if (updatedContent !== content) {\n await writeFileToRoot(rootDir, metroConfigFile, updatedContent);\n logger(\n `${v} Updated ${colorizePath(metroConfigFile)} to include the Intlayer Metro plugin`\n );\n } else {\n logger(\n `${x} Could not automatically update ${colorizePath(metroConfigFile)}. Wrap your exported config with ${colorize('configMetroIntlayer', ANSIColors.MAGENTA)}: ${colorizePath(DocumentationRouter.ReactNativeAndExpo)}`,\n { level: 'warn' }\n );\n }\n }\n } else {\n const newMetroConfigFile = 'metro.config.js';\n await writeFileToRoot(\n rootDir,\n newMetroConfigFile,\n getMetroConfigTemplate(Boolean(allDeps.expo))\n );\n logger(\n `${v} Created ${colorizePath(newMetroConfigFile)} with the Intlayer Metro plugin`\n );\n }\n }\n\n // CHECK WEBPACK CONFIG\n const webpackConfigs = [\n 'webpack.config.js',\n 'webpack.config.ts',\n 'webpack.config.mjs',\n 'webpack.config.cjs',\n ];\n\n for (const file of webpackConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n logger(\n `${v} Found ${colorizePath(\n file\n )}. Make sure to configure aliases manually or use the Intlayer Webpack plugin.`\n );\n break;\n }\n }\n\n // The server frameworks themselves, alongside their Intlayer packages: a\n // project may be mid-setup and carry only one of the two.\n const backendConfigPackages = [\n 'express',\n 'fastify',\n '@adonisjs/core',\n 'hono',\n 'elysia',\n ...BACKEND_INTLAYER_PACKAGES,\n ];\n\n if (backendConfigPackages.some((pkg) => allDeps[pkg])) {\n hasAliasConfiguration = true;\n }\n\n if (!hasAliasConfiguration) {\n const configuration = getConfiguration({ baseDir: rootDir });\n // `tsconfig`/`jsconfig` `paths` and `package.json` `imports` both expect\n // explicitly relative specifiers, so bare relative paths get a `./` prefix.\n const aliases = getAlias({\n configuration,\n formatter: (value) =>\n value.startsWith('./') || value.startsWith('../')\n ? value\n : `./${value}`,\n });\n\n if (hasTsConfig && tsConfigFiles.length > 0) {\n const tsConfigPath =\n tsConfigFiles.find((file) => file === 'tsconfig.json') ||\n tsConfigFiles[0];\n\n if (tsConfigPath) {\n const tsConfigContent = await readFileFromRoot(rootDir, tsConfigPath);\n const config = parseJSONWithComments(tsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n tsConfigPath,\n JSON.stringify(config, null, 2)\n );\n\n logger(\n `${v} Updated ${colorizePath(\n tsConfigPath\n )} to include Intlayer aliases`\n );\n }\n }\n } else {\n const jsConfigPath = 'jsconfig.json';\n\n if (await exists(rootDir, jsConfigPath)) {\n const jsConfigContent = await readFileFromRoot(rootDir, jsConfigPath);\n const config = parseJSONWithComments(jsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n jsConfigPath,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n jsConfigPath\n )} to include Intlayer aliases`\n );\n }\n } else {\n packageJson.imports ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n const importAlias = alias.replace('@', '#');\n\n if (!packageJson.imports[importAlias]) {\n packageJson.imports[importAlias] = path;\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n JSON.stringify(packageJson, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n packageJsonPath\n )} to include Intlayer imports`\n );\n }\n }\n }\n }\n\n // FRAMEWORK-SPECIFIC SCAFFOLDING\n // Sets up middleware/proxy and wraps the layout/page with the Intlayer\n // providers for the detected framework (Next.js App Router today). Idempotent\n // and non-destructive: it never overwrites user code it cannot safely\n // transform, skipping with guidance instead.\n //\n // Skipped entirely when a compat i18n library drives the app (i18next,\n // next-intl, vue-i18n, …): the app already owns its routing, providers and\n // layouts, and Intlayer only syncs its catalogs — restructuring routes or\n // injecting providers would break the existing setup.\n const hasCompatLibrary = Boolean(\n compatSyncConfig || compatVitePluginConfig\n );\n\n if (hasCompatLibrary) {\n logger(\n `${v} Compat i18n library detected — keeping the app structure untouched (no route restructure, no provider injection)`\n );\n }\n\n if (!hasCompatLibrary) {\n try {\n // Prefer the user's choices, else the configured routing (mode defaults\n // to `prefix-no-default`, an unset `enableProxy` means enabled). Drives\n // the proxy file and the locale route segment the adapters scaffold.\n const { routing } = getConfiguration({ baseDir: rootDir });\n\n await setupFramework({\n rootDir,\n allDeps,\n packageManager,\n useTypeScript: hasTsConfig,\n routingMode: routingMode ?? routing.mode,\n enableProxy: enableProxy ?? routing.enableProxy !== false,\n });\n } catch {\n logger(\n `${x} Framework-specific scaffolding failed. Your existing files were left untouched; follow the documentation to finish the setup.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // FINAL SUCCESS MESSAGE\n if (!options?.skipFinalMessage) {\n logInitSuccessMessage(guideUrl);\n }\n\n return { guideUrl };\n};\n\nexport const logInitSuccessMessage = (guideUrl: string): void => {\n logger(`${v} ${colorize('Intlayer init setup complete.', ANSIColors.GREEN)}`);\n logger([\n colorize('Next →', ANSIColors.MAGENTA),\n colorize(\n 'Follow the instructions in the documentation to complete the setup:',\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(guideUrl),\n ]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;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U;MACZ;KACF,CAAC;KAED,IAAI,SAAS;MACX,MAAMI,8CACJ,SACA,iBACA,KAAK,UAAU,aAAa,MAAM,CAAC,CACrC;MACA,oCACE,GAAGC,0BAAE,eAAWL,sCACd,eACF,EAAE,6BACJ;KACF;IACF;GACF;EACF;EAYA,MAAM,mBAAmB,QACvB,oBAAoB,sBACtB;EAEA,IAAI,kBACF,oCACE,GAAGK,0BAAE,kHACP;EAGF,IAAI,CAAC,kBACH,IAAI;GAIF,MAAM,EAAE,gBAAY2C,wCAAiB,EAAE,SAAS,QAAQ,CAAC;GAEzD,MAAME,iDAAe;IACnB;IACA;IACA;IACA,eAAe;IACf,aAAa,eAAe,QAAQ;IACpC,aAAa,eAAe,QAAQ,gBAAgB;GACtD,CAAC;EACH,QAAQ;GACN,oCACE,GAAGnD,0BAAE,iIACL,EAAE,OAAO,OAAO,CAClB;EACF;CAEJ;CAGA,IAAI,CAAC,SAAS,kBACZ,sBAAsB,QAAQ;CAGhC,OAAO,EAAE,SAAS;AACpB;AAEA,MAAa,yBAAyB,aAA2B;CAC/D,oCAAO,GAAGM,0BAAE,OAAGT,kCAAS,iCAAiCC,wBAAW,KAAK,GAAG;CAC5E,oCAAO;MACLD,kCAAS,UAAUC,wBAAW,OAAO;MACrCD,kCACE,uEACAC,wBAAW,UACb;MACAG,sCAAa,QAAQ;CACvB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["colorize","ANSIColors","exists","x","colorizePath","readFileFromRoot","getDocumentationUrl","moveCompatPackagesToDevDependencies","writeFileToRoot","v","detectPackageManager","detectLinguiCatalogPattern","detectMissingIntlayerPackages","isIntlayerPackageName","upgradeIntlayerPackages","resolveGithubWorkflowsContext","getGithubWorkflows","ensureDirectory","join","parseJSONWithComments","hasLegacyEslint","LINT_PLUGIN_PACKAGE_NAME","DocumentationRouter","hasLintTooling","addIntlayerRulesToOxlintConfig","findTsConfigFiles","detectJsonLocalePattern","initConfig","setCompilerOutputInConfig","detectNextIntlMessagesPattern","updateIntlayerConfigWithSyncPlugin","hasUrlRoutingFramework","detectCompatI18nLibraries","setRoutingStorageOnlyInConfig","ROUTING_MODE","setRoutingModeInConfig","setEnableProxyInConfig","replaceViteConfigPluginImportSource","updateViteConfigForCompatPlugin","hasIntlayerVitePlugin","updateViteConfig","updateNextConfigForNextI18next","updateNextConfigForNextIntl","updateNextConfigForNextTranslate","updateNextConfig","setupNextCompilerBabelConfig","updateAstroConfig","updateNuxtConfigForNuxtjsI18n","updateNuxtConfig","updateMetroConfig","getMetroConfigTemplate","BACKEND_INTLAYER_PACKAGES","getConfiguration","getAlias","setupFramework"],"sources":["../../../src/init/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { ROUTING_MODE } from '@intlayer/config/defaultValues';\nimport { colorize, colorizePath, logger, v, x } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { initConfig } from '../initConfig';\nimport {\n setCompilerOutputInConfig,\n setEnableProxyInConfig,\n setRoutingModeInConfig,\n setRoutingStorageOnlyInConfig,\n} from './cms';\nimport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n} from './documentationRouter';\nimport { setupFramework } from './frameworkSetup';\nimport { upgradeIntlayerPackages } from './upgradeIntlayerPackages';\nimport type { CompatSyncConfig, RoutingMode } from './utils';\nimport {\n addIntlayerRulesToOxlintConfig,\n BACKEND_INTLAYER_PACKAGES,\n detectCompatI18nLibraries,\n detectJsonLocalePattern,\n detectLinguiCatalogPattern,\n detectMissingIntlayerPackages,\n detectNextIntlMessagesPattern,\n detectPackageManager,\n ensureDirectory,\n exists,\n findTsConfigFiles,\n getGithubWorkflows,\n getMetroConfigTemplate,\n hasIntlayerVitePlugin,\n hasLegacyEslint,\n hasLintTooling,\n hasUrlRoutingFramework,\n installPackages,\n isIntlayerPackageName,\n LINT_PLUGIN_PACKAGE_NAME,\n MINIMUM_ESLINT_MAJOR,\n moveCompatPackagesToDevDependencies,\n type OxlintConfig,\n parseJSONWithComments,\n readFileFromRoot,\n replaceViteConfigPluginImportSource,\n resolveGithubWorkflowsContext,\n setupNextCompilerBabelConfig,\n updateAstroConfig,\n updateIntlayerConfigWithSyncPlugin,\n updateMetroConfig,\n updateNextConfig,\n updateNextConfigForNextI18next,\n updateNextConfigForNextIntl,\n updateNextConfigForNextTranslate,\n updateNuxtConfig,\n updateNuxtConfigForNuxtjsI18n,\n updateViteConfig,\n updateViteConfigForCompatPlugin,\n writeFileToRoot,\n} from './utils';\n\nexport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n};\n\n/**\n * Resolves the default dev-server URL of the detected framework, used as the\n * `editor.applicationURL` of the generated configuration file. Frameworks that\n * embed Vite (Astro, SvelteKit, …) are checked before the bare Vite fallback so\n * their own dev port wins.\n */\nexport const getDefaultApplicationURL = (\n dependencies: Record<string, string>\n): string => {\n if (dependencies.next) return 'http://localhost:3000';\n if (dependencies.astro) return 'http://localhost:4321';\n if (dependencies['@angular/core']) return 'http://localhost:4200';\n if (dependencies.nuxt) return 'http://localhost:3000';\n if (dependencies['@sveltejs/kit']) return 'http://localhost:5173';\n if (dependencies['react-scripts']) return 'http://localhost:3000';\n if (dependencies.vite) return 'http://localhost:5173';\n\n return 'http://localhost:3000';\n};\n\n/**\n * How the interactive init organizes autogenerated content (compiler output /\n * autofill):\n * - `per-component` — multilingual `.content` files co-located with components\n * (the configuration template default).\n * - `centralized` — per-locale JSON dictionaries under `/locales/{locale}/`.\n * - `json-namespaces` — plain per-locale JSON namespace files kept in sync\n * through `@intlayer/sync-json-plugin`.\n */\nexport type ContentStrategy =\n | 'per-component'\n | 'centralized'\n | 'json-namespaces';\n\n/**\n * OPTIONS\n */\nexport type InitOptions = {\n noGitignore?: boolean;\n /** Skip scaffolding the `fill` and `test` GitHub Actions workflows. */\n noGithubActions?: boolean;\n /**\n * Skip installing missing Intlayer dependencies and upgrading the Intlayer\n * packages of every `package.json` to their latest version.\n */\n noInstallPackages?: boolean;\n /** Skip adding the Intlayer extension to `.vscode/extensions.json`. */\n noVscodeExtension?: boolean;\n /** Skip writing the Intlayer LSP configuration to `.vscode/settings.json`. */\n noLsp?: boolean;\n /** Skip enabling the Intlayer lint rules (ESLint / oxlint). */\n noEslint?: boolean;\n /**\n * Skip the project setup: tsconfig types/aliases, the Intlayer config file,\n * bundler/framework configs and framework-specific\n * scaffolding (middleware/proxy, providers in layout/page). Defaults to\n * enabled.\n */\n noFrameworkSetup?: boolean;\n /** Skip logging the final success message and documentation link. */\n skipFinalMessage?: boolean;\n /**\n * Version to install the missing Intlayer packages at (typically the running\n * CLI version). Already declared Intlayer packages are upgraded to the latest\n * published version instead.\n */\n upgradeToVersion?: string;\n /**\n * Locale routing strategy to write to `routing.mode` in the generated/existing\n * Intlayer configuration file. When omitted, the configuration default\n * (`prefix-no-default`) is kept.\n */\n routingMode?: RoutingMode;\n /**\n * Whether the app routes by locale through the Intlayer proxy (middleware).\n * Written to `routing.enableProxy` in the configuration file and drives the\n * framework scaffolding: `false` skips the proxy file and any locale route\n * segment. When omitted, the configured value is kept (unset means enabled).\n */\n enableProxy?: boolean;\n /**\n * Content organization strategy chosen by the interactive init prompt. Drives\n * the `compiler.output` template (`centralized`) or the injection of the\n * syncJSON plugin (`json-namespaces`). When omitted (or `per-component`), the\n * configuration template default is kept.\n */\n contentStrategy?: ContentStrategy;\n};\n\n/**\n * MAIN LOGIC\n */\nexport const initIntlayer = async (rootDir: string, options?: InitOptions) => {\n logger(colorize('Checking Intlayer configuration...', ANSIColors.CYAN));\n\n // READ PACKAGE.JSON\n const packageJsonPath = 'package.json';\n if (!(await exists(rootDir, packageJsonPath))) {\n logger(\n `${x} No ${colorizePath('package.json')} found. Please run this script from the project root.`,\n { level: 'error' }\n );\n process.exit(1);\n }\n\n const packageJsonContent = await readFileFromRoot(rootDir, packageJsonPath);\n let packageJson: Record<string, any>;\n try {\n packageJson = JSON.parse(packageJsonContent);\n } catch {\n logger(`${x} Could not parse ${colorizePath('package.json')}.`, {\n level: 'error',\n });\n process.exit(1);\n }\n\n // Determine the correct documentation URL based on dependencies\n const guideUrl = getDocumentationUrl(packageJson);\n\n const allDeps: Record<string, string> = {\n ...(packageJson.dependencies ?? {}),\n ...(packageJson.devDependencies ?? {}),\n };\n\n // MOVE COMPAT PACKAGES (e.g. next-intl) REPLACED BY @INTLAYER/* TO DEVDEPENDENCIES\n // Part of the package step: the move pairs with installing the adapters.\n const movedPackages = options?.noInstallPackages\n ? []\n : moveCompatPackagesToDevDependencies(packageJson);\n if (movedPackages.length > 0) {\n const indentation = packageJsonContent.match(/^[ \\t]+(?=\")/m)?.[0] ?? 2;\n const trailingNewline = packageJsonContent.endsWith('\\n') ? '\\n' : '';\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n `${JSON.stringify(packageJson, null, indentation)}${trailingNewline}`\n );\n for (const pkg of movedPackages) {\n logger(\n `${v} Moved ${colorize(pkg, ANSIColors.MAGENTA)} from dependencies to devDependencies`\n );\n }\n }\n\n // INSTALL MISSING INTLAYER DEPENDENCIES\n const packageManager = detectPackageManager(rootDir);\n\n // lingui keeps its catalogs as `.po` (default) or `.json`. Detect which so the\n // matching sync plugin (`syncPO` / `syncJSON`) + dev dependency are chosen.\n const linguiPresent = Boolean(\n allDeps['@lingui/core'] ||\n allDeps['@lingui/react'] ||\n allDeps['@intlayer/lingui']\n );\n\n const linguiCatalog = linguiPresent\n ? await detectLinguiCatalogPattern(rootDir)\n : null;\n\n // `linguiCatalogFormat` resolution:\n // 1. Filesystem scan result (authoritative when catalogs already exist)\n // 2. Fallback: 'po' (lingui's default) when lingui is installed but no\n // catalogs have been generated yet.\n const linguiCatalogFormat: 'po' | 'json' | null =\n linguiCatalog?.format ?? (linguiPresent ? 'po' : null);\n\n const {\n packagesToInstall,\n devPackagesToInstall,\n compatSyncConfig,\n compatVitePluginConfig,\n pendingCompatAdapters,\n } = detectMissingIntlayerPackages(allDeps, {\n linguiCatalogFormat,\n dependencies: packageJson.dependencies,\n devDependencies: packageJson.devDependencies,\n skipLintPlugin: options?.noEslint,\n });\n\n /** Whether the compat adapter for a library is not released yet. */\n const isCompatAdapterPending = (adapterPackage: string): boolean =>\n pendingCompatAdapters.includes(adapterPackage);\n\n if (pendingCompatAdapters.length > 0) {\n logger(\n `${x} No released Intlayer adapter yet for ${pendingCompatAdapters\n .map((adapterPackage) => colorize(adapterPackage, ANSIColors.MAGENTA))\n .join(\n ', '\n )} — keeping your current i18n library and only syncing its catalogs with Intlayer.`,\n { level: 'warn' }\n );\n }\n\n // The `json-namespaces` content strategy uses the same syncJSON pipeline as\n // the compat libraries: plain per-locale JSON namespace files synced through\n // `@intlayer/sync-json-plugin`. A detected compat library keeps precedence —\n // its own catalog format/template is authoritative.\n const wantsJsonNamespaces =\n options?.contentStrategy === 'json-namespaces' && !compatSyncConfig;\n\n if (\n wantsJsonNamespaces &&\n !allDeps['@intlayer/sync-json-plugin'] &&\n !devPackagesToInstall.includes('@intlayer/sync-json-plugin')\n ) {\n devPackagesToInstall.push('@intlayer/sync-json-plugin');\n }\n\n if (!options?.noInstallPackages) {\n const withVersion = (packages: string[]): string[] =>\n options?.upgradeToVersion\n ? packages.map((pkg) =>\n isIntlayerPackageName(pkg)\n ? `${pkg}@${options.upgradeToVersion}`\n : pkg\n )\n : packages;\n\n if (packagesToInstall.length > 0) {\n logger(\n colorize('Installing missing Intlayer dependencies...', ANSIColors.CYAN)\n );\n try {\n installPackages(\n rootDir,\n withVersion(packagesToInstall),\n packageManager\n );\n logger(\n `${v} Installed: ${packagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install packages. Please install manually: ${packagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n if (devPackagesToInstall.length > 0) {\n logger(\n colorize(\n 'Installing missing Intlayer dev dependencies...',\n ANSIColors.CYAN\n )\n );\n try {\n installPackages(\n rootDir,\n withVersion(devPackagesToInstall),\n packageManager,\n true\n );\n logger(\n `${v} Installed: ${devPackagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install dev packages. Please install manually: ${devPackagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n // UPGRADE INTLAYER DEPENDENCIES TO LATEST\n await upgradeIntlayerPackages(rootDir);\n }\n\n // CHECK .GITIGNORE\n const gitignorePath = '.gitignore';\n if (\n !options?.noGitignore &&\n !options?.noFrameworkSetup &&\n (await exists(rootDir, gitignorePath))\n ) {\n const gitignoreContent = await readFileFromRoot(rootDir, gitignorePath);\n\n if (!gitignoreContent.includes('intlayer')) {\n const newContent = `${gitignoreContent}\\n# Intlayer\\n.intlayer\\n`;\n await writeFileToRoot(rootDir, gitignorePath, newContent);\n logger(\n `${v} Added ${colorizePath('.intlayer')} to ${colorizePath(gitignorePath)}`\n );\n } else {\n logger(`${v} ${colorizePath(gitignorePath)} already includes .intlayer`);\n }\n }\n\n // SCAFFOLD GITHUB ACTIONS WORKFLOWS (fill + test)\n // Generate two workflows whose commands match the detected package manager:\n // - intlayer-fill.yml: auto-fills missing translations on pull requests\n // - intlayer-test.yml: fails the PR when required locales are missing\n // Every command runs with `--ci`, which iterates over the Intlayer\n // project(s) of the repository. GitHub only triggers workflows stored at the\n // repository root, so in a monorepo the files are written to the git root\n // (see resolveGithubWorkflowsContext).\n if (!options?.noGithubActions) {\n const workflowsContext = await resolveGithubWorkflowsContext(\n rootDir,\n packageManager\n );\n const workflows = getGithubWorkflows(\n workflowsContext.packageManager,\n workflowsContext.options\n );\n\n for (const workflow of workflows) {\n if (await exists(workflowsContext.workflowsRootDir, workflow.filePath)) {\n logger(`${v} ${colorizePath(workflow.filePath)} already exists`);\n continue;\n }\n\n try {\n await ensureDirectory(\n workflowsContext.workflowsRootDir,\n join('.github', 'workflows')\n );\n await writeFileToRoot(\n workflowsContext.workflowsRootDir,\n workflow.filePath,\n workflow.content\n );\n logger(\n `${v} Added GitHub Actions workflow ${colorizePath(workflow.filePath)}`\n );\n } catch {\n logger(\n `${x} Could not create ${colorizePath(workflow.filePath)}. You may need to add it manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // CHECK VS CODE EXTENSION RECOMMENDATIONS\n const vscodeDir = '.vscode';\n const extensionsJsonPath = join(vscodeDir, 'extensions.json');\n const extensionId = 'intlayer.intlayer-vs-code-extension';\n\n if (!options?.noVscodeExtension) {\n try {\n let extensionsConfig: { recommendations: string[] } = {\n recommendations: [],\n };\n\n if (await exists(rootDir, extensionsJsonPath)) {\n const content = await readFileFromRoot(rootDir, extensionsJsonPath);\n extensionsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n if (!extensionsConfig.recommendations) {\n extensionsConfig.recommendations = [];\n }\n\n if (!extensionsConfig.recommendations.includes(extensionId)) {\n extensionsConfig.recommendations.push(extensionId);\n await writeFileToRoot(\n rootDir,\n extensionsJsonPath,\n JSON.stringify(extensionsConfig, null, 2)\n );\n logger(\n `${v} Added ${colorize(extensionId, ANSIColors.MAGENTA)} to ${colorizePath(extensionsJsonPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(extensionsJsonPath)} already includes ${colorize(extensionId, ANSIColors.MAGENTA)}`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(extensionsJsonPath)}. You may need to add ${colorize(extensionId, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK VS CODE LSP SETTINGS\n const settingsJsonPath = join(vscodeDir, 'settings.json');\n\n if (!options?.noLsp) {\n try {\n let settingsConfig: Record<string, unknown> = {};\n\n if (await exists(rootDir, settingsJsonPath)) {\n const content = await readFileFromRoot(rootDir, settingsJsonPath);\n settingsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n let settingsUpdated = false;\n\n if (!settingsConfig['intlayer.languageServer.command']) {\n settingsConfig['intlayer.languageServer.command'] = 'npx';\n settingsUpdated = true;\n }\n\n if (!settingsConfig['intlayer.languageServer.args']) {\n settingsConfig['intlayer.languageServer.args'] = ['@intlayer/lsp'];\n settingsUpdated = true;\n }\n\n if (settingsUpdated) {\n await writeFileToRoot(\n rootDir,\n settingsJsonPath,\n JSON.stringify(settingsConfig, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(settingsJsonPath)} with LSP configuration`\n );\n } else {\n logger(\n `${v} ${colorizePath(settingsJsonPath)} already includes LSP configuration`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(settingsJsonPath)}. You may need to add the LSP settings manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK LINT RULES (eslint-plugin-intlayer)\n //\n // Gated on the project already having a linter installed: with no ESLint or\n // oxlint there is nothing to plug the rules into, and the guidance below\n // would just be noise. The same check gates the install in\n // `detectMissingIntlayerPackages`, so the two never disagree.\n //\n // Only the oxlint config is patched here: `.oxlintrc.json` is plain JSON and\n // safe to edit, whereas an ESLint flat config is arbitrary JavaScript that\n // cannot be rewritten reliably — that one is left to the user, with the\n // snippet printed below.\n if (!options?.noEslint && hasLegacyEslint(allDeps)) {\n logger(\n `${x} ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} needs ESLint ${MINIMUM_ESLINT_MAJOR}+ (flat config) — skipped the Intlayer lint rules. Upgrade ESLint to enable them: ${colorizePath(DocumentationRouter.ESLint)}`,\n { level: 'warn' }\n );\n }\n\n if (!options?.noEslint && hasLintTooling(allDeps)) {\n // Without the package step (`intlayer init eslint`), the lint step\n // installs its own plugin so the rules it enables can resolve.\n if (options?.noInstallPackages && !allDeps[LINT_PLUGIN_PACKAGE_NAME]) {\n const lintPluginSpecifier = options.upgradeToVersion\n ? `${LINT_PLUGIN_PACKAGE_NAME}@${options.upgradeToVersion}`\n : LINT_PLUGIN_PACKAGE_NAME;\n\n try {\n installPackages(rootDir, [lintPluginSpecifier], packageManager, true);\n logger(\n `${v} Installed: ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)}`\n );\n } catch {\n logger(\n `${x} Failed to install ${LINT_PLUGIN_PACKAGE_NAME}. Please install it manually.`,\n { level: 'warn' }\n );\n }\n }\n\n const oxlintConfigPath = '.oxlintrc.json';\n const hasOxlintConfig = await exists(rootDir, oxlintConfigPath);\n // An oxlint-only project without a config gets one; with ESLint around,\n // the rules go into the ESLint config instead.\n const shouldCreateOxlintConfig =\n !hasOxlintConfig && Boolean(allDeps.oxlint) && !allDeps.eslint;\n\n if (hasOxlintConfig || shouldCreateOxlintConfig) {\n try {\n const oxlintConfig: OxlintConfig = hasOxlintConfig\n ? parseJSONWithComments(\n await readFileFromRoot(rootDir, oxlintConfigPath)\n )\n : {};\n\n if (addIntlayerRulesToOxlintConfig(oxlintConfig)) {\n await writeFileToRoot(\n rootDir,\n oxlintConfigPath,\n JSON.stringify(oxlintConfig, null, 2)\n );\n logger(\n `${v} ${hasOxlintConfig ? 'Added the Intlayer lint rules to' : 'Created'} ${colorizePath(oxlintConfigPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(oxlintConfigPath)} already includes the Intlayer lint rules`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(oxlintConfigPath)}. You may need to add ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n } else {\n // ESLint flat config — print the snippet instead of rewriting the file.\n logger([\n colorize('Intlayer lint rules →', ANSIColors.MAGENTA),\n colorize(\n `Add the ${LINT_PLUGIN_PACKAGE_NAME} preset to the array your ESLint flat config exports, to catch hardcoded text and dynamic calls the compiler cannot optimize:`,\n ANSIColors.GREY_LIGHT\n ),\n colorize(\n ` import intlayer from '${LINT_PLUGIN_PACKAGE_NAME}';\\n\\n export default [\\n // ...your existing config\\n ...intlayer.configs.recommended,\\n ];`,\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(DocumentationRouter.ESLint),\n ]);\n }\n }\n\n // PROJECT SETUP\n // Everything below edits the project itself: tsconfig types and aliases, the\n // Intlayer config file, bundler/framework configs and the\n // framework scaffolding. It only runs with the framework setup step, so\n // picking e.g. only the CI or editor steps never creates project files.\n if (!options?.noFrameworkSetup) {\n // CHECK TSCONFIGS\n const tsConfigFiles = await findTsConfigFiles(rootDir);\n let hasTsConfig = false;\n\n for (const fileName of tsConfigFiles) {\n if (await exists(rootDir, fileName)) {\n hasTsConfig = true;\n try {\n const fileContent = await readFileFromRoot(rootDir, fileName);\n const config = parseJSONWithComments(fileContent);\n const typeDefinition = './.intlayer/**/*.ts';\n\n let updated = false;\n\n if (!config.include) {\n // Skip if no include array (solution-style)\n } else if (\n Array.isArray(config.include) &&\n !(config.include as string[]).some((pattern: string) =>\n pattern.includes('.intlayer')\n )\n ) {\n config.include.push(typeDefinition);\n updated = true;\n } else if (config.include.includes(typeDefinition)) {\n logger(\n `${v} ${colorizePath(fileName)} already includes intlayer types`\n );\n }\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n fileName,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(fileName)} to include intlayer types`\n );\n }\n } catch {\n logger(\n `${x} Could not parse or update ${colorizePath(fileName)}. You may need to add ${colorizePath('.intlayer/types/**/*.ts')} manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // INITIALIZE CONFIG FILE\n const format = hasTsConfig ? 'intlayer.config.ts' : 'intlayer.config.mjs';\n\n // Detect the locale JSON file pattern already in the project so we can\n // insert the matching locales into the config and produce the most\n // accurate source template for compat libraries.\n const detectedPattern = await detectJsonLocalePattern(rootDir);\n\n const isConfigCreated = await initConfig(format, rootDir, {\n locales: detectedPattern?.locales,\n applicationURL: getDefaultApplicationURL(allDeps),\n });\n\n // APPLY CONTENT STRATEGY — CENTRALIZED\n // Point `compiler.output` at per-locale JSON dictionaries under `/locales/`\n // instead of the per-component template default.\n if (options?.contentStrategy === 'centralized') {\n await setCompilerOutputInConfig(\n rootDir,\n '/locales/{{locale}}/{{key}}.content.json'\n );\n }\n\n // INJECT SYNC-JSON PLUGIN FOR COMPAT LIBRARIES / JSON-NAMESPACES STRATEGY\n const syncConfigToInject: CompatSyncConfig | undefined =\n compatSyncConfig ??\n (wantsJsonNamespaces\n ? {\n format: 'i18next',\n sourceTemplate:\n detectedPattern?.template ?? './locales/${locale}/${key}.json',\n }\n : undefined);\n\n if (syncConfigToInject) {\n // For next-intl / use-intl, the messages path is authoritatively declared\n // in `i18n/request.ts` (e.g. `import(`../messages/${locale}.json`)`), so we\n // read it directly. It usually resolves to a single file per locale (no\n // `${key}` segment), whose first-level keys are namespaces — so the compat\n // config carries `splitKeys: true` to emit one dictionary per namespace.\n // Falls back to file-system globbing otherwise.\n const nextIntlMessagesPattern =\n allDeps['next-intl'] ||\n allDeps['@intlayer/next-intl'] ||\n allDeps['use-intl'] ||\n allDeps['@intlayer/use-intl']\n ? await detectNextIntlMessagesPattern(rootDir)\n : null;\n\n // lingui authoritatively resolves to `…/{locale}/messages.{po,json}`, where\n // the `messages` filename becomes the dictionary key. Prefer it so a `.po`\n // project gets `syncPO` (the generic JSON glob only sees `.json`).\n const sourceTemplate =\n linguiCatalog?.template ??\n nextIntlMessagesPattern?.template ??\n detectedPattern?.template;\n\n const resolvedSyncConfig = {\n ...syncConfigToInject,\n ...(sourceTemplate ? { sourceTemplate } : {}),\n };\n\n const syncPluginPackage =\n resolvedSyncConfig.plugin === 'po'\n ? '@intlayer/sync-po-plugin'\n : '@intlayer/sync-json-plugin';\n const syncPluginName =\n resolvedSyncConfig.plugin === 'po' ? 'syncPO' : 'syncJSON';\n\n // `splitKeys` only makes sense for a single file holding several namespaces.\n // If the resolved template addresses one namespace per file (`${key}`\n // segment), each file is already a single namespace — drop the flag so\n // syncJSON keeps one dictionary per file.\n if (\n resolvedSyncConfig.splitKeys &&\n resolvedSyncConfig.sourceTemplate.includes('${key}')\n ) {\n resolvedSyncConfig.splitKeys = false;\n }\n\n const intlayerConfigCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.mjs',\n 'intlayer.config.js',\n 'intlayer.config.cjs',\n ];\n\n for (const configFile of intlayerConfigCandidates) {\n if (await exists(rootDir, configFile)) {\n const configContent = await readFileFromRoot(rootDir, configFile);\n\n if (!configContent.includes(syncPluginPackage)) {\n const extension = configFile.split('.').pop()!;\n const updatedConfigContent = updateIntlayerConfigWithSyncPlugin(\n configContent,\n extension,\n resolvedSyncConfig\n );\n await writeFileToRoot(rootDir, configFile, updatedConfigContent);\n logger(\n `${v} Updated ${colorizePath(configFile)} with ${syncPluginName} compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(configFile)} already includes ${syncPluginName} plugin`\n );\n }\n break;\n }\n }\n }\n\n // APPLY ROUTING\n // An explicit choice (interactive prompt / `--routing`) is written to\n // `routing.mode` + `routing.enableProxy`. Without one, a freshly created\n // config is adapted to the project: frontends get prefix routing through\n // the proxy (the template ships it disabled), projects without URL routing\n // (backend, React Native…) keep only `routing.storage`. An existing config\n // is never rewritten without an explicit choice. A compat i18n library\n // owns the app routing, so its config keeps the template's disabled proxy:\n // compat bundler plugins wrap `intlayer()`, which would register it.\n const hasUrlRouting = hasUrlRoutingFramework(allDeps);\n const hasCompatI18nLibrary = detectCompatI18nLibraries(allDeps).length > 0;\n const shouldApplyDefaultRouting =\n isConfigCreated &&\n options?.routingMode === undefined &&\n !hasCompatI18nLibrary;\n\n if (shouldApplyDefaultRouting && !hasUrlRouting) {\n await setRoutingStorageOnlyInConfig(rootDir);\n }\n\n const routingMode =\n options?.routingMode ??\n (shouldApplyDefaultRouting && hasUrlRouting ? ROUTING_MODE : undefined);\n const enableProxy =\n options?.enableProxy ??\n (shouldApplyDefaultRouting && hasUrlRouting ? true : undefined);\n\n if (routingMode) {\n await setRoutingModeInConfig(rootDir, routingMode);\n }\n\n if (enableProxy !== undefined) {\n await setEnableProxyInConfig(rootDir, enableProxy);\n }\n\n let hasAliasConfiguration = false;\n\n // CHECK VITE CONFIG\n const viteConfigs = ['vite.config.ts', 'vite.config.js', 'vite.config.mjs'];\n\n for (const file of viteConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (compatVitePluginConfig) {\n const { replacesVitePlugin } = compatVitePluginConfig;\n\n if (content.includes(compatVitePluginConfig.pluginPackageSource)) {\n logger(\n `${v} ${colorizePath(file)} already includes ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else if (\n replacesVitePlugin &&\n content.includes(replacesVitePlugin.fromPackageSource)\n ) {\n // Drop-in replacement: rewrite the original i18n vite plugin's import\n // source, keeping its binding and call site (e.g. lingui).\n const updatedContent = replaceViteConfigPluginImportSource(\n content,\n replacesVitePlugin.importName,\n replacesVitePlugin.fromPackageSource,\n compatVitePluginConfig.pluginPackageSource\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to import ${replacesVitePlugin.importName} from ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else {\n const updatedContent = updateViteConfigForCompatPlugin(\n content,\n extension,\n compatVitePluginConfig\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include ${compatVitePluginConfig.pluginFunctionName} compat plugin`\n );\n }\n } else if (hasIntlayerVitePlugin(content)) {\n // A compat adapter plugin (e.g. `reactI18nextVitePlugin`) already wraps\n // `intlayer()` internally, so skip adding a redundant standalone plugin.\n logger(\n `${v} ${colorizePath(file)} already includes an Intlayer plugin`\n );\n } else {\n const updatedContent = updateViteConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT CONFIG\n const nextConfigs = ['next.config.js', 'next.config.mjs', 'next.config.ts'];\n let isNextJsProject = false;\n\n for (const file of nextConfigs) {\n if (await exists(rootDir, file)) {\n isNextJsProject = true;\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (allDeps['next-i18next'] || allDeps['@intlayer/next-i18next']) {\n if (!content.includes('@intlayer/next-i18next')) {\n const updatedContent = updateNextConfigForNextI18next(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-i18next compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-i18next`\n );\n }\n } else if (allDeps['next-intl'] || allDeps['@intlayer/next-intl']) {\n if (!content.includes('@intlayer/next-intl/plugin')) {\n const updatedContent = updateNextConfigForNextIntl(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-intl compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-intl/plugin`\n );\n }\n } else if (isCompatAdapterPending('@intlayer/next-translate')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (next-translate stays in charge)`\n );\n } else if (\n allDeps['next-translate'] ||\n allDeps['@intlayer/next-translate']\n ) {\n if (!content.includes('@intlayer/next-translate')) {\n const updatedContent = updateNextConfigForNextTranslate(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-translate compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-translate`\n );\n }\n } else if (!content.includes('next-intlayer')) {\n const updatedContent = updateNextConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT.JS COMPILER (BABEL)\n // When a Next.js project already uses Babel, install @intlayer/babel and print\n // the compiler + build-optimization plugins (extract, purge, minify, optimize)\n // to add. SWC projects need no setup: withIntlayer injects @intlayer/swc.\n if (isNextJsProject) {\n await setupNextCompilerBabelConfig({\n rootDir,\n packageManager,\n allDeps,\n skipInstall: Boolean(options?.noInstallPackages),\n });\n }\n\n // CHECK OTHER FRAMEWORKS CONFIG\n const astroConfigs = [\n 'astro.config.mjs',\n 'astro.config.js',\n 'astro.config.ts',\n 'astro.config.cjs',\n ];\n\n for (const file of astroConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n if (file.startsWith('astro.config.')) {\n const content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('astro-intlayer')) {\n const extension = file.split('.').pop()!;\n const updatedContent = updateAstroConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer integration`\n );\n }\n }\n break;\n }\n }\n\n const nuxtConfigs = ['nuxt.config.js', 'nuxt.config.ts'];\n for (const file of nuxtConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n const content = await readFileFromRoot(rootDir, file);\n\n if (isCompatAdapterPending('@intlayer/nuxtjs-i18n')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (@nuxtjs/i18n stays in charge)`\n );\n } else if (allDeps['@nuxtjs/i18n']) {\n if (!content.includes('@intlayer/nuxtjs-i18n')) {\n const updatedContent = updateNuxtConfigForNuxtjsI18n(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include @intlayer/nuxtjs-i18n module`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/nuxtjs-i18n`\n );\n }\n } else if (!content.includes('nuxt-intlayer')) {\n const updatedContent = updateNuxtConfig(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer module`\n );\n }\n break;\n }\n }\n\n // CHECK METRO CONFIG (React Native / Expo)\n // Metro is the React Native bundler. The Intlayer Metro plugin\n // (`react-native-intlayer/metro`) handles dictionary aliasing and building.\n // When no config exists we scaffold one; when one exists we safely wrap its\n // exported config with `configMetroIntlayerSync`, leaving custom async\n // (IIFE) configs untouched so existing setups are never broken.\n const isReactNativeProject = Boolean(\n allDeps['react-native'] || allDeps.expo\n );\n\n if (isReactNativeProject) {\n // Metro resolves Intlayer aliases itself, so skip the alias fallback below.\n hasAliasConfiguration = true;\n\n const metroConfigs = [\n 'metro.config.js',\n 'metro.config.cjs',\n 'metro.config.mjs',\n 'metro.config.ts',\n ];\n\n let metroConfigFile: string | undefined;\n\n for (const file of metroConfigs) {\n if (await exists(rootDir, file)) {\n metroConfigFile = file;\n break;\n }\n }\n\n if (metroConfigFile) {\n const content = await readFileFromRoot(rootDir, metroConfigFile);\n\n if (content.includes('react-native-intlayer')) {\n logger(\n `${v} ${colorizePath(metroConfigFile)} already includes the Intlayer Metro plugin`\n );\n } else {\n const extension = metroConfigFile.split('.').pop()!;\n const updatedContent = updateMetroConfig(content, extension);\n\n if (updatedContent !== content) {\n await writeFileToRoot(rootDir, metroConfigFile, updatedContent);\n logger(\n `${v} Updated ${colorizePath(metroConfigFile)} to include the Intlayer Metro plugin`\n );\n } else {\n logger(\n `${x} Could not automatically update ${colorizePath(metroConfigFile)}. Wrap your exported config with ${colorize('configMetroIntlayer', ANSIColors.MAGENTA)}: ${colorizePath(DocumentationRouter.ReactNativeAndExpo)}`,\n { level: 'warn' }\n );\n }\n }\n } else {\n const newMetroConfigFile = 'metro.config.js';\n await writeFileToRoot(\n rootDir,\n newMetroConfigFile,\n getMetroConfigTemplate(Boolean(allDeps.expo))\n );\n logger(\n `${v} Created ${colorizePath(newMetroConfigFile)} with the Intlayer Metro plugin`\n );\n }\n }\n\n // CHECK WEBPACK CONFIG\n const webpackConfigs = [\n 'webpack.config.js',\n 'webpack.config.ts',\n 'webpack.config.mjs',\n 'webpack.config.cjs',\n ];\n\n for (const file of webpackConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n logger(\n `${v} Found ${colorizePath(\n file\n )}. Make sure to configure aliases manually or use the Intlayer Webpack plugin.`\n );\n break;\n }\n }\n\n // The server frameworks themselves, alongside their Intlayer packages: a\n // project may be mid-setup and carry only one of the two.\n const backendConfigPackages = [\n 'express',\n 'fastify',\n '@adonisjs/core',\n 'hono',\n 'elysia',\n ...BACKEND_INTLAYER_PACKAGES,\n ];\n\n if (backendConfigPackages.some((pkg) => allDeps[pkg])) {\n hasAliasConfiguration = true;\n }\n\n if (!hasAliasConfiguration) {\n const configuration = getConfiguration({ baseDir: rootDir });\n // `tsconfig`/`jsconfig` `paths` and `package.json` `imports` both expect\n // explicitly relative specifiers, so bare relative paths get a `./` prefix.\n const aliases = getAlias({\n configuration,\n formatter: (value) =>\n value.startsWith('./') || value.startsWith('../')\n ? value\n : `./${value}`,\n });\n\n if (hasTsConfig && tsConfigFiles.length > 0) {\n const tsConfigPath =\n tsConfigFiles.find((file) => file === 'tsconfig.json') ||\n tsConfigFiles[0];\n\n if (tsConfigPath) {\n const tsConfigContent = await readFileFromRoot(rootDir, tsConfigPath);\n const config = parseJSONWithComments(tsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n tsConfigPath,\n JSON.stringify(config, null, 2)\n );\n\n logger(\n `${v} Updated ${colorizePath(\n tsConfigPath\n )} to include Intlayer aliases`\n );\n }\n }\n } else {\n const jsConfigPath = 'jsconfig.json';\n\n if (await exists(rootDir, jsConfigPath)) {\n const jsConfigContent = await readFileFromRoot(rootDir, jsConfigPath);\n const config = parseJSONWithComments(jsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n jsConfigPath,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n jsConfigPath\n )} to include Intlayer aliases`\n );\n }\n } else {\n packageJson.imports ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n const importAlias = alias.replace('@', '#');\n\n if (!packageJson.imports[importAlias]) {\n packageJson.imports[importAlias] = path;\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n JSON.stringify(packageJson, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n packageJsonPath\n )} to include Intlayer imports`\n );\n }\n }\n }\n }\n\n // FRAMEWORK-SPECIFIC SCAFFOLDING\n // Sets up middleware/proxy and wraps the layout/page with the Intlayer\n // providers for the detected framework (Next.js App Router today). Idempotent\n // and non-destructive: it never overwrites user code it cannot safely\n // transform, skipping with guidance instead.\n //\n // Skipped entirely when a compat i18n library drives the app (i18next,\n // next-intl, vue-i18n, …): the app already owns its routing, providers and\n // layouts, and Intlayer only syncs its catalogs — restructuring routes or\n // injecting providers would break the existing setup.\n const hasCompatLibrary = Boolean(\n compatSyncConfig || compatVitePluginConfig\n );\n\n if (hasCompatLibrary) {\n logger(\n `${v} Compat i18n library detected — keeping the app structure untouched (no route restructure, no provider injection)`\n );\n }\n\n if (!hasCompatLibrary) {\n try {\n // Prefer the user's choices, else the configured routing (mode defaults\n // to `prefix-no-default`, an unset `enableProxy` means enabled). Drives\n // the proxy file and the locale route segment the adapters scaffold.\n const { routing } = getConfiguration({ baseDir: rootDir });\n\n await setupFramework({\n rootDir,\n allDeps,\n packageManager,\n useTypeScript: hasTsConfig,\n routingMode: routingMode ?? routing.mode,\n enableProxy: enableProxy ?? routing.enableProxy !== false,\n });\n } catch {\n logger(\n `${x} Framework-specific scaffolding failed. Your existing files were left untouched; follow the documentation to finish the setup.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // FINAL SUCCESS MESSAGE\n if (!options?.skipFinalMessage) {\n logInitSuccessMessage(guideUrl);\n }\n\n return { guideUrl };\n};\n\nexport const logInitSuccessMessage = (guideUrl: string): void => {\n logger(`${v} ${colorize('Intlayer init setup complete.', ANSIColors.GREEN)}`);\n logger([\n colorize('Next →', ANSIColors.MAGENTA),\n colorize(\n 'Follow the instructions in the documentation to complete the setup:',\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(guideUrl),\n ]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,MAAa,4BACX,iBACW;CACX,IAAI,aAAa,MAAM,OAAO;CAC9B,IAAI,aAAa,OAAO,OAAO;CAC/B,IAAI,aAAa,kBAAkB,OAAO;CAC1C,IAAI,aAAa,MAAM,OAAO;CAC9B,IAAI,aAAa,kBAAkB,OAAO;CAC1C,IAAI,aAAa,kBAAkB,OAAO;CAC1C,IAAI,aAAa,MAAM,OAAO;CAE9B,OAAO;AACT;;;;AA0EA,MAAa,eAAe,OAAO,SAAiB,YAA0B;CAC5E,wCAAOA,kCAAS,sCAAsCC,wBAAW,IAAI,CAAC;CAGtE,MAAM,kBAAkB;CACxB,IAAI,CAAE,MAAMC,qCAAO,SAAS,eAAe,GAAI;EAC7C,oCACE,GAAGC,0BAAE,UAAMC,sCAAa,cAAc,EAAE,wDACxC,EAAE,OAAO,QAAQ,CACnB;EACA,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,qBAAqB,MAAMC,+CAAiB,SAAS,eAAe;CAC1E,IAAI;CACJ,IAAI;EACF,cAAc,KAAK,MAAM,kBAAkB;CAC7C,QAAQ;EACN,oCAAO,GAAGF,0BAAE,uBAAmBC,sCAAa,cAAc,EAAE,IAAI,EAC9D,OAAO,QACT,CAAC;EACD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,WAAWE,qDAAoB,WAAW;CAEhD,MAAM,UAAkC;EACtC,GAAI,YAAY,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EACH,QAAQ;GACN,oCACE,GAAGnD,0BAAE,iIACL,EAAE,OAAO,OAAO,CAClB;EACF;CAEJ;CAGA,IAAI,CAAC,SAAS,kBACZ,sBAAsB,QAAQ;CAGhC,OAAO,EAAE,SAAS;AACpB;AAEA,MAAa,yBAAyB,aAA2B;CAC/D,oCAAO,GAAGM,0BAAE,OAAGT,kCAAS,iCAAiCC,wBAAW,KAAK,GAAG;CAC5E,oCAAO;MACLD,kCAAS,UAAUC,wBAAW,OAAO;MACrCD,kCACE,uEACAC,wBAAW,UACb;MACAG,sCAAa,QAAQ;CACvB,CAAC;AACH"}
|
|
@@ -286,7 +286,7 @@ const detectMissingIntlayerPackages = (allDependencies, options = {}) => {
|
|
|
286
286
|
if (isInstalled("hono")) addIfMissing("hono-intlayer");
|
|
287
287
|
if (isInstalled("elysia")) addIfMissing("elysia-intlayer");
|
|
288
288
|
if (isInstalled("@adonisjs/core")) addIfMissing("adonis-intlayer");
|
|
289
|
-
if (hasLintTooling(allDependencies)) addDevIfMissing("eslint-plugin-intlayer");
|
|
289
|
+
if (!options.skipLintPlugin && hasLintTooling(allDependencies)) addDevIfMissing("eslint-plugin-intlayer");
|
|
290
290
|
if (isInstalled("next-intl") || isInstalled("@intlayer/next-intl")) {
|
|
291
291
|
markCompatReplacement("next-intl", "@intlayer/next-intl");
|
|
292
292
|
compatSyncConfig ??= {
|