Skip to content

feat: support npm workspaces for local development#185

Open
arbrandes wants to merge 3 commits intoopenedx:mainfrom
arbrandes:workspaces-dev
Open

feat: support npm workspaces for local development#185
arbrandes wants to merge 3 commits intoopenedx:mainfrom
arbrandes:workspaces-dev

Conversation

@arbrandes
Copy link
Contributor

@arbrandes arbrandes commented Mar 12, 2026

Description

This adds npm workspace support to frontend-base and documents how frontend apps should set up workspaces for local development.

The build Makefile target no longer depends on clean, allowing incremental rebuilds — particularly in workspace mode, where a watcher triggers build on every change. It also sets the executable bit on all bin entry points after compilation, since tsc doesn't preserve it and npm doesn't bin-link workspace packages during install.

The pack:watch and docs:watch scripts are renamed to watch:pack and watch:docs for consistency with the watch:build convention that turbo uses, and nodemon.pack.json is consolidated into nodemon.json.

The migration guide gains a full "Set up npm workspaces" section covering turbo config, nodemon, Makefile targets with a bin-linking workaround, and bind-mount usage instructions.

LLM usage notice

Built with assistance from Claude models (mostly Opus 4.6).

@arbrandes arbrandes marked this pull request as draft March 12, 2026 00:14
@arbrandes arbrandes force-pushed the workspaces-dev branch 2 times, most recently from 7af2983 to 7fd4dc4 Compare March 12, 2026 12:10
@arbrandes arbrandes force-pushed the workspaces-dev branch 2 times, most recently from 9b9827a to 99b6a94 Compare March 12, 2026 20:26
Decouple clean from build in the Makefile so that watch mode can
rebuild without wiping dist/.  Add nodemon.json and watch:build,
watch:docs, watch:pack scripts to standardize file watching.

Part of openedx#184

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@arbrandes arbrandes marked this pull request as ready for review March 16, 2026 17:05
tsc doesn't preserve the executable bit from source files, which
means bin entry points won't work when the package is installed
via npm workspaces (unlike registry installs, where npm sets +x
automatically).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
npm skips bin-linking for workspace packages during install, so the
openedx CLI from frontend-base isn't available in node_modules/.bin.
Document the workaround.

Co-Authored-By: Claude Opus 4.6 <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