Add prepare and pretest lifecycle scripts to auto-build dist/#65
Merged
sridhar-mani merged 2 commits intovtkjsfrom Mar 9, 2026
Merged
Add prepare and pretest lifecycle scripts to auto-build dist/#65sridhar-mani merged 2 commits intovtkjsfrom
prepare and pretest lifecycle scripts to auto-build dist/#65sridhar-mani merged 2 commits intovtkjsfrom
Conversation
Co-authored-by: sridhar-mani <165501918+sridhar-mani@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Work in progress on converting Plotly to VTK.js and removing dist folder
Add Mar 9, 2026
prepare and pretest lifecycle scripts to auto-build dist/
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures dist/ is generated automatically so installs/tests don’t fail now that built artifacts are no longer committed, aligning package entrypoints (main/module/exports) with the on-disk build output.
Changes:
- Add an npm
preparescript to builddist/after install (notably for Git-based installs). - Add an npm
pretestscript to builddist/before running example-based tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "scripts": { | ||
| "build": "rollup -c", | ||
| "prepare": "npm run build", | ||
| "prepublishOnly": "npm run build", |
There was a problem hiding this comment.
With prepare added, npm publish / npm pack will also run the build via prepare (npm lifecycle), so keeping prepublishOnly will typically run the build twice during publishing. Consider removing prepublishOnly (or prepare) to avoid redundant builds and potential non-deterministic artifact differences.
Suggested change
| "prepublishOnly": "npm run build", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
dist/removed from the repo,npm testand Git-based installs fail becausemain/module/exportsreference./dist/*files that no longer exist without an explicit build step.Changes
prepare: triggersrollup -cafternpm install, covering both local development and direct Git installspretest: triggersrollup -cbeforenpm test, ensuringdist/is always present when examples run🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.