@intlayer/cli 9.0.0-canary.12 → 9.0.0-canary.14

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":"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 { 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 } from 'commander';\nimport { login } from './auth/login';\nimport { build } from './build';\nimport { bundle } from './bundle';\nimport { runCI } from './ci';\nimport { getConfig } from './config';\nimport { startEditor } from './editor';\nimport { extract } from './extract';\nimport { type FillOptions, fill } from './fill/fill';\nimport { init } from './init';\nimport { initBuildOptimization } from './initBuildOptimization';\nimport { initMCP } from './initMCP';\nimport { initSkills } from './initSkills';\nimport { listContentDeclaration } from './listContentDeclaration';\nimport { listProjectsCommand } from './listProjects';\nimport { liveSync } from './liveSync';\nimport { pull } from './pull';\nimport { push } from './push/push';\nimport { pushConfig } from './pushConfig';\nimport { reviewDoc } from './reviewDoc/reviewDoc';\nimport { scan } from './scan';\nimport { searchDoc } from './searchDoc';\nimport { testMissingTranslations } from './test';\nimport { translateDoc } from './translateDoc/translateDoc';\nimport { getParentPackageJSON } from './utils/getParentPackageJSON';\nimport { watchContentDeclaration } from './watch';\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 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];\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 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 });\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.version(packageJson.version!).description('Intlayer CLI');\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((options) => {\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 scaffold framework middleware/proxy and 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((options) =>\n 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((options) => initSkills(options.projectRoot));\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((options) => initMCP(options.projectRoot));\n\n initCmd\n .command('build-optimization')\n .description(\n 'Configure build optimization for Next.js (@intlayer/swc or @intlayer/babel)'\n )\n .option('--project-root [projectRoot]', 'Project root directory')\n .action((options) => initBuildOptimization(options.projectRoot));\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) => {\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((options) =>\n 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 '--log',\n 'Log-only mode. Do not translate with AI; instead log the blocks that need attention (with line numbers and content) for the base and target locales, to help another agent generate the translations.'\n );\n\n applyConfigOptions(reviewProgram);\n applyAIOptions(reviewProgram);\n applyGitOptions(reviewProgram);\n applyOptions(reviewProgram, docParams);\n\n reviewProgram.action((options) =>\n 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 log: options.log,\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((query, options) =>\n 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((options) =>\n 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((options) => {\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((options) => {\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((options) => {\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((url, options) =>\n scan(url, {\n deep: options.deep,\n json: options.json,\n configOptions: extractConfigOptions(options),\n })\n );\n\n program.parse(process.argv);\n\n /**\n * CI / AUTOMATION\n *\n * Used to iterate over all projects in a monorepo, and help to parse secrets\n */\n program\n .command('ci')\n .description(\n 'Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.'\n )\n .argument(\n '<command...>',\n 'The intlayer command to execute (e.g., \"fill\", \"push\")'\n )\n .allowUnknownOption() // Allows passing flags like --verbose to the subcommand\n .action((args) => {\n runCI(args);\n });\n\n return program;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,aAAa,OAAO,OAAO,KAAK,QAAQ;AAE9C,MAAa,UAAU,aACnBA,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C;AAEJ,MAAM,cAAc,qBAAqB,QAAQ;AAOjD,MAAM,uBAAuB;CAC3B,CAAC,wBAAwB,mBAAmB;CAC5C,CAAC,mBAAmB,cAAc;CAClC,CAAC,wBAAwB,iBAAiB;CAC1C,CAAC,wBAAwB,WAAW;CACpC,GAAG,CATH,CAAC,aAAa,sCAAsC,EACpD,CAAC,qBAAqB,SAAS,CAQlB;CACd;AAED,MAAM,YAAY;CAChB,CAAC,yBAAyB,WAAW;CACrC,CAAC,+BAA+B,cAAc;CAC9C,CAAC,mBAAmB,QAAQ;CAC5B,CAAC,sBAAsB,mBAAmB;CAC1C,CAAC,4BAA4B,gBAAgB;CAC7C,CAAC,8CAA8C,sBAAsB;CACrE,CAAC,4CAA4C,qBAAqB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ACG,QAAQ,KAAK,CACb,YACC,iJACD,CACA,SACC,gBACA,6DACD,CACA,oBAAoB,CACpB,QAAQ,SAAS;AAChB,QAAM,KAAK;GACX;AAEJ,QAAO"}
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 { 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 } 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 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];\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 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 });\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.version(packageJson.version!).description('Intlayer CLI');\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 scaffold framework middleware/proxy and 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 return 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('build-optimization')\n .description(\n 'Configure build optimization for Next.js (@intlayer/swc or @intlayer/babel)'\n )\n .option('--project-root [projectRoot]', 'Project root directory')\n .action(async (options) => {\n const { initBuildOptimization } = await import('./initBuildOptimization');\n return initBuildOptimization(options.projectRoot);\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 '--log',\n 'Log-only mode. Do not translate with AI; instead log the blocks that need attention (with line numbers and content) for the base and target locales, to help another agent generate the translations.'\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 return 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 log: options.log,\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 program.parse(process.argv);\n\n /**\n * CI / AUTOMATION\n *\n * Used to iterate over all projects in a monorepo, and help to parse secrets\n */\n program\n .command('ci')\n .description(\n 'Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.'\n )\n .argument(\n '<command...>',\n 'The intlayer command to execute (e.g., \"fill\", \"push\")'\n )\n .allowUnknownOption() // Allows passing flags like --verbose to the subcommand\n .action(async (args) => {\n const { runCI } = await import('./ci');\n runCI(args);\n });\n\n return program;\n};\n"],"mappings":";;;;;;;;AAmBA,MAAM,aAAa,OAAO,OAAO,KAAK,QAAQ;AAE9C,MAAa,UAAU,aACnBA,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C;AAEJ,MAAM,cAAc,qBAAqB,QAAQ;AAOjD,MAAM,uBAAuB;CAC3B,CAAC,wBAAwB,mBAAmB;CAC5C,CAAC,mBAAmB,cAAc;CAClC,CAAC,wBAAwB,iBAAiB;CAC1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;GAClB,QAAQ,QAAQ;GAChB,eAAe,qBAAqB,QAAQ;GAC7C,CAAC;GAGsB,CAAC;;;;CAK7B,MAAM,UAAU,QACb,QAAQ,OAAO,CACf,YACC,0EACD,CACA,SAAS,SAAS,6BAA6B,CAC/C,OAAO,aAAa,iDAAiD,CACrE,OAAO,UAAU,6BAA6B;AAEjD,oBAAmB,QAAQ;AAE3B,SAAQ,OAAO,OAAO,KAAK,YAAY;EACrC,MAAM,EAAE,SAAS,MAAM,OAAO;AAC9B,SAAO,KAAK,KAAK;GACf,MAAM,QAAQ;GACd,MAAM,QAAQ;GACd,eAAe,qBAAqB,QAAQ;GAC7C,CAAC;GACF;AAEF,SAAQ,MAAM,QAAQ,KAAK;;;;;;AAO3B,SACG,QAAQ,KAAK,CACb,YACC,iJACD,CACA,SACC,gBACA,6DACD,CACA,oBAAoB,CACpB,OAAO,OAAO,SAAS;EACtB,MAAM,EAAE,UAAU,MAAM,OAAO;AAC/B,QAAM,KAAK;GACX;AAEJ,QAAO"}
@@ -6,6 +6,9 @@ import { PLATFORM_OPTIONS, getDetectedPlatform, initSkills } from "./initSkills.
6
6
  import { findProjectRoot, init } from "./init.mjs";
7
7
  import { startEditor } from "./editor.mjs";
8
8
  import { scan } from "./scan.mjs";
9
+ import { dirname, setAPI } from "./cli.mjs";
10
+ import { searchDoc } from "./searchDoc.mjs";
11
+ import { pushConfig } from "./pushConfig.mjs";
9
12
  import { build } from "./build.mjs";
10
13
  import { bundle } from "./bundle.mjs";
11
14
  import { listMissingTranslations, listMissingTranslationsWithConfig } from "./test/listMissingTranslations.mjs";
@@ -13,10 +16,7 @@ import { testMissingTranslations } from "./test/test.mjs";
13
16
  import { fill } from "./fill/fill.mjs";
14
17
  import { pull } from "./pull.mjs";
15
18
  import { push } from "./push/push.mjs";
16
- import { pushConfig } from "./pushConfig.mjs";
17
19
  import { reviewDoc } from "./reviewDoc/reviewDoc.mjs";
18
- import { searchDoc } from "./searchDoc.mjs";
19
20
  import { translateDoc } from "./translateDoc/translateDoc.mjs";
20
- import { dirname, setAPI } from "./cli.mjs";
21
21
 
22
22
  export { PLATFORM_OPTIONS, build, bundle, dirname, extract, fill, findProjectRoot, getDetectedPlatform, init, initSkills, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, listProjectsCommand, liveSync, pull, push, pushConfig, reviewDoc, scan, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };
package/dist/esm/init.mjs CHANGED
@@ -78,6 +78,28 @@ const ROUTING_MODE_OPTIONS = [
78
78
  hint: "/about?locale=fr"
79
79
  }
80
80
  ];
81
+ /**
82
+ * Content organization strategies offered by the interactive init flow.
83
+ * Drives the `compiler.output` template (autogenerated content: compiler /
84
+ * autofill / extract) or the injection of the syncJSON plugin.
85
+ */
86
+ const CONTENT_STRATEGY_OPTIONS = [
87
+ {
88
+ value: "per-component",
89
+ label: "Per component (default)",
90
+ hint: "multilingual .content files co-located with the components"
91
+ },
92
+ {
93
+ value: "centralized",
94
+ label: "Centralized folder",
95
+ hint: "per-locale JSON dictionaries under /locales/{locale}/{key}.content.json"
96
+ },
97
+ {
98
+ value: "json-namespaces",
99
+ label: "JSON namespaces",
100
+ hint: "plain /locales/{locale}/{namespace}.json files synced via @intlayer/sync-json-plugin"
101
+ }
102
+ ];
81
103
  const COMPAT_LIB_OPTIONS = [
82
104
  {
83
105
  value: "i18next",
@@ -280,10 +302,24 @@ const runInteractiveInit = async (root, baseOptions) => {
280
302
  } else if (hasLinguiJson && !hasLinguiPo) hintDependencies["__lingui_json__"] = "*";
281
303
  }
282
304
  }
305
+ let contentStrategy;
306
+ if (!hasCompatLib && !hintDependencies) {
307
+ const selectedContentStrategy = await p.select({
308
+ message: "How do you want to organize your translated content?",
309
+ options: CONTENT_STRATEGY_OPTIONS,
310
+ initialValue: "per-component"
311
+ });
312
+ if (p.isCancel(selectedContentStrategy)) {
313
+ p.cancel("Operation cancelled.");
314
+ return;
315
+ }
316
+ contentStrategy = selectedContentStrategy;
317
+ }
283
318
  await initIntlayer(root, {
284
319
  ...baseOptions,
285
320
  routingMode,
286
321
  hintDependencies,
322
+ contentStrategy,
287
323
  noInstallPackages: !steps.includes("packages"),
288
324
  noGitignore: baseOptions?.noGitignore,
289
325
  noGithubActions: baseOptions?.noGithubActions || !steps.includes("githubActions"),
@@ -1 +1 @@
1
- {"version":3,"file":"init.mjs","names":[],"sources":["../../src/init.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport * as p from '@clack/prompts';\nimport {\n type InitOptions,\n initIntlayer,\n PLATFORMS,\n type Platform,\n type RoutingMode,\n setupCmsCredentials,\n} from '@intlayer/engine/cli';\nimport enquirer from 'enquirer';\nimport { login } from './auth/login';\nimport { initBuildOptimization } from './initBuildOptimization';\nimport { initCompiler } from './initCompiler';\nimport { initMCP } from './initMCP';\nimport {\n getDetectedPlatform,\n initSkills,\n PLATFORM_OPTIONS,\n} from './initSkills';\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 | 'frameworkSetup'\n | 'vscodeExtension'\n | 'lsp'\n | 'skills'\n | 'mcp'\n | 'compiler'\n | 'buildOptimization';\n\nconst BASE_INIT_STEP_OPTIONS: Array<{\n value: InitStep;\n label: string;\n hint: string;\n}> = [\n {\n value: 'packages',\n label: 'Install & upgrade packages',\n hint: 'install missing Intlayer dependencies and upgrade outdated ones',\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',\n },\n {\n value: 'frameworkSetup',\n label: 'Framework setup',\n hint: 'middleware/proxy and providers in layout/page',\n },\n {\n value: 'vscodeExtension',\n label: 'VS Code extension',\n hint: 'recommend the Intlayer extension',\n },\n {\n value: 'lsp',\n label: 'Editor LSP',\n hint: 'go-to-definition from keys to .content files',\n },\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\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/**\n * Compat i18n library options surfaced in the interactive init prompt.\n * The `packages` field lists the package names to inject as hint-deps so\n * `detectMissingIntlayerPackages` detects the right sync plugin even before\n * those libraries are installed.\n */\ntype CompatLibOption = {\n value: string;\n label: string;\n hint: string;\n /**\n * Package names to inject as hint-dependencies (fake \"installed\" so that\n * the detection logic schedules the correct sync plugin and compat adapter).\n */\n packages?: string[];\n};\n\nconst COMPAT_LIB_OPTIONS: CompatLibOption[] = [\n {\n value: 'i18next',\n label: 'i18next / react-i18next',\n hint: 'i18next JSON format — installs @intlayer/i18next + @intlayer/sync-json-plugin',\n packages: ['i18next', 'react-i18next'],\n },\n {\n value: 'next-intl',\n label: 'next-intl / use-intl',\n hint: 'ICU format, Next.js — installs @intlayer/next-intl + @intlayer/sync-json-plugin',\n packages: ['next-intl'],\n },\n {\n value: 'vue-i18n',\n label: 'vue-i18n',\n hint: 'Vue i18n JSON format — installs @intlayer/vue-i18n + @intlayer/sync-json-plugin',\n packages: ['vue-i18n'],\n },\n {\n value: 'nuxtjs-i18n',\n label: '@nuxtjs/i18n',\n hint: 'Nuxt i18n module — installs @intlayer/nuxtjs-i18n + @intlayer/sync-json-plugin',\n packages: ['@nuxtjs/i18n'],\n },\n {\n value: 'next-i18next',\n label: 'next-i18next',\n hint: 'i18next JSON format, Next.js — installs @intlayer/next-i18next + @intlayer/sync-json-plugin',\n packages: ['next-i18next'],\n },\n {\n value: 'next-translate',\n label: 'next-translate',\n hint: 'i18next flat-namespace JSON, Next.js — installs @intlayer/next-translate + @intlayer/sync-json-plugin',\n packages: ['next-translate'],\n },\n {\n value: 'react-intl',\n label: 'react-intl',\n hint: 'ICU format — installs @intlayer/react-intl + @intlayer/sync-json-plugin',\n packages: ['react-intl'],\n },\n {\n value: 'lingui-po',\n label: 'Lingui (.po catalogs)',\n hint: \"gettext PO — Lingui's default, installs @intlayer/lingui + @intlayer/sync-po-plugin\",\n packages: ['@lingui/core'],\n },\n {\n value: 'lingui-json',\n label: 'Lingui (.json catalogs)',\n hint: 'JSON catalogs — installs @intlayer/lingui + @intlayer/sync-json-plugin',\n packages: ['@lingui/core'],\n },\n {\n value: 'svelte-i18n',\n label: 'svelte-i18n',\n hint: 'Flat i18next JSON — installs @intlayer/svelte-i18n + @intlayer/sync-json-plugin',\n packages: ['svelte-i18n'],\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/** Returns true when the project at `root` depends on Next.js. */\nconst isNextJsProject = (root: string): boolean =>\n Boolean(getProjectDependencies(root).next);\n\n/** Returns true when the project at `root` depends on Vite. */\nconst isViteProject = (root: string): boolean =>\n Boolean(getProjectDependencies(root).vite);\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 p.intro('Initialize Intlayer');\n\n const stepOptions = [...BASE_INIT_STEP_OPTIONS];\n\n const nextJsProject = isNextJsProject(root);\n\n // The compiler is plugged in directly on Vite; on Next.js it needs a Babel\n // config. Only offer the step when one of those frameworks is detected.\n if (nextJsProject || isViteProject(root)) {\n stepOptions.push({\n value: 'compiler',\n label: 'Compiler',\n hint: nextJsProject\n ? 'add the Babel compiler config to extract inline content (Next.js)'\n : 'auto-extract inline content at build time (already plugged in on Vite)',\n });\n }\n\n if (nextJsProject) {\n stepOptions.push({\n value: 'buildOptimization',\n label: 'Bundle optimization',\n hint: 'choose @intlayer/babel or @intlayer/swc for tree-shaking and minification (Next.js only)',\n });\n }\n\n const selected = await p.multiselect<InitStep>({\n message: 'Select what you want to set up:',\n options: stepOptions,\n initialValues: BASE_INIT_STEP_OPTIONS.map((option) => option.value),\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 (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 / selection.\n // When a compat library is already present in package.json the detection\n // in detectMissingIntlayerPackages handles everything automatically. We\n // only show the prompt when none of the known compat libs is detected so\n // we don't ask redundant questions.\n const knownCompatPackages = [\n 'i18next',\n 'react-i18next',\n 'next-intl',\n 'use-intl',\n 'vue-i18n',\n '@nuxtjs/i18n',\n 'next-i18next',\n 'next-translate',\n 'react-intl',\n '@lingui/core',\n '@lingui/react',\n 'svelte-i18n',\n '@ngneat/transloco',\n '@ngx-translate/core',\n 'node-polyglot',\n 'i18n-js',\n ];\n\n const existingDeps = getProjectDependencies(root);\n const hasCompatLib = knownCompatPackages.some((pkg) =>\n Boolean(existingDeps[pkg])\n );\n\n let hintDependencies: Record<string, string> | undefined;\n\n if (!hasCompatLib) {\n const selectedCompatLibs = await p.multiselect<string>({\n message:\n 'Are you using any existing i18n library? (Select all that apply, or press Enter to skip)',\n options: COMPAT_LIB_OPTIONS.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n })),\n required: false,\n });\n\n if (p.isCancel(selectedCompatLibs)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const selectedLibs = selectedCompatLibs as string[];\n\n if (selectedLibs.length > 0) {\n hintDependencies = {};\n\n for (const value of selectedLibs) {\n const option = COMPAT_LIB_OPTIONS.find((o) => o.value === value);\n if (option?.packages) {\n for (const pkg of option.packages) {\n hintDependencies[pkg] = '*';\n }\n }\n }\n\n // Lingui-specific: determine the catalog format so the right sync plugin\n // is chosen. If both lingui variants are selected, ask for clarification.\n const hasLinguiPo = selectedLibs.includes('lingui-po');\n const hasLinguiJson = selectedLibs.includes('lingui-json');\n\n if (hasLinguiPo && hasLinguiJson) {\n // Both selected — ask for clarification\n const linguiFormat = await p.select<'po' | 'json'>({\n message: 'Which catalog format does Lingui use in your project?',\n options: [\n {\n value: 'po' as const,\n label: '.po files (gettext)',\n hint: \"Lingui's default — installs @intlayer/sync-po-plugin\",\n },\n {\n value: 'json' as const,\n label: '.json files',\n hint: 'JSON catalogs — installs @intlayer/sync-json-plugin',\n },\n ],\n initialValue: 'po' as const,\n });\n\n if (p.isCancel(linguiFormat)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n // Signal JSON format to detectMissingIntlayerPackages via a sentinel\n // hint dep (the lingui detection only needs @lingui/core; the format\n // is conveyed through linguiCatalogFormat option from the filesystem\n // scan). For JSON we override by injecting a flag the init/index.ts\n // can read back from hintDependencies.\n if (linguiFormat === 'json') {\n hintDependencies['__lingui_json__'] = '*';\n }\n } else if (hasLinguiJson && !hasLinguiPo) {\n hintDependencies['__lingui_json__'] = '*';\n }\n // hasLinguiPo alone: @lingui/core hint is enough; PO is the default\n }\n }\n\n const options: InitOptions = {\n ...baseOptions,\n routingMode,\n hintDependencies,\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('frameworkSetup'),\n noVscodeExtension: !steps.includes('vscodeExtension'),\n noLsp: !steps.includes('lsp'),\n };\n\n await initIntlayer(root, options);\n\n const needsPlatform = steps.includes('skills') || steps.includes('mcp');\n\n let sharedPlatform: Platform | undefined;\n\n if (needsPlatform) {\n const detectedPlatform = getDetectedPlatform();\n\n try {\n const response = await enquirer.prompt<{ platforms: Platform }>({\n type: 'autocomplete',\n name: 'platforms',\n message: 'Which platform are you using? (Type to search)',\n multiple: false,\n initial: detectedPlatform\n ? PLATFORMS.indexOf(detectedPlatform)\n : undefined,\n choices: PLATFORM_OPTIONS.map((opt) => ({\n name: opt.value,\n message: opt.label,\n hint: opt.hint,\n })),\n });\n sharedPlatform = response.platforms;\n } catch {\n p.cancel('Operation cancelled.');\n return;\n }\n }\n\n if (steps.includes('skills')) {\n await initSkills(root, sharedPlatform);\n }\n\n if (steps.includes('mcp')) {\n await initMCP(root, sharedPlatform);\n }\n\n if (steps.includes('compiler')) {\n await initCompiler(root);\n }\n\n if (steps.includes('buildOptimization')) {\n await initBuildOptimization(root);\n }\n\n // CMS / visual editor is the last step: an opt-in browser login that\n // persists the access-key credentials to `.env` and enables the editor in the\n // config file. Asked last so the browser flow does not interrupt setup.\n const shouldSetUpCms = await p.confirm({\n message:\n 'Set up the Intlayer CMS now? (opens your browser to log in, then stores the credentials in your .env)',\n initialValue: false,\n });\n\n if (p.isCancel(shouldSetUpCms)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n if (shouldSetUpCms) {\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":";;;;;;;;;;;;AAsBA,MAAa,mBAAmB,aAAqB;CACnD,IAAI,aAAa;AAEjB,QAAO,eAAe,QAAQ,YAAY,KAAK,EAAE;AAC/C,MAAI,WAAW,KAAK,YAAY,eAAe,CAAC,CAC9C,QAAO;AAET,eAAa,QAAQ,YAAY,KAAK;;AAKxC,QAAO;;AAeT,MAAM,yBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACF;;AAGD,MAAM,uBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACF;AAmBD,MAAM,qBAAwC;CAC5C;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,WAAW,gBAAgB;EACvC;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,YAAY;EACxB;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,WAAW;EACvB;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,iBAAiB;EAC7B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,aAAa;EACzB;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO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,IAAI,KAAK,wDAAwD;AAGnE,QAAM,MAAM;GACV,WAAW;GACX,gBAAgB,gBAAgB,oBAAoB,MAAM,YAAY;GACvE,CAAC;;AAGJ,GAAE,MAAM,mCAAmC;;AAG7C,MAAa,OAAO,OAClB,aACA,SACA,gBACG;CACH,MAAM,OAAO,cACT,gBAAgB,QAAQ,YAAY,CAAC,GACrC,gBAAgB,QAAQ,KAAK,CAAC;AAElC,KAAI,aAAa;AACf,QAAM,mBAAmB,MAAM,QAAQ;AACvC;;AAGF,OAAM,aAAa,MAAM,QAAQ"}
1
+ {"version":3,"file":"init.mjs","names":[],"sources":["../../src/init.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport * as p from '@clack/prompts';\nimport {\n type ContentStrategy,\n type InitOptions,\n initIntlayer,\n PLATFORMS,\n type Platform,\n type RoutingMode,\n setupCmsCredentials,\n} from '@intlayer/engine/cli';\nimport enquirer from 'enquirer';\nimport { login } from './auth/login';\nimport { initBuildOptimization } from './initBuildOptimization';\nimport { initCompiler } from './initCompiler';\nimport { initMCP } from './initMCP';\nimport {\n getDetectedPlatform,\n initSkills,\n PLATFORM_OPTIONS,\n} from './initSkills';\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 | 'frameworkSetup'\n | 'vscodeExtension'\n | 'lsp'\n | 'skills'\n | 'mcp'\n | 'compiler'\n | 'buildOptimization';\n\nconst BASE_INIT_STEP_OPTIONS: Array<{\n value: InitStep;\n label: string;\n hint: string;\n}> = [\n {\n value: 'packages',\n label: 'Install & upgrade packages',\n hint: 'install missing Intlayer dependencies and upgrade outdated ones',\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',\n },\n {\n value: 'frameworkSetup',\n label: 'Framework setup',\n hint: 'middleware/proxy and providers in layout/page',\n },\n {\n value: 'vscodeExtension',\n label: 'VS Code extension',\n hint: 'recommend the Intlayer extension',\n },\n {\n value: 'lsp',\n label: 'Editor LSP',\n hint: 'go-to-definition from keys to .content files',\n },\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\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/**\n * Content organization strategies offered by the interactive init flow.\n * Drives the `compiler.output` template (autogenerated content: compiler /\n * autofill / extract) or the injection of the syncJSON plugin.\n */\nconst CONTENT_STRATEGY_OPTIONS: Array<{\n value: ContentStrategy;\n label: string;\n hint: string;\n}> = [\n {\n value: 'per-component',\n label: 'Per component (default)',\n hint: 'multilingual .content files co-located with the components',\n },\n {\n value: 'centralized',\n label: 'Centralized folder',\n hint: 'per-locale JSON dictionaries under /locales/{locale}/{key}.content.json',\n },\n {\n value: 'json-namespaces',\n label: 'JSON namespaces',\n hint: 'plain /locales/{locale}/{namespace}.json files synced via @intlayer/sync-json-plugin',\n },\n];\n\n/**\n * Compat i18n library options surfaced in the interactive init prompt.\n * The `packages` field lists the package names to inject as hint-deps so\n * `detectMissingIntlayerPackages` detects the right sync plugin even before\n * those libraries are installed.\n */\ntype CompatLibOption = {\n value: string;\n label: string;\n hint: string;\n /**\n * Package names to inject as hint-dependencies (fake \"installed\" so that\n * the detection logic schedules the correct sync plugin and compat adapter).\n */\n packages?: string[];\n};\n\nconst COMPAT_LIB_OPTIONS: CompatLibOption[] = [\n {\n value: 'i18next',\n label: 'i18next / react-i18next',\n hint: 'i18next JSON format — installs @intlayer/i18next + @intlayer/sync-json-plugin',\n packages: ['i18next', 'react-i18next'],\n },\n {\n value: 'next-intl',\n label: 'next-intl / use-intl',\n hint: 'ICU format, Next.js — installs @intlayer/next-intl + @intlayer/sync-json-plugin',\n packages: ['next-intl'],\n },\n {\n value: 'vue-i18n',\n label: 'vue-i18n',\n hint: 'Vue i18n JSON format — installs @intlayer/vue-i18n + @intlayer/sync-json-plugin',\n packages: ['vue-i18n'],\n },\n {\n value: 'nuxtjs-i18n',\n label: '@nuxtjs/i18n',\n hint: 'Nuxt i18n module — installs @intlayer/nuxtjs-i18n + @intlayer/sync-json-plugin',\n packages: ['@nuxtjs/i18n'],\n },\n {\n value: 'next-i18next',\n label: 'next-i18next',\n hint: 'i18next JSON format, Next.js — installs @intlayer/next-i18next + @intlayer/sync-json-plugin',\n packages: ['next-i18next'],\n },\n {\n value: 'next-translate',\n label: 'next-translate',\n hint: 'i18next flat-namespace JSON, Next.js — installs @intlayer/next-translate + @intlayer/sync-json-plugin',\n packages: ['next-translate'],\n },\n {\n value: 'react-intl',\n label: 'react-intl',\n hint: 'ICU format — installs @intlayer/react-intl + @intlayer/sync-json-plugin',\n packages: ['react-intl'],\n },\n {\n value: 'lingui-po',\n label: 'Lingui (.po catalogs)',\n hint: \"gettext PO — Lingui's default, installs @intlayer/lingui + @intlayer/sync-po-plugin\",\n packages: ['@lingui/core'],\n },\n {\n value: 'lingui-json',\n label: 'Lingui (.json catalogs)',\n hint: 'JSON catalogs — installs @intlayer/lingui + @intlayer/sync-json-plugin',\n packages: ['@lingui/core'],\n },\n {\n value: 'svelte-i18n',\n label: 'svelte-i18n',\n hint: 'Flat i18next JSON — installs @intlayer/svelte-i18n + @intlayer/sync-json-plugin',\n packages: ['svelte-i18n'],\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/** Returns true when the project at `root` depends on Next.js. */\nconst isNextJsProject = (root: string): boolean =>\n Boolean(getProjectDependencies(root).next);\n\n/** Returns true when the project at `root` depends on Vite. */\nconst isViteProject = (root: string): boolean =>\n Boolean(getProjectDependencies(root).vite);\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 p.intro('Initialize Intlayer');\n\n const stepOptions = [...BASE_INIT_STEP_OPTIONS];\n\n const nextJsProject = isNextJsProject(root);\n\n // The compiler is plugged in directly on Vite; on Next.js it needs a Babel\n // config. Only offer the step when one of those frameworks is detected.\n if (nextJsProject || isViteProject(root)) {\n stepOptions.push({\n value: 'compiler',\n label: 'Compiler',\n hint: nextJsProject\n ? 'add the Babel compiler config to extract inline content (Next.js)'\n : 'auto-extract inline content at build time (already plugged in on Vite)',\n });\n }\n\n if (nextJsProject) {\n stepOptions.push({\n value: 'buildOptimization',\n label: 'Bundle optimization',\n hint: 'choose @intlayer/babel or @intlayer/swc for tree-shaking and minification (Next.js only)',\n });\n }\n\n const selected = await p.multiselect<InitStep>({\n message: 'Select what you want to set up:',\n options: stepOptions,\n initialValues: BASE_INIT_STEP_OPTIONS.map((option) => option.value),\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 (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 / selection.\n // When a compat library is already present in package.json the detection\n // in detectMissingIntlayerPackages handles everything automatically. We\n // only show the prompt when none of the known compat libs is detected so\n // we don't ask redundant questions.\n const knownCompatPackages = [\n 'i18next',\n 'react-i18next',\n 'next-intl',\n 'use-intl',\n 'vue-i18n',\n '@nuxtjs/i18n',\n 'next-i18next',\n 'next-translate',\n 'react-intl',\n '@lingui/core',\n '@lingui/react',\n 'svelte-i18n',\n '@ngneat/transloco',\n '@ngx-translate/core',\n 'node-polyglot',\n 'i18n-js',\n ];\n\n const existingDeps = getProjectDependencies(root);\n const hasCompatLib = knownCompatPackages.some((pkg) =>\n Boolean(existingDeps[pkg])\n );\n\n let hintDependencies: Record<string, string> | undefined;\n\n if (!hasCompatLib) {\n const selectedCompatLibs = await p.multiselect<string>({\n message:\n 'Are you using any existing i18n library? (Select all that apply, or press Enter to skip)',\n options: COMPAT_LIB_OPTIONS.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n })),\n required: false,\n });\n\n if (p.isCancel(selectedCompatLibs)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const selectedLibs = selectedCompatLibs as string[];\n\n if (selectedLibs.length > 0) {\n hintDependencies = {};\n\n for (const value of selectedLibs) {\n const option = COMPAT_LIB_OPTIONS.find((o) => o.value === value);\n if (option?.packages) {\n for (const pkg of option.packages) {\n hintDependencies[pkg] = '*';\n }\n }\n }\n\n // Lingui-specific: determine the catalog format so the right sync plugin\n // is chosen. If both lingui variants are selected, ask for clarification.\n const hasLinguiPo = selectedLibs.includes('lingui-po');\n const hasLinguiJson = selectedLibs.includes('lingui-json');\n\n if (hasLinguiPo && hasLinguiJson) {\n // Both selected — ask for clarification\n const linguiFormat = await p.select<'po' | 'json'>({\n message: 'Which catalog format does Lingui use in your project?',\n options: [\n {\n value: 'po' as const,\n label: '.po files (gettext)',\n hint: \"Lingui's default — installs @intlayer/sync-po-plugin\",\n },\n {\n value: 'json' as const,\n label: '.json files',\n hint: 'JSON catalogs — installs @intlayer/sync-json-plugin',\n },\n ],\n initialValue: 'po' as const,\n });\n\n if (p.isCancel(linguiFormat)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n // Signal JSON format to detectMissingIntlayerPackages via a sentinel\n // hint dep (the lingui detection only needs @lingui/core; the format\n // is conveyed through linguiCatalogFormat option from the filesystem\n // scan). For JSON we override by injecting a flag the init/index.ts\n // can read back from hintDependencies.\n if (linguiFormat === 'json') {\n hintDependencies['__lingui_json__'] = '*';\n }\n } else if (hasLinguiJson && !hasLinguiPo) {\n hintDependencies['__lingui_json__'] = '*';\n }\n // hasLinguiPo alone: @lingui/core hint is enough; PO is the default\n }\n }\n\n // Content organization strategy → drives `compiler.output` (autogenerated\n // content) or the syncJSON plugin injection. A compat library already\n // dictates the catalog layout (its JSON/PO files are synced as-is), so the\n // question is only asked when none is in play.\n let contentStrategy: ContentStrategy | undefined;\n\n if (!hasCompatLib && !hintDependencies) {\n const selectedContentStrategy = await p.select<ContentStrategy>({\n message: 'How do you want to organize your translated content?',\n options: CONTENT_STRATEGY_OPTIONS,\n initialValue: 'per-component',\n });\n\n if (p.isCancel(selectedContentStrategy)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n contentStrategy = selectedContentStrategy;\n }\n\n const options: InitOptions = {\n ...baseOptions,\n routingMode,\n hintDependencies,\n contentStrategy,\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('frameworkSetup'),\n noVscodeExtension: !steps.includes('vscodeExtension'),\n noLsp: !steps.includes('lsp'),\n };\n\n await initIntlayer(root, options);\n\n const needsPlatform = steps.includes('skills') || steps.includes('mcp');\n\n let sharedPlatform: Platform | undefined;\n\n if (needsPlatform) {\n const detectedPlatform = getDetectedPlatform();\n\n try {\n const response = await enquirer.prompt<{ platforms: Platform }>({\n type: 'autocomplete',\n name: 'platforms',\n message: 'Which platform are you using? (Type to search)',\n multiple: false,\n initial: detectedPlatform\n ? PLATFORMS.indexOf(detectedPlatform)\n : undefined,\n choices: PLATFORM_OPTIONS.map((opt) => ({\n name: opt.value,\n message: opt.label,\n hint: opt.hint,\n })),\n });\n sharedPlatform = response.platforms;\n } catch {\n p.cancel('Operation cancelled.');\n return;\n }\n }\n\n if (steps.includes('skills')) {\n await initSkills(root, sharedPlatform);\n }\n\n if (steps.includes('mcp')) {\n await initMCP(root, sharedPlatform);\n }\n\n if (steps.includes('compiler')) {\n await initCompiler(root);\n }\n\n if (steps.includes('buildOptimization')) {\n await initBuildOptimization(root);\n }\n\n // CMS / visual editor is the last step: an opt-in browser login that\n // persists the access-key credentials to `.env` and enables the editor in the\n // config file. Asked last so the browser flow does not interrupt setup.\n const shouldSetUpCms = await p.confirm({\n message:\n 'Set up the Intlayer CMS now? (opens your browser to log in, then stores the credentials in your .env)',\n initialValue: false,\n });\n\n if (p.isCancel(shouldSetUpCms)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n if (shouldSetUpCms) {\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":";;;;;;;;;;;;AAuBA,MAAa,mBAAmB,aAAqB;CACnD,IAAI,aAAa;AAEjB,QAAO,eAAe,QAAQ,YAAY,KAAK,EAAE;AAC/C,MAAI,WAAW,KAAK,YAAY,eAAe,CAAC,CAC9C,QAAO;AAET,eAAa,QAAQ,YAAY,KAAK;;AAKxC,QAAO;;AAeT,MAAM,yBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACF;;AAGD,MAAM,uBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACF;;;;;;AAOD,MAAM,2BAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACP;CACF;AAmBD,MAAM,qBAAwC;CAC5C;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,WAAW,gBAAgB;EACvC;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,YAAY;EACxB;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,WAAW;EACvB;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,iBAAiB;EAC7B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,aAAa;EACzB;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,eAAe;EAC3B;CACD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,UAAU,CAAC,cAAc;EAC1B;CACF;;AAGD,MAAM,0BAA0B,SAAyC;AACvE,KAAI;EACF,MAAM,kBAAkB,KAAK,MAAM,eAAe;AAClD,MAAI,CAAC,WAAW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,SAAS,eAAe,EAAE;AAC9B,IAAE,OAAO,uBAAuB;AAChC;;AAGF,KAAI,gBAAgB;AAClB,IAAE,IAAI,KAAK,wDAAwD;AAGnE,QAAM,MAAM;GACV,WAAW;GACX,gBAAgB,gBAAgB,oBAAoB,MAAM,YAAY;GACvE,CAAC;;AAGJ,GAAE,MAAM,mCAAmC;;AAG7C,MAAa,OAAO,OAClB,aACA,SACA,gBACG;CACH,MAAM,OAAO,cACT,gBAAgB,QAAQ,YAAY,CAAC,GACrC,gBAAgB,QAAQ,KAAK,CAAC;AAElC,KAAI,aAAa;AACf,QAAM,mBAAmB,MAAM,QAAQ;AACvC;;AAGF,OAAM,aAAa,MAAM,QAAQ"}
package/dist/esm/pull.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { checkCMSAuth, getAuthenticatedAPI } from "./utils/checkAccess.mjs";
2
- import { PullLogger } from "./push/pullLog.mjs";
3
2
  import { selectCmsEnvironment } from "./utils/selectCmsEnvironment.mjs";
3
+ import { PullLogger } from "./push/pullLog.mjs";
4
4
  import { existsSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import * as ANSIColors from "@intlayer/config/colors";
@@ -6,6 +6,12 @@ import { watch } from "@intlayer/engine/watcher";
6
6
 
7
7
  //#region src/watch.ts
8
8
  /**
9
+ * Grace period granted to the `--with` child (e.g. Next.js/Turbopack) to exit
10
+ * after SIGTERM before it is force-killed with SIGKILL. Detached dev servers
11
+ * that ignore SIGTERM would otherwise re-orphan once the watcher exits.
12
+ */
13
+ const SHUTDOWN_GRACE_MS = 3e3;
14
+ /**
9
15
  * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.
10
16
  * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}
11
17
  */
@@ -14,9 +20,11 @@ const watchContentDeclaration = async (options) => {
14
20
  logConfigDetails(options?.configOptions);
15
21
  const appLogger = getAppLogger(config);
16
22
  let parallelProcess;
23
+ let isShuttingDown = false;
17
24
  if (options?.with) {
18
25
  parallelProcess = runParallel(options.with);
19
26
  parallelProcess.result.catch(() => {
27
+ if (isShuttingDown) return;
20
28
  process.exit(1);
21
29
  });
22
30
  }
@@ -24,13 +32,25 @@ const watchContentDeclaration = async (options) => {
24
32
  persistent: true,
25
33
  skipPrepare: options?.skipPrepare ?? false
26
34
  });
27
- let isShuttingDown = false;
28
35
  const handleShutdown = async () => {
29
36
  if (isShuttingDown) return;
30
37
  isShuttingDown = true;
31
38
  appLogger("Stopping Intlayer watcher...");
32
39
  try {
33
- if (parallelProcess) parallelProcess.kill();
40
+ if (parallelProcess) {
41
+ const { kill, result } = parallelProcess;
42
+ kill("SIGTERM");
43
+ let killTimer;
44
+ const graceDeadline = new Promise((resolveDeadline) => {
45
+ killTimer = setTimeout(() => {
46
+ appLogger("Parallel process did not exit after SIGTERM, sending SIGKILL...", { level: "warn" });
47
+ kill("SIGKILL");
48
+ resolveDeadline();
49
+ }, SHUTDOWN_GRACE_MS);
50
+ });
51
+ await Promise.race([result.catch(() => {}), graceDeadline]);
52
+ if (killTimer) clearTimeout(killTimer);
53
+ }
34
54
  await Promise.all(watcher?.map((watcherEl) => watcherEl.unsubscribe()) ?? []);
35
55
  } catch (error) {
36
56
  console.error("Error during shutdown:", error);
@@ -1 +1 @@
1
- {"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { logConfigDetails } from '@intlayer/engine/cli';\nimport { runParallel } from '@intlayer/engine/utils';\nimport { watch } from '@intlayer/engine/watcher';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = await watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n let isShuttingDown = false;\n const handleShutdown = async () => {\n // Prevent multiple calls\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Kill the parallel process (e.g., Next.js) before closing the watcher\n if (parallelProcess) {\n parallelProcess.kill();\n }\n\n // Close all file watchers to stop \"esbuild service not running\" errors\n await Promise.all(\n watcher?.map((watcherEl) => watcherEl.unsubscribe()) ?? []\n );\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,0BAA0B,OAAO,YAA2B;CACvE,MAAM,SAAS,iBAAiB,SAAS,cAAc;AACvD,kBAAiB,SAAS,cAAc;CAExC,MAAM,YAAY,aAAa,OAAO;CAGtC,IAAI;AAEJ,KAAI,SAAS,MAAM;AACjB,oBAAkB,YAAY,QAAQ,KAAK;AAE3C,kBAAgB,OAAO,YAAY;AAEjC,WAAQ,KAAK,EAAE;IACf;;CAIJ,MAAM,UAAU,MAAM,MAAM;EAC1B,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC;CAGF,IAAI,iBAAiB;CACrB,MAAM,iBAAiB,YAAY;AAEjC,MAAI,eAAgB;AACpB,mBAAiB;AAEjB,YAAU,+BAA+B;AAEzC,MAAI;AAEF,OAAI,gBACF,iBAAgB,MAAM;AAIxB,SAAM,QAAQ,IACZ,SAAS,KAAK,cAAc,UAAU,aAAa,CAAC,IAAI,EAAE,CAC3D;WACM,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;YACtC;AACR,WAAQ,KAAK,EAAE;;;AAKnB,SAAQ,GAAG,UAAU,eAAe;AACpC,SAAQ,GAAG,WAAW,eAAe"}
1
+ {"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\nimport { logConfigDetails } from '@intlayer/engine/cli';\nimport { runParallel } from '@intlayer/engine/utils';\nimport { watch } from '@intlayer/engine/watcher';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Grace period granted to the `--with` child (e.g. Next.js/Turbopack) to exit\n * after SIGTERM before it is force-killed with SIGKILL. Detached dev servers\n * that ignore SIGTERM would otherwise re-orphan once the watcher exits.\n */\nconst SHUTDOWN_GRACE_MS = 3000;\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n // Declared before the child is spawned so the failure handler below can tell a\n // genuine crash apart from the SIGKILL we send during shutdown.\n let isShuttingDown = false;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // During shutdown the child is expected to reject (we force-kill it); that\n // must not be reported as a crash.\n if (isShuttingDown) return;\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = await watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n const handleShutdown = async () => {\n // Prevent multiple calls\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Kill the parallel process (e.g., Next.js) before closing the watcher.\n // The child is spawned detached (its own process group), so we must wait\n // for it to actually exit — otherwise it re-orphans the moment we exit.\n if (parallelProcess) {\n const { kill, result } = parallelProcess;\n\n kill('SIGTERM'); // graceful termination of the whole process group\n\n // Escalate to SIGKILL if the child ignores SIGTERM within the grace\n // period (some dev servers/bundlers do), so it can never be left behind.\n let killTimer: NodeJS.Timeout | undefined;\n const graceDeadline = new Promise<void>((resolveDeadline) => {\n killTimer = setTimeout(() => {\n appLogger(\n 'Parallel process did not exit after SIGTERM, sending SIGKILL...',\n { level: 'warn' }\n );\n kill('SIGKILL');\n resolveDeadline();\n }, SHUTDOWN_GRACE_MS);\n });\n\n // `result` rejects when the child is killed; swallow it here since the\n // outcome is already handled by the shutdown-aware catch above.\n await Promise.race([result.catch(() => {}), graceDeadline]);\n\n if (killTimer) clearTimeout(killTimer);\n }\n\n // Close all file watchers to stop \"esbuild service not running\" errors\n await Promise.all(\n watcher?.map((watcherEl) => watcherEl.unsubscribe()) ?? []\n );\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,oBAAoB;;;;;AAM1B,MAAa,0BAA0B,OAAO,YAA2B;CACvE,MAAM,SAAS,iBAAiB,SAAS,cAAc;AACvD,kBAAiB,SAAS,cAAc;CAExC,MAAM,YAAY,aAAa,OAAO;CAGtC,IAAI;CAIJ,IAAI,iBAAiB;AAErB,KAAI,SAAS,MAAM;AACjB,oBAAkB,YAAY,QAAQ,KAAK;AAE3C,kBAAgB,OAAO,YAAY;AAGjC,OAAI,eAAgB;AAEpB,WAAQ,KAAK,EAAE;IACf;;CAIJ,MAAM,UAAU,MAAM,MAAM;EAC1B,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC;CAGF,MAAM,iBAAiB,YAAY;AAEjC,MAAI,eAAgB;AACpB,mBAAiB;AAEjB,YAAU,+BAA+B;AAEzC,MAAI;AAIF,OAAI,iBAAiB;IACnB,MAAM,EAAE,MAAM,WAAW;AAEzB,SAAK,UAAU;IAIf,IAAI;IACJ,MAAM,gBAAgB,IAAI,SAAe,oBAAoB;AAC3D,iBAAY,iBAAiB;AAC3B,gBACE,mEACA,EAAE,OAAO,QAAQ,CAClB;AACD,WAAK,UAAU;AACf,uBAAiB;QAChB,kBAAkB;MACrB;AAIF,UAAM,QAAQ,KAAK,CAAC,OAAO,YAAY,GAAG,EAAE,cAAc,CAAC;AAE3D,QAAI,UAAW,cAAa,UAAU;;AAIxC,SAAM,QAAQ,IACZ,SAAS,KAAK,cAAc,UAAU,aAAa,CAAC,IAAI,EAAE,CAC3D;WACM,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;YACtC;AACR,WAAQ,KAAK,EAAE;;;AAKnB,SAAQ,GAAG,UAAU,eAAe;AACpC,SAAQ,GAAG,WAAW,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.d.ts","names":[],"sources":["../../src/bundle.ts"],"mappings":";;;cAEa,MAAA,GAAgB,OAAA,EAAS,qBAAA,KAAwB,OAAA"}
1
+ {"version":3,"file":"bundle.d.ts","names":[],"sources":["../../src/bundle.ts"],"mappings":";;;cA8Ca,MAAA,GAAgB,OAAA,EAAS,qBAAA,KAAwB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/cli.ts"],"mappings":";;;cA4Ca,OAAA;AAAA,KA4IR,UAAA;EACH,MAAA;EACA,OAAA;AAAA;AAAA,KAGU,oBAAA;EACV,OAAA;EACA,GAAA;EACA,OAAA;EACA,OAAA;EACA,UAAA;AAAA,IACE,UAAA;AANJ;;;;;;;;AAAA,cAuEa,MAAA,QAAa,OAAA"}
1
+ {"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/cli.ts"],"mappings":";;;cAqBa,OAAA;AAAA,KA4IR,UAAA;EACH,MAAA;EACA,OAAA;AAAA;AAAA,KAGU,oBAAA;EACV,OAAA;EACA,GAAA;EACA,OAAA;EACA,OAAA;EACA,UAAA;AAAA,IACE,UAAA;AANJ;;;;;;;;AAAA,cAuEa,MAAA,QAAa,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","names":[],"sources":["../../src/init.ts"],"mappings":";;;cAsBa,eAAA,GAAmB,QAAA;AAAA,cA0enB,IAAA,GACX,WAAA,WACA,OAAA,GAAU,WAAA,EACV,WAAA,eAAqB,OAAA"}
1
+ {"version":3,"file":"init.d.ts","names":[],"sources":["../../src/init.ts"],"mappings":";;;cAuBa,eAAA,GAAmB,QAAA;AAAA,cA2hBnB,IAAA,GACX,WAAA,WACA,OAAA,GAAU,WAAA,EACV,WAAA,eAAqB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"watch.d.ts","names":[],"sources":["../../src/watch.ts"],"mappings":";;;KASK,YAAA;EACH,WAAA;EACA,IAAA;EACA,aAAA,GAAgB,uBAAA;AAAA;;;;;cAOL,uBAAA,GAAiC,OAAA,GAAU,YAAA,KAAY,OAAA"}
1
+ {"version":3,"file":"watch.d.ts","names":[],"sources":["../../src/watch.ts"],"mappings":";;;KASK,YAAA;EACH,WAAA;EACA,IAAA;EACA,aAAA,GAAgB,uBAAA;AAAA;;;;;cAcL,uBAAA,GAAiC,OAAA,GAAU,YAAA,KAAY,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/cli",
3
- "version": "9.0.0-canary.12",
3
+ "version": "9.0.0-canary.14",
4
4
  "private": false,
5
5
  "description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
6
6
  "keywords": [
@@ -67,22 +67,22 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@clack/prompts": "0.11.0",
70
- "@intlayer/api": "9.0.0-canary.12",
71
- "@intlayer/babel": "9.0.0-canary.12",
72
- "@intlayer/config": "9.0.0-canary.12",
73
- "@intlayer/core": "9.0.0-canary.12",
74
- "@intlayer/dictionaries-entry": "9.0.0-canary.12",
75
- "@intlayer/engine": "9.0.0-canary.12",
76
- "@intlayer/remote-dictionaries-entry": "9.0.0-canary.12",
77
- "@intlayer/types": "9.0.0-canary.12",
78
- "@intlayer/unmerged-dictionaries-entry": "9.0.0-canary.12",
79
- "commander": "14.0.3",
70
+ "@intlayer/api": "9.0.0-canary.14",
71
+ "@intlayer/babel": "9.0.0-canary.14",
72
+ "@intlayer/config": "9.0.0-canary.14",
73
+ "@intlayer/core": "9.0.0-canary.14",
74
+ "@intlayer/dictionaries-entry": "9.0.0-canary.14",
75
+ "@intlayer/engine": "9.0.0-canary.14",
76
+ "@intlayer/remote-dictionaries-entry": "9.0.0-canary.14",
77
+ "@intlayer/types": "9.0.0-canary.14",
78
+ "@intlayer/unmerged-dictionaries-entry": "9.0.0-canary.14",
79
+ "commander": "15.0.0",
80
80
  "enquirer": "2.4.1",
81
81
  "eventsource": "4.1.0",
82
82
  "fast-glob": "3.3.3"
83
83
  },
84
84
  "devDependencies": {
85
- "@intlayer/ai": "9.0.0-canary.12",
85
+ "@intlayer/ai": "9.0.0-canary.14",
86
86
  "@types/node": "25.9.4",
87
87
  "@utils/ts-config": "1.0.4",
88
88
  "@utils/ts-config-types": "1.0.4",
@@ -93,7 +93,7 @@
93
93
  "vitest": "4.1.9"
94
94
  },
95
95
  "peerDependencies": {
96
- "@intlayer/ai": "9.0.0-canary.12"
96
+ "@intlayer/ai": "9.0.0-canary.14"
97
97
  },
98
98
  "peerDependenciesMeta": {
99
99
  "@intlayer/ai": {