lingo.dev 0.90.0 → 0.90.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.cjs CHANGED
@@ -3821,7 +3821,6 @@ async function trackEvent(distinctId, event, properties) {
3821
3821
  }
3822
3822
  try {
3823
3823
  const { PostHog } = await Promise.resolve().then(() => _interopRequireWildcard(require("posthog-node")));
3824
- console.log("--- ---");
3825
3824
  const safeProperties = properties ? JSON.parse(
3826
3825
  JSON.stringify(properties, (key, value) => {
3827
3826
  if (value instanceof Error) {
@@ -3842,7 +3841,6 @@ async function trackEvent(distinctId, event, properties) {
3842
3841
  flushInterval: 0
3843
3842
  }
3844
3843
  );
3845
- console.log("--- ---");
3846
3844
  await posthog.capture({
3847
3845
  distinctId,
3848
3846
  event,
@@ -3854,9 +3852,7 @@ async function trackEvent(distinctId, event, properties) {
3854
3852
  }
3855
3853
  }
3856
3854
  });
3857
- console.log("--- ---");
3858
3855
  await posthog.shutdown();
3859
- console.log("--- ---");
3860
3856
  } catch (error) {
3861
3857
  if (process.env.DEBUG) {
3862
3858
  console.error(error);
@@ -4970,6 +4966,22 @@ var InBranchFlow = class extends IntegrationFlow {
4970
4966
  }
4971
4967
  return true;
4972
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
+ }
4973
4985
  };
4974
4986
 
4975
4987
  // src/cli/cmd/ci/flows/pull-request.ts
@@ -5548,24 +5560,25 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
5548
5560
  LINGODOTDEV_PROCESS_OWN_COMMITS: options.processOwnCommits.toString()
5549
5561
  }
5550
5562
  };
5551
- console.log("--- config ---");
5552
- console.log(env);
5553
- console.log("--- ---");
5554
5563
  process.env = { ...process.env, ...env };
5555
5564
  const ora = _ora2.default.call(void 0, );
5556
5565
  const platformKit = getPlatformKit();
5557
5566
  const { isPullRequestMode } = platformKit.config;
5558
5567
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
5559
5568
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
5560
- const canRun = await _optionalChain([flow, 'access', _181 => _181.preRun, 'optionalCall', _182 => _182()]);
5561
- if (canRun === false) {
5562
- return;
5563
- }
5564
- const hasChanges = await flow.run();
5565
- if (!hasChanges) {
5566
- return;
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()]);
5567
5581
  }
5568
- await _optionalChain([flow, 'access', _183 => _183.postRun, 'optionalCall', _184 => _184()]);
5569
5582
  });
5570
5583
 
5571
5584
  // src/cli/cmd/status.ts
@@ -5609,13 +5622,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
5609
5622
  flags
5610
5623
  });
5611
5624
  let buckets = getBuckets(i18nConfig);
5612
- if (_optionalChain([flags, 'access', _185 => _185.bucket, 'optionalAccess', _186 => _186.length])) {
5625
+ if (_optionalChain([flags, 'access', _187 => _187.bucket, 'optionalAccess', _188 => _188.length])) {
5613
5626
  buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
5614
5627
  }
5615
5628
  ora.succeed("Buckets retrieved");
5616
- if (_optionalChain([flags, 'access', _187 => _187.file, 'optionalAccess', _188 => _188.length])) {
5629
+ if (_optionalChain([flags, 'access', _189 => _189.file, 'optionalAccess', _190 => _190.length])) {
5617
5630
  buckets = buckets.map((bucket) => {
5618
- const paths = bucket.paths.filter((path17) => flags.file.find((file) => _optionalChain([path17, 'access', _189 => _189.pathPattern, 'optionalAccess', _190 => _190.match, 'call', _191 => _191(file)])));
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)])));
5619
5632
  return { ...bucket, paths };
5620
5633
  }).filter((bucket) => bucket.paths.length > 0);
5621
5634
  if (buckets.length === 0) {
@@ -5631,7 +5644,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
5631
5644
  });
5632
5645
  }
5633
5646
  }
5634
- const targetLocales = _optionalChain([flags, 'access', _192 => _192.locale, 'optionalAccess', _193 => _193.length]) ? flags.locale : i18nConfig.locale.targets;
5647
+ const targetLocales = _optionalChain([flags, 'access', _194 => _194.locale, 'optionalAccess', _195 => _195.length]) ? flags.locale : i18nConfig.locale.targets;
5635
5648
  let totalSourceKeyCount = 0;
5636
5649
  let uniqueKeysToTranslate = 0;
5637
5650
  let totalExistingTranslations = 0;
@@ -5972,12 +5985,12 @@ function validateParams2(i18nConfig, flags) {
5972
5985
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
5973
5986
  docUrl: "bucketNotFound"
5974
5987
  });
5975
- } else if (_optionalChain([flags, 'access', _194 => _194.locale, 'optionalAccess', _195 => _195.some, 'call', _196 => _196((locale) => !i18nConfig.locale.targets.includes(locale))])) {
5988
+ } else if (_optionalChain([flags, 'access', _196 => _196.locale, 'optionalAccess', _197 => _197.some, 'call', _198 => _198((locale) => !i18nConfig.locale.targets.includes(locale))])) {
5976
5989
  throw new CLIError({
5977
5990
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
5978
5991
  docUrl: "localeTargetNotFound"
5979
5992
  });
5980
- } else if (_optionalChain([flags, 'access', _197 => _197.bucket, 'optionalAccess', _198 => _198.some, 'call', _199 => _199((bucket) => !i18nConfig.buckets[bucket])])) {
5993
+ } else if (_optionalChain([flags, 'access', _199 => _199.bucket, 'optionalAccess', _200 => _200.some, 'call', _201 => _201((bucket) => !i18nConfig.buckets[bucket])])) {
5981
5994
  throw new CLIError({
5982
5995
  message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
5983
5996
  docUrl: "bucketNotFound"
@@ -5988,7 +6001,7 @@ function validateParams2(i18nConfig, flags) {
5988
6001
  // package.json
5989
6002
  var package_default = {
5990
6003
  name: "lingo.dev",
5991
- version: "0.90.0",
6004
+ version: "0.90.1",
5992
6005
  description: "Lingo.dev CLI",
5993
6006
  private: false,
5994
6007
  publishConfig: {
@@ -6047,7 +6060,7 @@ var package_default = {
6047
6060
  dependencies: {
6048
6061
  "@ai-sdk/anthropic": "^1.2.6",
6049
6062
  "@ai-sdk/openai": "^1.3.7",
6050
- "@datocms/cma-client-node": "^3.4.0",
6063
+ "@datocms/cma-client-node": "^4.0.1",
6051
6064
  "@gitbeaker/rest": "^39.34.3",
6052
6065
  "@inquirer/prompts": "^7.4.1",
6053
6066
  "@lingo.dev/_sdk": "workspace:*",