Skip to content

Link script#42

Open
Tainan404 wants to merge 3 commits into
mainfrom
link-script
Open

Link script#42
Tainan404 wants to merge 3 commits into
mainfrom
link-script

Conversation

@Tainan404
Copy link
Copy Markdown
Member

Add a TypeScript dev script (scripts/tldraw-dev.ts) that automates the full build-and-link workflow for developing tldraw inside BigBlueButton: it builds the package, publishes
to a local yalc store, relinks it into the BBB HTML5 client via yalc remove/yalc add/npm install, and touches the webpack entry point to trigger a hot rebuild. The script
exposes setup, rebuild, watch, and show commands via Commander, uses Ora for terminal feedback, and resolves the BBB HTML5 path from a CLI flag, env var, config file, or
default sibling directory (in that priority order). A companion buildInfo.ts file stamped with a unique build ID on every run lets the browser console confirm which build is
loaded. Also adds a dev-bbb script to package.json for convenience.

Usage

# First-time setup — build, publish to yalc, and link into BBB
yarn dev-bbb setup

# Explicitly point to your BBB HTML5 directory
yarn dev-bbb setup --bbb-html5 /path/to/bigbluebutton-html5

# Or persist the path in a config file so you never have to pass it again
echo 'BBB_HTML5_DIR=/path/to/bigbluebutton-html5' > .tldraw-dev.conf
yarn dev-bbb setup

# Rebuild after a manual change
yarn dev-bbb rebuild

# Watch mode — rebuilds automatically whenever a source file changes
yarn dev-bbb watch

# Print resolved paths without building (useful for debugging)
yarn dev-bbb show

Path resolution priority (highest → lowest):

  1. --bbb-html5 CLI flag
  2. BBB_HTML5_DIR environment variable
  3. BBB_HTML5_DIR in .tldraw-dev.conf (repo root)
  4. ../../bigbluebutton/bigbluebutton-html5 (default sibling path)

Change Type

  • patch — Bug fix
  • minor — New feature
  • major — Breaking change
  • dependencies — Changes to package dependencies1
  • documentation — Changes to the documentation only2
  • tests — Changes to any test code only2
  • internal — Any other changes that don't affect the published package2
  • I don't know

Test Plan

  1. In the tldraw repo root, run yarn dev-bbb setup (or yarn dev-bbb setup --bbb-html5 <path> if BBB HTML5 is not at the default sibling path).
  2. Open the BBB whiteboard in the browser and check the DevTools console for [tldraw] build_id: build-<timestamp>.
  3. Edit any file under packages/tldraw/src/, then run yarn dev-bbb rebuild. Confirm the console logs a different build ID after webpack finishes.
  4. Run yarn dev-bbb watch, edit a source file, and confirm the rebuild happens automatically.
  5. Run yarn dev-bbb show and verify the printed paths match your environment.
  • Unit Tests
  • End to end tests

Release Notes

  • Added scripts/tldraw-dev.ts: a dev-only CLI tool to build tldraw and hot-link it into a local BigBlueButton instance using yalc, with file-watch mode for automatic rebuilds.

Depends on

bigbluebutton/bigbluebutton#25077

Footnotes

  1. publishes a patch release, for devDependencies use internal

  2. will not publish a new version 2 3

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