chore: point MSD at git.golem15.com/golem15/msd-core
Some checks failed
Tests / PR mergeability (push) Successful in 1m37s
Tests / Base branch health (push) Successful in 11s
Tests / Detect test scope (push) Successful in 17s
Tests / lint-tests (push) Failing after 2m16s
Tests / plugin-validate (push) Successful in 1m6s
Tests / test (ubuntu-latest, 24, shard 1/3) (push) Failing after 25s
Tests / test (ubuntu-latest, 24, shard 2/3) (push) Failing after 20s
Tests / test (ubuntu-latest, 24, shard 3/3) (push) Failing after 20s
Tests / test (ubuntu-latest, 24) (push) Failing after 19s
Tests / test (inert CI) (push) Has been skipped
Tests / QA loop walk (smell ratchet) (push) Failing after 19s
Tests / Coverage gate (merged shards) (push) Has been skipped
Tests / Publish emitted-baseline artifact (push) Has been skipped
Dismiss Unauthorized PR Approvals / dismiss-unauthorized-approval (push) Successful in 9s
Close Draft PRs (sweep) / Sweep open draft PRs (push) Successful in 8s
Tests / conformance test (macos-latest, 24) (push) Has been cancelled
Tests / conformance test (windows-latest, 24, shard 1/3) (push) Has been cancelled
Tests / conformance test (windows-latest, 24, shard 2/3) (push) Has been cancelled
Tests / conformance test (windows-latest, 24, shard 3/3) (push) Has been cancelled
Tests / Required tests (push) Has been cancelled

The fork lives on the golem15 Gitea forge, not GitHub. Package identity now
parses either host and derives in-place raw URLs for Gitea; the identity-drift
lint accepts the new host; README drops GitHub-only badges and the npm
quickstart in favour of the checkout installer.
This commit is contained in:
Jakub Zych
2026-10-06 10:41:56 +02:00
parent a9a7a328e6
commit 12ee75a509
56 changed files with 182 additions and 172 deletions

View File

@@ -20,10 +20,24 @@
* Parse `owner/name` out of a package.json `repository.url`, stripping the
* `git+` prefix and `.git` suffix npm conventionally adds.
*/
function parseRepoSlug(repository) {
function parseRepo(repository) {
const url = typeof repository === 'string' ? repository : (repository && repository.url) || '';
const m = url.replace(/^git\+/, '').replace(/\.git$/, '').match(/github\.com[/:]([^/]+\/[^/]+)$/);
return m ? m[1] : '';
const m = url.replace(/^git\+/, '').replace(/\.git$/, '').match(/(github\.com|git\.golem15\.com)[/:]([^/]+\/[^/]+)$/);
return m ? { host: m[1], slug: m[2] } : { host: '', slug: '' };
}
function parseRepoSlug(repository) {
return parseRepo(repository).slug;
}
/**
* Raw-file URL for CHANGELOG.md on the repo's default branch. GitHub serves raw
* files from a separate host; the golem15 Gitea forge serves them in-place.
*/
function changelogRawUrlFor(host, slug) {
if (!slug) return '';
if (host === 'github.com') return `https://raw.githubusercontent.com/${slug}/main/CHANGELOG.md`;
return `https://${host}/${slug}/raw/branch/next/CHANGELOG.md`;
}
/**
@@ -47,11 +61,9 @@ function slugifyPackageName(name) {
function deriveIdentity(pkg = {}) {
const packageName = pkg.name || '';
const binName = pkg.bin ? Object.keys(pkg.bin)[0] || '' : '';
const repoSlug = parseRepoSlug(pkg.repository);
const repoUrl = repoSlug ? `https://github.com/${repoSlug}` : '';
const changelogRawUrl = repoSlug
? `https://raw.githubusercontent.com/${repoSlug}/main/CHANGELOG.md`
: '';
const { host, slug: repoSlug } = parseRepo(pkg.repository);
const repoUrl = repoSlug ? `https://${host}/${repoSlug}` : '';
const changelogRawUrl = changelogRawUrlFor(host, repoSlug);
const cacheSlug = slugifyPackageName(packageName);
const updateCacheFileName = cacheSlug ? `msd-update-check-${cacheSlug}.json` : 'msd-update-check.json';
return { packageName, binName, repoSlug, repoUrl, changelogRawUrl, cacheSlug, updateCacheFileName };