Skip to content

Have the npm run package script run the build #6159

@BeksOmega

Description

@BeksOmega

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

  1. I build the v7 files.
    The v7 files now exist in my build/ directory.
  2. I move the built files to the root of my blockly/ using npm run checkin:built and push them to my patch7/json-serialization branch.
  3. I go do some performance work.
  4. 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
  5. I run npm run package.
    This packages the v7 files that exist in build/.
  6. I sanity check that the dist files have the serialization fixes in them, but I don't sanity check the version number.
  7. I run npm run publish.
  8. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions