lingo.dev 0.79.0 → 0.79.1

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/build/cli.mjs CHANGED
@@ -3305,7 +3305,16 @@ function _tryParseJSON(line) {
3305
3305
  }
3306
3306
 
3307
3307
  // src/cli/cmd/i18n.ts
3308
- var i18n_default = new Command6().command("i18n").description("Run Localization engine").helpOption("-h, --help", "Show help").option("--locale <locale>", "Locale to process", (val, prev) => prev ? [...prev, val] : [val]).option("--bucket <bucket>", "Bucket to process", (val, prev) => prev ? [...prev, val] : [val]).option("--key <key>", "Key to process. Process only a specific translation key, useful for debugging or updating a single entry").option("--frozen", `Run in read-only mode - fails if any translations need updating, useful for CI/CD pipelines to detect missing translations`).option("--force", "Ignore lockfile and process all keys, useful for full re-translation").option("--verbose", "Show detailed output including intermediate processing data and API communication details").option("--interactive", "Enable interactive mode for reviewing and editing translations before they are applied").option("--api-key <api-key>", "Explicitly set the API key to use, override the default API key from settings").option("--debug", "Pause execution at start for debugging purposes, waits for user confirmation before proceeding").option("--strict", "Stop processing on first error instead of continuing with other locales/buckets").action(async function(options) {
3308
+ var i18n_default = new Command6().command("i18n").description("Run Localization engine").helpOption("-h, --help", "Show help").option("--locale <locale>", "Locale to process", (val, prev) => prev ? [...prev, val] : [val]).option("--bucket <bucket>", "Bucket to process", (val, prev) => prev ? [...prev, val] : [val]).option(
3309
+ "--key <key>",
3310
+ "Key to process. Process only a specific translation key, useful for debugging or updating a single entry"
3311
+ ).option(
3312
+ "--file [files...]",
3313
+ "File to process. Process only a specific path, may contain asterisk * to match multiple files. Useful if you have a lot of files and want to focus on a specific one. Specify more files separated by commas or spaces."
3314
+ ).option(
3315
+ "--frozen",
3316
+ `Run in read-only mode - fails if any translations need updating, useful for CI/CD pipelines to detect missing translations`
3317
+ ).option("--force", "Ignore lockfile and process all keys, useful for full re-translation").option("--verbose", "Show detailed output including intermediate processing data and API communication details").option("--interactive", "Enable interactive mode for reviewing and editing translations before they are applied").option("--api-key <api-key>", "Explicitly set the API key to use, override the default API key from settings").option("--debug", "Pause execution at start for debugging purposes, waits for user confirmation before proceeding").option("--strict", "Stop processing on first error instead of continuing with other locales/buckets").action(async function(options) {
3309
3318
  updateGitignore();
3310
3319
  const ora = Ora5();
3311
3320
  const flags = parseFlags(options);
@@ -3335,6 +3344,26 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
3335
3344
  buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
3336
3345
  }
3337
3346
  ora.succeed("Buckets retrieved");
3347
+ if (flags.file?.length) {
3348
+ buckets = buckets.map((bucket) => {
3349
+ const config = bucket.config.filter(
3350
+ (config2) => flags.file.find((file) => config2.pathPattern?.match(file))
3351
+ );
3352
+ return { ...bucket, config };
3353
+ }).filter((bucket) => bucket.config.length > 0);
3354
+ if (buckets.length === 0) {
3355
+ ora.fail("No buckets found. All buckets were filtered out by --file option.");
3356
+ process.exit(1);
3357
+ } else {
3358
+ ora.info(`\x1B[36mProcessing only filtered buckets:\x1B[0m`);
3359
+ buckets.map((bucket) => {
3360
+ ora.info(` ${bucket.type}:`);
3361
+ bucket.config.forEach((config) => {
3362
+ ora.info(` - ${config.pathPattern}`);
3363
+ });
3364
+ });
3365
+ }
3366
+ }
3338
3367
  const targetLocales = flags.locale?.length ? flags.locale : i18nConfig.locale.targets;
3339
3368
  const lockfileHelper = createLockfileHelper();
3340
3369
  ora.start("Ensuring i18n.lock exists...");
@@ -3630,6 +3659,7 @@ function parseFlags(options) {
3630
3659
  verbose: Z4.boolean().optional(),
3631
3660
  strict: Z4.boolean().optional(),
3632
3661
  key: Z4.string().optional(),
3662
+ file: Z4.array(Z4.string()).optional(),
3633
3663
  interactive: Z4.boolean().default(false),
3634
3664
  debug: Z4.boolean().default(false)
3635
3665
  }).parse(options);
@@ -4583,7 +4613,7 @@ var ci_default = new Command10().command("ci").description("Run Lingo.dev CI/CD
4583
4613
  // package.json
4584
4614
  var package_default = {
4585
4615
  name: "lingo.dev",
4586
- version: "0.79.0",
4616
+ version: "0.79.1",
4587
4617
  description: "Lingo.dev CLI",
4588
4618
  private: false,
4589
4619
  publishConfig: {