From 4959ecfd3393acdad1f8a005db5fd3f9b07eb2cb Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Fri, 13 Mar 2026 16:12:37 -0600 Subject: [PATCH] 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 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c80f6aae1..afb2a7f76 100644 --- a/package.json +++ b/package.json @@ -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",