Skip to content

Commit 73f3961

Browse files
authored
Improve turbo task dependency declarations (#4323)
1 parent 664346e commit 73f3961

File tree

16 files changed

+118
-38
lines changed

16 files changed

+118
-38
lines changed

.github/workflows/marketplace-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Package Extension
3737
run: |
3838
current_package_version=$(node -p "require('./src/package.json').version")
39-
pnpm build
39+
pnpm vsix
4040
4141
# Save VSIX contents to a temporary file to avoid broken pipe issues.
4242
unzip -l bin/roo-cline-${current_package_version}.vsix > /tmp/roo-code-vsix-contents.txt

.github/workflows/nightly-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
console.log(`🔖 Nightly version set to ${pkg.version}`);
4747
EOF
4848
- name: Build VSIX
49-
run: pnpm build:nightly # Produces bin/roo-code-nightly-0.0.[count].vsix
49+
run: pnpm vsix:nightly # Produces bin/roo-code-nightly-0.0.[count].vsix
5050
- name: Publish to VS Code Marketplace
5151
env:
5252
VSCE_PAT: ${{ secrets.VSCE_PAT }}

MONOREPO.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pnpm install
2424
If things are in good working order then you should be able to build a vsix and install it in VSCode:
2525

2626
```sh
27-
pnpm build -- --out ../bin/roo-code-main.vsix && \
27+
pnpm vsix -- --out ../bin/roo-code-main.vsix && \
2828
code --install-extension bin/roo-code-main.vsix
2929
```
3030

@@ -34,9 +34,40 @@ To fully stress the monorepo setup, run the following:
3434
pnpm clean && pnpm lint
3535
pnpm clean && pnpm check-types
3636
pnpm clean && pnpm test
37-
pnpm clean && pnpm bundle
3837
pnpm clean && pnpm build
38+
pnpm clean && pnpm bundle
39+
pnpm clean && pnpm bundle:nightly
40+
3941
pnpm clean && pnpm npx turbo watch:bundle
4042
pnpm clean && pnpm npx turbo watch:tsc
41-
cd apps/vscode-e2e && pnpm test:ci
43+
44+
pnpm --filter @roo-code/vscode-e2e test:ci
45+
46+
pnpm clean && \
47+
pnpm vsix -- --out ../bin/roo-code.vsix && \
48+
code --install-extension bin/roo-code.vsix
49+
50+
pnpm clean && \
51+
pnpm vsix:nightly -- --out ../../../bin/roo-code-nightly.vsix && \
52+
code --install-extension bin/roo-code-nightly.vsix
4253
```
54+
55+
### Turborepo
56+
57+
Note that this excludes the `build` task for next.js apps (@roo-code/web-\*).
58+
59+
Tasks: `build` -> `bundle` -> `vsix`
60+
61+
build:
62+
63+
- `@roo-code/build` [input: src, package.json, tsconfig.json | output: dist]
64+
- `@roo-code/types` [input: src, package.json, tsconfig.json, tsup.config.ts | output: dist]
65+
- `@roo-code/webview-ui` [input: src, package.json, tsconfig.json, vite.config.ts | output: ../src/webview-ui]
66+
67+
bundle:
68+
69+
- `roo-cline` [input: * | output: dist]
70+
71+
vsix:
72+
73+
- `roo-cline` [input: dist | output: bin]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Changes to the webview will appear immediately. Changes to the core extension wi
145145
Alternatively you can build a .vsix and install it directly in VSCode:
146146

147147
```sh
148-
pnpm build
148+
pnpm vsix
149149
```
150150

151151
A `.vsix` file will appear in the `bin/` directory which can be installed with:

apps/vscode-nightly/esbuild.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ async function main() {
4848
console.log(`[${name}] buildDir: ${buildDir}`)
4949
console.log(`[${name}] distDir: ${distDir}`)
5050

51-
// Clean build directory before starting new build
52-
if (fs.existsSync(buildDir)) {
53-
console.log(`[${name}] Cleaning build directory: ${buildDir}`)
54-
fs.rmSync(buildDir, { recursive: true, force: true })
51+
if (fs.existsSync(distDir)) {
52+
console.log(`[${name}] Cleaning dist directory: ${distDir}`)
53+
fs.rmSync(distDir, { recursive: true, force: true })
5554
}
5655

5756
/**

apps/vscode-nightly/turbo.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"extends": ["//"],
4+
"tasks": {
5+
"bundle:nightly": {
6+
"dependsOn": ["^build", "@roo-code/vscode-webview#build:nightly"],
7+
"outputs": ["build/**"]
8+
},
9+
"vsix:nightly": {
10+
"dependsOn": ["bundle:nightly"],
11+
"inputs": ["build/**"],
12+
"outputs": ["../../../bin/**"]
13+
}
14+
}
15+
}

apps/web-evals/next.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import type { NextConfig } from "next"
22

33
const nextConfig: NextConfig = {
4-
/* config options here */
4+
webpack: (config) => {
5+
config.resolve.extensionAlias = { ".js": [".ts", ".tsx", ".js", ".jsx"] }
6+
return config
7+
},
58
}
69

710
export default nextConfig

apps/web-evals/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@roo-code/web-evals",
3-
"private": true,
3+
"version": "0.0.0",
4+
"type": "module",
45
"scripts": {
56
"lint": "next lint",
67
"check-types": "tsc -b",

apps/web-evals/turbo.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"extends": ["//"],
4+
"tasks": {
5+
"build": {
6+
"outputs": [".next/**"],
7+
"inputs": ["src/**", "package.json", "tsconfig.json", "next.config.ts"]
8+
}
9+
}
10+
}

apps/web-roo-code/turbo.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"extends": ["//"],
4+
"tasks": {
5+
"build": {
6+
"outputs": [".next/**"],
7+
"inputs": ["src/**", "package.json", "tsconfig.json", "next.config.ts"]
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)