Skip to content

feat: support npm workspaces for local development#185

Merged
arbrandes merged 1 commit intoopenedx:mainfrom
arbrandes:workspaces-dev
Apr 2, 2026
Merged

feat: support npm workspaces for local development#185
arbrandes merged 1 commit intoopenedx:mainfrom
arbrandes:workspaces-dev

Conversation

@arbrandes
Copy link
Copy Markdown
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
Comment thread docs/how_tos/migrate-frontend-app.md Outdated
@arbrandes arbrandes force-pushed the workspaces-dev branch 3 times, most recently from 99b6a94 to b13dabc Compare March 13, 2026 17:53
@arbrandes arbrandes marked this pull request as ready for review March 16, 2026 17:05
@arbrandes arbrandes force-pushed the workspaces-dev branch 4 times, most recently from dc52c84 to d6076ab Compare March 24, 2026 17:10
@arbrandes arbrandes force-pushed the workspaces-dev branch 4 times, most recently from 7bf03c4 to 9a339b9 Compare March 26, 2026 18:55
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.

Also, ensure bin entry points are executable after build, and add
bin-linking workaround to migration guide.

Part of openedx#184

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@brian-smith-tcril
Copy link
Copy Markdown
Contributor

I see this isn't touching test-site, does that need any changes (similar to the ones in openedx/frontend-template-site#7)?

@arbrandes
Copy link
Copy Markdown
Contributor Author

arbrandes commented Mar 31, 2026

@brian-smith-tcril

this isn't touching test-site

This is intentional. I see no reason to mess with the pack -> install -> build workflow in CI, which is test-site's primary purpose. (I have no idea if workspaces work for a parent directory, and it's not really important to find out, methinks.)

@arbrandes arbrandes merged commit 107ce45 into openedx:main Apr 2, 2026
5 checks passed
@arbrandes arbrandes deleted the workspaces-dev branch April 2, 2026 16:48
@openedx-semantic-release-bot
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-alpha.18 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants