-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Description
Describe the bug
There is currently nothing to prevent you from publishing the incorrect build artifacts.
npm run package simply packages whatever artifacts exist in your current build directory.
Example
This is what (we think) occurred to cause #6153
- I build the v7 files.
The v7 files now exist in my build/ directory. - I move the built files to the root of my blockly/ using
npm run checkin:builtand push them to my patch7/json-serialization branch. - I go do some performance work.
- I check out master (aka the v8 patch).
At this point I have the v7 compressed files in build/ but the 8.0.1 package.json - I run
npm run package.
This packages the v7 files that exist in build/. - I sanity check that the dist files have the serialization fixes in them, but I don't sanity check the version number.
- I run
npm run publish. - We get the v7 files associated with v8.0.1
Proposed solution
npm run package should trigger a build so that it is impossible to accidentally publish the incorrect build artifacts
Alternative solutions
We could add automatic checks to npm run package that the package.js version matches the Blockly.VERSION in blockly_compressed.
Additional context
This theory is based on my git history from the period of when I created the v7 patch branch, to when I published the v8.0.1 release to NPM.