From a685abd13e94362111c08ac2c7b060382c185548 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 23 Aug 2026 21:22:44 +0800 Subject: [PATCH] fix(release): align npm repository identity --- packages/dsh-web/package.json | 2 +- packages/pi-web/package.json | 2 +- packages/web/package.json | 2 +- scripts/release-dry-run.mjs | 6 ++++++ scripts/test-release-invariants.mjs | 16 ++++++++++++++++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/packages/dsh-web/package.json b/packages/dsh-web/package.json index ab6d47f..8155d83 100644 --- a/packages/dsh-web/package.json +++ b/packages/dsh-web/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/guionai/web.git", + "url": "git+https://github.com/GuionAI/web.git", "directory": "packages/dsh-web" }, "license": "Apache-2.0", diff --git a/packages/pi-web/package.json b/packages/pi-web/package.json index c920776..20eed4d 100644 --- a/packages/pi-web/package.json +++ b/packages/pi-web/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/guionai/web.git", + "url": "git+https://github.com/GuionAI/web.git", "directory": "packages/pi-web" }, "license": "Apache-2.0", diff --git a/packages/web/package.json b/packages/web/package.json index b59b596..d8c999c 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/guionai/web.git", + "url": "git+https://github.com/GuionAI/web.git", "directory": "packages/web" }, "license": "Apache-2.0", diff --git a/scripts/release-dry-run.mjs b/scripts/release-dry-run.mjs index 1155df9..38fd48c 100644 --- a/scripts/release-dry-run.mjs +++ b/scripts/release-dry-run.mjs @@ -10,6 +10,7 @@ const publicPackages = [ { directory: "pi-web", name: "@guionai/pi-web" }, { directory: "dsh-web", name: "@guionai/dsh-web" }, ]; +const repositoryUrl = "git+https://github.com/GuionAI/web.git"; const semver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/; const workspace = join(dirname(fileURLToPath(import.meta.url)), ".."); @@ -27,6 +28,11 @@ for (const { directory, name } of publicPackages) { if (manifest.name !== name || manifest.private === true) { errors.push(`${manifestPath} is not the public ${name} package`); } + if (manifest.repository?.url !== repositoryUrl) { + errors.push( + `${name}: repository.url ${JSON.stringify(manifest.repository?.url)} != ${repositoryUrl}`, + ); + } if (manifest.version !== version) { errors.push(`${name}: version ${manifest.version} != ${version}`); } diff --git a/scripts/test-release-invariants.mjs b/scripts/test-release-invariants.mjs index 1b5bafe..6257690 100644 --- a/scripts/test-release-invariants.mjs +++ b/scripts/test-release-invariants.mjs @@ -72,6 +72,22 @@ try { } } + const repositoryManifestPath = join( + fixture, + "packages", + "web", + "package.json", + ); + const repositoryManifest = JSON.parse( + readFileSync(repositoryManifestPath, "utf8"), + ); + repositoryManifest.repository.url = "git+https://github.com/guionai/web.git"; + writeFileSync( + repositoryManifestPath, + JSON.stringify(repositoryManifest) + "\n", + ); + expectFailure(fixture, "release-dry-run.mjs", "1.2.3", 1); + writeFileSync( join(fixture, "packages", "web", "package.json"), JSON.stringify({ name: "@guionai/web", version: "0.0.0" }) + "\n",