fix: guard publish against uncommitted version sync changes

Adds a git diff check after sync-platform-versions so npm publish fails
if the sync had to make changes. Prevents a repeat of #276 where
optionalDependencies were out of sync with the published version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson 2026-03-13 16:12:37 -06:00
parent 54df619891
commit 4959ecfd33

View file

@ -55,7 +55,7 @@
"pi:uninstall-global": "node scripts/uninstall-pi-global.js",
"sync-pkg-version": "node scripts/sync-pkg-version.cjs",
"sync-platform-versions": "node native/scripts/sync-platform-versions.cjs",
"prepublishOnly": "npm run sync-pkg-version && npm run sync-platform-versions && npm run build"
"prepublishOnly": "npm run sync-pkg-version && npm run sync-platform-versions && git diff --exit-code || (echo 'ERROR: version sync changed files — commit them before publishing' && exit 1) && npm run build"
},
"dependencies": {
"@clack/prompts": "^1.1.0",