lingo.dev 0.77.3 → 0.77.4

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
@@ -689,7 +689,7 @@ import Ora4 from "ora";
689
689
  // src/cli/utils/buckets.ts
690
690
  import _5 from "lodash";
691
691
  import path8 from "path";
692
- import * as glob2 from "glob";
692
+ import { glob as glob2 } from "glob";
693
693
  import { resolveOverridenLocale } from "@lingo.dev/_spec";
694
694
  function getBuckets(i18nConfig) {
695
695
  const result = Object.entries(i18nConfig.buckets).map(([bucketType, bucketEntry]) => {
@@ -749,10 +749,15 @@ function expandPlaceholderedGlob(_pathPattern, sourceLocale) {
749
749
  const placeholderedPaths = sourcePaths.map((sourcePath) => {
750
750
  const sourcePathChunks = sourcePath.split(path8.sep);
751
751
  localeSegmentIndexes.forEach((localeSegmentIndex) => {
752
- const localePlaceholderIndex = pathPatternChunks[localeSegmentIndex]?.indexOf("[locale]") ?? -1;
753
- if (localeSegmentIndex >= 0 && localePlaceholderIndex >= 0) {
754
- const placeholderedPathChunk = sourcePathChunks[localeSegmentIndex];
755
- const placeholderedSegment = placeholderedPathChunk.substring(0, localePlaceholderIndex) + "[locale]" + placeholderedPathChunk.substring(localePlaceholderIndex + sourceLocale.length);
752
+ const pathPatternChunk = pathPatternChunks[localeSegmentIndex];
753
+ const sourcePathChunk = sourcePathChunks[localeSegmentIndex];
754
+ const regexp = new RegExp(
755
+ "(" + pathPatternChunk.replaceAll(".", "\\.").replaceAll("*", ".*").replace("[locale]", `)${sourceLocale}(`) + ")"
756
+ );
757
+ const match = sourcePathChunk.match(regexp);
758
+ if (match) {
759
+ const [, prefix, suffix] = match;
760
+ const placeholderedSegment = prefix + "[locale]" + suffix;
756
761
  sourcePathChunks[localeSegmentIndex] = placeholderedSegment;
757
762
  }
758
763
  });
@@ -3618,7 +3623,7 @@ var mcp_default = new Command9().command("mcp").description("Use Lingo.dev model
3618
3623
  // package.json
3619
3624
  var package_default = {
3620
3625
  name: "lingo.dev",
3621
- version: "0.77.3",
3626
+ version: "0.77.4",
3622
3627
  description: "Lingo.dev CLI",
3623
3628
  private: false,
3624
3629
  publishConfig: {