Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 203a6eb

Browse files
committed
feat: add serve:rebuild command for quick extension updates
Adds a --rebuild-only flag to the serve script that: - Rebuilds and reinstalls the extension - Skips starting code-server - Provides instructions to reload the window Usage: pnpm serve:rebuild
1 parent 32d34c2 commit 203a6eb

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"install:vsix": "pnpm install --frozen-lockfile && pnpm clean && pnpm vsix && node scripts/install-vsix.js",
2323
"install:vsix:nightly": "pnpm install --frozen-lockfile && pnpm clean && pnpm vsix:nightly && node scripts/install-vsix.js --nightly",
2424
"serve": "node scripts/serve.js",
25+
"serve:rebuild": "node scripts/serve.js --rebuild-only",
2526
"changeset:version": "cp CHANGELOG.md src/CHANGELOG.md && changeset version && cp -vf src/CHANGELOG.md .",
2627
"knip": "knip --include files",
2728
"evals": "dotenvx run -f packages/evals/.env.development packages/evals/.env.local -- docker compose -f packages/evals/docker-compose.yml --profile server --profile runner up --build --scale runner=0",

scripts/serve.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
* brew install code-server
99
*
1010
* Usage:
11-
* pnpm serve
11+
* pnpm serve # Build, install, and start code-server
12+
* pnpm serve:rebuild # Only rebuild and reinstall the extension
1213
*
1314
* The script will:
1415
* 1. Check if code-server is installed
1516
* 2. Build the vsix (pnpm vsix)
1617
* 3. Install the vsix into code-server
1718
* 4. Configure user settings (disable welcome tab)
18-
* 5. Start code-server on http://127.0.0.1:8080
19+
* 5. Start code-server on http://127.0.0.1:8080 (unless --rebuild-only)
1920
*
2021
* Your password is stored in ~/.config/code-server/config.yaml
2122
*/
@@ -35,6 +36,9 @@ const RED = "\x1b[31m"
3536
// Build vsix to a fixed path in temp directory
3637
const VSIX_PATH = path.join(os.tmpdir(), "roo-code-serve.vsix")
3738

39+
// Parse command line flags
40+
const rebuildOnly = process.argv.includes("--rebuild-only")
41+
3842
function log(message) {
3943
console.log(`${CYAN}[serve]${RESET} ${message}`)
4044
}
@@ -93,7 +97,8 @@ function ensureUserSettings() {
9397
}
9498

9599
async function main() {
96-
console.log(`\n${BOLD}🚀 Roo Code - code-server Development Server${RESET}\n`)
100+
const title = rebuildOnly ? "Roo Code - Rebuild Extension" : "Roo Code - code-server Development Server"
101+
console.log(`\n${BOLD}🚀 ${title}${RESET}\n`)
97102

98103
// Step 1: Check if code-server is installed
99104
log("Checking for code-server...")
@@ -130,6 +135,14 @@ async function main() {
130135
ensureUserSettings()
131136
logSuccess("User settings configured (welcome tab disabled)")
132137

138+
// If rebuild-only mode, exit here
139+
if (rebuildOnly) {
140+
console.log(`\n${GREEN}✓ Extension rebuilt and installed.${RESET}`)
141+
console.log(` Reload the code-server window to pick up changes.`)
142+
console.log(` (Cmd+Shift+P → "Developer: Reload Window")\n`)
143+
return
144+
}
145+
133146
// Step 5: Start code-server
134147
const cwd = process.cwd()
135148
console.log(`\n${BOLD}Starting code-server...${RESET}`)

0 commit comments

Comments
 (0)