Skip to content

fix(demo): auto-install demo deps in root dev script - #12

Merged
adeelraza merged 1 commit into
mainfrom
claude/react-image-editor-issue-c24fd3
Jul 28, 2026
Merged

fix(demo): auto-install demo deps in root dev script#12
adeelraza merged 1 commit into
mainfrom
claude/react-image-editor-issue-c24fd3

Conversation

@adeelraza

Copy link
Copy Markdown
Contributor

Summary

Fixes #8 — a fresh clone fails to start the demo with the root dev script.

The root dev script delegated to the demo's vite (npm --prefix demo run dev) without ensuring the demo's dependencies were installed. Because the root and demo/ are separate npm projects (no workspaces; demo/ has its own package.json + lockfile), a root npm install never installs @vitejs/plugin-react — which demo/vite.config.ts imports at config-load time.

Result on a fresh clone:

npm install
npm run dev
# → Cannot find package '@vitejs/plugin-react'

Fix

Prepend an idempotent install to the root dev script:

- "dev": "npm --prefix demo run dev",
+ "dev": "npm --prefix demo install && npm --prefix demo run dev",
  • Idempotent — npm no-ops when demo deps already match the lockfile, so repeat runs stay fast.
  • Mirrors the existing netlify-build script, which already runs cd demo && npm install before building.

The README and CONTRIBUTING docs already document cd demo && npm install && npm run dev, so this change closes the gap for the root-level dev script specifically.

Test plan

  • Fresh clone → npm install (root) → npm run dev starts the demo without a separate cd demo && npm install.

The root `dev` script delegated to demo's vite without ensuring demo's
dependencies were installed. A fresh clone + root `npm install` +
`npm run dev` failed with "Cannot find package '@vitejs/plugin-react'"
since demo is a separate npm project with its own lockfile.

Prepend `npm --prefix demo install` (idempotent) so the demo starts
without a separate manual install step.

Closes #8
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-image-editor Ready Ready Preview, Comment Jul 28, 2026 1:57pm

Request Review

@adeelraza
adeelraza merged commit abb8db9 into main Jul 28, 2026
9 checks passed
@adeelraza
adeelraza deleted the claude/react-image-editor-issue-c24fd3 branch July 28, 2026 14:27
@adeelraza adeelraza mentioned this pull request Jul 28, 2026
5 tasks
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.

Fresh clone requires an additional npm install in demo/ before npm run dev works

1 participant