This package contains Cloudflare's fork VSCode for Web, to support web editing of Workers. This package primarily contains code and setup for building VSCode for web, but it can also be used for development.
- You must switch your NodeJS version to NodeJS 18 (using a tool like nvm). VSCode's build process requires this. For instance, if you use
nvm
, runningnvm use
would be enough to switch to the correct NodeJS version. - Run
pnpm install
- Run
pnpm run setup
, which will install dependencies, clone VSCode (currently v1.85.2), apply the patches specified in./patches
, and symlink the top level packages withinworkers-sdk
. - Run
pnpm run dev
. This will start various dev servers for VSCode andquick-edit-extension
. Note, this takes a long time to start up. Expect up to 3 minutes, although reloads will be much faster. You can access the VSCode dev server athttp://localhost:8788
Follow steps (1), (2) and (3) from above, and then run pnpm run custom:build
Deployments are managed by GitHub Actions:
- deploy-pages-previews.yml:
- Runs on any PR that has the
preview:quick-edit
label. - Deploys a preview, which can then be accessed via [https://.quick-edit-cny.pages.dev/].
- Runs on any PR that has the
- changesets.yml:
- Runs when a "Version Packages" PR, containing a changeset that touches this package, is merged to
main
. - Deploys this package to production, which can then be accessed via [https://quick-edit-cny.pages.dev/].
- Runs when a "Version Packages" PR, containing a changeset that touches this package, is merged to
If you need to add additional patches to VSCode, ensure you've run pnpm run setup
. Then:
- Make your changes in the checked out VSCode in
vendor/vscode
. - Commit your changes with
git commit -m "YOUR MESSAGE" --no-verify
(run this in thevendor/vscode
directory). - Prepare a new series of patches for VSCode with (again, run in the
vendor/vscode
directory)git format-patch -o ../../packages/quick-edit/patches base
.
If you need to change VSCode's configuration, open the packages/quick-edit/functions/_middleware.ts
file.
The WORKBENCH_WEB_CONFIGURATION
object contains VSCode's setup config, but the property configurationDefaults
is most relevant, since it lets you set defaults for any VSCode settings. The format is exactly the same as VSCode's settings.json
file.