lingo.dev 0.90.1 → 0.90.2

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.cjs CHANGED
@@ -4854,7 +4854,7 @@ var mcp_default = new (0, _interactivecommander.Command)().command("mcp").descri
4854
4854
 
4855
4855
 
4856
4856
  // src/cli/cmd/ci/flows/pull-request.ts
4857
- var _child_process = require('child_process');
4857
+ var _child_process = require('child_process'); var cp = _interopRequireWildcard(_child_process);
4858
4858
 
4859
4859
  // src/cli/cmd/ci/flows/in-branch.ts
4860
4860
 
@@ -4966,22 +4966,6 @@ var InBranchFlow = class extends IntegrationFlow {
4966
4966
  }
4967
4967
  return true;
4968
4968
  }
4969
- async returnToOriginalBranch() {
4970
- const originalBranch = this.platformKit.platformConfig.baseBranchName;
4971
- if (originalBranch) {
4972
- this.ora.start(`Returning to original branch: ${originalBranch}`);
4973
- try {
4974
- _child_process.execSync.call(void 0, `git checkout ${originalBranch}`, {
4975
- stdio: "inherit",
4976
- encoding: "utf8"
4977
- });
4978
- this.ora.succeed(`Returned to original branch: ${originalBranch}`);
4979
- } catch (error) {
4980
- const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
4981
- this.ora.fail(`Failed to return to original branch: ${errorMessage}`);
4982
- }
4983
- }
4984
- }
4985
4969
  };
4986
4970
 
4987
4971
  // src/cli/cmd/ci/flows/pull-request.ts
@@ -5566,19 +5550,15 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
5566
5550
  const { isPullRequestMode } = platformKit.config;
5567
5551
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
5568
5552
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
5569
- try {
5570
- const canRun = await _optionalChain([flow, 'access', _181 => _181.preRun, 'optionalCall', _182 => _182()]);
5571
- if (canRun === false) {
5572
- return;
5573
- }
5574
- const hasChanges = await flow.run();
5575
- if (!hasChanges) {
5576
- return;
5577
- }
5578
- await _optionalChain([flow, 'access', _183 => _183.postRun, 'optionalCall', _184 => _184()]);
5579
- } finally {
5580
- await _optionalChain([flow, 'access', _185 => _185.returnToOriginalBranch, 'optionalCall', _186 => _186()]);
5553
+ const canRun = await _optionalChain([flow, 'access', _181 => _181.preRun, 'optionalCall', _182 => _182()]);
5554
+ if (canRun === false) {
5555
+ return;
5581
5556
  }
5557
+ const hasChanges = await flow.run();
5558
+ if (!hasChanges) {
5559
+ return;
5560
+ }
5561
+ await _optionalChain([flow, 'access', _183 => _183.postRun, 'optionalCall', _184 => _184()]);
5582
5562
  });
5583
5563
 
5584
5564
  // src/cli/cmd/status.ts
@@ -5622,13 +5602,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
5622
5602
  flags
5623
5603
  });
5624
5604
  let buckets = getBuckets(i18nConfig);
5625
- if (_optionalChain([flags, 'access', _187 => _187.bucket, 'optionalAccess', _188 => _188.length])) {
5605
+ if (_optionalChain([flags, 'access', _185 => _185.bucket, 'optionalAccess', _186 => _186.length])) {
5626
5606
  buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
5627
5607
  }
5628
5608
  ora.succeed("Buckets retrieved");
5629
- if (_optionalChain([flags, 'access', _189 => _189.file, 'optionalAccess', _190 => _190.length])) {
5609
+ if (_optionalChain([flags, 'access', _187 => _187.file, 'optionalAccess', _188 => _188.length])) {
5630
5610
  buckets = buckets.map((bucket) => {
5631
- const paths = bucket.paths.filter((path17) => flags.file.find((file) => _optionalChain([path17, 'access', _191 => _191.pathPattern, 'optionalAccess', _192 => _192.match, 'call', _193 => _193(file)])));
5611
+ const paths = bucket.paths.filter((path17) => flags.file.find((file) => _optionalChain([path17, 'access', _189 => _189.pathPattern, 'optionalAccess', _190 => _190.match, 'call', _191 => _191(file)])));
5632
5612
  return { ...bucket, paths };
5633
5613
  }).filter((bucket) => bucket.paths.length > 0);
5634
5614
  if (buckets.length === 0) {
@@ -5644,7 +5624,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
5644
5624
  });
5645
5625
  }
5646
5626
  }
5647
- const targetLocales = _optionalChain([flags, 'access', _194 => _194.locale, 'optionalAccess', _195 => _195.length]) ? flags.locale : i18nConfig.locale.targets;
5627
+ const targetLocales = _optionalChain([flags, 'access', _192 => _192.locale, 'optionalAccess', _193 => _193.length]) ? flags.locale : i18nConfig.locale.targets;
5648
5628
  let totalSourceKeyCount = 0;
5649
5629
  let uniqueKeysToTranslate = 0;
5650
5630
  let totalExistingTranslations = 0;
@@ -5985,12 +5965,12 @@ function validateParams2(i18nConfig, flags) {
5985
5965
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
5986
5966
  docUrl: "bucketNotFound"
5987
5967
  });
