CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.03k stars 3.51k forks source link

Don't rebuild during the release process #12263

Closed jjspace closed 1 month ago

jjspace commented 1 month ago

Description

The past couple releases we've had some extra .map.js files bleed through into the published version. These cause warnings for users downstream. See https://github.com/CesiumGS/cesium/issues/12182

It seems these are generated when we run npm run test even with the --release option. I also noticed these would be generated any time we run npm start without --production as the dev server does a build when it starts up.

This PR adds a check for the release flag to skip building for npm run test. It also updates the release guide to specify the dev server should only be started with the --production flag.

One extra precaution we could add is a prepublishOnly lifecycle script to our package.json that calls npm run make-zip right before publish. Would make the publish command slower but guarantee we always build the version of files we want published.

Issue number and link

Fixes https://github.com/CesiumGS/cesium/issues/12182

Testing plan

Author checklist

github-actions[bot] commented 1 month ago

Thank you for the pull request, @jjspace!

:white_check_mark: We can confirm we have a CLA on file for you.

ggetz commented 1 month ago

Awesome, thanks @jjspace!

One extra precaution we could add is a prepublishOnly lifecycle script to our package.json that calls npm run make-zip right before publish. Would make the publish command slower but guarantee we always build the version of files we want published.

We can follow up about this in a separate thread when appropriate. But the only concern I have with this is that it means the versions of each of the files we just tested will not be the ones that get published. Perhaps a simpler measure would be to add the maps to .npmignore?

jjspace commented 1 month ago

Perhaps a simpler measure would be to add the maps to .npmignore?

The problem with this when coupled with our current build process is that the flow when maps are generated is slightly different than the flow when they are not. If we just ignored the map files it could hide the fact that the files were rebuilt differently than we may want them to be.