Skip to content

Move three and glsl-parser to dependencies so BB installs build - #8

Closed
alexandre-vl wants to merge 1 commit into
ComicBit:mainfrom
alexandre-vl:fix/bb-install-runtime-deps
Closed

alexandre-vl wants to merge 1 commit into
ComicBit:mainfrom
alexandre-vl:fix/bb-install-runtime-deps

Conversation

@alexandre-vl

Copy link
Copy Markdown
Contributor

Fixes #7.

three (Scene: ui/components/sceneAssets.ts, sceneWorld.ts) and @shaderfrog/glsl-parser (core/glsl-parser.js) are imported at runtime but listed under devDependencies. BB installs a git plugin with npm install --omit=dev --omit=optional --ignore-scripts, so neither reaches the build, and installing 0.2.0 or main through BB fails with Could not resolve "three".

This moves both to dependencies. In package-lock.json only the root entry and the two packages' dev flags change.

Tested on bb 0.46.1

  • BB's real install: bb plugin install git:https://github.com/alexandre-vl/bb-plugin-genui.git@fix/bb-install-runtime-deps gives [email protected] running. The same command on main fails with the 13 three errors quoted in Can't install 0.2.0 or main through BB: three and @shaderfrog/glsl-parser are devDependencies #7.
  • BB's dependency step, then bb plugin build: main and v0.2.0 fail as published and exit 0 with this change. Moving only glsl-parser still fails on three (13 errors), so both moves are needed.
  • The repo's own checks (npm ci, tsc --noEmit, vitest run) give the same result as main: the lockfile is in sync, there are 0 type errors, and all 956 tests in 81 files pass.
  • The image viewer this unblocks (b6e23a0), clicked in a real thread and in the gallery at desktop and iPhone sizes: it opens, fits the picture (1056×528, its full size, on desktop), two Zoom-ins give ×2.25, and Escape closes it, with no page errors.

Root cause: BB installs a git plugin with npm install --omit=dev
--omit=optional --ignore-scripts, so nothing under devDependencies
reaches its build. Scene imports three (ui/components/sceneAssets.ts,
sceneWorld.ts) and core/glsl-parser.js imports @shaderfrog/glsl-parser
at runtime, so installing 0.2.0 or main through BB fails with
"Could not resolve" errors and only 0.1.0 installs.

Fix: both sit under dependencies; package-lock.json only drops their
dev flags. The other devDependencies the code imports (clsx, sonner,
the radix dialog, better-sqlite3, the SDK, ...) are supplied by BB.

Fixes ComicBit#7
@ComicBit

Copy link
Copy Markdown
Owner

Thanks for tracking this down. The diagnosis was spot on: BB installs git plugins with npm install --omit=dev --omit=optional --ignore-scripts, so three and @shaderfrog/glsl-parser never reached the build.

The same fix shipped in 0.2.5 (da56158, "install from GitHub again"), which moved both packages to dependencies. On current main, a clean copy installed with BB's command builds with bb plugin build, so merging this would be a no-op. Closing it as superseded.

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.

Can't install 0.2.0 or main through BB: three and @shaderfrog/glsl-parser are devDependencies

2 participants