lingo.dev 0.117.24 → 0.117.26

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
@@ -9113,7 +9113,7 @@ function extractCodePlaceholders(content) {
9113
9113
  for (const match2 of codeBlockMatches) {
9114
9114
  const codeBlock = match2[0];
9115
9115
  const codeBlockHash = md5(codeBlock);
9116
- const placeholder = `---CODE-PLACEHOLDER-${codeBlockHash}---`;
9116
+ const placeholder = `{/* CODE_PLACEHOLDER_${codeBlockHash} */}`;
9117
9117
  codePlaceholders[placeholder] = codeBlock;
9118
9118
  const replacement = codeBlock.trim().startsWith(">") ? `> ${placeholder}` : `${placeholder}`;
9119
9119
  finalContent = finalContent.replace(codeBlock, () => replacement);
@@ -9122,7 +9122,7 @@ function extractCodePlaceholders(content) {
9122
9122
  for (const match2 of inlineCodeMatches) {
9123
9123
  const inlineCode = match2[0];
9124
9124
  const inlineCodeHash = md5(inlineCode);
9125
- const placeholder = `---INLINE-CODE-PLACEHOLDER-${inlineCodeHash}---`;
9125
+ const placeholder = `{/* INLINE_CODE_PLACEHOLDER_${inlineCodeHash} */}`;
9126
9126
  codePlaceholders[placeholder] = inlineCode;
9127
9127
  const replacement = placeholder;
9128
9128
  finalContent = finalContent.replace(inlineCode, () => replacement);
@@ -9216,7 +9216,7 @@ function extractLockedPatterns(content, patterns = []) {
9216
9216
  for (const match2 of matches) {
9217
9217
  const matchedText = match2[0];
9218
9218
  const matchHash = md5(matchedText);
9219
- const placeholder = `---LOCKED-PATTERN-${matchHash}---`;
9219
+ const placeholder = `{/* LOCKED_PATTERN_${matchHash} */}`;
9220
9220
  lockedPlaceholders[placeholder] = matchedText;
9221
9221
  finalContent = finalContent.replace(matchedText, placeholder);
9222
9222
  }
@@ -10860,7 +10860,17 @@ var _https = require('https'); var _https2 = _interopRequireDefault(_https);
10860
10860
 
10861
10861
  // src/cli/utils/repository-id.ts
10862
10862
  var _child_process = require('child_process'); var cp = _interopRequireWildcard(_child_process);
10863
+ var _crypto = require('crypto');
10863
10864
  var cachedGitRepoId = void 0;
10865
+ function hashProjectName(fullPath) {
10866
+ const parts = fullPath.split("/");
10867
+ if (parts.length !== 2) {
10868
+ return _crypto.createHash.call(void 0, "sha256").update(fullPath).digest("hex").slice(0, 8);
10869
+ }
10870
+ const [org, project] = parts;
10871
+ const hashedProject = _crypto.createHash.call(void 0, "sha256").update(project).digest("hex").slice(0, 8);
10872
+ return `${org}/${hashedProject}`;
10873
+ }
10864
10874
  function getRepositoryId() {
10865
10875
  const ciRepoId = getCIRepositoryId();
10866
10876
  if (ciRepoId) return ciRepoId;
@@ -10870,13 +10880,16 @@ function getRepositoryId() {
10870
10880
  }
10871
10881
  function getCIRepositoryId() {
10872
10882
  if (process.env.GITHUB_REPOSITORY) {
10873
- return `github:${process.env.GITHUB_REPOSITORY}`;
10883
+ const hashed = hashProjectName(process.env.GITHUB_REPOSITORY);
10884
+ return `github:${hashed}`;
10874
10885
  }
10875
10886
  if (process.env.CI_PROJECT_PATH) {
10876
- return `gitlab:${process.env.CI_PROJECT_PATH}`;
10887
+ const hashed = hashProjectName(process.env.CI_PROJECT_PATH);
10888
+ return `gitlab:${hashed}`;
10877
10889
  }
10878
10890
  if (process.env.BITBUCKET_REPO_FULL_NAME) {
10879
- return `bitbucket:${process.env.BITBUCKET_REPO_FULL_NAME}`;
10891
+ const hashed = hashProjectName(process.env.BITBUCKET_REPO_FULL_NAME);
10892
+ return `bitbucket:${hashed}`;
10880
10893
  }
10881
10894
  return null;
10882
10895
  }
@@ -10914,10 +10927,11 @@ function parseGitUrl(url) {
10914
10927
  const httpsMatch = cleanUrl.match(/\/([^/]+\/[^/]+)$/);
10915
10928
  const repoPath = _optionalChain([sshMatch, 'optionalAccess', _341 => _341[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _342 => _342[1]]);
10916
10929
  if (!repoPath) return null;
10930
+ const hashedPath = hashProjectName(repoPath);
10917
10931
  if (platform) {
10918
- return `${platform}:${repoPath}`;
10932
+ return `${platform}:${hashedPath}`;
10919
10933
  }
10920
- return `git:${repoPath}`;
10934
+ return `git:${hashedPath}`;
10921
10935
  }
10922
10936
 
10923
10937
  // src/cli/utils/observability.ts
@@ -14778,7 +14792,7 @@ async function renderHero2() {
14778
14792
  // package.json
14779
14793
  var package_default = {
14780
14794
  name: "lingo.dev",
14781
- version: "0.117.24",
14795
+ version: "0.117.26",
14782
14796
  description: "Lingo.dev CLI",
14783
14797
  private: false,
14784
14798
  repository: {