Skip to content

Add prepare and pretest lifecycle scripts to auto-build dist/#65

Merged
sridhar-mani merged 2 commits intovtkjsfrom
copilot/sub-pr-64
Mar 9, 2026
Merged

Add prepare and pretest lifecycle scripts to auto-build dist/#65
sridhar-mani merged 2 commits intovtkjsfrom
copilot/sub-pr-64

Conversation

Copy link

Copilot AI commented Mar 9, 2026

With dist/ removed from the repo, npm test and Git-based installs fail because main/module/exports reference ./dist/* files that no longer exist without an explicit build step.

Changes

  • prepare: triggers rollup -c after npm install, covering both local development and direct Git installs
  • pretest: triggers rollup -c before npm test, ensuring dist/ is always present when examples run
"scripts": {
  "build": "rollup -c",
  "prepare": "npm run build",
  "prepublishOnly": "npm run build",
  "pretest": "npm run build",
  "test": "..."
}

🔒 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.

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 prepare and pretest lifecycle scripts to auto-build dist/ Mar 9, 2026
@sridhar-mani sridhar-mani marked this pull request as ready for review March 9, 2026 10:44
Copilot AI review requested due to automatic review settings March 9, 2026 10:44
@sridhar-mani sridhar-mani merged commit b30a882 into vtkjs Mar 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 prepare script to build dist/ after install (notably for Git-based installs).
  • Add an npm pretest script to build dist/ 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",
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

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",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants