Skip to content

Standardize the UI toolchain on npm and fix dependency classification - #50

Open
amc-corey-cox wants to merge 5 commits into
mainfrom
ui-toolchain-npm
Open

amc-corey-cox wants to merge 5 commits into
mainfrom
ui-toolchain-npm

Conversation

@amc-corey-cox

Copy link
Copy Markdown
Member

Two pieces of scaffold cruft that are getting in the way of the packaging work in #44 and tis-lab/bdc-dp-core#4. Both date to the original March scaffold and are mine.

Build tooling was declared as runtime dependencies. vite, @vitejs/plugin-react, recharts, and @nivo/sankey sat in dependencies, so every consumer of the published @tis-lab/study-palette-ui installed the whole Vite toolchain. In bdc-dp-core that was 127 extra packages — vite, esbuild, and every @esbuild/* and @rollup/rollup-* platform binary. None are needed at runtime: the library build inlines recharts and nivo into lib/index.js, and vite is build-only. react/react-dom are deliberately left alone, since clean-ui is already moving those.

The repo had two package managers. The UI has been developed and published with npm since September, but CI, the Netlify build, and ./dev still ran bun, and ui/bun.lock hadn't been touched since March — it still named the package unscoped with only react and react-dom in it. bun install runs unfrozen, so CI stayed green while validating a dependency graph nobody ships. That divergence is what hid a build:lib failure under bun (ajv@6 hoisted over ajv-draft-04's ajv@8).

Netlify keeps its target, base, publish directory, redirects, and environment — only the package manager in the build command changes, so this doesn't touch the Cloudapps/OpenShift direction.

Verified locally on Node 22: npm ci → build → test (7 passed) → lint, all clean from a cold node_modules. The Netlify preview on this PR exercises the new build command directly.

vite, @vitejs/plugin-react, recharts, and @nivo/sankey were declared as runtime
dependencies, so anything consuming @tis-lab/study-palette-ui installed the whole
Vite toolchain. None are needed at runtime — the site build inlines recharts and
nivo, and vite is build-only.

Also ignore lib/, which the library build writes.
The UI has been developed and published with npm since September, but CI, the
Netlify build, and the dev script still ran bun, and the committed bun lockfiles
had not been updated since March. Two resolvers over one package.json meant CI
validated a dependency graph nobody ships.

Netlify keeps its target, base, publish dir, and redirects — only the package
manager in the build command changes.
Copilot AI lite review requested due to automatic review settings September 18, 2026 19:19
@netlify

netlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for study-palette ready!

Name Link
🔨 Latest commit 0de0d52
🔍 Latest deploy log https://app.netlify.com/projects/study-palette/deploys/6ab6925c6a558600076a45cc
😎 Deploy Preview https://deploy-preview-50--study-palette.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Dependencies imported by non-test UI source (recharts, @nivo/sankey) were moved to devDependencies, which can break production/consumer installs that omit dev deps unless the build/publish pipeline explicitly bundles them.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR standardizes the UI workflow on npm (removing bun from CI/Netlify/local dev) and adjusts dependency classification in ui/package.json/ui/package-lock.json to avoid shipping build tooling as runtime dependencies.

Changes:

  • Move vite / @vitejs/plugin-react (and some UI libs) out of dependencies and into devDependencies, updating the lockfile accordingly.
  • Remove ui/bun.lock and switch CI (test-frontend), Netlify, and ./dev to use Node 22 + npm (npm ci, npm run ...).
  • Ignore lib/ in .gitignore.
File summaries
File Description
ui/package.json Reclassifies runtime vs dev dependencies for the UI package.
ui/package-lock.json Regenerates lockfile to reflect dependency section changes.
ui/bun.lock Removes bun lockfile to eliminate dual package-manager drift.
netlify.toml Switches Netlify build command from bun to npm.
dev Updates local dev bootstrap/run commands to npm.
.gitignore Adds lib/ to ignored build artifacts.
.github/workflows/test-frontend.yaml Switches CI setup from bun to Node 22 + npm, with npm caching.
Review details

Files not reviewed (1)

  • ui/package-lock.json: Generated file
  • Files reviewed: 4/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ui/package.json
@amc-corey-cox

Copy link
Copy Markdown
Member Author

@yn-huang @varun-divya — Yinuo, thanks for pulling react and react-dom out of dependencies in clean-ui. That was my mess from the original scaffold, and this PR is really just finishing the same job with the other four.

Flagging a merge conflict it creates with #44, because it's the kind that's easy to resolve wrong.

Once #44 is in clean-ui and this is in main, merging clean-ui into main conflicts in ui/package.json and ui/package-lock.json. The clean-ui side of that conflict still has vite, recharts, and @nivo/sankey under dependencies — so resolving it with "take theirs" quietly undoes this PR, and nothing fails to tell you.

It's a union, not a pick:

  • dependencies ends up empty — react/react-dom stay in devDependencies + peerDependencies the way clean-ui has them
  • devDependencies takes both sides: @microsoft/api-extractor, @types/node, react, react-dom, vite-plugin-dts from clean-ui, plus @nivo/sankey, @vitejs/plugin-react, recharts, vite from here
  • don't hand-resolve ui/package-lock.json — run npm install after and commit the result

Happy to take that merge myself if it's easier.

Copilot AI review requested due to automatic review settings September 22, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The package currently uses React 19 in devDependencies while peerDependencies only allow React 18, which can cause peer install failures/warnings for React 19 consumers.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread ui/package.json
Copilot AI review requested due to automatic review settings September 25, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes are cohesive and low-risk (dependency classification + toolchain standardization) and the updated workflow already scopes npm commands to ./ui.

Review effort: Lite
Findings: None

Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 25, 2026 15:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes consistently migrate tooling from bun to npm across CI/Netlify/dev and the dependency reclassification aligns with the package’s described build/publish model without introducing inconsistencies in the reviewed configuration.

Review effort: Lite
Findings: None

@yn-huang yn-huang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me, thanks for the cleanup Corey!

This branch has not been deployed

No deployments
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