renovate 39.235.3 → 39.235.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.
@@ -110,16 +110,24 @@ function addMetaData(dep, datasource, packageName) {
110
110
  });
111
111
  extraBaseUrls.push('gitlab.com');
112
112
  if (dep.sourceUrl) {
113
+ // try massaging it
113
114
  const massagedUrl = massageUrl(dep.sourceUrl);
114
115
  if (is_1.default.emptyString(massagedUrl)) {
115
116
  delete dep.sourceUrl;
116
117
  }
117
118
  else {
118
- // try massaging it
119
+ // parse from github-url-from-git only supports Github URLs as its name implies
119
120
  dep.sourceUrl =
120
121
  (0, github_url_from_git_1.default)(massagedUrl, {
121
122
  extraBaseUrls,
122
123
  }) || dep.sourceUrl;
124
+ // prefer massaged URL to source URL if the latter does not start with http:// or https://
125
+ // (e.g. git@somehost.com) and the detected platform is gitlab.
126
+ // this allows to retrieve changelogs from git hosts other than Github
127
+ if (!(0, url_2.isHttpUrl)(dep.sourceUrl) &&
128
+ (0, common_1.detectPlatform)(massagedUrl) === 'gitlab') {
129
+ dep.sourceUrl = massagedUrl;
130
+ }
123
131
  }
124
132
  }
125
133
  if (shouldDeleteHomepage(dep.sourceUrl, dep.homepage)) {
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/modules/datasource/metadata.ts"],"names":[],"mappings":";;AAcA,gCAcC;AAED,4CAcC;AAiCD,kCAiFC;AASD,oDAsBC;;AA7LD,kEAAkC;AAClC,sFAAwC;AACxC,8CAAmD;AACnD,4CAAiD;AACjD,yEAAmD;AACnD,4CAAyC;AACzC,oDAAmD;AACnD,wCAAwE;AACxE,uDAA0E;AAG1E,MAAM,WAAW,GAAG,IAAA,aAAK,EAAC,sCAAsC,CAAC,CAAC;AAClE,MAAM,SAAS,GAAG,IAAA,aAAK,EAAC,WAAW,CAAC,CAAC;AAErC,SAAgB,UAAU,CAAC,SAAiB;IAC1C,8DAA8D;IAC9D,MAAM,W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U,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAA,uBAAc,EAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACnD,MAAM,eAAe,GAAG,IAAA,cAAQ,EAAC,iBAAiB,CAAC,CAAC;QACpD,IAAI,YAAE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,cAAc,GAAG,IAAA,cAAQ,EAAC,QAAQ,CAAC,CAAC;QAC1C,OAAO,CACL,cAAc,KAAK,IAAI;YACvB,IAAA,uBAAiB,EAAC,cAAc,CAAC,QAAQ,CAAC;gBACxC,IAAA,uBAAiB,EAAC,eAAe,CAAC,QAAQ,CAAC,CAC9C,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,KAAK,QAAQ,CAAC;AACxC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport parse from 'github-url-from-git';\nimport { detectPlatform } from '../../util/common';\nimport { parseGitUrl } from '../../util/git/url';\nimport * as hostRules from '../../util/host-rules';\nimport { regEx } from '../../util/regex';\nimport { asTimestamp } from '../../util/timestamp';\nimport { isHttpUrl, parseUrl, trimTrailingSlash } from '../../util/url';\nimport { manualChangelogUrls, manualSourceUrls } from './metadata-manual';\nimport type { ReleaseResult } from './types';\n\nconst githubPages = regEx('^https://([^.]+).github.com/([^/]+)$');\nconst gitPrefix = regEx('^git:/?/?');\n\nexport function massageUrl(sourceUrl: string): string {\n // Replace git@ sourceUrl with https so hostname can be parsed\n const massagedUrl = massageGitAtUrl(sourceUrl);\n\n // Check if URL is valid\n const parsedUrl = parseUrl(massagedUrl);\n if (!parsedUrl) {\n return '';\n }\n\n if (detectPlatform(massagedUrl) === 'gitlab') {\n return massageGitlabUrl(sourceUrl);\n }\n return massageGithubUrl(sourceUrl);\n}\n\nexport function massageGithubUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace('http+git:', 'https:')\n .replace('https+git:', 'https:')\n .replace('ssh://git@', 'https://')\n .replace(gitPrefix, 'https://')\n .replace(githubPages, 'https://github.com/$1/$2')\n .replace('www.github.com', 'github.com')\n .split('/')\n .slice(0, 5)\n .join('/');\n}\n\nfunction massageGitlabUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace(gitPrefix, 'https://')\n .replace(regEx(/\\/tree\\/.*$/i), '')\n .replace(regEx(/\\/$/i), '')\n .replace('.git', '');\n}\n\nfunction massageGitAtUrl(url: string): string {\n let massagedUrl = url;\n\n if (url.startsWith('git@')) {\n massagedUrl = url.replace(':', '/').replace('git@', 'https://');\n }\n return massagedUrl;\n}\n\nfunction massageTimestamps(dep: ReleaseResult): void {\n for (const release of dep.releases || []) {\n let { releaseTimestamp } = release;\n delete release.releaseTimestamp;\n releaseTimestamp = asTimestamp(releaseTimestamp);\n if (releaseTimestamp) {\n release.releaseTimestamp = releaseTimestamp;\n }\n }\n}\n\nexport function addMetaData(\n dep: ReleaseResult,\n datasource: string,\n packageName: string,\n): void {\n massageTimestamps(dep);\n\n const packageNameLowercase = packageName.toLowerCase();\n const manualChangelogUrl =\n manualChangelogUrls[datasource]?.[packageNameLowercase];\n if (manualChangelogUrl) {\n dep.changelogUrl = manualChangelogUrl;\n }\n\n const manualSourceUrl = manualSourceUrls[datasource]?.[packageNameLowercase];\n if (manualSourceUrl) {\n dep.sourceUrl = manualSourceUrl;\n }\n\n if (dep.sourceUrl && !dep.sourceDirectory) {\n try {\n const parsed = parseGitUrl(dep.sourceUrl);\n if (parsed.filepathtype === 'tree' && parsed.filepath !== '') {\n dep.sourceUrl = parsed.toString();\n dep.sourceDirectory = parsed.filepath;\n }\n } catch {\n // ignore invalid urls\n }\n }\n\n if (\n !dep.sourceUrl &&\n dep.changelogUrl &&\n detectPlatform(dep.changelogUrl) === 'github'\n ) {\n dep.sourceUrl = dep.changelogUrl;\n }\n\n if (!dep.sourceUrl && dep.homepage) {\n const platform = detectPlatform(dep.homepage);\n if (platform === 'github' || platform === 'gitlab') {\n dep.sourceUrl = dep.homepage;\n }\n }\n const extraBaseUrls = [];\n // istanbul ignore next\n hostRules.hosts({ hostType: 'github' }).forEach((host) => {\n extraBaseUrls.push(host, `gist.${host}`);\n });\n extraBaseUrls.push('gitlab.com');\n if (dep.sourceUrl) {\n const massagedUrl = massageUrl(dep.sourceUrl);\n if (is.emptyString(massagedUrl)) {\n delete dep.sourceUrl;\n } else {\n // try massaging it\n dep.sourceUrl =\n parse(massagedUrl, {\n extraBaseUrls,\n }) || dep.sourceUrl;\n }\n }\n if (shouldDeleteHomepage(dep.sourceUrl, dep.homepage)) {\n delete dep.homepage;\n }\n // Clean up any empty urls\n const urlKeys: (keyof ReleaseResult)[] = [\n 'homepage',\n 'sourceUrl',\n 'changelogUrl',\n 'dependencyUrl',\n ];\n for (const urlKey of urlKeys) {\n const urlVal = dep[urlKey];\n if (is.string(urlVal) && isHttpUrl(urlVal.trim())) {\n dep[urlKey] = urlVal.trim() as never;\n } else {\n delete dep[urlKey];\n }\n }\n}\n\n/**\n * Returns true if\n * 1. it's a github or gitlab url and not a path within the repo.\n * 2. it's equal to sourceURl\n * @param sourceUrl\n * @param homepage\n */\nexport function shouldDeleteHomepage(\n sourceUrl: string | null | undefined,\n homepage: string | undefined,\n): boolean {\n if (is.nullOrUndefined(sourceUrl) || is.undefined(homepage)) {\n return false;\n }\n const massagedSourceUrl = massageUrl(sourceUrl);\n const platform = detectPlatform(homepage);\n if (platform === 'github' || platform === 'gitlab') {\n const sourceUrlParsed = parseUrl(massagedSourceUrl);\n if (is.nullOrUndefined(sourceUrlParsed)) {\n return false;\n }\n const homepageParsed = parseUrl(homepage);\n return (\n homepageParsed !== null &&\n trimTrailingSlash(homepageParsed.pathname) ===\n trimTrailingSlash(sourceUrlParsed.pathname)\n );\n }\n return massagedSourceUrl === homepage;\n}\n"]}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/modules/datasource/metadata.ts"],"names":[],"mappings":";;AAcA,gCAcC;AAED,4CAcC;AAiCD,kCA2FC;AASD,oDAsBC;;AAvMD,kEAAkC;AAClC,sFAAwC;AACxC,8CAAmD;AACnD,4CAAiD;AACjD,yEAAmD;AACnD,4CAAyC;AACzC,oDAAmD;AACnD,wCAAwE;AACxE,uDAA0E;AAG1E,MAAM,WAAW,GAAG,IAAA,aAAK,EAAC,sCAAsC,CAAC,CAAC;AAClE,MAAM,SAAS,GAAG,IAAA,aAAK,EAAC,WAAW,CAAC,CAAC;AAErC,SAAgB,UAAU,CAAC,SAAiB;IAC1C,8DAA8D;IAC9D,MAAM,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IAE/C,wBAAwB;IACxB,MAAM,SAAS,GAAG,IAAA,cAAQ,EAAC,WAAW,CAAC,CAAC;IACxC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,IAAA,uBAAc,EAAC,WAAW,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,gBAAgB,CAAC,GAAW;IAC1C,MAAM,WAAW,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAEzC,OAAO,WAAW;SACf,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;SAC1B,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC;SAC9B,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC;SAC/B,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC;SACjC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC;SAC9B,OAAO,CAAC,WAAW,EAAE,0BAA0B,CAAC;SAChD,OAAO,CA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,CAAC,CAC9C,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,KAAK,QAAQ,CAAC;AACxC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport parse from 'github-url-from-git';\nimport { detectPlatform } from '../../util/common';\nimport { parseGitUrl } from '../../util/git/url';\nimport * as hostRules from '../../util/host-rules';\nimport { regEx } from '../../util/regex';\nimport { asTimestamp } from '../../util/timestamp';\nimport { isHttpUrl, parseUrl, trimTrailingSlash } from '../../util/url';\nimport { manualChangelogUrls, manualSourceUrls } from './metadata-manual';\nimport type { ReleaseResult } from './types';\n\nconst githubPages = regEx('^https://([^.]+).github.com/([^/]+)$');\nconst gitPrefix = regEx('^git:/?/?');\n\nexport function massageUrl(sourceUrl: string): string {\n // Replace git@ sourceUrl with https so hostname can be parsed\n const massagedUrl = massageGitAtUrl(sourceUrl);\n\n // Check if URL is valid\n const parsedUrl = parseUrl(massagedUrl);\n if (!parsedUrl) {\n return '';\n }\n\n if (detectPlatform(massagedUrl) === 'gitlab') {\n return massageGitlabUrl(sourceUrl);\n }\n return massageGithubUrl(sourceUrl);\n}\n\nexport function massageGithubUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace('http+git:', 'https:')\n .replace('https+git:', 'https:')\n .replace('ssh://git@', 'https://')\n .replace(gitPrefix, 'https://')\n .replace(githubPages, 'https://github.com/$1/$2')\n .replace('www.github.com', 'github.com')\n .split('/')\n .slice(0, 5)\n .join('/');\n}\n\nfunction massageGitlabUrl(url: string): string {\n const massagedUrl = massageGitAtUrl(url);\n\n return massagedUrl\n .replace('http:', 'https:')\n .replace(gitPrefix, 'https://')\n .replace(regEx(/\\/tree\\/.*$/i), '')\n .replace(regEx(/\\/$/i), '')\n .replace('.git', '');\n}\n\nfunction massageGitAtUrl(url: string): string {\n let massagedUrl = url;\n\n if (url.startsWith('git@')) {\n massagedUrl = url.replace(':', '/').replace('git@', 'https://');\n }\n return massagedUrl;\n}\n\nfunction massageTimestamps(dep: ReleaseResult): void {\n for (const release of dep.releases || []) {\n let { releaseTimestamp } = release;\n delete release.releaseTimestamp;\n releaseTimestamp = asTimestamp(releaseTimestamp);\n if (releaseTimestamp) {\n release.releaseTimestamp = releaseTimestamp;\n }\n }\n}\n\nexport function addMetaData(\n dep: ReleaseResult,\n datasource: string,\n packageName: string,\n): void {\n massageTimestamps(dep);\n\n const packageNameLowercase = packageName.toLowerCase();\n const manualChangelogUrl =\n manualChangelogUrls[datasource]?.[packageNameLowercase];\n if (manualChangelogUrl) {\n dep.changelogUrl = manualChangelogUrl;\n }\n\n const manualSourceUrl = manualSourceUrls[datasource]?.[packageNameLowercase];\n if (manualSourceUrl) {\n dep.sourceUrl = manualSourceUrl;\n }\n\n if (dep.sourceUrl && !dep.sourceDirectory) {\n try {\n const parsed = parseGitUrl(dep.sourceUrl);\n if (parsed.filepathtype === 'tree' && parsed.filepath !== '') {\n dep.sourceUrl = parsed.toString();\n dep.sourceDirectory = parsed.filepath;\n }\n } catch {\n // ignore invalid urls\n }\n }\n\n if (\n !dep.sourceUrl &&\n dep.changelogUrl &&\n detectPlatform(dep.changelogUrl) === 'github'\n ) {\n dep.sourceUrl = dep.changelogUrl;\n }\n\n if (!dep.sourceUrl && dep.homepage) {\n const platform = detectPlatform(dep.homepage);\n if (platform === 'github' || platform === 'gitlab') {\n dep.sourceUrl = dep.homepage;\n }\n }\n const extraBaseUrls = [];\n // istanbul ignore next\n hostRules.hosts({ hostType: 'github' }).forEach((host) => {\n extraBaseUrls.push(host, `gist.${host}`);\n });\n extraBaseUrls.push('gitlab.com');\n if (dep.sourceUrl) {\n // try massaging it\n const massagedUrl = massageUrl(dep.sourceUrl);\n if (is.emptyString(massagedUrl)) {\n delete dep.sourceUrl;\n } else {\n // parse from github-url-from-git only supports Github URLs as its name implies\n dep.sourceUrl =\n parse(massagedUrl, {\n extraBaseUrls,\n }) || dep.sourceUrl;\n // prefer massaged URL to source URL if the latter does not start with http:// or https://\n // (e.g. git@somehost.com) and the detected platform is gitlab.\n // this allows to retrieve changelogs from git hosts other than Github\n if (\n !isHttpUrl(dep.sourceUrl) &&\n detectPlatform(massagedUrl) === 'gitlab'\n ) {\n dep.sourceUrl = massagedUrl;\n }\n }\n }\n if (shouldDeleteHomepage(dep.sourceUrl, dep.homepage)) {\n delete dep.homepage;\n }\n // Clean up any empty urls\n const urlKeys: (keyof ReleaseResult)[] = [\n 'homepage',\n 'sourceUrl',\n 'changelogUrl',\n 'dependencyUrl',\n ];\n for (const urlKey of urlKeys) {\n const urlVal = dep[urlKey];\n if (is.string(urlVal) && isHttpUrl(urlVal.trim())) {\n dep[urlKey] = urlVal.trim() as never;\n } else {\n delete dep[urlKey];\n }\n }\n}\n\n/**\n * Returns true if\n * 1. it's a github or gitlab url and not a path within the repo.\n * 2. it's equal to sourceURl\n * @param sourceUrl\n * @param homepage\n */\nexport function shouldDeleteHomepage(\n sourceUrl: string | null | undefined,\n homepage: string | undefined,\n): boolean {\n if (is.nullOrUndefined(sourceUrl) || is.undefined(homepage)) {\n return false;\n }\n const massagedSourceUrl = massageUrl(sourceUrl);\n const platform = detectPlatform(homepage);\n if (platform === 'github' || platform === 'gitlab') {\n const sourceUrlParsed = parseUrl(massagedSourceUrl);\n if (is.nullOrUndefined(sourceUrlParsed)) {\n return false;\n }\n const homepageParsed = parseUrl(homepage);\n return (\n homepageParsed !== null &&\n trimTrailingSlash(homepageParsed.pathname) ===\n trimTrailingSlash(sourceUrlParsed.pathname)\n );\n }\n return massagedSourceUrl === homepage;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "renovate",
3
3
  "description": "Automated dependency updates. Flexible so you don't need to be.",
4
- "version": "39.235.3",
4
+ "version": "39.235.4",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -300,7 +300,7 @@
300
300
  "@types/mdast": "3.0.15",
301
301
  "@types/moo": "0.5.10",
302
302
  "@types/ms": "2.1.0",
303
- "@types/node": "22.13.16",
303
+ "@types/node": "22.13.17",
304
304
  "@types/parse-link-header": "2.0.3",
305
305
  "@types/punycode": "2.1.4",
306
306
  "@types/semver": "7.7.0",