5988
- } else if (_optionalChain([flags, 'access', _196 => _196.locale, 'optionalAccess', _197 => _197.some, 'call', _198 => _198((locale) => !i18nConfig.locale.targets.includes(locale))])) {
5968
+ } else if (_optionalChain([flags, 'access', _194 => _194.locale, 'optionalAccess', _195 => _195.some, 'call', _196 => _196((locale) => !i18nConfig.locale.targets.includes(locale))])) {
5989
5969
  throw new CLIError({
5990
5970
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
5991
5971
  docUrl: "localeTargetNotFound"
5992
5972
  });
5993
- } else if (_optionalChain([flags, 'access', _199 => _199.bucket, 'optionalAccess', _200 => _200.some, 'call', _201 => _201((bucket) => !i18nConfig.buckets[bucket])])) {
5973
+ } else if (_optionalChain([flags, 'access', _197 => _197.bucket, 'optionalAccess', _198 => _198.some, 'call', _199 => _199((bucket) => !i18nConfig.buckets[bucket])])) {
5994
5974
  throw new CLIError({
5995
5975
  message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
5996
5976
  docUrl: "bucketNotFound"
@@ -5998,10 +5978,82 @@ function validateParams2(i18nConfig, flags) {
5998
5978
  }
5999
5979
  }
6000
5980
 
5981
+ // src/cli/cmd/may-the-fourth.ts
5982
+
5983
+
5984
+
5985
+
5986
+
5987
+ var colors = {
5988
+ orange: "#ff6600",
5989
+ green: "#6ae300",
5990
+ blue: "#0090ff",
5991
+ yellow: "#ffcc00",
5992
+ grey: "#808080",
5993
+ red: "#ff0000"
5994
+ };
5995
+ var may_the_fourth_default = new (0, _interactivecommander.Command)().command("may-the-fourth").description("May the Fourth be with you").helpOption("-h, --help", "Show help").action(async () => {
5996
+ await renderClear();
5997
+ await renderBanner();
5998
+ await renderSpacer();
5999
+ console.log(_chalk2.default.hex(colors.yellow)("Loading the Star Wars movie..."));
6000
+ await renderSpacer();
6001
+ await new Promise((resolve, reject) => {
6002
+ const ssh = cp.spawn("ssh", ["starwarstel.net"], {
6003
+ stdio: "inherit"
6004
+ });
6005
+ ssh.on("close", (code) => {
6006
+ if (code !== 0) {
6007
+ console.error(`SSH process exited with code ${code}`);
6008
+ }
6009
+ resolve();
6010
+ });
6011
+ ssh.on("error", (err) => {
6012
+ console.error("Failed to start SSH process:", err);
6013
+ reject(err);
6014
+ });
6015
+ });
6016
+ await renderSpacer();
6017
+ console.log(
6018
+ `${_chalk2.default.hex(colors.green)("We hope you enjoyed it! :)")} ${_chalk2.default.hex(colors.blue)("May the Fourth be with you! \u{1F680}")}`
6019
+ );
6020
+ await renderSpacer();
6021
+ console.log(_chalk2.default.dim(`---`));
6022
+ await renderSpacer();
6023
+ await renderHero();
6024
+ });
6025
+ async function renderClear() {
6026
+ console.log("\x1Bc");
6027
+ }
6028
+ async function renderSpacer() {
6029
+ console.log(" ");
6030
+ }
6031
+ async function renderBanner() {
6032
+ console.log(
6033
+ _gradientstring.vice.call(void 0,
6034
+ _figlet2.default.textSync("LINGO.DEV", {
6035
+ font: "ANSI Shadow",
6036
+ horizontalLayout: "default",
6037
+ verticalLayout: "default"
6038
+ })
6039
+ )
6040
+ );
6041
+ }
6042
+ async function renderHero() {
6043
+ console.log(
6044
+ `\u26A1\uFE0F ${_chalk2.default.hex(colors.green)("Lingo.dev")} - open-source, AI-powered i18n CLI for web & mobile localization.`
6045
+ );
6046
+ console.log(" ");
6047
+ console.log(
6048
+ _chalk2.default.hex(colors.blue)("\u2B50 GitHub Repo: https://lingo.dev/go/gh")
6049
+ );
6050
+ console.log(_chalk2.default.hex(colors.blue)("\u{1F4AC} 24/7 Support: hi@lingo.dev"));
6051
+ }
6052
+
6001
6053
  // package.json
6002
6054
  var package_default = {
6003
6055
  name: "lingo.dev",
6004
- version: "0.90.1",
6056
+ version: "0.90.2",
6005
6057
  description: "Lingo.dev CLI",
6006
6058
  private: false,
6007
6059
  publishConfig: {
@@ -6170,7 +6222,7 @@ ${_gradientstring.vice.call(void 0,
6170
6222
 
6171
6223
  Star the the repo :) https://github.com/LingoDotDev/lingo.dev
6172
6224
  `
6173
- ).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).addCommand(ci_default).addCommand(status_default).exitOverride((err) => {
6225
+ ).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).addCommand(ci_default).addCommand(status_default).addCommand(may_the_fourth_default, { hidden: true }).exitOverride((err) => {
6174
6226
  if (err.code === "commander.helpDisplayed" || err.code === "commander.version" || err.code === "commander.help") {
6175
6227
  process.exit(0);
6176
6228
  }