i18next-cli 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.15.0](https://github.com/i18next/i18next-cli/compare/v1.14.0...v1.15.0) - 2025-10-27
9
+
10
+ - feat(cli): add global `-c, --config <path>` option to override automatic config detection and point the CLI at a specific i18next config file. [#77](https://github.com/i18next/i18next-cli/issues/77)
11
+
8
12
  ## [1.14.0](https://github.com/i18next/i18next-cli/compare/v1.13.1...v1.14.0) - 2025-10-27
9
13
 
10
14
  - Parse simple template strings when extracting defaultValue-s [#76](https://github.com/i18next/i18next-cli/pull/76)
package/README.md CHANGED
@@ -251,6 +251,19 @@ npx i18next-cli locize-sync [options]
251
251
 
252
252
  **Interactive Setup:** If your locize credentials are missing or invalid, the toolkit will guide you through an interactive setup process to configure your Project ID, API Key, and version.
253
253
 
254
+ ## Global Options
255
+
256
+ - `-c, --config <path>` — Override automatic config detection and use the specified config file (relative to cwd or absolute). This option is forwarded to commands that load or ensure a config (e.g. extract, status, types, sync, locize-*).
257
+
258
+ Examples:
259
+ ```bash
260
+ # Use a config file stored in a package subfolder (monorepo)
261
+ npx i18next-cli extract --config ./packages/my-package/config/i18next.config.ts
262
+
263
+ # Short flag variant, for status
264
+ npx i18next-cli status de -c ./packages/my-package/config/i18next.config.ts
265
+ ```
266
+
254
267
  ## Configuration
255
268
 
256
269
  The configuration file supports both TypeScript (`.ts`) and JavaScript (`.js`) formats. Use the `defineConfig` helper for type safety and IntelliSense.
package/dist/cjs/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var e=require("commander"),t=require("chokidar"),n=require("glob"),o=require("minimatch"),i=require("chalk"),a=require("./config.js"),r=require("./heuristic-config.js"),c=require("./extractor/core/extractor.js");require("node:path"),require("node:fs/promises"),require("jiti");var s=require("./types-generator.js"),l=require("./syncer.js"),u=require("./migrator.js"),d=require("./init.js"),g=require("./linter.js"),p=require("./status.js"),f=require("./locize.js");const m=new e.Command;m.name("i18next-cli").description("A unified, high-performance i18next CLI.").version("1.14.0"),m.command("extract").description("Extract translation keys from source files and update resource files.").option("-w, --watch","Watch for file changes and re-run the extractor.").option("--ci","Exit with a non-zero status code if any files are updated.").option("--dry-run","Run the extractor without writing any files to disk.").option("--sync-primary","Sync primary language values with default values from code.").action(async e=>{try{const n=await a.ensureConfig(),i=async()=>{const t=await c.runExtractor(n,{isWatchMode:!!e.watch,isDryRun:!!e.dryRun,syncPrimaryWithDefaults:!!e.syncPrimary});return e.ci&&!t?(console.log("✅ No files were updated."),process.exit(0)):e.ci&&t&&(console.error("❌ Some files were updated. This should not happen in CI mode."),process.exit(1)),t};if(await i(),e.watch){console.log("\nWatching for changes...");const e=await w(n.extract.input),a=y(n.extract.ignore),r=h(n.extract.output),c=[...a,...r].filter(Boolean),s=e.filter(e=>!c.some(t=>o.minimatch(e,t,{dot:!0})));t.watch(s,{ignored:/node_modules/,persistent:!0}).on("change",e=>{console.log(`\nFile changed: ${e}`),i()})}}catch(e){console.error("Error running extractor:",e),process.exit(1)}}),m.command("status [locale]").description("Display translation status. Provide a locale for a detailed key-by-key view.").option("-n, --namespace <ns>","Filter the status report by a specific namespace").action(async(e,t)=>{let n=await a.loadConfig();if(!n){console.log(i.blue("No config file found. Attempting to detect project structure..."));const e=await r.detectConfig();e||(console.error(i.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${i.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(i.green("Project structure detected successfully!")),n=e}await p.runStatus(n,{detail:e,namespace:t.namespace})}),m.command("types").description("Generate TypeScript definitions from translation resource files.").option("-w, --watch","Watch for file changes and re-run the type generator.").action(async e=>{const n=await a.ensureConfig(),i=()=>s.runTypesGenerator(n);if(await i(),e.watch){console.log("\nWatching for changes...");const e=await w(n.types?.input||[]),a=[...y(n.extract?.ignore)].filter(Boolean),r=e.filter(e=>!a.some(t=>o.minimatch(e,t,{dot:!0})));t.watch(r,{persistent:!0}).on("change",e=>{console.log(`\nFile changed: ${e}`),i()})}}),m.command("sync").description("Synchronize secondary language files with the primary language file.").action(async()=>{const e=await a.ensureConfig();await l.runSyncer(e)}),m.command("migrate-config [configPath]").description("Migrate a legacy i18next-parser.config.js to the new format.").action(async e=>{await u.runMigrator(e)}),m.command("init").description("Create a new i18next.config.ts/js file with an interactive setup wizard.").action(d.runInit),m.command("lint").description("Find potential issues like hardcoded strings in your codebase.").option("-w, --watch","Watch for file changes and re-run the linter.").action(async e=>{const n=async()=>{let e=await a.loadConfig();if(!e){console.log(i.blue("No config file found. Attempting to detect project structure..."));const t=await r.detectConfig();t||(console.error(i.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${i.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(i.green("Project structure detected successfully!")),e=t}await g.runLinter(e)};if(await n(),e.watch){console.log("\nWatching for changes...");const e=await a.loadConfig();if(e?.extract?.input){const i=await w(e.extract.input),a=[...y(e.extract.ignore),...h(e.extract.output)].filter(Boolean),r=i.filter(e=>!a.some(t=>o.minimatch(e,t,{dot:!0})));t.watch(r,{ignored:/node_modules/,persistent:!0}).on("change",e=>{console.log(`\nFile changed: ${e}`),n()})}}}),m.command("locize-sync").description("Synchronize local translations with your locize project.").option("--update-values","Update values of existing translations on locize.").option("--src-lng-only","Check for changes in source language only.").option("--compare-mtime","Compare modification times when syncing.").option("--dry-run","Run the command without making any changes.").action(async e=>{const t=await a.ensureConfig();await f.runLocizeSync(t,e)}),m.command("locize-download").description("Download all translations from your locize project.").action(async e=>{const t=await a.ensureConfig();await f.runLocizeDownload(t,e)}),m.command("locize-migrate").description("Migrate local translation files to a new locize project.").action(async e=>{const t=await a.ensureConfig();await f.runLocizeMigrate(t,e)}),m.parse(process.argv);const y=e=>Array.isArray(e)?e:e?[e]:[],h=e=>e&&"string"==typeof e?[e.replace(/\{\{[^}]+\}\}/g,"*")]:[],w=async(e=[])=>{const t=y(e),o=await Promise.all(t.map(e=>n.glob(e||"",{nodir:!0})));return Array.from(new Set(o.flat()))};
2
+ "use strict";var e=require("commander"),t=require("chokidar"),o=require("glob"),n=require("minimatch"),i=require("chalk"),a=require("./config.js"),r=require("./heuristic-config.js"),c=require("./extractor/core/extractor.js");require("node:path"),require("node:fs/promises"),require("jiti");var s=require("./types-generator.js"),l=require("./syncer.js"),u=require("./migrator.js"),g=require("./init.js"),d=require("./linter.js"),p=require("./status.js"),f=require("./locize.js");const m=new e.Command;m.name("i18next-cli").description("A unified, high-performance i18next CLI.").version("1.15.0"),m.option("-c, --config <path>","Path to i18next-cli config file (overrides detection)"),m.command("extract").description("Extract translation keys from source files and update resource files.").option("-w, --watch","Watch for file changes and re-run the extractor.").option("--ci","Exit with a non-zero status code if any files are updated.").option("--dry-run","Run the extractor without writing any files to disk.").option("--sync-primary","Sync primary language values with default values from code.").action(async e=>{try{const o=m.opts().config,i=await a.ensureConfig(o),r=async()=>{const t=await c.runExtractor(i,{isWatchMode:!!e.watch,isDryRun:!!e.dryRun,syncPrimaryWithDefaults:!!e.syncPrimary});return e.ci&&!t?(console.log("✅ No files were updated."),process.exit(0)):e.ci&&t&&(console.error("❌ Some files were updated. This should not happen in CI mode."),process.exit(1)),t};if(await r(),e.watch){console.log("\nWatching for changes...");const e=await w(i.extract.input),o=y(i.extract.ignore),a=h(i.extract.output),c=[...o,...a].filter(Boolean),s=e.filter(e=>!c.some(t=>n.minimatch(e,t,{dot:!0})));t.watch(s,{ignored:/node_modules/,persistent:!0}).on("change",e=>{console.log(`\nFile changed: ${e}`),r()})}}catch(e){console.error("Error running extractor:",e),process.exit(1)}}),m.command("status [locale]").description("Display translation status. Provide a locale for a detailed key-by-key view.").option("-n, --namespace <ns>","Filter the status report by a specific namespace").action(async(e,t)=>{const o=m.opts().config;let n=await a.loadConfig(o);if(!n){console.log(i.blue("No config file found. Attempting to detect project structure..."));const e=await r.detectConfig();e||(console.error(i.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${i.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(i.green("Project structure detected successfully!")),n=e}await p.runStatus(n,{detail:e,namespace:t.namespace})}),m.command("types").description("Generate TypeScript definitions from translation resource files.").option("-w, --watch","Watch for file changes and re-run the type generator.").action(async e=>{const o=m.opts().config,i=await a.ensureConfig(o),r=()=>s.runTypesGenerator(i);if(await r(),e.watch){console.log("\nWatching for changes...");const e=await w(i.types?.input||[]),o=[...y(i.extract?.ignore)].filter(Boolean),a=e.filter(e=>!o.some(t=>n.minimatch(e,t,{dot:!0})));t.watch(a,{persistent:!0}).on("change",e=>{console.log(`\nFile changed: ${e}`),r()})}}),m.command("sync").description("Synchronize secondary language files with the primary language file.").action(async()=>{const e=m.opts().config,t=await a.ensureConfig(e);await l.runSyncer(t)}),m.command("migrate-config [configPath]").description("Migrate a legacy i18next-parser.config.js to the new format.").action(async e=>{await u.runMigrator(e)}),m.command("init").description("Create a new i18next.config.ts/js file with an interactive setup wizard.").action(g.runInit),m.command("lint").description("Find potential issues like hardcoded strings in your codebase.").option("-w, --watch","Watch for file changes and re-run the linter.").action(async e=>{const o=m.opts().config,c=async()=>{let e=await a.loadConfig(o);if(!e){console.log(i.blue("No config file found. Attempting to detect project structure..."));const t=await r.detectConfig();t||(console.error(i.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${i.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(i.green("Project structure detected successfully!")),e=t}await d.runLinter(e)};if(await c(),e.watch){console.log("\nWatching for changes...");const e=await a.loadConfig(o);if(e?.extract?.input){const o=await w(e.extract.input),i=[...y(e.extract.ignore),...h(e.extract.output)].filter(Boolean),a=o.filter(e=>!i.some(t=>n.minimatch(e,t,{dot:!0})));t.watch(a,{ignored:/node_modules/,persistent:!0}).on("change",e=>{console.log(`\nFile changed: ${e}`),c()})}}}),m.command("locize-sync").description("Synchronize local translations with your locize project.").option("--update-values","Update values of existing translations on locize.").option("--src-lng-only","Check for changes in source language only.").option("--compare-mtime","Compare modification times when syncing.").option("--dry-run","Run the command without making any changes.").action(async e=>{const t=m.opts().config,o=await a.ensureConfig(t);await f.runLocizeSync(o,e)}),m.command("locize-download").description("Download all translations from your locize project.").action(async e=>{const t=m.opts().config,o=await a.ensureConfig(t);await f.runLocizeDownload(o,e)}),m.command("locize-migrate").description("Migrate local translation files to a new locize project.").action(async e=>{const t=m.opts().config,o=await a.ensureConfig(t);await f.runLocizeMigrate(o,e)}),m.parse(process.argv);const y=e=>Array.isArray(e)?e:e?[e]:[],h=e=>e&&"string"==typeof e?[e.replace(/\{\{[^}]+\}\}/g,"*")]:[],w=async(e=[])=>{const t=y(e),n=await Promise.all(t.map(e=>o.glob(e||"",{nodir:!0})));return Array.from(new Set(n.flat()))};
@@ -1 +1 @@
1
- "use strict";var e=require("node:path"),r=require("node:url"),t=require("node:fs/promises"),n=require("jiti"),o=require("jsonc-parser"),i=require("inquirer"),a=require("chalk"),s=require("./init.js"),c=require("./utils/logger.js");const u=["i18next.config.ts","i18next.config.js","i18next.config.mjs","i18next.config.cjs"];async function l(o=new c.ConsoleLogger){const i=await async function(){for(const r of u){const n=e.resolve(process.cwd(),r);try{return await t.access(n),n}catch{}}return null}();if(!i)return null;try{let e;if(i.endsWith(".ts")){const r=await f(),t=n.createJiti(process.cwd(),{alias:r,interopDefault:!1}),o=await t.import(i,{default:!0});e=o}else{const t=r.pathToFileURL(i).href,n=await import(`${t}?t=${Date.now()}`);e=n.default}return e?(e.extract||={},e.extract.primaryLanguage||=e.locales[0]||"en",e.extract.secondaryLanguages||=e.locales.filter(r=>r!==e.extract.primaryLanguage),e):(o.error(`Error: No default export found in ${i}`),null)}catch(e){return o.error(`Error loading configuration from ${i}`),o.error(e),null}}async function f(){try{const r=await async function(){let r=process.cwd();for(;;){const n=e.join(r,"tsconfig.json");try{return await t.access(n),n}catch{const t=e.dirname(r);if(t===r)return null;r=t}}}();if(!r)return{};const n=await t.readFile(r,"utf-8"),i=o.parse(n),a=i.compilerOptions?.paths,s=i.compilerOptions?.baseUrl||".";if(!a)return{};const c={};for(const[r,t]of Object.entries(a))if(Array.isArray(t)&&t.length>0){const n=r.replace("/*",""),o=e.resolve(process.cwd(),s,t[0].replace("/*",""));c[n]=o}return c}catch(e){return{}}}exports.defineConfig=function(e){return e},exports.ensureConfig=async function(e=new c.ConsoleLogger){let r=await l();if(r)return r;const{shouldInit:t}=await i.prompt([{type:"confirm",name:"shouldInit",message:a.yellow("Configuration file not found. Would you like to create one now?"),default:!0}]);if(t){if(await s.runInit(),e.info(a.green("Configuration created. Resuming command...")),r=await l(),r)return r;e.error(a.red("Error: Failed to load configuration after creation. Please try running the command again.")),process.exit(1)}else e.info("Operation cancelled. Please create a configuration file to proceed."),process.exit(0)},exports.getTsConfigAliases=f,exports.loadConfig=l;
1
+ "use strict";var e=require("node:path"),r=require("node:url"),t=require("node:fs/promises"),n=require("jiti"),o=require("jsonc-parser"),i=require("inquirer"),a=require("chalk"),s=require("./init.js"),c=require("./utils/logger.js");const u=["i18next.config.ts","i18next.config.js","i18next.config.mjs","i18next.config.cjs"];async function l(o,i=new c.ConsoleLogger){const a=await async function(r){if(r){const n=e.resolve(process.cwd(),r);try{return await t.access(n),n}catch{return null}}for(const r of u){const n=e.resolve(process.cwd(),r);try{return await t.access(n),n}catch{}}return null}(o);if(!a)return o&&i.error(`Error: Config file not found at "${o}"`),null;try{let e;if(a.endsWith(".ts")){const r=await f(),t=n.createJiti(process.cwd(),{alias:r,interopDefault:!1}),o=await t.import(a,{default:!0});e=o}else{const t=r.pathToFileURL(a).href,n=await import(`${t}?t=${Date.now()}`);e=n.default}return e?(e.extract||={},e.extract.primaryLanguage||=e.locales[0]||"en",e.extract.secondaryLanguages||=e.locales.filter(r=>r!==e.extract.primaryLanguage),e):(i.error(`Error: No default export found in ${a}`),null)}catch(e){return i.error(`Error loading configuration from ${a}`),i.error(e),null}}async function f(){try{const r=await async function(){let r=process.cwd();for(;;){const n=e.join(r,"tsconfig.json");try{return await t.access(n),n}catch{const t=e.dirname(r);if(t===r)return null;r=t}}}();if(!r)return{};const n=await t.readFile(r,"utf-8"),i=o.parse(n),a=i.compilerOptions?.paths,s=i.compilerOptions?.baseUrl||".";if(!a)return{};const c={};for(const[r,t]of Object.entries(a))if(Array.isArray(t)&&t.length>0){const n=r.replace("/*",""),o=e.resolve(process.cwd(),s,t[0].replace("/*",""));c[n]=o}return c}catch(e){return{}}}exports.defineConfig=function(e){return e},exports.ensureConfig=async function(e,r=new c.ConsoleLogger){let t=await l(e,r);if(t)return t;const{shouldInit:n}=await i.prompt([{type:"confirm",name:"shouldInit",message:a.yellow("Configuration file not found. Would you like to create one now?"),default:!0}]);if(n){if(await s.runInit(),r.info(a.green("Configuration created. Resuming command...")),t=await l(e,r),t)return t;r.error(a.red("Error: Failed to load configuration after creation. Please try running the command again.")),process.exit(1)}else r.info("Operation cancelled. Please create a configuration file to proceed."),process.exit(0)},exports.getTsConfigAliases=f,exports.loadConfig=l;
package/dist/esm/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{Command as t}from"commander";import e from"chokidar";import{glob as o}from"glob";import{minimatch as n}from"minimatch";import i from"chalk";import{ensureConfig as a,loadConfig as r}from"./config.js";import{detectConfig as c}from"./heuristic-config.js";import{runExtractor as s}from"./extractor/core/extractor.js";import"node:path";import"node:fs/promises";import"jiti";import{runTypesGenerator as l}from"./types-generator.js";import{runSyncer as p}from"./syncer.js";import{runMigrator as m}from"./migrator.js";import{runInit as d}from"./init.js";import{runLinter as f}from"./linter.js";import{runStatus as u}from"./status.js";import{runLocizeSync as g,runLocizeDownload as y,runLocizeMigrate as h}from"./locize.js";const w=new t;w.name("i18next-cli").description("A unified, high-performance i18next CLI.").version("1.14.0"),w.command("extract").description("Extract translation keys from source files and update resource files.").option("-w, --watch","Watch for file changes and re-run the extractor.").option("--ci","Exit with a non-zero status code if any files are updated.").option("--dry-run","Run the extractor without writing any files to disk.").option("--sync-primary","Sync primary language values with default values from code.").action(async t=>{try{const o=await a(),i=async()=>{const e=await s(o,{isWatchMode:!!t.watch,isDryRun:!!t.dryRun,syncPrimaryWithDefaults:!!t.syncPrimary});return t.ci&&!e?(console.log("✅ No files were updated."),process.exit(0)):t.ci&&e&&(console.error("❌ Some files were updated. This should not happen in CI mode."),process.exit(1)),e};if(await i(),t.watch){console.log("\nWatching for changes...");const t=await z(o.extract.input),a=x(o.extract.ignore),r=j(o.extract.output),c=[...a,...r].filter(Boolean),s=t.filter(t=>!c.some(e=>n(t,e,{dot:!0})));e.watch(s,{ignored:/node_modules/,persistent:!0}).on("change",t=>{console.log(`\nFile changed: ${t}`),i()})}}catch(t){console.error("Error running extractor:",t),process.exit(1)}}),w.command("status [locale]").description("Display translation status. Provide a locale for a detailed key-by-key view.").option("-n, --namespace <ns>","Filter the status report by a specific namespace").action(async(t,e)=>{let o=await r();if(!o){console.log(i.blue("No config file found. Attempting to detect project structure..."));const t=await c();t||(console.error(i.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${i.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(i.green("Project structure detected successfully!")),o=t}await u(o,{detail:t,namespace:e.namespace})}),w.command("types").description("Generate TypeScript definitions from translation resource files.").option("-w, --watch","Watch for file changes and re-run the type generator.").action(async t=>{const o=await a(),i=()=>l(o);if(await i(),t.watch){console.log("\nWatching for changes...");const t=await z(o.types?.input||[]),a=[...x(o.extract?.ignore)].filter(Boolean),r=t.filter(t=>!a.some(e=>n(t,e,{dot:!0})));e.watch(r,{persistent:!0}).on("change",t=>{console.log(`\nFile changed: ${t}`),i()})}}),w.command("sync").description("Synchronize secondary language files with the primary language file.").action(async()=>{const t=await a();await p(t)}),w.command("migrate-config [configPath]").description("Migrate a legacy i18next-parser.config.js to the new format.").action(async t=>{await m(t)}),w.command("init").description("Create a new i18next.config.ts/js file with an interactive setup wizard.").action(d),w.command("lint").description("Find potential issues like hardcoded strings in your codebase.").option("-w, --watch","Watch for file changes and re-run the linter.").action(async t=>{const o=async()=>{let t=await r();if(!t){console.log(i.blue("No config file found. Attempting to detect project structure..."));const e=await c();e||(console.error(i.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${i.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(i.green("Project structure detected successfully!")),t=e}await f(t)};if(await o(),t.watch){console.log("\nWatching for changes...");const t=await r();if(t?.extract?.input){const i=await z(t.extract.input),a=[...x(t.extract.ignore),...j(t.extract.output)].filter(Boolean),r=i.filter(t=>!a.some(e=>n(t,e,{dot:!0})));e.watch(r,{ignored:/node_modules/,persistent:!0}).on("change",t=>{console.log(`\nFile changed: ${t}`),o()})}}}),w.command("locize-sync").description("Synchronize local translations with your locize project.").option("--update-values","Update values of existing translations on locize.").option("--src-lng-only","Check for changes in source language only.").option("--compare-mtime","Compare modification times when syncing.").option("--dry-run","Run the command without making any changes.").action(async t=>{const e=await a();await g(e,t)}),w.command("locize-download").description("Download all translations from your locize project.").action(async t=>{const e=await a();await y(e,t)}),w.command("locize-migrate").description("Migrate local translation files to a new locize project.").action(async t=>{const e=await a();await h(e,t)}),w.parse(process.argv);const x=t=>Array.isArray(t)?t:t?[t]:[],j=t=>t&&"string"==typeof t?[t.replace(/\{\{[^}]+\}\}/g,"*")]:[],z=async(t=[])=>{const e=x(t),n=await Promise.all(e.map(t=>o(t||"",{nodir:!0})));return Array.from(new Set(n.flat()))};
2
+ import{Command as t}from"commander";import o from"chokidar";import{glob as e}from"glob";import{minimatch as i}from"minimatch";import n from"chalk";import{ensureConfig as a,loadConfig as r}from"./config.js";import{detectConfig as c}from"./heuristic-config.js";import{runExtractor as s}from"./extractor/core/extractor.js";import"node:path";import"node:fs/promises";import"jiti";import{runTypesGenerator as l}from"./types-generator.js";import{runSyncer as p}from"./syncer.js";import{runMigrator as m}from"./migrator.js";import{runInit as f}from"./init.js";import{runLinter as d}from"./linter.js";import{runStatus as g}from"./status.js";import{runLocizeSync as u,runLocizeDownload as y,runLocizeMigrate as h}from"./locize.js";const w=new t;w.name("i18next-cli").description("A unified, high-performance i18next CLI.").version("1.15.0"),w.option("-c, --config <path>","Path to i18next-cli config file (overrides detection)"),w.command("extract").description("Extract translation keys from source files and update resource files.").option("-w, --watch","Watch for file changes and re-run the extractor.").option("--ci","Exit with a non-zero status code if any files are updated.").option("--dry-run","Run the extractor without writing any files to disk.").option("--sync-primary","Sync primary language values with default values from code.").action(async t=>{try{const e=w.opts().config,n=await a(e),r=async()=>{const o=await s(n,{isWatchMode:!!t.watch,isDryRun:!!t.dryRun,syncPrimaryWithDefaults:!!t.syncPrimary});return t.ci&&!o?(console.log("✅ No files were updated."),process.exit(0)):t.ci&&o&&(console.error("❌ Some files were updated. This should not happen in CI mode."),process.exit(1)),o};if(await r(),t.watch){console.log("\nWatching for changes...");const t=await z(n.extract.input),e=x(n.extract.ignore),a=j(n.extract.output),c=[...e,...a].filter(Boolean),s=t.filter(t=>!c.some(o=>i(t,o,{dot:!0})));o.watch(s,{ignored:/node_modules/,persistent:!0}).on("change",t=>{console.log(`\nFile changed: ${t}`),r()})}}catch(t){console.error("Error running extractor:",t),process.exit(1)}}),w.command("status [locale]").description("Display translation status. Provide a locale for a detailed key-by-key view.").option("-n, --namespace <ns>","Filter the status report by a specific namespace").action(async(t,o)=>{const e=w.opts().config;let i=await r(e);if(!i){console.log(n.blue("No config file found. Attempting to detect project structure..."));const t=await c();t||(console.error(n.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${n.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(n.green("Project structure detected successfully!")),i=t}await g(i,{detail:t,namespace:o.namespace})}),w.command("types").description("Generate TypeScript definitions from translation resource files.").option("-w, --watch","Watch for file changes and re-run the type generator.").action(async t=>{const e=w.opts().config,n=await a(e),r=()=>l(n);if(await r(),t.watch){console.log("\nWatching for changes...");const t=await z(n.types?.input||[]),e=[...x(n.extract?.ignore)].filter(Boolean),a=t.filter(t=>!e.some(o=>i(t,o,{dot:!0})));o.watch(a,{persistent:!0}).on("change",t=>{console.log(`\nFile changed: ${t}`),r()})}}),w.command("sync").description("Synchronize secondary language files with the primary language file.").action(async()=>{const t=w.opts().config,o=await a(t);await p(o)}),w.command("migrate-config [configPath]").description("Migrate a legacy i18next-parser.config.js to the new format.").action(async t=>{await m(t)}),w.command("init").description("Create a new i18next.config.ts/js file with an interactive setup wizard.").action(f),w.command("lint").description("Find potential issues like hardcoded strings in your codebase.").option("-w, --watch","Watch for file changes and re-run the linter.").action(async t=>{const e=w.opts().config,a=async()=>{let t=await r(e);if(!t){console.log(n.blue("No config file found. Attempting to detect project structure..."));const o=await c();o||(console.error(n.red("Could not automatically detect your project structure.")),console.log(`Please create a config file first by running: ${n.cyan("npx i18next-cli init")}`),process.exit(1)),console.log(n.green("Project structure detected successfully!")),t=o}await d(t)};if(await a(),t.watch){console.log("\nWatching for changes...");const t=await r(e);if(t?.extract?.input){const e=await z(t.extract.input),n=[...x(t.extract.ignore),...j(t.extract.output)].filter(Boolean),r=e.filter(t=>!n.some(o=>i(t,o,{dot:!0})));o.watch(r,{ignored:/node_modules/,persistent:!0}).on("change",t=>{console.log(`\nFile changed: ${t}`),a()})}}}),w.command("locize-sync").description("Synchronize local translations with your locize project.").option("--update-values","Update values of existing translations on locize.").option("--src-lng-only","Check for changes in source language only.").option("--compare-mtime","Compare modification times when syncing.").option("--dry-run","Run the command without making any changes.").action(async t=>{const o=w.opts().config,e=await a(o);await u(e,t)}),w.command("locize-download").description("Download all translations from your locize project.").action(async t=>{const o=w.opts().config,e=await a(o);await y(e,t)}),w.command("locize-migrate").description("Migrate local translation files to a new locize project.").action(async t=>{const o=w.opts().config,e=await a(o);await h(e,t)}),w.parse(process.argv);const x=t=>Array.isArray(t)?t:t?[t]:[],j=t=>t&&"string"==typeof t?[t.replace(/\{\{[^}]+\}\}/g,"*")]:[],z=async(t=[])=>{const o=x(t),i=await Promise.all(o.map(t=>e(t||"",{nodir:!0})));return Array.from(new Set(i.flat()))};
@@ -1 +1 @@
1
- import{resolve as r,join as t,dirname as o}from"node:path";import{pathToFileURL as n}from"node:url";import{access as e,readFile as i}from"node:fs/promises";import{createJiti as a}from"jiti";import{parse as c}from"jsonc-parser";import s from"inquirer";import f from"chalk";import{runInit as l}from"./init.js";import{ConsoleLogger as u}from"./utils/logger.js";const p=["i18next.config.ts","i18next.config.js","i18next.config.mjs","i18next.config.cjs"];function m(r){return r}async function d(t=new u){const o=await async function(){for(const t of p){const o=r(process.cwd(),t);try{return await e(o),o}catch{}}return null}();if(!o)return null;try{let r;if(o.endsWith(".ts")){const t=await w(),n=a(process.cwd(),{alias:t,interopDefault:!1}),e=await n.import(o,{default:!0});r=e}else{const t=n(o).href,e=await import(`${t}?t=${Date.now()}`);r=e.default}return r?(r.extract||={},r.extract.primaryLanguage||=r.locales[0]||"en",r.extract.secondaryLanguages||=r.locales.filter(t=>t!==r.extract.primaryLanguage),r):(t.error(`Error: No default export found in ${o}`),null)}catch(r){return t.error(`Error loading configuration from ${o}`),t.error(r),null}}async function g(r=new u){let t=await d();if(t)return t;const{shouldInit:o}=await s.prompt([{type:"confirm",name:"shouldInit",message:f.yellow("Configuration file not found. Would you like to create one now?"),default:!0}]);if(o){if(await l(),r.info(f.green("Configuration created. Resuming command...")),t=await d(),t)return t;r.error(f.red("Error: Failed to load configuration after creation. Please try running the command again.")),process.exit(1)}else r.info("Operation cancelled. Please create a configuration file to proceed."),process.exit(0)}async function w(){try{const n=await async function(){let r=process.cwd();for(;;){const n=t(r,"tsconfig.json");try{return await e(n),n}catch{const t=o(r);if(t===r)return null;r=t}}}();if(!n)return{};const a=await i(n,"utf-8"),s=c(a),f=s.compilerOptions?.paths,l=s.compilerOptions?.baseUrl||".";if(!f)return{};const u={};for(const[t,o]of Object.entries(f))if(Array.isArray(o)&&o.length>0){const n=t.replace("/*",""),e=r(process.cwd(),l,o[0].replace("/*",""));u[n]=e}return u}catch(r){return{}}}export{m as defineConfig,g as ensureConfig,w as getTsConfigAliases,d as loadConfig};
1
+ import{resolve as r,join as t,dirname as o}from"node:path";import{pathToFileURL as n}from"node:url";import{access as e,readFile as i}from"node:fs/promises";import{createJiti as a}from"jiti";import{parse as c}from"jsonc-parser";import s from"inquirer";import f from"chalk";import{runInit as l}from"./init.js";import{ConsoleLogger as u}from"./utils/logger.js";const p=["i18next.config.ts","i18next.config.js","i18next.config.mjs","i18next.config.cjs"];function m(r){return r}async function d(t,o=new u){const i=await async function(t){if(t){const o=r(process.cwd(),t);try{return await e(o),o}catch{return null}}for(const t of p){const o=r(process.cwd(),t);try{return await e(o),o}catch{}}return null}(t);if(!i)return t&&o.error(`Error: Config file not found at "${t}"`),null;try{let r;if(i.endsWith(".ts")){const t=await w(),o=a(process.cwd(),{alias:t,interopDefault:!1}),n=await o.import(i,{default:!0});r=n}else{const t=n(i).href,o=await import(`${t}?t=${Date.now()}`);r=o.default}return r?(r.extract||={},r.extract.primaryLanguage||=r.locales[0]||"en",r.extract.secondaryLanguages||=r.locales.filter(t=>t!==r.extract.primaryLanguage),r):(o.error(`Error: No default export found in ${i}`),null)}catch(r){return o.error(`Error loading configuration from ${i}`),o.error(r),null}}async function g(r,t=new u){let o=await d(r,t);if(o)return o;const{shouldInit:n}=await s.prompt([{type:"confirm",name:"shouldInit",message:f.yellow("Configuration file not found. Would you like to create one now?"),default:!0}]);if(n){if(await l(),t.info(f.green("Configuration created. Resuming command...")),o=await d(r,t),o)return o;t.error(f.red("Error: Failed to load configuration after creation. Please try running the command again.")),process.exit(1)}else t.info("Operation cancelled. Please create a configuration file to proceed."),process.exit(0)}async function w(){try{const n=await async function(){let r=process.cwd();for(;;){const n=t(r,"tsconfig.json");try{return await e(n),n}catch{const t=o(r);if(t===r)return null;r=t}}}();if(!n)return{};const a=await i(n,"utf-8"),s=c(a),f=s.compilerOptions?.paths,l=s.compilerOptions?.baseUrl||".";if(!f)return{};const u={};for(const[t,o]of Object.entries(f))if(Array.isArray(o)&&o.length>0){const n=t.replace("/*",""),e=r(process.cwd(),l,o[0].replace("/*",""));u[n]=e}return u}catch(r){return{}}}export{m as defineConfig,g as ensureConfig,w as getTsConfigAliases,d as loadConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18next-cli",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "A unified, high-performance i18next CLI.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -22,7 +22,10 @@ const program = new Command()
22
22
  program
23
23
  .name('i18next-cli')
24
24
  .description('A unified, high-performance i18next CLI.')
25
- .version('1.14.0')
25
+ .version('1.15.0')
26
+
27
+ // new: global config override option
28
+ program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)')
26
29
 
27
30
  program
28
31
  .command('extract')
@@ -33,7 +36,8 @@ program
33
36
  .option('--sync-primary', 'Sync primary language values with default values from code.')
34
37
  .action(async (options) => {
35
38
  try {
36
- const config = await ensureConfig()
39
+ const cfgPath = program.opts().config
40
+ const config = await ensureConfig(cfgPath)
37
41
 
38
42
  const runExtract = async () => {
39
43
  const success = await runExtractor(config, {
@@ -88,7 +92,8 @@ program
88
92
  .description('Display translation status. Provide a locale for a detailed key-by-key view.')
89
93
  .option('-n, --namespace <ns>', 'Filter the status report by a specific namespace')
90
94
  .action(async (locale, options) => {
91
- let config = await loadConfig()
95
+ const cfgPath = program.opts().config
96
+ let config = await loadConfig(cfgPath)
92
97
  if (!config) {
93
98
  console.log(chalk.blue('No config file found. Attempting to detect project structure...'))
94
99
  const detected = await detectConfig()
@@ -108,7 +113,8 @@ program
108
113
  .description('Generate TypeScript definitions from translation resource files.')
109
114
  .option('-w, --watch', 'Watch for file changes and re-run the type generator.')
110
115
  .action(async (options) => {
111
- const config = await ensureConfig()
116
+ const cfgPath = program.opts().config
117
+ const config = await ensureConfig(cfgPath)
112
118
 
113
119
  const run = () => runTypesGenerator(config)
114
120
  await run()
@@ -130,7 +136,8 @@ program
130
136
  .command('sync')
131
137
  .description('Synchronize secondary language files with the primary language file.')
132
138
  .action(async () => {
133
- const config = await ensureConfig()
139
+ const cfgPath = program.opts().config
140
+ const config = await ensureConfig(cfgPath)
134
141
  await runSyncer(config)
135
142
  })
136
143
 
@@ -151,9 +158,11 @@ program
151
158
  .description('Find potential issues like hardcoded strings in your codebase.')
152
159
  .option('-w, --watch', 'Watch for file changes and re-run the linter.')
153
160
  .action(async (options) => {
161
+ const cfgPath = program.opts().config
162
+
154
163
  const loadAndRunLinter = async () => {
155
164
  // The existing logic for loading the config or detecting it is now inside this function
156
- let config = await loadConfig()
165
+ let config = await loadConfig(cfgPath)
157
166
  if (!config) {
158
167
  console.log(chalk.blue('No config file found. Attempting to detect project structure...'))
159
168
  const detected = await detectConfig()
@@ -175,7 +184,7 @@ program
175
184
  if (options.watch) {
176
185
  console.log('\nWatching for changes...')
177
186
  // Re-load the config to get the correct input paths for the watcher
178
- const config = await loadConfig()
187
+ const config = await loadConfig(cfgPath)
179
188
  if (config?.extract?.input) {
180
189
  const expandedLint = await expandGlobs(config.extract.input)
181
190
  const configuredIgnore2 = toArray(config.extract.ignore)
@@ -203,7 +212,8 @@ program
203
212
  .option('--compare-mtime', 'Compare modification times when syncing.')
204
213
  .option('--dry-run', 'Run the command without making any changes.')
205
214
  .action(async (options) => {
206
- const config = await ensureConfig()
215
+ const cfgPath = program.opts().config
216
+ const config = await ensureConfig(cfgPath)
207
217
  await runLocizeSync(config, options)
208
218
  })
209
219
 
@@ -211,7 +221,8 @@ program
211
221
  .command('locize-download')
212
222
  .description('Download all translations from your locize project.')
213
223
  .action(async (options) => {
214
- const config = await ensureConfig()
224
+ const cfgPath = program.opts().config
225
+ const config = await ensureConfig(cfgPath)
215
226
  await runLocizeDownload(config, options)
216
227
  })
217
228
 
@@ -219,7 +230,8 @@ program
219
230
  .command('locize-migrate')
220
231
  .description('Migrate local translation files to a new locize project.')
221
232
  .action(async (options) => {
222
- const config = await ensureConfig()
233
+ const cfgPath = program.opts().config
234
+ const config = await ensureConfig(cfgPath)
223
235
  await runLocizeMigrate(config, options)
224
236
  })
225
237
 
package/src/config.ts CHANGED
@@ -46,7 +46,18 @@ export function defineConfig (config: I18nextToolkitConfig): I18nextToolkitConfi
46
46
  *
47
47
  * @returns Promise that resolves to the full path of the found config file, or null if none found
48
48
  */
49
- async function findConfigFile (): Promise<string | null> {
49
+ async function findConfigFile (configPath?: string): Promise<string | null> {
50
+ if (configPath) {
51
+ // Allow relative or absolute path provided by the user
52
+ const resolved = resolve(process.cwd(), configPath)
53
+ try {
54
+ await access(resolved)
55
+ return resolved
56
+ } catch {
57
+ return null
58
+ }
59
+ }
60
+
50
61
  for (const file of CONFIG_FILES) {
51
62
  const fullPath = resolve(process.cwd(), file)
52
63
  try {
@@ -60,30 +71,18 @@ async function findConfigFile (): Promise<string | null> {
60
71
  }
61
72
 
62
73
  /**
63
- * Loads and validates the i18next toolkit configuration from the project root.
64
- *
65
- * This function:
66
- * 1. Searches for a config file using findConfigFile()
67
- * 2. Dynamically imports the config file using ESM import()
68
- * 3. Validates the configuration structure
69
- * 4. Sets default values for sync options
70
- * 5. Adds cache busting for watch mode
74
+ * Loads and validates the i18next toolkit configuration from the project root or a provided path.
71
75
  *
72
- * @returns Promise that resolves to the loaded configuration object, or null if loading failed
73
- *
74
- * @example
75
- * ```typescript
76
- * const config = await loadConfig()
77
- * if (!config) {
78
- * console.error('Failed to load configuration')
79
- * process.exit(1)
80
- * }
81
- * ```
76
+ * @param configPath - Optional explicit path to a config file (relative to cwd or absolute)
77
+ * @param logger - Optional logger instance
82
78
  */
83
- export async function loadConfig (logger: Logger = new ConsoleLogger()): Promise<I18nextToolkitConfig | null> {
84
- const configPath = await findConfigFile()
79
+ export async function loadConfig (configPath?: string, logger: Logger = new ConsoleLogger()): Promise<I18nextToolkitConfig | null> {
80
+ const configPathFound = await findConfigFile(configPath)
85
81
 
86
- if (!configPath) {
82
+ if (!configPathFound) {
83
+ if (configPath) {
84
+ logger.error(`Error: Config file not found at "${configPath}"`)
85
+ }
87
86
  // QUIETLY RETURN NULL: The caller will handle the "not found" case.
88
87
  return null
89
88
  }
@@ -92,23 +91,23 @@ export async function loadConfig (logger: Logger = new ConsoleLogger()): Promise
92
91
  let config: any
93
92
 
94
93
  // Use jiti for TypeScript files, native import for JavaScript
95
- if (configPath.endsWith('.ts')) {
94
+ if (configPathFound.endsWith('.ts')) {
96
95
  const aliases = await getTsConfigAliases()
97
96
  const jiti = createJiti(process.cwd(), {
98
97
  alias: aliases,
99
98
  interopDefault: false,
100
99
  })
101
100
 
102
- const configModule = await jiti.import(configPath, { default: true })
101
+ const configModule = await jiti.import(configPathFound, { default: true })
103
102
  config = configModule
104
103
  } else {
105
- const configUrl = pathToFileURL(configPath).href
104
+ const configUrl = pathToFileURL(configPathFound).href
106
105
  const configModule = await import(`${configUrl}?t=${Date.now()}`)
107
106
  config = configModule.default
108
107
  }
109
108
 
110
109
  if (!config) {
111
- logger.error(`Error: No default export found in ${configPath}`)
110
+ logger.error(`Error: No default export found in ${configPathFound}`)
112
111
  return null
113
112
  }
114
113
 
@@ -119,7 +118,7 @@ export async function loadConfig (logger: Logger = new ConsoleLogger()): Promise
119
118
 
120
119
  return config
121
120
  } catch (error) {
122
- logger.error(`Error loading configuration from ${configPath}`)
121
+ logger.error(`Error loading configuration from ${configPathFound}`)
123
122
  logger.error(error)
124
123
  return null
125
124
  }
@@ -127,13 +126,10 @@ export async function loadConfig (logger: Logger = new ConsoleLogger()): Promise
127
126
 
128
127
  /**
129
128
  * Ensures a configuration exists, prompting the user to create one if necessary.
130
- * This function is a wrapper around loadConfig that provides an interactive fallback.
131
- *
132
- * @returns A promise that resolves to a valid configuration object.
133
- * @throws Exits the process if the user declines to create a config or if loading fails after creation.
129
+ * Accepts an optional configPath which will be used when loading the config.
134
130
  */
135
- export async function ensureConfig (logger: Logger = new ConsoleLogger()): Promise<I18nextToolkitConfig> {
136
- let config = await loadConfig()
131
+ export async function ensureConfig (configPath?: string, logger: Logger = new ConsoleLogger()): Promise<I18nextToolkitConfig> {
132
+ let config = await loadConfig(configPath, logger)
137
133
 
138
134
  if (config) {
139
135
  return config
@@ -148,9 +144,9 @@ export async function ensureConfig (logger: Logger = new ConsoleLogger()): Promi
148
144
  }])
149
145
 
150
146
  if (shouldInit) {
151
- await runInit() // Run the interactive setup wizard
147
+ await runInit() // Run the interactive setup wizard (keeps existing behavior)
152
148
  logger.info(chalk.green('Configuration created. Resuming command...'))
153
- config = await loadConfig() // Try loading the newly created config
149
+ config = await loadConfig(configPath, logger) // Try loading the newly created config
154
150
 
155
151
  if (config) {
156
152
  return config
package/types/config.d.ts CHANGED
@@ -18,35 +18,17 @@ import type { I18nextToolkitConfig, Logger } from './types';
18
18
  */
19
19
  export declare function defineConfig(config: I18nextToolkitConfig): I18nextToolkitConfig;
20
20
  /**
21
- * Loads and validates the i18next toolkit configuration from the project root.
21
+ * Loads and validates the i18next toolkit configuration from the project root or a provided path.
22
22
  *
23
- * This function:
24
- * 1. Searches for a config file using findConfigFile()
25
- * 2. Dynamically imports the config file using ESM import()
26
- * 3. Validates the configuration structure
27
- * 4. Sets default values for sync options
28
- * 5. Adds cache busting for watch mode
29
- *
30
- * @returns Promise that resolves to the loaded configuration object, or null if loading failed
31
- *
32
- * @example
33
- * ```typescript
34
- * const config = await loadConfig()
35
- * if (!config) {
36
- * console.error('Failed to load configuration')
37
- * process.exit(1)
38
- * }
39
- * ```
23
+ * @param configPath - Optional explicit path to a config file (relative to cwd or absolute)
24
+ * @param logger - Optional logger instance
40
25
  */
41
- export declare function loadConfig(logger?: Logger): Promise<I18nextToolkitConfig | null>;
26
+ export declare function loadConfig(configPath?: string, logger?: Logger): Promise<I18nextToolkitConfig | null>;
42
27
  /**
43
28
  * Ensures a configuration exists, prompting the user to create one if necessary.
44
- * This function is a wrapper around loadConfig that provides an interactive fallback.
45
- *
46
- * @returns A promise that resolves to a valid configuration object.
47
- * @throws Exits the process if the user declines to create a config or if loading fails after creation.
29
+ * Accepts an optional configPath which will be used when loading the config.
48
30
  */
49
- export declare function ensureConfig(logger?: Logger): Promise<I18nextToolkitConfig>;
31
+ export declare function ensureConfig(configPath?: string, logger?: Logger): Promise<I18nextToolkitConfig>;
50
32
  /**
51
33
  * Parses the project's tsconfig.json to extract path aliases for jiti.
52
34
  * @returns A record of aliases for jiti's configuration.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAc3D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAE,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAEhF;AAqBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,UAAU,CAAE,MAAM,GAAE,MAA4B,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CA2C5G;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAE,MAAM,GAAE,MAA4B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA8BvG;AAyBD;;;GAGG;AACH,wBAAsB,kBAAkB,IAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyB3E"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAc3D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAE,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAEhF;AAgCD;;;;;GAKG;AACH,wBAAsB,UAAU,CAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,MAA4B,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CA8CjI;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,MAA4B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA8B5H;AAyBD;;;GAGG;AACH,wBAAsB,kBAAkB,IAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyB3E"}