@intlayer/cli 9.5.9 → 9.5.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"init.cjs","names":["resolve","existsSync","join","readFileSync","loadPrompts","detectCompatI18nLibraries","initIntlayer","initSkills","initMCP","initInfra","login","setupCmsCredentials"],"sources":["../../src/init.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport {\n detectCompatI18nLibraries,\n type InitOptions,\n initIntlayer,\n type RoutingMode,\n setupCmsCredentials,\n} from '@intlayer/engine/cli';\nimport { login } from './auth/login';\nimport { initInfra } from './initInfra';\nimport { initMCP } from './initMCP';\nimport { initSkills } from './initSkills';\nimport { loadPrompts } from './loadPrompts';\n\nexport const findProjectRoot = (startDir: string) => {\n let currentDir = startDir;\n\n while (currentDir !== resolve(currentDir, '..')) {\n if (existsSync(join(currentDir, 'package.json'))) {\n return currentDir;\n }\n currentDir = resolve(currentDir, '..');\n }\n\n // If no package.json is found, return the start directory.\n // The initIntlayer function will handle the missing package.json error.\n return startDir;\n};\n\n/** Individually selectable setup steps exposed by the interactive init flow. */\ntype InitStep =\n | 'packages'\n | 'githubActions'\n | 'projectSetup'\n | 'vscodeExtension'\n | 'lsp'\n | 'eslint'\n | 'skills'\n | 'mcp'\n | 'infra'\n | 'cms';\n\n/** A checkbox entry of the interactive init flow. */\ntype InitStepOption = {\n value: InitStep;\n label: string;\n hint: string;\n};\n\n/**\n * Steps shown but not pre-selected. The infrastructure installer touches the\n * machine (downloads an app, pulls Docker images) rather than the project, so\n * it must be an explicit choice.\n */\nconst OPT_IN_INIT_STEPS: InitStep[] = ['infra'];\n\n/** Grouped checkbox entries of the interactive init flow, in display order. */\nconst INIT_STEP_GROUPS: Record<string, InitStepOption[]> = {\n Codebase: [\n {\n value: 'packages',\n label: 'Install & upgrade packages',\n hint: 'install missing Intlayer dependencies and upgrade outdated ones',\n },\n {\n value: 'projectSetup',\n label: 'Project setup',\n hint: 'intlayer config, tsconfig, bundler plugin, middleware/proxy and providers in layout/page',\n },\n {\n value: 'githubActions',\n label: 'CI/CD (GitHub Actions)',\n hint: 'scaffold the fill and test workflows that run on every pull request (covers every project in a monorepo)',\n },\n ],\n DevTools: [\n {\n value: 'vscodeExtension',\n label: 'VS Code extension',\n hint: 'recommend the Intlayer extension',\n },\n {\n value: 'eslint',\n label: 'Lint rules (ESLint / oxlint)',\n hint: 'flag hardcoded text and dynamic calls the compiler cannot optimize',\n },\n ],\n 'Coding assistant': [\n {\n value: 'skills',\n label: 'AI skills',\n hint: 'install the Intlayer documentation as agent skills',\n },\n {\n value: 'mcp',\n label: 'MCP server',\n hint: 'configure the Intlayer MCP server',\n },\n {\n value: 'lsp',\n label: 'Editor LSP',\n hint: 'go-to-definition from keys to .content files',\n },\n ],\n CMS: [\n {\n value: 'cms',\n label: 'CMS',\n hint: 'log in through your browser, then store the credentials in your .env',\n },\n {\n value: 'infra',\n label: 'Infrastructure (desktop app / self-hosting)',\n hint: 'install the desktop app, or self-host with Docker (all-in-one or Compose)',\n },\n ],\n};\n\n/** Locale routing strategies offered by the interactive init flow. */\nconst ROUTING_MODE_OPTIONS: Array<{\n value: RoutingMode;\n label: string;\n hint: string;\n}> = [\n {\n value: 'prefix-no-default',\n label: 'Prefix all except the default locale',\n hint: '/about, /fr/about (default)',\n },\n {\n value: 'prefix-all',\n label: 'Prefix all locales',\n hint: '/en/about, /fr/about',\n },\n {\n value: 'no-prefix',\n label: 'No locale in the URL',\n hint: '/about',\n },\n {\n value: 'search-params',\n label: 'Use a search parameter',\n hint: '/about?locale=fr',\n },\n];\n\n/** Reads the merged dependencies of the project at `root`. */\nconst getProjectDependencies = (root: string): Record<string, string> => {\n try {\n const packageJsonPath = join(root, 'package.json');\n if (!existsSync(packageJsonPath)) return {};\n const { dependencies = {}, devDependencies = {} } = JSON.parse(\n readFileSync(packageJsonPath, 'utf-8')\n );\n return { ...dependencies, ...devDependencies };\n } catch {\n return {};\n }\n};\n\n/**\n * Returns true when the project uses a URL-based router for which a locale\n * routing strategy is meaningful: Next.js, React Router, or TanStack Router.\n * Apps without URL routing (e.g. React Native / Expo) are excluded, since\n * `routing.mode` has no effect there.\n */\nconst hasUrlRouting = (root: string): boolean => {\n const deps = getProjectDependencies(root);\n\n // React Native / Expo apps have no URL routing — never ask for a strategy.\n if (deps['react-native'] || deps.expo) return false;\n\n return Boolean(\n deps.next ||\n deps['react-router'] ||\n deps['react-router-dom'] ||\n deps['@tanstack/react-router'] ||\n deps['@tanstack/react-start']\n );\n};\n\n/**\n * Runs `init` in interactive mode: prompts the user with a checkbox of setup\n * steps, then forwards the selection to {@link initIntlayer} (packages, GitHub\n * Actions, VS Code extension, LSP) and runs the dedicated skills/MCP installers\n * for the steps that own their own prompts. The `.gitignore` entry is not\n * offered as a checkbox — it is always added (unless `--no-gitignore` is set).\n */\nconst runInteractiveInit = async (\n root: string,\n baseOptions?: InitOptions\n): Promise<void> => {\n const p = await loadPrompts();\n\n p.intro('Initialize Intlayer');\n\n const selected = await p.groupMultiselect<InitStep>({\n message: 'Select what you want to set up:',\n options: INIT_STEP_GROUPS,\n initialValues: Object.values(INIT_STEP_GROUPS)\n .flat()\n .map((option) => option.value)\n .filter((step) => !OPT_IN_INIT_STEPS.includes(step)),\n required: false,\n });\n\n if (p.isCancel(selected)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const steps = selected as InitStep[];\n\n // Locale routing strategy → written to `routing.mode` in the config file.\n // Only relevant for URL-based routers (Next.js, React Router, TanStack);\n // skipped for apps without URL routing such as React Native / Expo.\n let routingMode: RoutingMode | undefined;\n\n if (steps.includes('projectSetup') && hasUrlRouting(root)) {\n const selectedRoutingMode = await p.select<RoutingMode>({\n message: 'Which locale routing strategy do you want?',\n options: ROUTING_MODE_OPTIONS,\n initialValue: 'prefix-no-default',\n });\n\n if (p.isCancel(selectedRoutingMode)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n routingMode = selectedRoutingMode;\n }\n\n // Compat i18n library detection — never asked, always derived from the\n // installed packages. `detectMissingIntlayerPackages` reads the very same\n // dependency map to schedule the compat adapter, the sync plugin and the\n // catalog template, so a project without any of those packages is simply set\n // up on Intlayer alone.\n const detectedCompatLibraries = detectCompatI18nLibraries(\n getProjectDependencies(root)\n );\n const hasCompatLib = detectedCompatLibraries.length > 0;\n\n if (hasCompatLib) {\n p.log.info(\n `Detected existing i18n ${detectedCompatLibraries.length > 1 ? 'libraries' : 'library'}: ${detectedCompatLibraries.join(', ')} — the matching Intlayer compat adapter and catalog sync will be set up.`\n );\n }\n\n const options: InitOptions = {\n ...baseOptions,\n routingMode,\n noInstallPackages: !steps.includes('packages'),\n // The `.gitignore` entry is never offered as a checkbox: in interactive\n // mode we always add `.intlayer` to `.gitignore`, only honoring an explicit\n // `--no-gitignore` flag from the command line.\n noGitignore: baseOptions?.noGitignore,\n // Respect explicit `--no-*` flags from the command line even when the\n // corresponding step is selected in the checkbox.\n noGithubActions:\n baseOptions?.noGithubActions || !steps.includes('githubActions'),\n noFrameworkSetup:\n baseOptions?.noFrameworkSetup || !steps.includes('projectSetup'),\n noVscodeExtension: !steps.includes('vscodeExtension'),\n noLsp: !steps.includes('lsp'),\n noEslint: !steps.includes('eslint'),\n };\n\n await initIntlayer(root, options);\n\n // Skills ask for the platform after the skill selection; MCP reuses it.\n const skillsPlatform = steps.includes('skills')\n ? await initSkills(root)\n : undefined;\n\n if (steps.includes('mcp')) {\n await initMCP(root, skillsPlatform);\n }\n\n // Delegated to the hosted install script, which owns its own menu.\n if (steps.includes('infra')) {\n await initInfra();\n }\n\n // CMS / visual editor runs last: the browser login persists the access-key\n // credentials to `.env` and enables the editor in the config file. Kept last\n // so the browser flow does not interrupt setup.\n if (steps.includes('cms')) {\n p.log.info('Opening your browser to log in to the Intlayer CMS...');\n // `exitAfter: false` keeps the process alive so the flow can finish; the\n // credentials are persisted to `.env` and the editor enabled in the config.\n await login({\n exitAfter: false,\n onCredentials: (credentials) => setupCmsCredentials(root, credentials),\n });\n }\n\n p.outro('Intlayer initialization complete');\n};\n\nexport const init = async (\n projectRoot?: string,\n options?: InitOptions,\n interactive?: boolean\n) => {\n const root = projectRoot\n ? findProjectRoot(resolve(projectRoot))\n : findProjectRoot(process.cwd());\n\n if (interactive) {\n await runInteractiveInit(root, options);\n return;\n }\n\n await initIntlayer(root, options);\n};\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,mBAAmB,aAAqB;CACnD,IAAI,aAAa;CAEjB,OAAO,mBAAeA,mBAAQ,YAAY,IAAI,GAAG;EAC/C,QAAIC,wBAAWC,gBAAK,YAAY,cAAc,CAAC,GAC7C,OAAO;EAET,iBAAaF,mBAAQ,YAAY,IAAI;CACvC;CAIA,OAAO;AACT;;;;;;AA2BA,MAAM,oBAAgC,CAAC,OAAO;;AAG9C,MAAM,mBAAqD;CACzD,UAAU;EACR;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,UAAU,CACR;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,GACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,CACF;CACA,oBAAoB;EAClB;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,KAAK,CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,GACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,CACF;AACF;;AAGA,MAAM,uBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAA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uB,IAAI,CAC7B;CAGA,IAFqB,wBAAwB,SAAS,GAGpD,EAAE,IAAI,KACJ,0BAA0B,wBAAwB,SAAS,IAAI,cAAc,UAAU,IAAI,wBAAwB,KAAK,IAAI,EAAE,yEAChI;CAGF,MAAM,UAAuB;EAC3B,GAAG;EACH;EACA,mBAAmB,CAAC,MAAM,SAAS,UAAU;EAI7C,aAAa,aAAa;EAG1B,iBACE,aAAa,mBAAmB,CAAC,MAAM,SAAS,eAAe;EACjE,kBACE,aAAa,oBAAoB,CAAC,MAAM,SAAS,cAAc;EACjE,mBAAmB,CAAC,MAAM,SAAS,iBAAiB;EACpD,OAAO,CAAC,MAAM,SAAS,KAAK;EAC5B,UAAU,CAAC,MAAM,SAAS,QAAQ;CACpC;CAEA,UAAMC,mCAAa,MAAM,OAAO;CAGhC,MAAM,iBAAiB,MAAM,SAAS,QAAQ,IAC1C,MAAMC,8BAAW,IAAI,IACrB;CAEJ,IAAI,MAAM,SAAS,KAAK,GACtB,MAAMC,wBAAQ,MAAM,cAAc;CAIpC,IAAI,MAAM,SAAS,OAAO,GACxB,MAAMC,4BAAU;CAMlB,IAAI,MAAM,SAAS,KAAK,GAAG;EACzB,EAAE,IAAI,KAAK,uDAAuD;EAGlE,MAAMC,yBAAM;GACV,WAAW;GACX,gBAAgB,oBAAgBC,0CAAoB,MAAM,WAAW;EACvE,CAAC;CACH;CAEA,EAAE,MAAM,kCAAkC;AAC5C;AAEA,MAAa,OAAO,OAClB,aACA,SACA,gBACG;CACH,MAAM,OAAO,cACT,oBAAgBX,mBAAQ,WAAW,CAAC,IACpC,gBAAgB,QAAQ,IAAI,CAAC;CAEjC,IAAI,aAAa;EACf,MAAM,mBAAmB,MAAM,OAAO;EACtC;CACF;CAEA,UAAMM,mCAAa,MAAM,OAAO;AAClC"}
1
+ {"version":3,"file":"init.cjs","names":["resolve","existsSync","join","hasLintTooling","readFileSync","loadPrompts","detectCompatI18nLibraries","hasUrlRoutingFramework","initIntlayer","initSkills","initMCP","initInfra","initChromeExtension","login","setupCmsCredentials"],"sources":["../../src/init.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport {\n detectCompatI18nLibraries,\n hasLintTooling,\n hasUrlRoutingFramework,\n type InitOptions,\n initIntlayer,\n logInitSuccessMessage,\n type RoutingMode,\n setupCmsCredentials,\n} from '@intlayer/engine/cli';\nimport { login } from './auth/login';\nimport { initChromeExtension } from './initChromeExtension';\nimport { initInfra } from './initInfra';\nimport { initMCP } from './initMCP';\nimport { initSkills } from './initSkills';\nimport { loadPrompts } from './loadPrompts';\n\nexport const findProjectRoot = (startDir: string) => {\n let currentDir = startDir;\n\n while (currentDir !== resolve(currentDir, '..')) {\n if (existsSync(join(currentDir, 'package.json'))) {\n return currentDir;\n }\n currentDir = resolve(currentDir, '..');\n }\n\n // If no package.json is found, return the start directory.\n // The initIntlayer function will handle the missing package.json error.\n return startDir;\n};\n\n/** Individually selectable setup steps exposed by the interactive init flow. */\nexport type InitStep =\n | 'packages'\n | 'githubActions'\n | 'projectSetup'\n | 'vscodeExtension'\n | 'lsp'\n | 'eslint'\n | 'skills'\n | 'mcp'\n | 'infra'\n | 'cms'\n | 'chromeExtension';\n\n/** A checkbox entry of the interactive init flow. */\nexport type InitStepOption = {\n value: InitStep;\n label: string;\n hint: string;\n};\n\n/**\n * Steps shown but not pre-selected. The infrastructure installer touches the\n * machine (downloads an app, pulls Docker images) and browser extensions open external URLs\n * rather than modifying the project, so they must be an explicit choice.\n */\nexport const OPT_IN_INIT_STEPS: InitStep[] = ['infra', 'chromeExtension'];\n\n/** Grouped checkbox entries of the interactive init flow, in display order. */\nexport const INIT_STEP_GROUPS: Record<string, InitStepOption[]> = {\n Codebase: [\n {\n value: 'packages',\n label: 'Install & upgrade packages',\n hint: 'install missing Intlayer dependencies and upgrade outdated ones',\n },\n {\n value: 'projectSetup',\n label: 'Project setup',\n hint: 'intlayer config, tsconfig, bundler plugin, middleware/proxy and providers in layout/page',\n },\n {\n value: 'githubActions',\n label: 'CI/CD (GitHub Actions)',\n hint: 'scaffold the fill and test workflows that run on every pull request (covers every project in a monorepo)',\n },\n ],\n DevTools: [\n {\n value: 'vscodeExtension',\n label: 'VS Code extension',\n hint: 'recommend the Intlayer extension',\n },\n {\n value: 'eslint',\n label: 'Lint rules (ESLint / oxlint)',\n hint: 'flag hardcoded text and dynamic calls the compiler cannot optimize',\n },\n {\n value: 'chromeExtension',\n label: 'Chrome extension',\n hint: 'for audit, debug and analysis purpose',\n },\n ],\n 'Coding assistant': [\n {\n value: 'skills',\n label: 'AI skills',\n hint: 'install the Intlayer documentation as agent skills',\n },\n {\n value: 'mcp',\n label: 'MCP server',\n hint: 'configure the Intlayer MCP server',\n },\n {\n value: 'lsp',\n label: 'Editor LSP',\n hint: 'go-to-definition from keys to .content files',\n },\n ],\n CMS: [\n {\n value: 'cms',\n label: 'CMS',\n hint: 'log in through your browser, then store the credentials in your .env',\n },\n {\n value: 'infra',\n label: 'Infrastructure (desktop app / self-hosting)',\n hint: 'install the desktop app, or self-host with Docker (all-in-one or Compose)',\n },\n ],\n};\n\n/**\n * Locale routing choice: a `routing.mode` served through the locale proxy, or\n * `none` to leave routing to the app (`no-prefix` with the proxy disabled).\n */\nexport type LocaleRoutingChoice = RoutingMode | 'none';\n\n/** Locale routing strategies offered by the interactive init flow. */\nconst ROUTING_OPTIONS: Array<{\n value: LocaleRoutingChoice;\n label: string;\n hint: string;\n}> = [\n {\n value: 'prefix-no-default',\n label: 'Prefix all except the default locale',\n hint: '/about, /fr/about (default)',\n },\n {\n value: 'prefix-all',\n label: 'Prefix all locales',\n hint: '/en/about, /fr/about',\n },\n {\n value: 'no-prefix',\n label: 'No locale in the URL',\n hint: '/about',\n },\n {\n value: 'search-params',\n label: 'Use a search parameter',\n hint: '/about?locale=fr',\n },\n {\n value: 'none',\n label: 'No locale routing',\n hint: 'no proxy, no locale route segment — handle the locale yourself',\n },\n];\n\n/** Locale routing choices accepted by `--routing`. */\nexport const LOCALE_ROUTING_CHOICES = ROUTING_OPTIONS.map(\n (option) => option.value\n);\n\n/** Validates a `--routing` value, throwing on an unknown choice. */\nexport const parseLocaleRoutingChoice = (\n value: string\n): LocaleRoutingChoice => {\n const choice = LOCALE_ROUTING_CHOICES.find((routing) => routing === value);\n\n if (!choice) {\n throw new Error(\n `Invalid --routing value \"${value}\". Expected one of: ${LOCALE_ROUTING_CHOICES.join(', ')}.`\n );\n }\n\n return choice;\n};\n\n/** Maps a routing choice to the init options it sets. */\nexport const getRoutingInitOptions = (\n choice: LocaleRoutingChoice\n): Pick<InitOptions, 'routingMode' | 'enableProxy'> =>\n choice === 'none'\n ? { routingMode: 'no-prefix', enableProxy: false }\n : { routingMode: choice, enableProxy: true };\n\n/** Known ESLint and oxlint configuration file names. */\nexport const ESLINT_CONFIG_FILES = [\n 'eslint.config.js',\n 'eslint.config.mjs',\n 'eslint.config.cjs',\n 'eslint.config.ts',\n 'eslint.config.mts',\n 'eslint.config.cts',\n '.eslintrc.js',\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n '.eslintrc',\n '.oxlintrc.json',\n];\n\n/**\n * Checks whether ESLint or a compatible linter (oxlint) is installed or\n * configured in the project.\n */\nexport const isEslintInstalled = (\n dependencies: Record<string, string>,\n root?: string\n): boolean => {\n if (hasLintTooling(dependencies)) return true;\n if (dependencies.eslint || dependencies.oxlint) return true;\n\n if (root) {\n return ESLINT_CONFIG_FILES.some((file) => existsSync(join(root, file)));\n }\n\n return false;\n};\n\n/**\n * Computes the initial setup steps selected by default in the interactive prompt.\n * Steps like infrastructure and browser extension require opt-in, while\n * eslint is preselected only if installed on the project.\n */\nexport const getInitialInitSteps = (\n dependencies: Record<string, string>,\n root?: string\n): InitStep[] => {\n const isEslintPresent = isEslintInstalled(dependencies, root);\n\n return Object.values(INIT_STEP_GROUPS)\n .flat()\n .map((option) => option.value)\n .filter((step) => {\n if (OPT_IN_INIT_STEPS.includes(step)) return false;\n if (step === 'eslint' && !isEslintPresent) return false;\n return true;\n });\n};\n\n/** Reads the merged dependencies of the project at `root`. */\nexport const getProjectDependencies = (\n root: string\n): Record<string, string> => {\n try {\n const packageJsonPath = join(root, 'package.json');\n if (!existsSync(packageJsonPath)) return {};\n const { dependencies = {}, devDependencies = {} } = JSON.parse(\n readFileSync(packageJsonPath, 'utf-8')\n );\n return { ...dependencies, ...devDependencies };\n } catch {\n return {};\n }\n};\n\n/**\n * Runs `init` in interactive mode: prompts the user with a checkbox of setup\n * steps, then forwards the selection to {@link initIntlayer} (packages, GitHub\n * Actions, VS Code extension, LSP) and runs the dedicated skills/MCP installers\n * for the steps that own their own prompts. The `.gitignore` entry is not\n * offered as a checkbox — it is always added (unless `--no-gitignore` is set).\n */\nconst runInteractiveInit = async (\n root: string,\n baseOptions?: InitOptions\n): Promise<void> => {\n const p = await loadPrompts();\n\n p.intro('Initialize Intlayer');\n\n const projectDependencies = getProjectDependencies(root);\n\n const selected = await p.groupMultiselect<InitStep>({\n message: 'Select what you want to set up:',\n options: INIT_STEP_GROUPS,\n initialValues: getInitialInitSteps(projectDependencies, root),\n required: false,\n });\n\n if (p.isCancel(selected)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const steps = selected as InitStep[];\n\n // Compat i18n library detection — never asked, always derived from the\n // installed packages. `detectMissingIntlayerPackages` reads the very same\n // dependency map to schedule the compat adapter, the sync plugin and the\n // catalog template, so a project without any of those packages is simply set\n // up on Intlayer alone.\n const detectedCompatLibraries =\n detectCompatI18nLibraries(projectDependencies);\n const hasCompatLib = detectedCompatLibraries.length > 0;\n\n if (hasCompatLib) {\n p.log.info(\n `Detected existing i18n ${detectedCompatLibraries.length > 1 ? 'libraries' : 'library'}: ${detectedCompatLibraries.join(', ')} — the matching Intlayer compat adapter and catalog sync will be set up.`\n );\n }\n\n // Locale routing → `routing.mode` + `routing.enableProxy` in the config, and\n // the route segment the framework scaffolding creates. Only asked for web\n // frontends; projects without URL routing (backend, React Native / Expo) keep\n // only `routing.storage` in a freshly created config. Skipped for compat\n // i18n libraries, which keep their own routing.\n let routingOptions: Pick<InitOptions, 'routingMode' | 'enableProxy'> = {};\n\n if (\n steps.includes('projectSetup') &&\n baseOptions?.routingMode === undefined &&\n !hasCompatLib &&\n hasUrlRoutingFramework(projectDependencies)\n ) {\n const selectedRouting = await p.select<LocaleRoutingChoice>({\n message: 'How should the locale appear in your URLs?',\n options: ROUTING_OPTIONS,\n initialValue: 'prefix-no-default',\n });\n\n if (p.isCancel(selectedRouting)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n routingOptions = getRoutingInitOptions(selectedRouting);\n }\n\n const options: InitOptions = {\n ...baseOptions,\n ...routingOptions,\n noInstallPackages: !steps.includes('packages'),\n // The `.gitignore` entry is tied to project setup.\n noGitignore: baseOptions?.noGitignore || !steps.includes('projectSetup'),\n // Respect explicit `--no-*` flags from the command line even when the\n // corresponding step is selected in the checkbox.\n noGithubActions:\n baseOptions?.noGithubActions || !steps.includes('githubActions'),\n noFrameworkSetup:\n baseOptions?.noFrameworkSetup || !steps.includes('projectSetup'),\n noVscodeExtension: !steps.includes('vscodeExtension'),\n noLsp: !steps.includes('lsp'),\n noEslint: !steps.includes('eslint'),\n skipFinalMessage: true,\n };\n\n const { guideUrl } = await initIntlayer(root, options);\n\n // Skills ask for the platform after the skill selection; MCP reuses it.\n const skillsPlatform = steps.includes('skills')\n ? await initSkills(root)\n : undefined;\n\n if (steps.includes('mcp')) {\n await initMCP(root, skillsPlatform);\n }\n\n // Delegated to the hosted install script, which owns its own menu.\n if (steps.includes('infra')) {\n await initInfra();\n }\n\n if (steps.includes('chromeExtension')) {\n await initChromeExtension();\n }\n\n // CMS / visual editor runs last: the browser login persists the access-key\n // credentials to `.env` and enables the editor in the config file. Kept last\n // so the browser flow does not interrupt setup.\n if (steps.includes('cms')) {\n p.log.info('Opening your browser to log in to the Intlayer CMS...');\n // `exitAfter: false` keeps the process alive so the flow can finish; the\n // credentials are persisted to `.env` and the editor enabled in the config.\n await login({\n exitAfter: false,\n onCredentials: (credentials) => setupCmsCredentials(root, credentials),\n });\n }\n\n p.outro('Intlayer initialization complete');\n\n if (guideUrl) {\n logInitSuccessMessage(guideUrl);\n }\n};\n\nexport const init = async (\n projectRoot?: string,\n options?: InitOptions,\n interactive?: boolean\n) => {\n const root = projectRoot\n ? findProjectRoot(resolve(projectRoot))\n : findProjectRoot(process.cwd());\n\n if (interactive) {\n await runInteractiveInit(root, options);\n return;\n }\n\n await initIntlayer(root, options);\n};\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,mBAAmB,aAAqB;CACnD,IAAI,aAAa;CAEjB,OAAO,mBAAeA,mBAAQ,YAAY,IAAI,GAAG;EAC/C,QAAIC,wBAAWC,gBAAK,YAAY,cAAc,CAAC,GAC7C,OAAO;EAET,iBAAaF,mBAAQ,YAAY,IAAI;CACvC;CAIA,OAAO;AACT;;;;;;AA4BA,MAAa,oBAAgC,CAAC,SAAS,iBAAiB;;AAGxE,MAAa,mBAAqD;CAChE,UAAU;EACR;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,UAAU;EACR;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,oBAAoB;EAClB;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,KAAK,CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,GACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,CACF;AACF;;AASA,MAAM,kBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CAC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,CAAC,MAAM,SAAS,eAAe;EACjE,kBACE,aAAa,oBAAoB,CAAC,MAAM,SAAS,cAAc;EACjE,mBAAmB,CAAC,MAAM,SAAS,iBAAiB;EACpD,OAAO,CAAC,MAAM,SAAS,KAAK;EAC5B,UAAU,CAAC,MAAM,SAAS,QAAQ;EAClC,kBAAkB;CACpB;CAEA,MAAM,EAAE,aAAa,UAAMC,mCAAa,MAAM,OAAO;CAGrD,MAAM,iBAAiB,MAAM,SAAS,QAAQ,IAC1C,MAAMC,8BAAW,IAAI,IACrB;CAEJ,IAAI,MAAM,SAAS,KAAK,GACtB,MAAMC,wBAAQ,MAAM,cAAc;CAIpC,IAAI,MAAM,SAAS,OAAO,GACxB,MAAMC,4BAAU;CAGlB,IAAI,MAAM,SAAS,iBAAiB,GAClC,MAAMC,gDAAoB;CAM5B,IAAI,MAAM,SAAS,KAAK,GAAG;EACzB,EAAE,IAAI,KAAK,uDAAuD;EAGlE,MAAMC,yBAAM;GACV,WAAW;GACX,gBAAgB,oBAAgBC,0CAAoB,MAAM,WAAW;EACvE,CAAC;CACH;CAEA,EAAE,MAAM,kCAAkC;CAE1C,IAAI,UACF,gDAAsB,QAAQ;AAElC;AAEA,MAAa,OAAO,OAClB,aACA,SACA,gBACG;CACH,MAAM,OAAO,cACT,oBAAgBd,mBAAQ,WAAW,CAAC,IACpC,gBAAgB,QAAQ,IAAI,CAAC;CAEjC,IAAI,aAAa;EACf,MAAM,mBAAmB,MAAM,OAAO;EACtC;CACF;CAEA,UAAMQ,mCAAa,MAAM,OAAO;AAClC"}
@@ -0,0 +1,36 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_utils_openBrowser = require('./utils/openBrowser.cjs');
3
+ const require_loadPrompts = require('./loadPrompts.cjs');
4
+
5
+ //#region src/initChromeExtension.ts
6
+ const CHROME_EXTENSION_URL = "https://chromewebstore.google.com/detail/intlayer_i18n_scanner/pmlehcgmjmfimmjnembihbakhnheiabc";
7
+ const MOZILLA_EXTENSION_URL = "https://addons.mozilla.org/en-US/firefox/addon/intlayer-i18n-scanner/";
8
+ const BROWSER_EXTENSION_OPTIONS = [{
9
+ value: CHROME_EXTENSION_URL,
10
+ label: "Chrome",
11
+ hint: CHROME_EXTENSION_URL
12
+ }, {
13
+ value: MOZILLA_EXTENSION_URL,
14
+ label: "Mozilla Firefox",
15
+ hint: MOZILLA_EXTENSION_URL
16
+ }];
17
+ const initChromeExtension = async () => {
18
+ const p = await require_loadPrompts.loadPrompts();
19
+ const selectedUrls = await p.multiselect({
20
+ message: "Select browser extension(s) to install:",
21
+ options: BROWSER_EXTENSION_OPTIONS,
22
+ required: false
23
+ });
24
+ if (p.isCancel(selectedUrls)) return;
25
+ if (Array.isArray(selectedUrls) && selectedUrls.length > 0) for (const url of selectedUrls) {
26
+ p.log.info(`Opening ${url} in your browser...`);
27
+ require_utils_openBrowser.openBrowser(url);
28
+ }
29
+ };
30
+
31
+ //#endregion
32
+ exports.BROWSER_EXTENSION_OPTIONS = BROWSER_EXTENSION_OPTIONS;
33
+ exports.CHROME_EXTENSION_URL = CHROME_EXTENSION_URL;
34
+ exports.MOZILLA_EXTENSION_URL = MOZILLA_EXTENSION_URL;
35
+ exports.initChromeExtension = initChromeExtension;
36
+ //# sourceMappingURL=initChromeExtension.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initChromeExtension.cjs","names":["loadPrompts"],"sources":["../../src/initChromeExtension.ts"],"sourcesContent":["import { loadPrompts } from './loadPrompts';\nimport { openBrowser } from './utils/openBrowser';\n\nexport const CHROME_EXTENSION_URL =\n 'https://chromewebstore.google.com/detail/intlayer_i18n_scanner/pmlehcgmjmfimmjnembihbakhnheiabc';\n\nexport const MOZILLA_EXTENSION_URL =\n 'https://addons.mozilla.org/en-US/firefox/addon/intlayer-i18n-scanner/';\n\nexport const BROWSER_EXTENSION_OPTIONS = [\n {\n value: CHROME_EXTENSION_URL,\n label: 'Chrome',\n hint: CHROME_EXTENSION_URL,\n },\n {\n value: MOZILLA_EXTENSION_URL,\n label: 'Mozilla Firefox',\n hint: MOZILLA_EXTENSION_URL,\n },\n];\n\nexport const initChromeExtension = async () => {\n const p = await loadPrompts();\n\n const selectedUrls = await p.multiselect({\n message: 'Select browser extension(s) to install:',\n options: BROWSER_EXTENSION_OPTIONS,\n required: false,\n });\n\n if (p.isCancel(selectedUrls)) {\n return;\n }\n\n if (Array.isArray(selectedUrls) && selectedUrls.length > 0) {\n for (const url of selectedUrls) {\n p.log.info(`Opening ${url} in your browser...`);\n openBrowser(url);\n }\n }\n};\n"],"mappings":";;;;;AAGA,MAAa,uBACX;AAEF,MAAa,wBACX;AAEF,MAAa,4BAA4B,CACvC;CACE,OAAO;CACP,OAAO;CACP,MAAM;AACR,GACA;CACE,OAAO;CACP,OAAO;CACP,MAAM;AACR,CACF;AAEA,MAAa,sBAAsB,YAAY;CAC7C,MAAM,IAAI,MAAMA,gCAAY;CAE5B,MAAM,eAAe,MAAM,EAAE,YAAY;EACvC,SAAS;EACT,SAAS;EACT,UAAU;CACZ,CAAC;CAED,IAAI,EAAE,SAAS,YAAY,GACzB;CAGF,IAAI,MAAM,QAAQ,YAAY,KAAK,aAAa,SAAS,GACvD,KAAK,MAAM,OAAO,cAAc;EAC9B,EAAE,IAAI,KAAK,WAAW,IAAI,oBAAoB;EAC9C,sCAAY,GAAG;CACjB;AAEJ"}
@@ -75,7 +75,7 @@ const initInfra = async (options = {}) => {
75
75
  if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);
76
76
  script = await response.text();
77
77
  } catch (error) {
78
- spinner.stop("Could not download the installer", 1);
78
+ spinner.stop("Could not download the installer");
79
79
  p.log.error(`${error.message}\nRun it directly: ${process.platform === "win32" ? `irm ${scriptUrl} | iex` : `curl -fsSL ${scriptUrl} | sh`}`);
80
80
  process.exitCode = 1;
81
81
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"initInfra.cjs","names":["spawn","loadPrompts","mkdtemp","join","tmpdir","writeFile","rm"],"sources":["../../src/initInfra.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport { mkdtemp, rm, writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { loadPrompts } from './loadPrompts';\n\n/** Setup modes understood by the hosted installer. */\nexport const INFRA_MODES = ['desktop', 'docker', 'compose'] as const;\n\nexport type InfraMode = (typeof INFRA_MODES)[number];\n\n/**\n * The hosted installers are the single source of truth for the infrastructure\n * setup flow (desktop app, all-in-one container, Compose stack). The CLI runs\n * them rather than re-implementing the same steps in JavaScript.\n */\nexport const INSTALL_SCRIPT_URL = 'https://intlayer.org/install.sh';\nexport const INSTALL_SCRIPT_URL_WINDOWS = 'https://intlayer.org/install.ps1';\n\nexport type InitInfraOptions = {\n /** Skip the interactive menu and run this mode directly. */\n mode?: InfraMode;\n /** Installer URL override (forks, staging). Defaults to the platform's script. */\n scriptUrl?: string;\n};\n\n/** How to fetch and execute the installer on the current platform. */\ntype InstallerRunner = {\n url: string;\n fileName: string;\n /** Builds the command and arguments that execute the downloaded script. */\n command: (scriptPath: string, mode?: InfraMode) => [string, string[]];\n};\n\nconst POSIX_RUNNER: InstallerRunner = {\n url: INSTALL_SCRIPT_URL,\n fileName: 'install.sh',\n command: (scriptPath, mode) => [\n 'sh',\n [scriptPath, ...(mode ? ['--mode', mode] : [])],\n ],\n};\n\nconst WINDOWS_RUNNER: InstallerRunner = {\n url: INSTALL_SCRIPT_URL_WINDOWS,\n fileName: 'install.ps1',\n command: (scriptPath, mode) => [\n 'powershell',\n [\n '-NoProfile',\n '-ExecutionPolicy',\n 'Bypass',\n '-File',\n scriptPath,\n ...(mode ? ['-Mode', mode] : []),\n ],\n ],\n};\n\nconst getInstallerRunner = (): InstallerRunner =>\n process.platform === 'win32' ? WINDOWS_RUNNER : POSIX_RUNNER;\n\n/**\n * Validates a user-provided mode against {@link INFRA_MODES}.\n *\n * @throws When the value is not a known mode.\n */\nexport const parseInfraMode = (value: string): InfraMode => {\n if ((INFRA_MODES as readonly string[]).includes(value)) {\n return value as InfraMode;\n }\n\n throw new Error(\n `Unknown infra mode \"${value}\". Expected one of: ${INFRA_MODES.join(', ')}`\n );\n};\n\n/**\n * Runs the installer with the terminal attached, so its own prompts and\n * progress bars reach the user unchanged.\n *\n * @returns The script's exit code.\n */\nconst runInstaller = (command: string, args: string[]): Promise<number> =>\n new Promise((resolve, reject) => {\n const child = spawn(command, args, { stdio: 'inherit' });\n\n child.on('error', reject);\n child.on('close', (code) => resolve(code ?? 1));\n });\n\n/**\n * Downloads the hosted installer and runs it: desktop app, all-in-one Docker\n * container or Docker Compose stack, chosen interactively unless `mode` is set.\n *\n * Exposed as `intlayer init infra` and as a step of `intlayer init --interactive`.\n */\nexport const initInfra = async (\n options: InitInfraOptions = {}\n): Promise<void> => {\n const p = await loadPrompts();\n const runner = getInstallerRunner();\n const scriptUrl = options.scriptUrl ?? runner.url;\n\n const spinner = p.spinner();\n spinner.start(`Fetching ${scriptUrl}`);\n\n let script: string;\n\n try {\n const response = await fetch(scriptUrl);\n\n if (!response.ok) {\n throw new Error(`${response.status} ${response.statusText}`);\n }\n\n script = await response.text();\n } catch (error) {\n spinner.stop('Could not download the installer', 1);\n p.log.error(\n `${(error as Error).message}\\nRun it directly: ${\n process.platform === 'win32'\n ? `irm ${scriptUrl} | iex`\n : `curl -fsSL ${scriptUrl} | sh`\n }`\n );\n process.exitCode = 1;\n return;\n }\n\n spinner.stop('Installer downloaded');\n\n const directory = await mkdtemp(join(tmpdir(), 'intlayer-install-'));\n const scriptPath = join(directory, runner.fileName);\n\n try {\n await writeFile(scriptPath, script, { mode: 0o700 });\n\n const [command, args] = runner.command(scriptPath, options.mode);\n const exitCode = await runInstaller(command, args);\n\n if (exitCode !== 0) {\n process.exitCode = exitCode;\n }\n } finally {\n await rm(directory, { recursive: true, force: true });\n }\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,cAAc;CAAC;CAAW;CAAU;AAAS;;;;;;AAS1D,MAAa,qBA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J,GAAI,MAAgB,QAAQ,qBAC1B,QAAQ,aAAa,UACjB,OAAO,UAAU,UACjB,cAAc,UAAU,QAEhC;EACA,QAAQ,WAAW;EACnB;CACF;CAEA,QAAQ,KAAK,sBAAsB;CAEnC,MAAM,YAAY,UAAMC,8BAAQC,oBAAKC,gBAAO,GAAG,mBAAmB,CAAC;CACnE,MAAM,iBAAaD,gBAAK,WAAW,OAAO,QAAQ;CAElD,IAAI;EACF,UAAME,4BAAU,YAAY,QAAQ,EAAE,MAAM,IAAM,CAAC;EAEnD,MAAM,CAAC,SAAS,QAAQ,OAAO,QAAQ,YAAY,QAAQ,IAAI;EAC/D,MAAM,WAAW,MAAM,aAAa,SAAS,IAAI;EAEjD,IAAI,aAAa,GACf,QAAQ,WAAW;CAEvB,UAAU;EACR,UAAMC,qBAAG,WAAW;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;CACtD;AACF"}
1
+ {"version":3,"file":"initInfra.cjs","names":["spawn","loadPrompts","mkdtemp","join","tmpdir","writeFile","rm"],"sources":["../../src/initInfra.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport { mkdtemp, rm, writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { loadPrompts } from './loadPrompts';\n\n/** Setup modes understood by the hosted installer. */\nexport const INFRA_MODES = ['desktop', 'docker', 'compose'] as const;\n\nexport type InfraMode = (typeof INFRA_MODES)[number];\n\n/**\n * The hosted installers are the single source of truth for the infrastructure\n * setup flow (desktop app, all-in-one container, Compose stack). The CLI runs\n * them rather than re-implementing the same steps in JavaScript.\n */\nexport const INSTALL_SCRIPT_URL = 'https://intlayer.org/install.sh';\nexport const INSTALL_SCRIPT_URL_WINDOWS = 'https://intlayer.org/install.ps1';\n\nexport type InitInfraOptions = {\n /** Skip the interactive menu and run this mode directly. */\n mode?: InfraMode;\n /** Installer URL override (forks, staging). Defaults to the platform's script. */\n scriptUrl?: string;\n};\n\n/** How to fetch and execute the installer on the current platform. */\ntype InstallerRunner = {\n url: string;\n fileName: string;\n /** Builds the command and arguments that execute the downloaded script. */\n command: (scriptPath: string, mode?: InfraMode) => [string, string[]];\n};\n\nconst POSIX_RUNNER: InstallerRunner = {\n url: INSTALL_SCRIPT_URL,\n fileName: 'install.sh',\n command: (scriptPath, mode) => [\n 'sh',\n [scriptPath, ...(mode ? ['--mode', mode] : [])],\n ],\n};\n\nconst WINDOWS_RUNNER: InstallerRunner = {\n url: INSTALL_SCRIPT_URL_WINDOWS,\n fileName: 'install.ps1',\n command: (scriptPath, mode) => [\n 'powershell',\n [\n '-NoProfile',\n '-ExecutionPolicy',\n 'Bypass',\n '-File',\n scriptPath,\n ...(mode ? ['-Mode', mode] : []),\n ],\n ],\n};\n\nconst getInstallerRunner = (): InstallerRunner =>\n process.platform === 'win32' ? WINDOWS_RUNNER : POSIX_RUNNER;\n\n/**\n * Validates a user-provided mode against {@link INFRA_MODES}.\n *\n * @throws When the value is not a known mode.\n */\nexport const parseInfraMode = (value: string): InfraMode => {\n if ((INFRA_MODES as readonly string[]).includes(value)) {\n return value as InfraMode;\n }\n\n throw new Error(\n `Unknown infra mode \"${value}\". Expected one of: ${INFRA_MODES.join(', ')}`\n );\n};\n\n/**\n * Runs the installer with the terminal attached, so its own prompts and\n * progress bars reach the user unchanged.\n *\n * @returns The script's exit code.\n */\nconst runInstaller = (command: string, args: string[]): Promise<number> =>\n new Promise((resolve, reject) => {\n const child = spawn(command, args, { stdio: 'inherit' });\n\n child.on('error', reject);\n child.on('close', (code) => resolve(code ?? 1));\n });\n\n/**\n * Downloads the hosted installer and runs it: desktop app, all-in-one Docker\n * container or Docker Compose stack, chosen interactively unless `mode` is set.\n *\n * Exposed as `intlayer init infra` and as a step of `intlayer init --interactive`.\n */\nexport const initInfra = async (\n options: InitInfraOptions = {}\n): Promise<void> => {\n const p = await loadPrompts();\n const runner = getInstallerRunner();\n const scriptUrl = options.scriptUrl ?? runner.url;\n\n const spinner = p.spinner();\n spinner.start(`Fetching ${scriptUrl}`);\n\n let script: string;\n\n try {\n const response = await fetch(scriptUrl);\n\n if (!response.ok) {\n throw new Error(`${response.status} ${response.statusText}`);\n }\n\n script = await response.text();\n } catch (error) {\n spinner.stop('Could not download the installer');\n p.log.error(\n `${(error as Error).message}\\nRun it directly: ${\n process.platform === 'win32'\n ? `irm ${scriptUrl} | iex`\n : `curl -fsSL ${scriptUrl} | sh`\n }`\n );\n process.exitCode = 1;\n return;\n }\n\n spinner.stop('Installer downloaded');\n\n const directory = await mkdtemp(join(tmpdir(), 'intlayer-install-'));\n const scriptPath = join(directory, runner.fileName);\n\n try {\n await writeFile(scriptPath, script, { mode: 0o700 });\n\n const [command, args] = runner.command(scriptPath, options.mode);\n const exitCode = await runInstaller(command, args);\n\n if (exitCode !== 0) {\n process.exitCode = exitCode;\n }\n } finally {\n await rm(directory, { recursive: true, force: true });\n }\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,cAAc;CAAC;CAAW;CAAU;AAAS;;;;;;AAS1D,MAAa,qBAAqB;AAClC,MAAa,6BAA6B;AAiB1C,MAAM,eAAgC;CACpC,KAAK;CACL,UAAU;CACV,UAAU,YAAY,SAAS,CAC7B,MACA,CAAC,YAAY,GAAI,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,CAAE,CAChD;AACF;AAEA,MAAM,iBAAkC;CACtC,KAAK;CACL,UAAU;CACV,UAAU,YAAY,SAAS,CAC7B,cACA;EACE;EACA;EACA;EACA;EACA;EACA,GAAI,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;CAChC,CACF;AACF;AAEA,MAAM,2BACJ,QAAQ,aAAa,UAAU,iBAAiB;;;;;;AAOlD,MAAa,kBAAkB,UAA6B;CAC1D,IAAK,YAAkC,SAAS,KAAK,GACnD,OAAO;CAGT,MAAM,IAAI,MACR,uBAAuB,MAAM,sBAAsB,YAAY,KAAK,IAAI,GAC1E;AACF;;;;;;;AAQA,MAAM,gBAAgB,SAAiB,SACrC,IAAI,SAAS,S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= 10, configOptions }) => {
28
28
  appLogger(`${(0, _intlayer_config_logger.colorizeKey)("Title")}: ${chunk.docName}`);
29
29
  appLogger(`${(0, _intlayer_config_logger.colorizeKey)("URL")}: ${chunk.docUrl}`);
30
30
  appLogger(`${(0, _intlayer_config_logger.colorizeKey)("Chunk")}: ${chunk.chunkNumber}`);
31
+ if (chunk.priority !== void 0) appLogger(`${(0, _intlayer_config_logger.colorizeKey)("Priority")}: ${(0, _intlayer_config_logger.colorizeNumber)(chunk.priority)}`);
31
32
  appLogger(`${(0, _intlayer_config_logger.colorizeKey)("Content")}:`);
32
33
  appLogger(chunk.content);
33
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"searchDoc.cjs","names":["getConfiguration","getAppLogger","getSearchAPI","colorizeNumber","colorizeKey"],"sources":["../../src/searchDoc.ts"],"sourcesContent":["import { getSearchAPI } from '@intlayer/api';\nimport {\n colorizeKey,\n colorizeNumber,\n getAppLogger,\n} from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { logConfigDetails } from '@intlayer/engine/cli';\n\ninterface SearchDocOptions {\n query: string;\n limit?: number;\n configOptions?: GetConfigurationOptions;\n}\n\nexport const searchDoc = async ({\n query,\n limit = 10,\n configOptions,\n}: SearchDocOptions) => {\n const config = getConfiguration(configOptions);\n logConfigDetails(configOptions);\n\n const appLogger = getAppLogger(config);\n\n try {\n const { searchDoc } = getSearchAPI(undefined, config);\n const response = await searchDoc({\n input: query,\n limit: limit.toString(),\n returnContent: 'true',\n });\n\n if (!response.data || !Array.isArray(response.data)) {\n appLogger('No relevant chunks found.');\n return;\n }\n\n const chunks = response.data;\n\n appLogger(`Found ${colorizeNumber(chunks.length)} relevant chunks:`);\n\n chunks.forEach((chunk: any) => {\n appLogger('---');\n appLogger(`${colorizeKey('File')}: ${chunk.fileKey}`);\n appLogger(`${colorizeKey('Title')}: ${chunk.docName}`);\n appLogger(`${colorizeKey('URL')}: ${chunk.docUrl}`);\n appLogger(`${colorizeKey('Chunk')}: ${chunk.chunkNumber}`);\n appLogger(`${colorizeKey('Content')}:`);\n appLogger(chunk.content);\n });\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n appLogger(`Search failed: ${errorMessage}`, { level: 'error' });\n }\n};\n"],"mappings":";;;;;;;AAkBA,MAAa,YAAY,OAAO,EAC9B,OACA,QAAQ,IACR,oBACsB;CACtB,MAAM,aAASA,wCAAiB,aAAa;CAC7C,2CAAiB,aAAa;CAE9B,MAAM,gBAAYC,sCAAa,MAAM;CAErC,IAAI;EACF,MAAM,EAAE,kBAAcC,4BAAa,QAAW,MAAM;EACpD,MAAM,WAAW,MAAM,UAAU;GAC/B,OAAO;GACP,OAAO,MAAM,SAAS;GACtB,eAAe;EACjB,CAAC;EAED,IAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,QAAQ,SAAS,IAAI,GAAG;GACnD,UAAU,2BAA2B;GACrC;EACF;EAEA,MAAM,SAAS,SAAS;EAExB,UAAU,aAASC,wCAAe,OAAO,MAAM,EAAE,kBAAkB;EAEnE,OAAO,SAAS,UAAe;GAC7B,UAAU,KAAK;GACf,UAAU,OAAGC,qCAAY,MAAM,EAAE,IAAI,MAAM,SAAS;GACpD,UAAU,OAAGA,qCAAY,OAAO,EAAE,IAAI,MAAM,SAAS;GACrD,UAAU,OAAGA,qCAAY,KAAK,EAAE,IAAI,MAAM,QAAQ;GAClD,UAAU,OAAGA,qCAAY,OAAO,EAAE,IAAI,MAAM,aAAa;GACzD,UAAU,OAAGA,qCAAY,SAAS,EAAE,EAAE;GACtC,UAAU,MAAM,OAAO;EACzB,CAAC;CACH,SAAS,OAAO;EAGd,UAAU,kBADR,iBAAiB,QAAQ,MAAM,UAAU,+BACC,EAAE,OAAO,QAAQ,CAAC;CAChE;AACF"}
1
+ {"version":3,"file":"searchDoc.cjs","names":["getConfiguration","getAppLogger","getSearchAPI","colorizeNumber","colorizeKey"],"sources":["../../src/searchDoc.ts"],"sourcesContent":["import { getSearchAPI } from '@intlayer/api';\nimport {\n colorizeKey,\n colorizeNumber,\n getAppLogger,\n} from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { logConfigDetails } from '@intlayer/engine/cli';\n\n/** A documentation chunk returned by the search endpoint with `returnContent`. */\ntype SearchDocChunk = Exclude<\n NonNullable<\n Awaited<ReturnType<ReturnType<typeof getSearchAPI>['searchDoc']>>['data']\n >,\n string[]\n>[number];\n\ninterface SearchDocOptions {\n query: string;\n limit?: number;\n configOptions?: GetConfigurationOptions;\n}\n\nexport const searchDoc = async ({\n query,\n limit = 10,\n configOptions,\n}: SearchDocOptions) => {\n const config = getConfiguration(configOptions);\n logConfigDetails(configOptions);\n\n const appLogger = getAppLogger(config);\n\n try {\n const { searchDoc } = getSearchAPI(undefined, config);\n const response = await searchDoc({\n input: query,\n limit: limit.toString(),\n returnContent: 'true',\n });\n\n if (!response.data || !Array.isArray(response.data)) {\n appLogger('No relevant chunks found.');\n return;\n }\n\n // Ranked by relevance, weighted by the `priority` front matter of each doc\n const chunks = response.data as SearchDocChunk[];\n\n appLogger(`Found ${colorizeNumber(chunks.length)} relevant chunks:`);\n\n chunks.forEach((chunk) => {\n appLogger('---');\n appLogger(`${colorizeKey('File')}: ${chunk.fileKey}`);\n appLogger(`${colorizeKey('Title')}: ${chunk.docName}`);\n appLogger(`${colorizeKey('URL')}: ${chunk.docUrl}`);\n appLogger(`${colorizeKey('Chunk')}: ${chunk.chunkNumber}`);\n if (chunk.priority !== undefined) {\n appLogger(\n `${colorizeKey('Priority')}: ${colorizeNumber(chunk.priority)}`\n );\n }\n appLogger(`${colorizeKey('Content')}:`);\n appLogger(chunk.content);\n });\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n appLogger(`Search failed: ${errorMessage}`, { level: 'error' });\n }\n};\n"],"mappings":";;;;;;;AA0BA,MAAa,YAAY,OAAO,EAC9B,OACA,QAAQ,IACR,oBACsB;CACtB,MAAM,aAASA,wCAAiB,aAAa;CAC7C,2CAAiB,aAAa;CAE9B,MAAM,gBAAYC,sCAAa,MAAM;CAErC,IAAI;EACF,MAAM,EAAE,kBAAcC,4BAAa,QAAW,MAAM;EACpD,MAAM,WAAW,MAAM,UAAU;GAC/B,OAAO;GACP,OAAO,MAAM,SAAS;GACtB,eAAe;EACjB,CAAC;EAED,IAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,QAAQ,SAAS,IAAI,GAAG;GACnD,UAAU,2BAA2B;GACrC;EACF;EAGA,MAAM,SAAS,SAAS;EAExB,UAAU,aAASC,wCAAe,OAAO,MAAM,EAAE,kBAAkB;EAEnE,OAAO,SAAS,UAAU;GACxB,UAAU,KAAK;GACf,UAAU,OAAGC,qCAAY,MAAM,EAAE,IAAI,MAAM,SAAS;GACpD,UAAU,OAAGA,qCAAY,OAAO,EAAE,IAAI,MAAM,SAAS;GACrD,UAAU,OAAGA,qCAAY,KAAK,EAAE,IAAI,MAAM,QAAQ;GAClD,UAAU,OAAGA,qCAAY,OAAO,EAAE,IAAI,MAAM,aAAa;GACzD,IAAI,MAAM,aAAa,QACrB,UACE,OAAGA,qCAAY,UAAU,EAAE,QAAID,wCAAe,MAAM,QAAQ,GAC9D;GAEF,UAAU,OAAGC,qCAAY,SAAS,EAAE,EAAE;GACtC,UAAU,MAAM,OAAO;EACzB,CAAC;CACH,SAAS,OAAO;EAGd,UAAU,kBADR,iBAAiB,QAAQ,MAAM,UAAU,+BACC,EAAE,OAAO,QAAQ,CAAC;CAChE;AACF"}
@@ -35,7 +35,7 @@ const selectCmsEnvironment = async (environmentName, intlayerAPI, config) => {
35
35
  appLogger(`Using environment: ${(0, _intlayer_config_logger.colorize)(targetEnvironment.name, _intlayer_config_colors.CYAN)} (default)`);
36
36
  return;
37
37
  }
38
- await intlayerAPI.project.selectEnvironment(String(targetEnvironment.id));
38
+ await intlayerAPI.environment.selectEnvironment(String(targetEnvironment.id));
39
39
  appLogger(`Using environment: ${(0, _intlayer_config_logger.colorize)(targetEnvironment.name, _intlayer_config_colors.CYAN)}`);
40
40
  } catch (error) {
41
41
  appLogger(`Failed to select environment "${environmentName}": ${error}`, { level: "warn" });
@@ -1 +1 @@
1
- {"version":3,"file":"selectCmsEnvironment.cjs","names":["getAppLogger","colorize","ANSIColors"],"sources":["../../../src/utils/selectCmsEnvironment.ts"],"sourcesContent":["import type { IntlayerAPIProxy } from '@intlayer/api';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\n/**\n * Selects the CMS project environment that matches `environmentName`.\n *\n * Convention: session.activeEnvironmentId = null means \"production\" (default).\n * When the target environment is the project's default, we reset the session to\n * null instead of storing the env's ObjectId — so no API call is needed.\n *\n * No-op when `environmentName` is undefined.\n */\nexport const selectCmsEnvironment = async (\n environmentName: string | undefined,\n intlayerAPI: IntlayerAPIProxy,\n config: IntlayerConfig\n): Promise<void> => {\n if (!environmentName) return;\n\n const appLogger = getAppLogger(config);\n\n try {\n const sessionResult = await intlayerAPI.oAuth.getCliSessionMe();\n const project = sessionResult.data?.project;\n\n if (!project) {\n appLogger(\n `Cannot resolve environment \"${environmentName}\": no project selected in session.`,\n { level: 'warn' }\n );\n return;\n }\n\n const projectEnvironments: any[] = (project as any).environments ?? [];\n\n if (projectEnvironments.length === 0) {\n // No environments stored — everything is implicitly production; nothing to select\n return;\n }\n\n const targetEnvironment = projectEnvironments.find(\n (environment: any) =>\n environment.name.toLowerCase() === environmentName.toLowerCase() ||\n String(environment.id) === environmentName\n );\n\n if (!targetEnvironment) {\n const availableNames = projectEnvironments\n .map((environment: any) => environment.name)\n .join(', ');\n appLogger(\n `Environment \"${environmentName}\" not found in project. Available: ${colorize(availableNames, ANSIColors.BLUE)}.`,\n { level: 'error' }\n );\n return;\n }\n\n // Production / default env → null convention; no API call needed\n if (targetEnvironment.isDefault) {\n appLogger(\n `Using environment: ${colorize(targetEnvironment.name, ANSIColors.CYAN)} (default)`\n );\n return;\n }\n\n await intlayerAPI.project.selectEnvironment(String(targetEnvironment.id));\n\n appLogger(\n `Using environment: ${colorize(targetEnvironment.name, ANSIColors.CYAN)}`\n );\n } catch (error) {\n appLogger(`Failed to select environment \"${environmentName}\": ${error}`, {\n level: 'warn',\n });\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAa,uBAAuB,OAClC,iBACA,aACA,WACkB;CAClB,IAAI,CAAC,iBAAiB;CAEtB,MAAM,gBAAYA,sCAAa,MAAM;CAErC,IAAI;EAEF,MAAM,WAAU,MADY,YAAY,MAAM,gBAAgB,EACjC,CAAC,MAAM;EAEpC,IAAI,CAAC,SAAS;GACZ,UACE,+BAA+B,gBAAgB,qCAC/C,EAAE,OAAO,OAAO,CAClB;GACA;EACF;EAEA,MAAM,sBAA8B,QAAgB,gBAAgB,CAAC;EAErE,IAAI,oBAAoB,WAAW,GAEjC;EAGF,MAAM,oBAAoB,oBAAoB,MAC3C,gBACC,YAAY,KAAK,YAAY,MAAM,gBAAgB,YAAY,KAC/D,OAAO,YAAY,EAAE,MAAM,eAC/B;EAEA,IAAI,CAAC,mBAAmB;GACtB,MAAM,iBAAiB,oBACpB,KAAK,gBAAqB,YAAY,IAAI,CAAC,CAC3C,KAAK,IAAI;GACZ,UACE,gBAAgB,gBAAgB,yCAAqCC,kCAAS,gBAAgBC,wBAAW,IAAI,EAAE,IAC/G,EAAE,OAAO,QAAQ,CACnB;GACA;EACF;EAGA,IAAI,kBAAkB,WAAW;GAC/B,UACE,0BAAsBD,kCAAS,kBAAkB,MAAMC,wBAAW,IAAI,EAAE,WAC1E;GACA;EACF;EAEA,MAAM,YAAY,QAAQ,kBAAkB,OAAO,kBAAkB,EAAE,CAAC;EAExE,UACE,0BAAsBD,kCAAS,kBAAkB,MAAMC,wBAAW,IAAI,GACxE;CACF,SAAS,OAAO;EACd,UAAU,iCAAiC,gBAAgB,KAAK,SAAS,EACvE,OAAO,OACT,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"selectCmsEnvironment.cjs","names":["getAppLogger","colorize","ANSIColors"],"sources":["../../../src/utils/selectCmsEnvironment.ts"],"sourcesContent":["import type { IntlayerAPIProxy } from '@intlayer/api';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\n/**\n * Selects the CMS project environment that matches `environmentName`.\n *\n * Convention: session.activeEnvironmentId = null means \"production\" (default).\n * When the target environment is the project's default, we reset the session to\n * null instead of storing the env's ObjectId — so no API call is needed.\n *\n * No-op when `environmentName` is undefined.\n */\nexport const selectCmsEnvironment = async (\n environmentName: string | undefined,\n intlayerAPI: IntlayerAPIProxy,\n config: IntlayerConfig\n): Promise<void> => {\n if (!environmentName) return;\n\n const appLogger = getAppLogger(config);\n\n try {\n const sessionResult = await intlayerAPI.oAuth.getCliSessionMe();\n const project = sessionResult.data?.project;\n\n if (!project) {\n appLogger(\n `Cannot resolve environment \"${environmentName}\": no project selected in session.`,\n { level: 'warn' }\n );\n return;\n }\n\n const projectEnvironments: any[] = (project as any).environments ?? [];\n\n if (projectEnvironments.length === 0) {\n // No environments stored — everything is implicitly production; nothing to select\n return;\n }\n\n const targetEnvironment = projectEnvironments.find(\n (environment: any) =>\n environment.name.toLowerCase() === environmentName.toLowerCase() ||\n String(environment.id) === environmentName\n );\n\n if (!targetEnvironment) {\n const availableNames = projectEnvironments\n .map((environment: any) => environment.name)\n .join(', ');\n appLogger(\n `Environment \"${environmentName}\" not found in project. Available: ${colorize(availableNames, ANSIColors.BLUE)}.`,\n { level: 'error' }\n );\n return;\n }\n\n // Production / default env → null convention; no API call needed\n if (targetEnvironment.isDefault) {\n appLogger(\n `Using environment: ${colorize(targetEnvironment.name, ANSIColors.CYAN)} (default)`\n );\n return;\n }\n\n await intlayerAPI.environment.selectEnvironment(\n String(targetEnvironment.id)\n );\n\n appLogger(\n `Using environment: ${colorize(targetEnvironment.name, ANSIColors.CYAN)}`\n );\n } catch (error) {\n appLogger(`Failed to select environment \"${environmentName}\": ${error}`, {\n level: 'warn',\n });\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAa,uBAAuB,OAClC,iBACA,aACA,WACkB;CAClB,IAAI,CAAC,iBAAiB;CAEtB,MAAM,gBAAYA,sCAAa,MAAM;CAErC,IAAI;EAEF,MAAM,WAAU,MADY,YAAY,MAAM,gBAAgB,EACjC,CAAC,MAAM;EAEpC,IAAI,CAAC,SAAS;GACZ,UACE,+BAA+B,gBAAgB,qCAC/C,EAAE,OAAO,OAAO,CAClB;GACA;EACF;EAEA,MAAM,sBAA8B,QAAgB,gBAAgB,CAAC;EAErE,IAAI,oBAAoB,WAAW,GAEjC;EAGF,MAAM,oBAAoB,oBAAoB,MAC3C,gBACC,YAAY,KAAK,YAAY,MAAM,gBAAgB,YAAY,KAC/D,OAAO,YAAY,EAAE,MAAM,eAC/B;EAEA,IAAI,CAAC,mBAAmB;GACtB,MAAM,iBAAiB,oBACpB,KAAK,gBAAqB,YAAY,IAAI,CAAC,CAC3C,KAAK,IAAI;GACZ,UACE,gBAAgB,gBAAgB,yCAAqCC,kCAAS,gBAAgBC,wBAAW,IAAI,EAAE,IAC/G,EAAE,OAAO,QAAQ,CACnB;GACA;EACF;EAGA,IAAI,kBAAkB,WAAW;GAC/B,UACE,0BAAsBD,kCAAS,kBAAkB,MAAMC,wBAAW,IAAI,EAAE,WAC1E;GACA;EACF;EAEA,MAAM,YAAY,YAAY,kBAC5B,OAAO,kBAAkB,EAAE,CAC7B;EAEA,UACE,0BAAsBD,kCAAS,kBAAkB,MAAMC,wBAAW,IAAI,GACxE;CACF,SAAS,OAAO;EACd,UAAU,iCAAiC,gBAAgB,KAAK,SAAS,EACvE,OAAO,OACT,CAAC;CACH;AACF"}
package/dist/esm/cli.mjs CHANGED
@@ -153,13 +153,14 @@ const setAPI = () => {
153
153
  /**
154
154
  * INIT
155
155
  */
156
- const initCmd = program.command("init").description("Initialize Intlayer in the project").option("--project-root [projectRoot]", "Project root directory").option("--no-gitignore", "Do not add .intlayer to .gitignore").option("--no-github-actions", "Do not scaffold the fill and test GitHub Actions workflows").option("--no-framework-setup", "Do not set up the project (Intlayer config, tsconfig, bundler plugin, middleware/proxy, providers in layout/page)").option("-i, --interactive", "Interactively choose what to set up (packages, skills, MCP, VS Code extension, LSP, …)").action(async (options) => {
157
- const { init } = await import("./init.mjs");
156
+ const initCmd = program.command("init").description("Initialize Intlayer in the project").option("--project-root [projectRoot]", "Project root directory").option("--no-gitignore", "Do not add .intlayer to .gitignore").option("--no-github-actions", "Do not scaffold the fill and test GitHub Actions workflows").option("--no-framework-setup", "Do not set up the project (Intlayer config, tsconfig, bundler plugin, middleware/proxy, providers in layout/page)").option("-i, --interactive", "Interactively choose what to set up (packages, skills, MCP, VS Code extension, LSP, …)").option("--routing <routing>", "Locale routing: prefix-no-default | prefix-all | no-prefix | search-params | none").action(async (options) => {
157
+ const { init, parseLocaleRoutingChoice, getRoutingInitOptions } = await import("./init.mjs");
158
158
  return init(options.projectRoot, {
159
159
  noGitignore: options.gitignore === false,
160
160
  noGithubActions: options.githubActions === false,
161
161
  noFrameworkSetup: options.frameworkSetup === false,
162
- upgradeToVersion: packageJson.version
162
+ upgradeToVersion: packageJson.version,
163
+ ...options.routing ? getRoutingInitOptions(parseLocaleRoutingChoice(options.routing)) : {}
163
164
  }, options.interactive === true);
164
165
  });
165
166
  initCmd.command("skills").description("Initialize Intlayer skills in the project").option("--project-root [projectRoot]", "Project root directory").action(async (options) => {
@@ -174,6 +175,10 @@ const setAPI = () => {
174
175
  const { initInfra, parseInfraMode } = await import("./initInfra.mjs");
175
176
  return initInfra({ mode: options.mode ? parseInfraMode(options.mode) : void 0 });
176
177
  });
178
+ initCmd.command("extension").alias("chrome-extension").description("Install the Intlayer Chrome extension or Firefox add-on in your browser").action(async () => {
179
+ const { initChromeExtension } = await import("./initChromeExtension.mjs");
180
+ return initChromeExtension();
181
+ });
177
182
  /**
178
183
  * UPGRADE
179
184
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":["pathDirname"],"sources":["../../src/cli.ts"],"sourcesContent":["import { dirname as pathDirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { AIOptions as BaseAIOptions } from '@intlayer/api';\nimport { logger, setPrefix } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport type { DiffMode, ListGitFilesOptions } from '@intlayer/engine/cli';\nimport type { CustomIntlayerConfig } from '@intlayer/types/config';\nimport { Command, Option } from 'commander';\nimport type { FillOptions } from './fill/fill';\nimport { getParentPackageJSON } from './utils/getParentPackageJSON';\n\n// Extended AI options to include customPrompt\ntype AIOptions = BaseAIOptions & {\n customPrompt?: string;\n};\n\nconst isESModule = typeof import.meta.url === 'string';\n\nexport const dirname = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson = getParentPackageJSON(dirname);\n\nconst logOptions = [\n ['--verbose', 'Verbose (default to true using CLI)'],\n ['--prefix [prefix]', 'Prefix'],\n];\n\nconst ciOptions = [\n [\n '--ci',\n 'CI mode - Run the command in every Intlayer project of the repository (or only the current one), injecting per-project credentials from INTLAYER_PROJECT_CREDENTIALS',\n ],\n];\n\nconst configurationOptions = [\n ['--env-file [envFile]', 'Environment file'],\n ['-e, --env [env]', 'Environment'],\n ['--base-dir [baseDir]', 'Base directory'],\n ['--no-cache [noCache]', 'No cache'],\n ...logOptions,\n ...ciOptions,\n];\n\nconst aiOptions = [\n ['--provider [provider]', 'Provider'],\n ['--temperature [temperature]', 'Temperature'],\n ['--model [model]', 'Model'],\n ['--api-key [apiKey]', 'Provider API key'],\n ['--custom-prompt [prompt]', 'Custom prompt'],\n ['--application-context [applicationContext]', 'Application context'],\n ['--data-serialization [dataSerialization]', 'Data serialization'],\n];\n\nconst gitOptions = [\n ['--git-diff [gitDiff]', 'Git diff mode - Check git diff between two refs'],\n ['--git-diff-base [gitDiffBase]', 'Git diff base ref'],\n ['--git-diff-current [gitDiffCurrent]', 'Git diff current ref'],\n ['--uncommitted [uncommitted]', 'Uncommitted'],\n ['--unpushed [unpushed]', 'Unpushed'],\n ['--untracked [untracked]', 'Untracked'],\n];\n\nconst extractKeysFromOptions = (options: object, keys: string[]) =>\n keys.filter((key) => options[key as keyof typeof options] !== undefined);\n\n/**\n * Helper functions to apply common options to commands\n */\nconst applyOptions = (command: Command, options: string[][]) => {\n options.forEach(([flag, description]) => {\n command.option(flag!, description);\n });\n return command;\n};\n\nconst removeUndefined = <T extends Record<string, any>>(obj: T): T =>\n Object.fromEntries(\n Object.entries(obj).filter(([_, value]) => value !== undefined)\n ) as T;\n\nconst applyConfigOptions = (command: Command) =>\n applyOptions(command, configurationOptions);\nconst applyAIOptions = (command: Command) => applyOptions(command, aiOptions);\nconst applyGitOptions = (command: Command) => applyOptions(command, gitOptions);\n\nconst extractAiOptions = (options: AIOptions): AIOptions | undefined => {\n const {\n apiKey,\n provider,\n model,\n temperature,\n applicationContext,\n customPrompt,\n dataSerialization,\n } = options;\n\n const configuration = getConfiguration();\n\n const { ai } = configuration;\n\n // `AIOptions` is discriminated on `provider`, which is only known at runtime\n // here (CLI flag or configuration file), so the merged object cannot be\n // narrowed to a single member of the union.\n return removeUndefined({\n ...ai,\n apiKey: apiKey ?? configuration.ai?.apiKey,\n provider: provider ?? (configuration.ai?.provider as AIOptions['provider']),\n model: model ?? configuration.ai?.model,\n temperature: temperature ?? configuration.ai?.temperature,\n applicationContext:\n applicationContext ?? configuration.ai?.applicationContext,\n customPrompt: customPrompt ?? (configuration.ai as any)?.customPrompt,\n dataSerialization: dataSerialization ?? configuration.ai?.dataSerialization,\n }) as AIOptions;\n};\n\ntype GitOptions = {\n gitDiff?: boolean;\n gitDiffBase?: string;\n gitDiffCurrent?: string;\n uncommitted?: boolean;\n unpushed?: boolean;\n untracked?: boolean;\n};\n\nconst gitOptionKeys: (keyof GitOptions)[] = [\n 'gitDiff',\n 'gitDiffBase',\n 'gitDiffCurrent',\n 'uncommitted',\n 'unpushed',\n 'untracked',\n];\n\nconst extractGitOptions = (\n options: GitOptions\n): ListGitFilesOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(options, gitOptionKeys);\n\n const isOptionEmpty = filteredOptions.length === 0;\n\n if (isOptionEmpty) return undefined;\n\n const {\n gitDiff,\n gitDiffBase,\n gitDiffCurrent,\n uncommitted,\n unpushed,\n untracked,\n } = options;\n\n const mode = [\n gitDiff && 'gitDiff',\n uncommitted && 'uncommitted',\n unpushed && 'unpushed',\n untracked && 'untracked',\n ].filter(Boolean) as DiffMode[];\n\n return removeUndefined({\n mode,\n baseRef: gitDiffBase,\n currentRef: gitDiffCurrent,\n absolute: true,\n });\n};\n\ntype LogOptions = {\n prefix?: string;\n verbose?: boolean;\n};\n\nexport type ConfigurationOptions = {\n baseDir?: string;\n env?: string;\n envFile?: string;\n noCache?: boolean;\n checkTypes?: boolean;\n} & LogOptions;\n\nconst configurationOptionKeys: (keyof ConfigurationOptions)[] = [\n 'baseDir',\n 'env',\n 'envFile',\n 'verbose',\n 'prefix',\n 'checkTypes',\n];\n\nconst extractConfigOptions = (\n options: ConfigurationOptions & { with?: string }\n): GetConfigurationOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(\n options,\n configurationOptionKeys\n );\n\n const isOptionEmpty = filteredOptions.length === 0;\n\n if (isOptionEmpty) {\n return undefined;\n }\n\n const { baseDir, env, envFile, verbose, noCache, checkTypes } = options;\n\n const log = removeUndefined({\n mode:\n typeof verbose !== 'undefined'\n ? verbose\n ? 'verbose'\n : 'default'\n : undefined,\n });\n\n const build = removeUndefined({\n checkTypes,\n });\n\n const override: CustomIntlayerConfig = removeUndefined({\n log:\n Object.keys(log).length > 0\n ? (log as CustomIntlayerConfig['log'])\n : undefined,\n build: Object.keys(build).length > 0 ? build : undefined,\n });\n\n return removeUndefined({\n baseDir,\n env,\n envFile,\n override: Object.keys(override).length > 0 ? override : undefined,\n cache: typeof noCache !== 'undefined' ? !noCache : undefined,\n });\n};\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const isWithCommand = process.argv.includes('--with');\n\n if (!isWithCommand) {\n setPrefix('');\n }\n\n const program = new Command();\n\n program\n .version(\n packageJson.version!,\n '-v, --version',\n 'Print the Intlayer CLI version'\n )\n .description('Intlayer CLI');\n\n // Keep `-V` (commander's default short flag) working alongside `-v`\n program.addOption(\n new Option('-V', 'Print the Intlayer CLI version').hideHelp()\n );\n program.on('option:V', () => {\n console.log(packageJson.version ?? 'unknown');\n process.exit(0);\n });\n\n // Explicit version subcommand for convenience: `npx intlayer version`\n program\n .command('version')\n .description('Print the Intlayer CLI version')\n .action(() => {\n // Prefer the resolved package.json version; fallback to unknown\n // Keeping output minimal to align with common CLI behavior\n console.log(packageJson.version ?? 'unknown');\n });\n\n /**\n * AUTH\n */\n const loginCmd = program\n .command('login')\n .description('Login to Intlayer')\n .option('--cms-url [cmsUrl]', 'CMS URL');\n\n applyConfigOptions(loginCmd);\n\n loginCmd.action(async (options) => {\n const { login } = await import('./auth/login');\n const configOptions = extractConfigOptions(options) ?? {\n override: {\n log: {\n prefix: '',\n mode: 'verbose',\n },\n },\n };\n\n return login({\n cmsUrl: options.cmsUrl,\n configOptions,\n });\n });\n\n /**\n * INIT\n */\n const initCmd = program\n .command('init')\n .description('Initialize Intlayer in the project')\n .option('--project-root [projectRoot]', 'Project root directory')\n .option('--no-gitignore', 'Do not add .intlayer to .gitignore')\n .option(\n '--no-github-actions',\n 'Do not scaffold the fill and test GitHub Actions workflows'\n )\n .option(\n '--no-framework-setup',\n 'Do not set up the project (Intlayer config, tsconfig, bundler plugin, middleware/proxy, providers in layout/page)'\n )\n .option(\n '-i, --interactive',\n 'Interactively choose what to set up (packages, skills, MCP, VS Code extension, LSP, …)'\n )\n .action(async (options) => {\n const { init } = await import('./init');\n return init(\n options.projectRoot,\n {\n noGitignore: options.gitignore === false,\n noGithubActions: options.githubActions === false,\n noFrameworkSetup: options.frameworkSetup === false,\n upgradeToVersion: packageJson.version,\n },\n options.interactive === true\n );\n });\n\n initCmd\n .command('skills')\n .description('Initialize Intlayer skills in the project')\n .option('--project-root [projectRoot]', 'Project root directory')\n .action(async (options) => {\n const { initSkills } = await import('./initSkills');\n await initSkills(options.projectRoot);\n });\n\n initCmd\n .command('mcp')\n .description('Initialize Intlayer MCP server in the project')\n .option('--project-root [projectRoot]', 'Project root directory')\n .action(async (options) => {\n const { initMCP } = await import('./initMCP');\n return initMCP(options.projectRoot);\n });\n\n initCmd\n .command('infra')\n .description(\n 'Set up the Intlayer infrastructure: desktop app, all-in-one Docker container or Docker Compose stack (runs https://intlayer.org/install.sh, or install.ps1 on Windows)'\n )\n .option('-m, --mode <mode>', 'Skip the menu: desktop | docker | compose')\n .action(async (options) => {\n const { initInfra, parseInfraMode } = await import('./initInfra');\n return initInfra({\n mode: options.mode ? parseInfraMode(options.mode) : undefined,\n });\n });\n\n /**\n * UPGRADE\n */\n program\n .command('upgrade')\n .description(\n 'List the Intlayer packages of every package.json of the project and upgrade them to the latest version'\n )\n .option('--project-root [projectRoot]', 'Project root directory')\n .option('--dry-run', 'List the packages and their target version only')\n .option('--tag <tag>', 'npm dist-tag to upgrade to (e.g. canary)', 'latest')\n .action(async (options) => {\n const { upgrade } = await import('./upgrade');\n return upgrade(options.projectRoot, {\n dryRun: options.dryRun === true,\n distTag: options.tag,\n });\n });\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionary')\n .alias('dictionaries')\n .alias('dic')\n .description('Dictionaries operations');\n\n // Dictionary build command\n const buildOptions = {\n description: 'Build the dictionaries',\n options: [\n ['-w, --watch', 'Watch for changes'],\n ['--skip-prepare', 'Skip the prepare step'],\n ['--with [with...]', 'Start command in parallel with the build'],\n ['--check-types', 'Check TypeScript type and log errors'],\n ],\n };\n\n // Add build command to dictionaries program\n const dictionariesBuildCmd = dictionariesProgram\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(dictionariesBuildCmd, buildOptions.options);\n applyConfigOptions(dictionariesBuildCmd);\n dictionariesBuildCmd.action(async (options) => {\n const { build } = await import('./build');\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add build command to root program as well\n const rootBuildCmd = program\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(rootBuildCmd, buildOptions.options);\n applyConfigOptions(rootBuildCmd);\n rootBuildCmd.action(async (options) => {\n const { build } = await import('./build');\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n const watchOptions = {\n description: 'Watch the dictionaries changes',\n options: [['--with [with...]', 'Start command in parallel with the build']],\n };\n\n // Add build command to dictionaries program\n const dictionariesWatchCmd = dictionariesProgram\n .command('watch')\n .description(buildOptions.description);\n\n applyOptions(dictionariesWatchCmd, watchOptions.options);\n applyConfigOptions(dictionariesWatchCmd);\n dictionariesWatchCmd.action(async (options) => {\n const { watchContentDeclaration } = await import('./watch');\n watchContentDeclaration({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add build command to root program as well\n const rootWatchCmd = program\n .command('watch')\n .description(buildOptions.description);\n\n applyOptions(rootWatchCmd, watchOptions.options);\n applyConfigOptions(rootWatchCmd);\n rootWatchCmd.action(async (options) => {\n const { watchContentDeclaration } = await import('./watch');\n watchContentDeclaration({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary pull command\n const pullOptions = {\n description: 'Pull dictionaries from the server',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to pull'],\n [\n '--dictionary [ids...]',\n 'List of dictionary IDs to pull (alias for --dictionaries)',\n ],\n ['--new-dictionaries-path [path]', 'Path to save the new dictionaries'],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--newDictionariesPath [path]',\n '[alias] Path to save the new dictionaries',\n ],\n ],\n };\n\n // Add pull command to dictionaries program\n const dictionariesPullCmd = dictionariesProgram\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(dictionariesPullCmd, pullOptions.options);\n applyConfigOptions(dictionariesPullCmd);\n dictionariesPullCmd.action(async (options) => {\n const { pull } = await import('./pull');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries ?? []),\n ...(options.dictionary ?? []),\n ];\n\n pull({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add pull command to root program as well\n const rootPullCmd = program\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(rootPullCmd, pullOptions.options);\n applyConfigOptions(rootPullCmd);\n rootPullCmd.action(async (options) => {\n const { pull } = await import('./pull');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries ?? []),\n ...(options.dictionary ?? []),\n ];\n\n pull({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary push command\n const pushOptions = {\n description:\n 'Push all dictionaries. Create or update the pushed dictionaries',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to push'],\n [\n '--dictionary [ids...]',\n 'List of dictionary IDs to push (alias for --dictionaries)',\n ],\n [\n '-r, --delete-locale-dictionary',\n 'Delete the local dictionaries after pushing',\n ],\n [\n '-k, --keep-locale-dictionary',\n 'Keep the local dictionaries after pushing',\n ],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--deleteLocaleDictionary',\n '[alias] Delete the local dictionaries after pushing',\n ],\n [\n '--keepLocaleDictionary',\n '[alias] Keep the local dictionaries after pushing',\n ],\n [\n '--build [build]',\n 'Build the dictionaries before pushing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build',\n ],\n ],\n };\n\n // Add push command to dictionaries program\n const dictionariesPushCmd = dictionariesProgram\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(dictionariesPushCmd, pushOptions.options);\n applyConfigOptions(dictionariesPushCmd);\n applyGitOptions(dictionariesPushCmd);\n\n dictionariesPushCmd.action(async (options) => {\n const { push } = await import('./push/push');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries || []),\n ...(options.dictionary || []),\n ];\n\n return push({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions);\n });\n\n // Add push command to root program as well\n const rootPushCmd = program\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(rootPushCmd, pushOptions.options);\n applyConfigOptions(rootPushCmd);\n applyGitOptions(rootPushCmd);\n\n rootPushCmd.action(async (options) => {\n const { push } = await import('./push/push');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries || []),\n ...(options.dictionary || []),\n ];\n\n return push({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions);\n });\n\n /**\n * CONFIGURATION\n */\n\n // Define the parent command\n const configurationProgram = program\n .command('configuration')\n .alias('config')\n .alias('conf')\n .description('Configuration operations');\n\n const configGetCmd = configurationProgram\n .command('get')\n .description('Get the configuration');\n\n applyConfigOptions(configGetCmd);\n configGetCmd.action(async (options) => {\n const { getConfig } = await import('./config');\n getConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Define the `push config` subcommand and add it to the `push` command\n const configPushCmd = configurationProgram\n .command('push')\n .description('Push the configuration');\n\n applyConfigOptions(configPushCmd);\n configPushCmd.action(async (options) => {\n const { pushConfig } = await import('./pushConfig');\n pushConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * PROJECTS\n */\n\n const projectsProgram = program\n .command('projects')\n .alias('project')\n .description('List Intlayer projects');\n\n const projectsListCmd = projectsProgram\n .command('list')\n .description('List all Intlayer projects in the directory')\n .option('--base-dir [baseDir]', 'Base directory to search from')\n .option(\n '--git-root',\n 'Search from the git root directory instead of the base directory'\n )\n .option('--json', 'Output the results as JSON');\n\n projectsListCmd.action(async (options) => {\n const { listProjectsCommand } = await import('./listProjects');\n listProjectsCommand({\n baseDir: options.baseDir,\n gitRoot: options.gitRoot,\n json: options.json,\n });\n });\n\n // Add alias for projects list command at root level\n const rootProjectsListCmd = program\n .command('projects-list')\n .alias('pl')\n .description('List all Intlayer projects in the directory')\n .option('--base-dir [baseDir]', 'Base directory to search from')\n .option(\n '--git-root',\n 'Search from the git root directory instead of the base directory'\n )\n .option('--absolute', 'Output the results as absolute paths')\n .option('--json', 'Output the results as JSON');\n\n rootProjectsListCmd.action(async (options) => {\n const { listProjectsCommand } = await import('./listProjects');\n listProjectsCommand({\n baseDir: options.baseDir,\n gitRoot: options.gitRoot,\n json: options.json,\n absolute: options.absolute,\n });\n });\n\n /**\n * CONTENT DECLARATION\n */\n\n const contentProgram = program\n .command('content')\n .description('Content declaration operations');\n\n contentProgram\n .command('list')\n .description('List the content declaration files')\n .option('--json', 'Output the results as JSON')\n .option('--absolute', 'Output the results as absolute paths')\n .action(async (options) => {\n const { listContentDeclaration } = await import(\n './listContentDeclaration'\n );\n listContentDeclaration({\n json: options.json,\n absolute: options.absolute,\n });\n });\n\n // Add alias for content list command\n program\n .command('list')\n .description('List the content declaration files')\n .option('--json', 'Output the results as JSON')\n .option('--absolute', 'Output the results as absolute paths')\n .action(async (options) => {\n const { listContentDeclaration } = await import(\n './listContentDeclaration'\n );\n listContentDeclaration({\n json: options.json,\n absolute: options.absolute,\n });\n });\n\n const testProgram = contentProgram\n .command('test')\n .description('Test if there are missing translations')\n .option(\n '--build [build]',\n 'Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build'\n );\n\n applyConfigOptions(testProgram);\n testProgram.action(async (options) => {\n const { testMissingTranslations } = await import('./test');\n testMissingTranslations({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add alias for content test command\n const rootTestCmd = program\n .command('test')\n .description('Test if there are missing translations')\n .option(\n '--build [build]',\n 'Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build'\n );\n\n applyConfigOptions(rootTestCmd);\n rootTestCmd.action(async (options) => {\n const { testMissingTranslations } = await import('./test');\n testMissingTranslations({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n const fillProgram = program\n .command('fill')\n .description('Fill the dictionaries')\n .option('-f, --file [files...]', 'List of Dictionary files to fill')\n .option('--source-locale [sourceLocale]', 'Source locale to translate from')\n .option(\n '--output-locales [outputLocales...]',\n 'Target locales to translate to'\n )\n .option(\n '--mode [mode]',\n 'Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys',\n 'complete'\n )\n .option('-k, --keys [keys...]', 'Filter dictionaries based on keys')\n .option(\n '--key [keys...]',\n 'Filter dictionaries based on keys (alias for --keys)'\n )\n .option(\n '--excluded-keys [excludedKeys...]',\n 'Filter out dictionaries based on keys'\n )\n .option(\n '--excluded-key [excludedKeys...]',\n 'Filter out dictionaries based on keys (alias for --excluded-keys)'\n )\n .option(\n '--path-filter [pathFilters...]',\n 'Filter dictionaries based on glob pattern'\n )\n .option(\n '--build [build]',\n 'Build the dictionaries before filling to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build'\n )\n .option(\n '--skip-metadata',\n 'Skip filling missing metadata (description, title, tags) for dictionaries'\n );\n\n applyConfigOptions(fillProgram);\n applyAIOptions(fillProgram);\n applyGitOptions(fillProgram);\n\n fillProgram.action(async (options) => {\n const { fill } = await import('./fill/fill');\n // Merge key aliases\n const keys = [...(options.keys ?? []), ...(options.key ?? [])];\n const excludedKeys = [\n ...(options.excludedKeys ?? []),\n ...(options.excludedKey ?? []),\n ];\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries ?? []),\n ...(options.dictionary ?? []),\n ];\n\n return fill({\n ...options,\n keys: keys.length > 0 ? keys : undefined,\n excludedKeys: excludedKeys.length > 0 ? excludedKeys : undefined,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions);\n });\n\n /**\n * DOCS\n */\n\n const docParams = [\n ['--doc-pattern [docPattern...]', 'Documentation pattern'],\n [\n '--excluded-glob-pattern [excludedGlobPattern...]',\n 'Excluded glob pattern',\n ],\n [\n '--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]',\n 'Number of simultaneous file processed',\n ],\n ['--locales [locales...]', 'Locales'],\n ['--base-locale [baseLocale]', 'Base locale'],\n [\n '--custom-instructions [customInstructions]',\n 'Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc.',\n ],\n [\n '--skip-if-modified-before [skipIfModifiedBefore]',\n 'Skip the file if it has been modified before the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n [\n '--skip-if-modified-after [skipIfModifiedAfter]',\n 'Skip the file if it has been modified within the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n ['--skip-if-exists', 'Skip the file if it already exists'],\n ];\n\n const docProgram = program\n .command('doc')\n .description('Documentation operations');\n\n const translateProgram = docProgram\n .command('translate')\n .description('Translate the documentation');\n\n applyConfigOptions(translateProgram);\n applyAIOptions(translateProgram);\n applyGitOptions(translateProgram);\n applyOptions(translateProgram, docParams);\n\n translateProgram.action(async (options) => {\n const { translateDoc } = await import('./translateDoc/translateDoc');\n return translateDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n skipIfExists: options.skipIfExists,\n });\n });\n\n const reviewProgram = docProgram\n .command('review')\n .description('Review the documentation')\n .option(\n '--mode [mode]',\n 'How the review runs: \"apply\" (default) translates the diverging blocks with AI and writes the files; \"report\" calls no AI and logs the blocks that need attention (line numbers and content, for both locales) to help another agent generate the translations; \"synthesis\" calls no AI and only logs the final recap of the documents that are up to date and the ones that have blocks to edit.',\n 'apply'\n );\n\n applyConfigOptions(reviewProgram);\n applyAIOptions(reviewProgram);\n applyGitOptions(reviewProgram);\n applyOptions(reviewProgram, docParams);\n\n reviewProgram.action(async (options) => {\n const { reviewDoc } = await import('./reviewDoc/reviewDoc');\n await reviewDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n skipIfExists: options.skipIfExists,\n mode: options.mode,\n });\n });\n\n const searchProgram = docProgram\n .command('search')\n .description('Search the documentation')\n .argument('<query>', 'Search query')\n .option('--limit [limit]', 'Limit the number of results', '10');\n\n applyConfigOptions(searchProgram);\n\n searchProgram.action(async (query, options) => {\n const { searchDoc } = await import('./searchDoc');\n return searchDoc({\n query,\n limit: options.limit ? parseInt(options.limit, 10) : 10,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * LIVE SYNC\n */\n\n const liveOptions = [\n ['--with [with...]', 'Start command in parallel with the live sync'],\n ];\n\n const liveCmd = program\n .command('live')\n .description(\n 'Live sync - Watch for changes made on the CMS and update the application content accordingly'\n );\n\n applyOptions(liveCmd, liveOptions);\n applyConfigOptions(liveCmd);\n\n liveCmd.action(async (options) => {\n const { liveSync } = await import('./liveSync');\n return liveSync({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * EDITOR\n */\n\n const editorProgram = program\n .command('editor')\n .description('Visual editor operations');\n\n const editorStartCmd = editorProgram\n .command('start')\n .description('Start the Intlayer visual editor');\n\n applyConfigOptions(editorStartCmd);\n\n editorStartCmd.action(async (options) => {\n const { startEditor } = await import('./editor');\n startEditor({\n env: options.env,\n envFile: options.envFile,\n });\n });\n\n /**\n * EXTRACT\n */\n const extractProgram = program\n .command('extract')\n .alias('ext')\n .description(\n 'Extract strings from components to be placed in a .content file close to the component'\n );\n\n applyConfigOptions(extractProgram);\n\n extractProgram\n .option('-f, --file [files...]', 'List of files to extract')\n .option('--code-only', 'Only extract the component code', false)\n .option('--declaration-only', 'Only generate content declaration', false)\n .action(async (options) => {\n const { extract } = await import('./extract');\n extract({\n files: options.file,\n configOptions: extractConfigOptions(options),\n codeOnly: options.codeOnly,\n declarationOnly: options.declarationOnly,\n });\n });\n\n /**\n * STANDALONE\n */\n const bundleCmd = program\n .command('standalone')\n .description('Create a standalone bundle of the application content')\n .option(\n '-o, --outfile [outfile]',\n 'Output file for the bundle',\n 'intlayer-bundle.js'\n )\n .option('--packages [packages...]', 'List of packages to bundle')\n .option('--version [version]', 'Version of the packages to bundle')\n .option('--minify', 'Minify the output')\n .option('--platform [platform]', 'Target platform', 'browser')\n .option('--format [format]', 'Output format', 'esm')\n .action(async (options) => {\n const { bundle } = await import('./bundle');\n bundle({\n outfile: options.outfile,\n bundlePackages: options.packages,\n version: options.version,\n minify: options.minify,\n platform: options.platform,\n format: options.format,\n configOptions: extractConfigOptions(options),\n });\n });\n\n applyConfigOptions(bundleCmd);\n\n /**\n * SCAN\n */\n const scanCmd = program\n .command('scan')\n .description(\n 'Scan a website to measure its page size and audit its i18n / SEO health'\n )\n .argument('<url>', 'URL of the website to scan')\n .option('--no-deep', 'Disable the deeper puppeteer-based render scan')\n .option('--json', 'Output the results as JSON');\n\n applyConfigOptions(scanCmd);\n\n scanCmd.action(async (url, options) => {\n const { scan } = await import('./scan');\n return scan(url, {\n deep: options.deep,\n json: options.json,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * CI / AUTOMATION\n *\n * `--ci` is accepted by every command. It re-runs the same command (flag\n * stripped) in every Intlayer project of the repository, injecting\n * per-project credentials from INTLAYER_PROJECT_CREDENTIALS. Handled once at\n * the program level so no action needs to know about it: the process exits\n * with the aggregated status once every project has run.\n */\n program.hook('preAction', async (_program, actionCommand) => {\n if (!actionCommand.opts().ci) return;\n\n const { runCI } = await import('./ci');\n process.exit(await runCI(process.argv.slice(2)));\n });\n\n /**\n * @deprecated `intlayer ci <command...>` is replaced by `intlayer <command> --ci`.\n * Kept hidden so workflows scaffolded by older versions keep working.\n */\n program\n .command('ci', { hidden: true })\n .argument('<command...>', 'The intlayer command to execute')\n .allowUnknownOption() // Forward flags like --verbose to the subcommand\n .action(async (args: string[]) => {\n logger(\n '`intlayer ci <command>` is deprecated, use `intlayer <command> --ci` instead.',\n { level: 'warn' }\n );\n const { runCI } = await import('./ci');\n process.exit(await runCI(args));\n });\n\n // Every command must be registered before parsing: commander dispatches\n // synchronously, so anything added after this line is an unknown command.\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":";;;;;;;;AAmBA,MAAM,aAAa,OAAO,YAAY,QAAQ;AAE9C,MAAa,UAAU,aACnBA,UAAY,cAAc,YAAY,GAAG,CAAC,IAC1C;AAEJ,MAAM,cAAc,qBAAqB,OAAO;AAEhD,MAAM,aAAa,CACjB,CAAC,aAAa,qCAAqC,GACnD,CAAC,qBAAqB,QAAQ,CAChC;AAEA,MAAM,YAAY,CAChB,CACE,QACA,sKACF,CACF;AAEA,MAAM,uBAAuB;CAC3B,CAAC,wBAAwB,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ts"],"sourcesContent":["import { dirname as pathDirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { AIOptions as BaseAIOptions } from '@intlayer/api';\nimport { logger, setPrefix } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport type { DiffMode, ListGitFilesOptions } from '@intlayer/engine/cli';\nimport type { CustomIntlayerConfig } from '@intlayer/types/config';\nimport { Command, Option } from 'commander';\nimport type { FillOptions } from './fill/fill';\nimport { getParentPackageJSON } from './utils/getParentPackageJSON';\n\n// Extended AI options to include customPrompt\ntype AIOptions = BaseAIOptions & {\n customPrompt?: string;\n};\n\nconst isESModule = typeof import.meta.url === 'string';\n\nexport const dirname = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson = getParentPackageJSON(dirname);\n\nconst logOptions = [\n ['--verbose', 'Verbose (default to true using CLI)'],\n ['--prefix [prefix]', 'Prefix'],\n];\n\nconst ciOptions = [\n [\n '--ci',\n 'CI mode - Run the command in every Intlayer project of the repository (or only the current one), injecting per-project credentials from INTLAYER_PROJECT_CREDENTIALS',\n ],\n];\n\nconst configurationOptions = [\n ['--env-file [envFile]', 'Environment file'],\n ['-e, --env [env]', 'Environment'],\n ['--base-dir [baseDir]', 'Base directory'],\n ['--no-cache [noCache]', 'No cache'],\n ...logOptions,\n ...ciOptions,\n];\n\nconst aiOptions = [\n ['--provider [provider]', 'Provider'],\n ['--temperature [temperature]', 'Temperature'],\n ['--model [model]', 'Model'],\n ['--api-key [apiKey]', 'Provider API key'],\n ['--custom-prompt [prompt]', 'Custom prompt'],\n ['--application-context [applicationContext]', 'Application context'],\n ['--data-serialization [dataSerialization]', 'Data serialization'],\n];\n\nconst gitOptions = [\n ['--git-diff [gitDiff]', 'Git diff mode - Check git diff between two refs'],\n ['--git-diff-base [gitDiffBase]', 'Git diff base ref'],\n ['--git-diff-current [gitDiffCurrent]', 'Git diff current ref'],\n ['--uncommitted [uncommitted]', 'Uncommitted'],\n ['--unpushed [unpushed]', 'Unpushed'],\n ['--untracked [untracked]', 'Untracked'],\n];\n\nconst extractKeysFromOptions = (options: object, keys: string[]) =>\n keys.filter((key) => options[key as keyof typeof options] !== undefined);\n\n/**\n * Helper functions to apply common options to commands\n */\nconst applyOptions = (command: Command, options: string[][]) => {\n options.forEach(([flag, description]) => {\n command.option(flag!, description);\n });\n return command;\n};\n\nconst removeUndefined = <T extends Record<string, any>>(obj: T): T =>\n Object.fromEntries(\n Object.entries(obj).filter(([_, value]) => value !== undefined)\n ) as T;\n\nconst applyConfigOptions = (command: Command) =>\n applyOptions(command, configurationOptions);\nconst applyAIOptions = (command: Command) => applyOptions(command, aiOptions);\nconst applyGitOptions = (command: Command) => applyOptions(command, gitOptions);\n\nconst extractAiOptions = (options: AIOptions): AIOptions | undefined => {\n const {\n apiKey,\n provider,\n model,\n temperature,\n applicationContext,\n customPrompt,\n dataSerialization,\n } = options;\n\n const configuration = getConfiguration();\n\n const { ai } = configuration;\n\n // `AIOptions` is discriminated on `provider`, which is only known at runtime\n // here (CLI flag or configuration file), so the merged object cannot be\n // narrowed to a single member of the union.\n return removeUndefined({\n ...ai,\n apiKey: apiKey ?? configuration.ai?.apiKey,\n provider: provider ?? (configuration.ai?.provider as AIOptions['provider']),\n model: model ?? configuration.ai?.model,\n temperature: temperature ?? configuration.ai?.temperature,\n applicationContext:\n applicationContext ?? configuration.ai?.applicationContext,\n customPrompt: customPrompt ?? (configuration.ai as any)?.customPrompt,\n dataSerialization: dataSerialization ?? configuration.ai?.dataSerialization,\n }) as AIOptions;\n};\n\ntype GitOptions = {\n gitDiff?: boolean;\n gitDiffBase?: string;\n gitDiffCurrent?: string;\n uncommitted?: boolean;\n unpushed?: boolean;\n untracked?: boolean;\n};\n\nconst gitOptionKeys: (keyof GitOptions)[] = [\n 'gitDiff',\n 'gitDiffBase',\n 'gitDiffCurrent',\n 'uncommitted',\n 'unpushed',\n 'untracked',\n];\n\nconst extractGitOptions = (\n options: GitOptions\n): ListGitFilesOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(options, gitOptionKeys);\n\n const isOptionEmpty = filteredOptions.length === 0;\n\n if (isOptionEmpty) return undefined;\n\n const {\n gitDiff,\n gitDiffBase,\n gitDiffCurrent,\n uncommitted,\n unpushed,\n untracked,\n } = options;\n\n const mode = [\n gitDiff && 'gitDiff',\n uncommitted && 'uncommitted',\n unpushed && 'unpushed',\n untracked && 'untracked',\n ].filter(Boolean) as DiffMode[];\n\n return removeUndefined({\n mode,\n baseRef: gitDiffBase,\n currentRef: gitDiffCurrent,\n absolute: true,\n });\n};\n\ntype LogOptions = {\n prefix?: string;\n verbose?: boolean;\n};\n\nexport type ConfigurationOptions = {\n baseDir?: string;\n env?: string;\n envFile?: string;\n noCache?: boolean;\n checkTypes?: boolean;\n} & LogOptions;\n\nconst configurationOptionKeys: (keyof ConfigurationOptions)[] = [\n 'baseDir',\n 'env',\n 'envFile',\n 'verbose',\n 'prefix',\n 'checkTypes',\n];\n\nconst extractConfigOptions = (\n options: ConfigurationOptions & { with?: string }\n): GetConfigurationOptions | undefined => {\n const filteredOptions = extractKeysFromOptions(\n options,\n configurationOptionKeys\n );\n\n const isOptionEmpty = filteredOptions.length === 0;\n\n if (isOptionEmpty) {\n return undefined;\n }\n\n const { baseDir, env, envFile, verbose, noCache, checkTypes } = options;\n\n const log = removeUndefined({\n mode:\n typeof verbose !== 'undefined'\n ? verbose\n ? 'verbose'\n : 'default'\n : undefined,\n });\n\n const build = removeUndefined({\n checkTypes,\n });\n\n const override: CustomIntlayerConfig = removeUndefined({\n log:\n Object.keys(log).length > 0\n ? (log as CustomIntlayerConfig['log'])\n : undefined,\n build: Object.keys(build).length > 0 ? build : undefined,\n });\n\n return removeUndefined({\n baseDir,\n env,\n envFile,\n override: Object.keys(override).length > 0 ? override : undefined,\n cache: typeof noCache !== 'undefined' ? !noCache : undefined,\n });\n};\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const isWithCommand = process.argv.includes('--with');\n\n if (!isWithCommand) {\n setPrefix('');\n }\n\n const program = new Command();\n\n program\n .version(\n packageJson.version!,\n '-v, --version',\n 'Print the Intlayer CLI version'\n )\n .description('Intlayer CLI');\n\n // Keep `-V` (commander's default short flag) working alongside `-v`\n program.addOption(\n new Option('-V', 'Print the Intlayer CLI version').hideHelp()\n );\n program.on('option:V', () => {\n console.log(packageJson.version ?? 'unknown');\n process.exit(0);\n });\n\n // Explicit version subcommand for convenience: `npx intlayer version`\n program\n .command('version')\n .description('Print the Intlayer CLI version')\n .action(() => {\n // Prefer the resolved package.json version; fallback to unknown\n // Keeping output minimal to align with common CLI behavior\n console.log(packageJson.version ?? 'unknown');\n });\n\n /**\n * AUTH\n */\n const loginCmd = program\n .command('login')\n .description('Login to Intlayer')\n .option('--cms-url [cmsUrl]', 'CMS URL');\n\n applyConfigOptions(loginCmd);\n\n loginCmd.action(async (options) => {\n const { login } = await import('./auth/login');\n const configOptions = extractConfigOptions(options) ?? {\n override: {\n log: {\n prefix: '',\n mode: 'verbose',\n },\n },\n };\n\n return login({\n cmsUrl: options.cmsUrl,\n configOptions,\n });\n });\n\n /**\n * INIT\n */\n const initCmd = program\n .command('init')\n .description('Initialize Intlayer in the project')\n .option('--project-root [projectRoot]', 'Project root directory')\n .option('--no-gitignore', 'Do not add .intlayer to .gitignore')\n .option(\n '--no-github-actions',\n 'Do not scaffold the fill and test GitHub Actions workflows'\n )\n .option(\n '--no-framework-setup',\n 'Do not set up the project (Intlayer config, tsconfig, bundler plugin, middleware/proxy, providers in layout/page)'\n )\n .option(\n '-i, --interactive',\n 'Interactively choose what to set up (packages, skills, MCP, VS Code extension, LSP, …)'\n )\n .option(\n '--routing <routing>',\n 'Locale routing: prefix-no-default | prefix-all | no-prefix | search-params | none'\n )\n .action(async (options) => {\n const { init, parseLocaleRoutingChoice, getRoutingInitOptions } =\n await import('./init');\n return init(\n options.projectRoot,\n {\n noGitignore: options.gitignore === false,\n noGithubActions: options.githubActions === false,\n noFrameworkSetup: options.frameworkSetup === false,\n upgradeToVersion: packageJson.version,\n ...(options.routing\n ? getRoutingInitOptions(parseLocaleRoutingChoice(options.routing))\n : {}),\n },\n options.interactive === true\n );\n });\n\n initCmd\n .command('skills')\n .description('Initialize Intlayer skills in the project')\n .option('--project-root [projectRoot]', 'Project root directory')\n .action(async (options) => {\n const { initSkills } = await import('./initSkills');\n await initSkills(options.projectRoot);\n });\n\n initCmd\n .command('mcp')\n .description('Initialize Intlayer MCP server in the project')\n .option('--project-root [projectRoot]', 'Project root directory')\n .action(async (options) => {\n const { initMCP } = await import('./initMCP');\n return initMCP(options.projectRoot);\n });\n\n initCmd\n .command('infra')\n .description(\n 'Set up the Intlayer infrastructure: desktop app, all-in-one Docker container or Docker Compose stack (runs https://intlayer.org/install.sh, or install.ps1 on Windows)'\n )\n .option('-m, --mode <mode>', 'Skip the menu: desktop | docker | compose')\n .action(async (options) => {\n const { initInfra, parseInfraMode } = await import('./initInfra');\n return initInfra({\n mode: options.mode ? parseInfraMode(options.mode) : undefined,\n });\n });\n\n initCmd\n .command('extension')\n .alias('chrome-extension')\n .description(\n 'Install the Intlayer Chrome extension or Firefox add-on in your browser'\n )\n .action(async () => {\n const { initChromeExtension } = await import('./initChromeExtension');\n return initChromeExtension();\n });\n\n /**\n * UPGRADE\n */\n program\n .command('upgrade')\n .description(\n 'List the Intlayer packages of every package.json of the project and upgrade them to the latest version'\n )\n .option('--project-root [projectRoot]', 'Project root directory')\n .option('--dry-run', 'List the packages and their target version only')\n .option('--tag <tag>', 'npm dist-tag to upgrade to (e.g. canary)', 'latest')\n .action(async (options) => {\n const { upgrade } = await import('./upgrade');\n return upgrade(options.projectRoot, {\n dryRun: options.dryRun === true,\n distTag: options.tag,\n });\n });\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionary')\n .alias('dictionaries')\n .alias('dic')\n .description('Dictionaries operations');\n\n // Dictionary build command\n const buildOptions = {\n description: 'Build the dictionaries',\n options: [\n ['-w, --watch', 'Watch for changes'],\n ['--skip-prepare', 'Skip the prepare step'],\n ['--with [with...]', 'Start command in parallel with the build'],\n ['--check-types', 'Check TypeScript type and log errors'],\n ],\n };\n\n // Add build command to dictionaries program\n const dictionariesBuildCmd = dictionariesProgram\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(dictionariesBuildCmd, buildOptions.options);\n applyConfigOptions(dictionariesBuildCmd);\n dictionariesBuildCmd.action(async (options) => {\n const { build } = await import('./build');\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add build command to root program as well\n const rootBuildCmd = program\n .command('build')\n .description(buildOptions.description);\n\n applyOptions(rootBuildCmd, buildOptions.options);\n applyConfigOptions(rootBuildCmd);\n rootBuildCmd.action(async (options) => {\n const { build } = await import('./build');\n build({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n const watchOptions = {\n description: 'Watch the dictionaries changes',\n options: [['--with [with...]', 'Start command in parallel with the build']],\n };\n\n // Add build command to dictionaries program\n const dictionariesWatchCmd = dictionariesProgram\n .command('watch')\n .description(buildOptions.description);\n\n applyOptions(dictionariesWatchCmd, watchOptions.options);\n applyConfigOptions(dictionariesWatchCmd);\n dictionariesWatchCmd.action(async (options) => {\n const { watchContentDeclaration } = await import('./watch');\n watchContentDeclaration({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add build command to root program as well\n const rootWatchCmd = program\n .command('watch')\n .description(buildOptions.description);\n\n applyOptions(rootWatchCmd, watchOptions.options);\n applyConfigOptions(rootWatchCmd);\n rootWatchCmd.action(async (options) => {\n const { watchContentDeclaration } = await import('./watch');\n watchContentDeclaration({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary pull command\n const pullOptions = {\n description: 'Pull dictionaries from the server',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to pull'],\n [\n '--dictionary [ids...]',\n 'List of dictionary IDs to pull (alias for --dictionaries)',\n ],\n ['--new-dictionaries-path [path]', 'Path to save the new dictionaries'],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--newDictionariesPath [path]',\n '[alias] Path to save the new dictionaries',\n ],\n ],\n };\n\n // Add pull command to dictionaries program\n const dictionariesPullCmd = dictionariesProgram\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(dictionariesPullCmd, pullOptions.options);\n applyConfigOptions(dictionariesPullCmd);\n dictionariesPullCmd.action(async (options) => {\n const { pull } = await import('./pull');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries ?? []),\n ...(options.dictionary ?? []),\n ];\n\n pull({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add pull command to root program as well\n const rootPullCmd = program\n .command('pull')\n .description(pullOptions.description);\n\n applyOptions(rootPullCmd, pullOptions.options);\n applyConfigOptions(rootPullCmd);\n rootPullCmd.action(async (options) => {\n const { pull } = await import('./pull');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries ?? []),\n ...(options.dictionary ?? []),\n ];\n\n pull({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Dictionary push command\n const pushOptions = {\n description:\n 'Push all dictionaries. Create or update the pushed dictionaries',\n options: [\n ['-d, --dictionaries [ids...]', 'List of dictionary IDs to push'],\n [\n '--dictionary [ids...]',\n 'List of dictionary IDs to push (alias for --dictionaries)',\n ],\n [\n '-r, --delete-locale-dictionary',\n 'Delete the local dictionaries after pushing',\n ],\n [\n '-k, --keep-locale-dictionary',\n 'Keep the local dictionaries after pushing',\n ],\n // Backward-compatibility for older tests/flags (camelCase)\n [\n '--deleteLocaleDictionary',\n '[alias] Delete the local dictionaries after pushing',\n ],\n [\n '--keepLocaleDictionary',\n '[alias] Keep the local dictionaries after pushing',\n ],\n [\n '--build [build]',\n 'Build the dictionaries before pushing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build',\n ],\n ],\n };\n\n // Add push command to dictionaries program\n const dictionariesPushCmd = dictionariesProgram\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(dictionariesPushCmd, pushOptions.options);\n applyConfigOptions(dictionariesPushCmd);\n applyGitOptions(dictionariesPushCmd);\n\n dictionariesPushCmd.action(async (options) => {\n const { push } = await import('./push/push');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries || []),\n ...(options.dictionary || []),\n ];\n\n return push({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions);\n });\n\n // Add push command to root program as well\n const rootPushCmd = program\n .command('push')\n .description(pushOptions.description);\n\n applyOptions(rootPushCmd, pushOptions.options);\n applyConfigOptions(rootPushCmd);\n applyGitOptions(rootPushCmd);\n\n rootPushCmd.action(async (options) => {\n const { push } = await import('./push/push');\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries || []),\n ...(options.dictionary || []),\n ];\n\n return push({\n ...options,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions);\n });\n\n /**\n * CONFIGURATION\n */\n\n // Define the parent command\n const configurationProgram = program\n .command('configuration')\n .alias('config')\n .alias('conf')\n .description('Configuration operations');\n\n const configGetCmd = configurationProgram\n .command('get')\n .description('Get the configuration');\n\n applyConfigOptions(configGetCmd);\n configGetCmd.action(async (options) => {\n const { getConfig } = await import('./config');\n getConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Define the `push config` subcommand and add it to the `push` command\n const configPushCmd = configurationProgram\n .command('push')\n .description('Push the configuration');\n\n applyConfigOptions(configPushCmd);\n configPushCmd.action(async (options) => {\n const { pushConfig } = await import('./pushConfig');\n pushConfig({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * PROJECTS\n */\n\n const projectsProgram = program\n .command('projects')\n .alias('project')\n .description('List Intlayer projects');\n\n const projectsListCmd = projectsProgram\n .command('list')\n .description('List all Intlayer projects in the directory')\n .option('--base-dir [baseDir]', 'Base directory to search from')\n .option(\n '--git-root',\n 'Search from the git root directory instead of the base directory'\n )\n .option('--json', 'Output the results as JSON');\n\n projectsListCmd.action(async (options) => {\n const { listProjectsCommand } = await import('./listProjects');\n listProjectsCommand({\n baseDir: options.baseDir,\n gitRoot: options.gitRoot,\n json: options.json,\n });\n });\n\n // Add alias for projects list command at root level\n const rootProjectsListCmd = program\n .command('projects-list')\n .alias('pl')\n .description('List all Intlayer projects in the directory')\n .option('--base-dir [baseDir]', 'Base directory to search from')\n .option(\n '--git-root',\n 'Search from the git root directory instead of the base directory'\n )\n .option('--absolute', 'Output the results as absolute paths')\n .option('--json', 'Output the results as JSON');\n\n rootProjectsListCmd.action(async (options) => {\n const { listProjectsCommand } = await import('./listProjects');\n listProjectsCommand({\n baseDir: options.baseDir,\n gitRoot: options.gitRoot,\n json: options.json,\n absolute: options.absolute,\n });\n });\n\n /**\n * CONTENT DECLARATION\n */\n\n const contentProgram = program\n .command('content')\n .description('Content declaration operations');\n\n contentProgram\n .command('list')\n .description('List the content declaration files')\n .option('--json', 'Output the results as JSON')\n .option('--absolute', 'Output the results as absolute paths')\n .action(async (options) => {\n const { listContentDeclaration } = await import(\n './listContentDeclaration'\n );\n listContentDeclaration({\n json: options.json,\n absolute: options.absolute,\n });\n });\n\n // Add alias for content list command\n program\n .command('list')\n .description('List the content declaration files')\n .option('--json', 'Output the results as JSON')\n .option('--absolute', 'Output the results as absolute paths')\n .action(async (options) => {\n const { listContentDeclaration } = await import(\n './listContentDeclaration'\n );\n listContentDeclaration({\n json: options.json,\n absolute: options.absolute,\n });\n });\n\n const testProgram = contentProgram\n .command('test')\n .description('Test if there are missing translations')\n .option(\n '--build [build]',\n 'Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build'\n );\n\n applyConfigOptions(testProgram);\n testProgram.action(async (options) => {\n const { testMissingTranslations } = await import('./test');\n testMissingTranslations({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n // Add alias for content test command\n const rootTestCmd = program\n .command('test')\n .description('Test if there are missing translations')\n .option(\n '--build [build]',\n 'Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build'\n );\n\n applyConfigOptions(rootTestCmd);\n rootTestCmd.action(async (options) => {\n const { testMissingTranslations } = await import('./test');\n testMissingTranslations({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n const fillProgram = program\n .command('fill')\n .description('Fill the dictionaries')\n .option('-f, --file [files...]', 'List of Dictionary files to fill')\n .option('--source-locale [sourceLocale]', 'Source locale to translate from')\n .option(\n '--output-locales [outputLocales...]',\n 'Target locales to translate to'\n )\n .option(\n '--mode [mode]',\n 'Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys',\n 'complete'\n )\n .option('-k, --keys [keys...]', 'Filter dictionaries based on keys')\n .option(\n '--key [keys...]',\n 'Filter dictionaries based on keys (alias for --keys)'\n )\n .option(\n '--excluded-keys [excludedKeys...]',\n 'Filter out dictionaries based on keys'\n )\n .option(\n '--excluded-key [excludedKeys...]',\n 'Filter out dictionaries based on keys (alias for --excluded-keys)'\n )\n .option(\n '--path-filter [pathFilters...]',\n 'Filter dictionaries based on glob pattern'\n )\n .option(\n '--build [build]',\n 'Build the dictionaries before filling to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build'\n )\n .option(\n '--skip-metadata',\n 'Skip filling missing metadata (description, title, tags) for dictionaries'\n );\n\n applyConfigOptions(fillProgram);\n applyAIOptions(fillProgram);\n applyGitOptions(fillProgram);\n\n fillProgram.action(async (options) => {\n const { fill } = await import('./fill/fill');\n // Merge key aliases\n const keys = [...(options.keys ?? []), ...(options.key ?? [])];\n const excludedKeys = [\n ...(options.excludedKeys ?? []),\n ...(options.excludedKey ?? []),\n ];\n // Merge dictionary aliases\n const dictionaries = [\n ...(options.dictionaries ?? []),\n ...(options.dictionary ?? []),\n ];\n\n return fill({\n ...options,\n keys: keys.length > 0 ? keys : undefined,\n excludedKeys: excludedKeys.length > 0 ? excludedKeys : undefined,\n dictionaries: dictionaries.length > 0 ? dictionaries : undefined,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n configOptions: extractConfigOptions(options),\n } as FillOptions);\n });\n\n /**\n * DOCS\n */\n\n const docParams = [\n ['--doc-pattern [docPattern...]', 'Documentation pattern'],\n [\n '--excluded-glob-pattern [excludedGlobPattern...]',\n 'Excluded glob pattern',\n ],\n [\n '--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]',\n 'Number of simultaneous file processed',\n ],\n ['--locales [locales...]', 'Locales'],\n ['--base-locale [baseLocale]', 'Base locale'],\n [\n '--custom-instructions [customInstructions]',\n 'Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc.',\n ],\n [\n '--skip-if-modified-before [skipIfModifiedBefore]',\n 'Skip the file if it has been modified before the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n [\n '--skip-if-modified-after [skipIfModifiedAfter]',\n 'Skip the file if it has been modified within the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.',\n ],\n ['--skip-if-exists', 'Skip the file if it already exists'],\n ];\n\n const docProgram = program\n .command('doc')\n .description('Documentation operations');\n\n const translateProgram = docProgram\n .command('translate')\n .description('Translate the documentation');\n\n applyConfigOptions(translateProgram);\n applyAIOptions(translateProgram);\n applyGitOptions(translateProgram);\n applyOptions(translateProgram, docParams);\n\n translateProgram.action(async (options) => {\n const { translateDoc } = await import('./translateDoc/translateDoc');\n return translateDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n skipIfExists: options.skipIfExists,\n });\n });\n\n const reviewProgram = docProgram\n .command('review')\n .description('Review the documentation')\n .option(\n '--mode [mode]',\n 'How the review runs: \"apply\" (default) translates the diverging blocks with AI and writes the files; \"report\" calls no AI and logs the blocks that need attention (line numbers and content, for both locales) to help another agent generate the translations; \"synthesis\" calls no AI and only logs the final recap of the documents that are up to date and the ones that have blocks to edit.',\n 'apply'\n );\n\n applyConfigOptions(reviewProgram);\n applyAIOptions(reviewProgram);\n applyGitOptions(reviewProgram);\n applyOptions(reviewProgram, docParams);\n\n reviewProgram.action(async (options) => {\n const { reviewDoc } = await import('./reviewDoc/reviewDoc');\n await reviewDoc({\n docPattern: options.docPattern,\n excludedGlobPattern: options.excludedGlobPattern,\n locales: options.locales,\n baseLocale: options.baseLocale,\n aiOptions: extractAiOptions(options),\n gitOptions: extractGitOptions(options),\n nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,\n configOptions: extractConfigOptions(options),\n customInstructions: options.customInstructions,\n skipIfModifiedBefore: options.skipIfModifiedBefore,\n skipIfModifiedAfter: options.skipIfModifiedAfter,\n skipIfExists: options.skipIfExists,\n mode: options.mode,\n });\n });\n\n const searchProgram = docProgram\n .command('search')\n .description('Search the documentation')\n .argument('<query>', 'Search query')\n .option('--limit [limit]', 'Limit the number of results', '10');\n\n applyConfigOptions(searchProgram);\n\n searchProgram.action(async (query, options) => {\n const { searchDoc } = await import('./searchDoc');\n return searchDoc({\n query,\n limit: options.limit ? parseInt(options.limit, 10) : 10,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * LIVE SYNC\n */\n\n const liveOptions = [\n ['--with [with...]', 'Start command in parallel with the live sync'],\n ];\n\n const liveCmd = program\n .command('live')\n .description(\n 'Live sync - Watch for changes made on the CMS and update the application content accordingly'\n );\n\n applyOptions(liveCmd, liveOptions);\n applyConfigOptions(liveCmd);\n\n liveCmd.action(async (options) => {\n const { liveSync } = await import('./liveSync');\n return liveSync({\n ...options,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * EDITOR\n */\n\n const editorProgram = program\n .command('editor')\n .description('Visual editor operations');\n\n const editorStartCmd = editorProgram\n .command('start')\n .description('Start the Intlayer visual editor');\n\n applyConfigOptions(editorStartCmd);\n\n editorStartCmd.action(async (options) => {\n const { startEditor } = await import('./editor');\n startEditor({\n env: options.env,\n envFile: options.envFile,\n });\n });\n\n /**\n * EXTRACT\n */\n const extractProgram = program\n .command('extract')\n .alias('ext')\n .description(\n 'Extract strings from components to be placed in a .content file close to the component'\n );\n\n applyConfigOptions(extractProgram);\n\n extractProgram\n .option('-f, --file [files...]', 'List of files to extract')\n .option('--code-only', 'Only extract the component code', false)\n .option('--declaration-only', 'Only generate content declaration', false)\n .action(async (options) => {\n const { extract } = await import('./extract');\n extract({\n files: options.file,\n configOptions: extractConfigOptions(options),\n codeOnly: options.codeOnly,\n declarationOnly: options.declarationOnly,\n });\n });\n\n /**\n * STANDALONE\n */\n const bundleCmd = program\n .command('standalone')\n .description('Create a standalone bundle of the application content')\n .option(\n '-o, --outfile [outfile]',\n 'Output file for the bundle',\n 'intlayer-bundle.js'\n )\n .option('--packages [packages...]', 'List of packages to bundle')\n .option('--version [version]', 'Version of the packages to bundle')\n .option('--minify', 'Minify the output')\n .option('--platform [platform]', 'Target platform', 'browser')\n .option('--format [format]', 'Output format', 'esm')\n .action(async (options) => {\n const { bundle } = await import('./bundle');\n bundle({\n outfile: options.outfile,\n bundlePackages: options.packages,\n version: options.version,\n minify: options.minify,\n platform: options.platform,\n format: options.format,\n configOptions: extractConfigOptions(options),\n });\n });\n\n applyConfigOptions(bundleCmd);\n\n /**\n * SCAN\n */\n const scanCmd = program\n .command('scan')\n .description(\n 'Scan a website to measure its page size and audit its i18n / SEO health'\n )\n .argument('<url>', 'URL of the website to scan')\n .option('--no-deep', 'Disable the deeper puppeteer-based render scan')\n .option('--json', 'Output the results as JSON');\n\n applyConfigOptions(scanCmd);\n\n scanCmd.action(async (url, options) => {\n const { scan } = await import('./scan');\n return scan(url, {\n deep: options.deep,\n json: options.json,\n configOptions: extractConfigOptions(options),\n });\n });\n\n /**\n * CI / AUTOMATION\n *\n * `--ci` is accepted by every command. It re-runs the same command (flag\n * stripped) in every Intlayer project of the repository, injecting\n * per-project credentials from INTLAYER_PROJECT_CREDENTIALS. Handled once at\n * the program level so no action needs to know about it: the process exits\n * with the aggregated status once every project has run.\n */\n program.hook('preAction', async (_program, actionCommand) => {\n if (!actionCommand.opts().ci) return;\n\n const { runCI } = await import('./ci');\n process.exit(await runCI(process.argv.slice(2)));\n });\n\n /**\n * @deprecated `intlayer ci <command...>` is replaced by `intlayer <command> --ci`.\n * Kept hidden so workflows scaffolded by older versions keep working.\n */\n program\n .command('ci', { hidden: true })\n .argument('<command...>', 'The intlayer command to execute')\n .allowUnknownOption() // Forward flags like --verbose to the subcommand\n .action(async (args: string[]) => {\n logger(\n '`intlayer ci <command>` is deprecated, use `intlayer <command> --ci` instead.',\n { level: 'warn' }\n );\n const { runCI } = await import('./ci');\n process.exit(await runCI(args));\n });\n\n // Every command must be registered before parsing: commander dispatches\n // synchronously, so anything added after this line is an unknown command.\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":";;;;;;;;AAmBA,MAAM,aAAa,OAAO,YAAY,QAAQ;AAE9C,MAAa,UAAU,aACnBA,UAAY,cAAc,YAAY,GAAG,CAAC,IAC1C;AAEJ,MAAM,cAAc,qBAAqB,OAAO;AAEhD,MA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AM,MAAM,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;CACjD,CAAC;;;;;CAMD,QACG,QAAQ,MAAM,EAAE,QAAQ,KAAK,CAAC,CAAC,CAC/B,SAAS,gBAAgB,iCAAiC,CAAC,CAC3D,mBAAmB,CAAC,CACpB,OAAO,OAAO,SAAmB;EAChC,OACE,iFACA,EAAE,OAAO,OAAO,CAClB;EACA,MAAM,EAAE,UAAU,MAAM,OAAO;EAC/B,QAAQ,KAAK,MAAM,MAAM,IAAI,CAAC;CAChC,CAAC;CAIH,QAAQ,MAAM,QAAQ,IAAI;CAE1B,OAAO;AACT"}
@@ -1,6 +1,7 @@
1
+ import { BROWSER_EXTENSION_OPTIONS, CHROME_EXTENSION_URL, MOZILLA_EXTENSION_URL, initChromeExtension } from "./initChromeExtension.mjs";
1
2
  import { INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, initInfra, parseInfraMode } from "./initInfra.mjs";
2
3
  import { PLATFORM_OPTIONS, getDetectedPlatform, initSkills, promptPlatform } from "./initSkills.mjs";
3
- import { findProjectRoot, init } from "./init.mjs";
4
+ import { ESLINT_CONFIG_FILES, INIT_STEP_GROUPS, LOCALE_ROUTING_CHOICES, OPT_IN_INIT_STEPS, findProjectRoot, getInitialInitSteps, getProjectDependencies, getRoutingInitOptions, init, isEslintInstalled, parseLocaleRoutingChoice } from "./init.mjs";
4
5
  import { build } from "./build.mjs";
5
6
  import { listProjectsCommand } from "./listProjects.mjs";
6
7
  import { startEditor } from "./editor.mjs";
@@ -20,4 +21,4 @@ import { reviewDoc } from "./reviewDoc/reviewDoc.mjs";
20
21
  import { searchDoc } from "./searchDoc.mjs";
21
22
  import { translateDoc } from "./translateDoc/translateDoc.mjs";
22
23
 
23
- export { INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, PLATFORM_OPTIONS, build, bundle, dirname, extract, fill, findProjectRoot, getDetectedPlatform, init, initInfra, initSkills, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, listProjectsCommand, liveSync, parseInfraMode, promptPlatform, pull, push, pushConfig, reviewDoc, scan, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };
24
+ export { BROWSER_EXTENSION_OPTIONS, CHROME_EXTENSION_URL, ESLINT_CONFIG_FILES, INFRA_MODES, INIT_STEP_GROUPS, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, LOCALE_ROUTING_CHOICES, MOZILLA_EXTENSION_URL, OPT_IN_INIT_STEPS, PLATFORM_OPTIONS, build, bundle, dirname, extract, fill, findProjectRoot, getDetectedPlatform, getInitialInitSteps, getProjectDependencies, getRoutingInitOptions, init, initChromeExtension, initInfra, initSkills, isEslintInstalled, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, listProjectsCommand, liveSync, parseInfraMode, parseLocaleRoutingChoice, promptPlatform, pull, push, pushConfig, reviewDoc, scan, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };