Skip to content

Modernize the dev toolchain on Bun; clear the 50 Dependabot alerts - #33

Merged
cinderblock merged 4 commits into
masterfrom
modernize/2026
Nov 7, 2026
Merged

cinderblock merged 4 commits into
masterfrom
modernize/2026

Conversation

@cinderblock

Copy link
Copy Markdown
Owner

Clears the repo's 50 open Dependabot alerts by moving the dev toolchain to Bun. The published package doesn't change: dist/ built on this branch is byte-identical to the published react-smoothie@1.0.0, so no release is needed for this.

What changed

  • Bun-first toolchain. bun.lock replaces package-lock.json, which is where every open alert lived (webpack-dev-server, vite/vitest, undici via jsdom, fast-uri, launch-editor, proxy-addr, …). That drops webpack, webpack-cli, webpack-dev-server, ts-loader, html-webpack-plugin, nodemon, ts-node, vitest, jsdom and react-markdown. 60 packages remain, and bun audit reports no vulnerabilities.
  • Tests: the existing suite runs on bun:test with happy-dom (preload in src/test-setup.ts). All 14 tests pass. The only changes are swapping out the vi.* helpers and wrapping one mousemove in act().
  • Demo: bun run dev serves examples/index.html on Bun's built-in dev server (port 3456). Bun's bundler renders the README import to HTML, so react-markdown is gone.
  • Layout: sources move to src/. example.tsx moves to examples/SmoothieDemo.tsx.
  • TypeScript 7.0.2. rootDir: "src" and strict: false are pinned because TS 6+ changed both defaults. That keeps the output paths and the .d.ts shape identical to 1.0.0.
  • CI (ci.yml): typecheck, Prettier, tests and build on Ubuntu and Windows with React 19, plus a React 18 leg. A package job runs npm pack, which builds through prepare the same way a git install does, then installs the tarball into a bare consumer and checks that both require() and import() load under Node 24.
  • Publish (npm.yml): now runs only on v* tags. It tests with Bun, publishes with npm publish --provenance via Trusted Publishing (next dist-tag for prereleases, as before), then creates the GitHub Release.
  • dependabot.yml: weekly grouped bun and github-actions updates, ignoring @types/node majors.
  • Line endings and editor config: .gitattributes (* text=auto); Prettier endOfLine: auto. Removed .npmrc (engine-strict with no engines field did nothing).
  • README: bun/npm install, the react peer dependency, modern function/class examples instead of React.createClass, a note that chart options are read only at mount (Additional properties #14), a Development section and an Unreleased changelog entry.

Consumer-facing changes

None to the runtime API, exports, types, exports map, peer range or dependencies. The only tarball difference is the demo's path: example.tsx becomes examples/SmoothieDemo.tsx.

Choices made (the plan was stale)

plans/react-smoothie.md was written in May, before the 0.14.0 and 1.0.0 releases you made by hand in July. Where it conflicted with what's already published, I kept the published 1.0.0 contract:

  1. smoothie stays a dependency (^1.36.1), not the peer dependency the plan proposed. Moving it would break consumers who don't install smoothie themselves.
  2. The React peer range stays >=16.8, not the plan's ^17 || ^18 || ^19.
  3. Classic JSX (jsx: react) stays, not react-jsx (plan open question 2). react/jsx-runtime doesn't exist in React 16.8–16.13, which the peer range allows.
  4. Kept example.tsx, moved it to examples/SmoothieDemo.tsx, and still ship it (plan open question 4). The README links to it.
  5. The publish workflow keeps the name npm.yml, not the plan's publish.yml. The Trusted Publisher entry on npm names the workflow file, so renaming it would break publishing until npm is reconfigured. That also settles open question 1: Trusted Publishing is already live.
  6. Kept prepare so npm i cinderblock/react-smoothie git installs still build. build uses only node and tsc, so it works under both npm and bun.
  7. No version bump and no tag. The shipped output is unchanged, so there's nothing to release.
  8. Issue Additional properties #14 is not addressed (Phase 2, per the plan). Plan open question 3, its priority, is left to you.

How I verified it

  • bun run typecheck, bun run format:check, bun test (14/14) and bun run build pass on Windows. bun test also passes with React 18.3.1.
  • diff -r of dist/ from bun run build and from npm pack against the published react-smoothie@1.0.0 tarball: identical.
  • I installed the packed tarball into a scratch consumer. require('react-smoothie') and import('react-smoothie') both load under Node with the same six exports.
  • bun run dev, loaded in headless Chromium: all 10 canvases draw, the README renders, no console errors.
  • bun audit: no vulnerabilities.

What's left

  • After merge, the 50 package-lock.json alerts should close as fixed, since that manifest is gone.
  • Close the superseded Dependabot PRs (after merge).
  • The v2 branch (uPlot rewrite) has its own bun.lock and an npm.yml that still runs CI. Expect conflicts in .github/workflows/npm.yml and README.md whenever v2 meets master.
  • Possible follow-ups, not done here: turn on strict (that changes the emitted .d.ts, so do it with care), and test React 16.8/17 (needs an older Testing Library).

Supersedes

#15, #17, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29. All are transitive bumps in the removed package-lock.json, apart from #26 (smoothie 1.35 → 1.36.1), which master already has: ^1.36.1, and this lock resolves 1.36.1.

🤖 Generated with Claude Code

cinderblock and others added 4 commits November 7, 2026 00:59
- bun.lock replaces package-lock.json (and the 50 dev-only Dependabot
  alerts pinned in it: webpack-dev-server, vite/vitest, undici, ...)
- Tests run on bun:test with happy-dom instead of vitest + jsdom; the
  suite is unchanged apart from the vi.* helpers and one act() wrap
- The demo runs on Bun's built-in HTML dev server (bun run dev, port
  3456); Bun renders the README import to HTML, so react-markdown goes
- Sources move to src/, the demo to examples/SmoothieDemo.tsx
- TypeScript 7; rootDir and strict pinned so dist/ is byte-identical
  to the published 1.0.0
- build stays runner-agnostic so git installs via npm still work

Consumer contract unchanged: same exports, types, peer range (react
>=16.8) and smoothie dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Git stores LF (* text=auto); editors and Prettier use the checkout's
native endings instead of forcing LF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ci.yml: typecheck, Prettier, tests and build on Ubuntu + Windows with
  React 19, plus a React 18 leg; a package job packs the tarball (via
  prepare, like a git install) and loads it with require() and import()
- npm.yml now only runs on v* tags: test with Bun, then npm publish
  --provenance via Trusted Publishing, then the GitHub Release. The
  file name stays because the npm trusted-publisher entry names it
- dependabot.yml: weekly grouped bun + github-actions updates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Install with bun or npm; spell out the react peer dependency
- Replace the React.createClass/string-ref examples with a function
  component and a class with createRef
- Note that chart options are read at mount (#14) and how to rebuild
- Development section for the Bun toolchain; Unreleased changelog entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant