Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the build has min.js files before generating the .zip file #2149

Merged
merged 2 commits into from
May 17, 2024

Conversation

gigitux
Copy link
Contributor

@gigitux gigitux commented May 16, 2024

This PR adds a sanity check step before generating the .zip file to proceed with the release.

When the right version of node isn't used, the *.min.js files aren't generated and this may create some issues on website. This PR ensures that the min.js files exist before creating the zip.

Testing instructions:

  1. Checkout this branch
  2. Switch to the node 14 version.
  3. Run npm run build.
  4. Ensure that everything works correctly.
  5. Switch to the node 20 version (or another version different from 14).
  6. Run npm run build.
  7. Expect to see an error.

@gigitux gigitux requested review from a team and Aljullu and removed request for a team May 16, 2024 10:54
Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm! I could reproduce the issue on my end when running the build script with the wrong node version. I left one minor comment, but pre-approving.


# Exit with an error code if any .js file is missing its corresponding .min.js file
if [ "$error_flag" -ne 0 ]; then
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding a troubleshooting message here, something like:

"Error: the ZIP could not be built because minified scripts are missing. Please ensure you are using the correct versions of NPM and Node.js."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added with 9aba910

@github-actions github-actions bot added the status: ready to merge Automatically applied to a pull when a pull is approved. Indicates ready for merging. label May 17, 2024
@gigitux
Copy link
Contributor Author

gigitux commented May 17, 2024

Works like a charm! I could reproduce the issue on my end when running the build script with the wrong node version. I left one minor comment, but pre-approving.

Thanks for the review! I added the troubleshooting message! Great suggestion!

@gigitux gigitux merged commit 61f976e into trunk May 17, 2024
7 checks passed
@gigitux gigitux deleted the fix/sanity-check-before-zip-file branch May 17, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready to merge Automatically applied to a pull when a pull is approved. Indicates ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants