Skip to content

Commit 9656baa

Browse files
author
Stefano Verna
committed
Refuse a hand-typed npm publish
This repo's root is the published package, so 'npm publish' typed at the repo root reaches the registry: it skips the tests, the changelog, the tag and the GitHub release, and npm takes it whenever the working tree carries a version the registry has not seen. Today a clean checkout carries the version already published, so the registry answers 403 - a side effect, not a decision, and it stops holding the moment somebody bumps by hand. prepublishOnly now runs 'release-toolchain --assert-release', which passes only while the release script is the one publishing. 'npm pack' runs prepack instead, so reading a tarball still works and the pkg-pr-new previews, which pack rather than publish, are untouched. Also moves the toolchain pin to v1.2.0. The lockfile is the substantive half of that: changing the spec alone left the previous SHA resolved, so 'npm ci' kept installing v1.0.0 while package.json claimed otherwise. Claude-Session: https://claude.ai/code/session_01XaYAhzmiJwysZeq1XC5xrQ
1 parent 5beee92 commit 9656baa

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"format": "biome check --write --unsafe",
2424
"changeset": "changeset",
2525
"release": "release-toolchain",
26-
"release:next": "release-toolchain --tag next"
26+
"release:next": "release-toolchain --tag next",
27+
"prepublishOnly": "release-toolchain --assert-release"
2728
},
2829
"keywords": [
2930
"datocms",
@@ -55,7 +56,7 @@
5556
"devDependencies": {
5657
"@biomejs/biome": "^1.8.3",
5758
"@changesets/cli": "^3.0.1",
58-
"@datocms/release-toolchain": "github:datocms/release-toolchain#v1.1.0",
59+
"@datocms/release-toolchain": "github:datocms/release-toolchain#v1.2.0",
5960
"pkg-pr-new": "^0.0.88",
6061
"rimraf": "^5.0.7",
6162
"simple-git-hooks": "^2.11.1",

0 commit comments

Comments
 (0)