diff --git a/.github/workflows/marketplace-publish.yml b/.github/workflows/marketplace-publish.yml index 5a88e61dc2..1aa6815205 100644 --- a/.github/workflows/marketplace-publish.yml +++ b/.github/workflows/marketplace-publish.yml @@ -36,7 +36,7 @@ jobs: - name: Package Extension run: | current_package_version=$(node -p "require('./src/package.json').version") - pnpm build + pnpm vsix # Save VSIX contents to a temporary file to avoid broken pipe issues. unzip -l bin/roo-cline-${current_package_version}.vsix > /tmp/roo-code-vsix-contents.txt diff --git a/.github/workflows/nightly-publish.yml b/.github/workflows/nightly-publish.yml index 011d1df3f1..d3c6076740 100644 --- a/.github/workflows/nightly-publish.yml +++ b/.github/workflows/nightly-publish.yml @@ -46,7 +46,7 @@ jobs: console.log(`🔖 Nightly version set to ${pkg.version}`); EOF - name: Build VSIX - run: pnpm build:nightly # Produces bin/roo-code-nightly-0.0.[count].vsix + run: pnpm vsix:nightly # Produces bin/roo-code-nightly-0.0.[count].vsix - name: Publish to VS Code Marketplace env: VSCE_PAT: ${{ secrets.VSCE_PAT }} diff --git a/MONOREPO.md b/MONOREPO.md index f436b116eb..e7f48ec740 100644 --- a/MONOREPO.md +++ b/MONOREPO.md @@ -24,7 +24,7 @@ pnpm install If things are in good working order then you should be able to build a vsix and install it in VSCode: ```sh -pnpm build -- --out ../bin/roo-code-main.vsix && \ +pnpm vsix -- --out ../bin/roo-code-main.vsix && \ code --install-extension bin/roo-code-main.vsix ``` @@ -34,9 +34,40 @@ To fully stress the monorepo setup, run the following: pnpm clean && pnpm lint pnpm clean && pnpm check-types pnpm clean && pnpm test -pnpm clean && pnpm bundle pnpm clean && pnpm build +pnpm clean && pnpm bundle +pnpm clean && pnpm bundle:nightly + pnpm clean && pnpm npx turbo watch:bundle pnpm clean && pnpm npx turbo watch:tsc -cd apps/vscode-e2e && pnpm test:ci + +pnpm --filter @roo-code/vscode-e2e test:ci + +pnpm clean && \ + pnpm vsix -- --out ../bin/roo-code.vsix && \ + code --install-extension bin/roo-code.vsix + +pnpm clean && \ + pnpm vsix:nightly -- --out ../../../bin/roo-code-nightly.vsix && \ + code --install-extension bin/roo-code-nightly.vsix ``` + +### Turborepo + +Note that this excludes the `build` task for next.js apps (@roo-code/web-\*). + +Tasks: `build` -> `bundle` -> `vsix` + +build: + +- `@roo-code/build` [input: src, package.json, tsconfig.json | output: dist] +- `@roo-code/types` [input: src, package.json, tsconfig.json, tsup.config.ts | output: dist] +- `@roo-code/webview-ui` [input: src, package.json, tsconfig.json, vite.config.ts | output: ../src/webview-ui] + +bundle: + +- `roo-cline` [input: * | output: dist] + +vsix: + +- `roo-cline` [input: dist | output: bin] diff --git a/README.md b/README.md index c4712518da..76a000f502 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ Changes to the webview will appear immediately. Changes to the core extension wi Alternatively you can build a .vsix and install it directly in VSCode: ```sh -pnpm build +pnpm vsix ``` A `.vsix` file will appear in the `bin/` directory which can be installed with: diff --git a/apps/vscode-nightly/esbuild.mjs b/apps/vscode-nightly/esbuild.mjs index d4302fc100..e45dbd3c3e 100644 --- a/apps/vscode-nightly/esbuild.mjs +++ b/apps/vscode-nightly/esbuild.mjs @@ -48,10 +48,9 @@ async function main() { console.log(`[${name}] buildDir: ${buildDir}`) console.log(`[${name}] distDir: ${distDir}`) - // Clean build directory before starting new build - if (fs.existsSync(buildDir)) { - console.log(`[${name}] Cleaning build directory: ${buildDir}`) - fs.rmSync(buildDir, { recursive: true, force: true }) + if (fs.existsSync(distDir)) { + console.log(`[${name}] Cleaning dist directory: ${distDir}`) + fs.rmSync(distDir, { recursive: true, force: true }) } /** diff --git a/apps/vscode-nightly/turbo.json b/apps/vscode-nightly/turbo.json new file mode 100644 index 0000000000..543e55aaf7 --- /dev/null +++ b/apps/vscode-nightly/turbo.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"], + "tasks": { + "bundle:nightly": { + "dependsOn": ["^build", "@roo-code/vscode-webview#build:nightly"], + "outputs": ["build/**"] + }, + "vsix:nightly": { + "dependsOn": ["bundle:nightly"], + "inputs": ["build/**"], + "outputs": ["../../../bin/**"] + } + } +} diff --git a/apps/web-evals/next.config.ts b/apps/web-evals/next.config.ts index 9da1646d2a..08ed853fc3 100644 --- a/apps/web-evals/next.config.ts +++ b/apps/web-evals/next.config.ts @@ -1,7 +1,10 @@ import type { NextConfig } from "next" const nextConfig: NextConfig = { - /* config options here */ + webpack: (config) => { + config.resolve.extensionAlias = { ".js": [".ts", ".tsx", ".js", ".jsx"] } + return config + }, } export default nextConfig diff --git a/apps/web-evals/package.json b/apps/web-evals/package.json index 36d7facc28..ed09abe6e3 100644 --- a/apps/web-evals/package.json +++ b/apps/web-evals/package.json @@ -1,6 +1,7 @@ { "name": "@roo-code/web-evals", - "private": true, + "version": "0.0.0", + "type": "module", "scripts": { "lint": "next lint", "check-types": "tsc -b", diff --git a/apps/web-evals/turbo.json b/apps/web-evals/turbo.json new file mode 100644 index 0000000000..8ebadcb020 --- /dev/null +++ b/apps/web-evals/turbo.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"], + "tasks": { + "build": { + "outputs": [".next/**"], + "inputs": ["src/**", "package.json", "tsconfig.json", "next.config.ts"] + } + } +} diff --git a/apps/web-roo-code/turbo.json b/apps/web-roo-code/turbo.json new file mode 100644 index 0000000000..8ebadcb020 --- /dev/null +++ b/apps/web-roo-code/turbo.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"], + "tasks": { + "build": { + "outputs": [".next/**"], + "inputs": ["src/**", "package.json", "tsconfig.json", "next.config.ts"] + } + } +} diff --git a/package.json b/package.json index d2141ddfc3..47afde03ec 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,11 @@ "check-types": "turbo check-types --log-order grouped --output-logs new-only", "test": "turbo test --log-order grouped --output-logs new-only", "format": "turbo format --log-order grouped --output-logs new-only", + "build": "turbo build --log-order grouped --output-logs new-only", "bundle": "turbo bundle --log-order grouped --output-logs new-only", "bundle:nightly": "turbo bundle:nightly --log-order grouped --output-logs new-only", - "build": "turbo vsix --log-order grouped --output-logs new-only", - "build:nightly": "turbo vsix:nightly --log-order grouped --output-logs new-only", + "vsix": "turbo vsix --log-order grouped --output-logs new-only", + "vsix:nightly": "turbo vsix:nightly --log-order grouped --output-logs new-only", "clean": "turbo clean --log-order grouped --output-logs new-only && rimraf dist out bin .vite-port .turbo", "changeset:version": "cp CHANGELOG.md src/CHANGELOG.md && changeset version && cp -vf src/CHANGELOG.md .", "knip": "knip --include files", diff --git a/src/package.json b/src/package.json index ac8563de21..ed12c22a65 100644 --- a/src/package.json +++ b/src/package.json @@ -350,7 +350,7 @@ "publish:marketplace": "vsce publish --no-dependencies && ovsx publish --no-dependencies", "watch:bundle": "pnpm bundle --watch", "watch:tsc": "tsc --noEmit --watch --project tsconfig.json", - "clean": "rimraf README.md CHANGELOG.md LICENSE dist webview-ui out mock .turbo" + "clean": "rimraf README.md CHANGELOG.md LICENSE dist mock .turbo" }, "dependencies": { "@anthropic-ai/bedrock-sdk": "^0.10.2", diff --git a/src/turbo.json b/src/turbo.json new file mode 100644 index 0000000000..d4b2ab3ffd --- /dev/null +++ b/src/turbo.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"], + "tasks": { + "bundle": { + "dependsOn": ["^build", "@roo-code/vscode-webview#build"], + "outputs": ["dist/**"] + }, + "vsix": { + "dependsOn": ["bundle"], + "inputs": ["dist/**"], + "outputs": ["../bin/**"] + }, + "watch:bundle": { + "dependsOn": ["@roo-code/build#build", "@roo-code/types#build"], + "cache": false + } + } +} diff --git a/turbo.json b/turbo.json index ea05254302..7079455464 100644 --- a/turbo.json +++ b/turbo.json @@ -12,28 +12,7 @@ }, "build": { "outputs": ["dist/**"], - "inputs": ["src/**", "package.json", "tsconfig.json", "tsup.config.ts"] - }, - "build:nightly": {}, - "bundle": { - "dependsOn": ["^build"], - "cache": false - }, - "bundle:nightly": { - "dependsOn": ["^build"], - "cache": false - }, - "vsix": { - "dependsOn": ["bundle", "@roo-code/vscode-webview#build"], - "cache": false - }, - "vsix:nightly": { - "dependsOn": ["bundle:nightly", "@roo-code/vscode-webview#build:nightly"], - "cache": false - }, - "watch:bundle": { - "dependsOn": ["@roo-code/build#build", "@roo-code/types#build"], - "cache": false + "inputs": ["src/**", "package.json", "tsconfig.json", "tsup.config.ts", "vite.config.ts"] }, "watch:tsc": { "cache": false diff --git a/webview-ui/package.json b/webview-ui/package.json index 28b35c79e4..f72496b8c5 100644 --- a/webview-ui/package.json +++ b/webview-ui/package.json @@ -14,7 +14,7 @@ "preview": "vite preview", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", - "clean": "rimraf build tsconfig.tsbuildinfo .turbo" + "clean": "rimraf ../src/webview-ui/build ../apps/vscode-nightly/build/webview-ui tsconfig.tsbuildinfo .turbo" }, "dependencies": { "@radix-ui/react-alert-dialog": "^1.1.6", diff --git a/webview-ui/turbo.json b/webview-ui/turbo.json new file mode 100644 index 0000000000..048b913add --- /dev/null +++ b/webview-ui/turbo.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"], + "tasks": { + "build": { + "outputs": ["../src/webview-ui/**"] + }, + "build:nightly": { + "outputs": ["../apps/vscode-nightly/build/webview-ui/**"] + } + } +}