Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/marketplace-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
echo "$package" | grep -q "extension/dist/package.json" || exit 1
echo "$package" | grep -q "extension/dist/package.nls.json" || exit 1
echo "$package" | grep -q "extension/dist/extension.js" || exit 1
echo "$package" | grep -q "extension/webview-ui/audio/celebration.wav" || exit 1
echo "$package" | grep -q "extension/webview-ui/build/assets/index.js" || exit 1
echo "$package" | grep -q "extension/assets/codicons/codicon.ttf" || exit 1
echo "$package" | grep -q "extension/assets/vscode-material-icons/icons/3d.svg" || exit 1
Expand Down
1 change: 1 addition & 0 deletions apps/vscode-nightly/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
145 changes: 145 additions & 0 deletions apps/vscode-nightly/esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import * as esbuild from "esbuild"
import * as fs from "fs"
import * as path from "path"
import { fileURLToPath } from "url"

import { copyPaths, copyLocales, copyWasms, generatePackageJson } from "@roo-code/build"

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

async function main() {
const production = process.argv.includes("--production")
const minify = production
const sourcemap = !production

/**
* @type {import('esbuild').BuildOptions}
*/
const buildOptions = {
bundle: true,
minify,
sourcemap,
logLevel: "silent",
format: "cjs",
sourcesContent: false,
platform: "node",
define: {
"process.env.PKG_NAME": '"roo-code-nightly"',
"process.env.PKG_OUTPUT_CHANNEL": '"Roo-Code-Nightly"',
},
}

const srcDir = path.join(__dirname, "..", "..", "src")
const buildDir = path.join(__dirname, "build")
const distDir = path.join(buildDir, "dist")

/**
* @type {import('esbuild').Plugin[]}
*/
const plugins = [
{
name: "copy-src",
setup(build) {
build.onEnd(() => {
const paths = [
["LICENSE", "LICENSE"],
[".vscodeignore", ".vscodeignore"],
["assets", "assets"],
["integrations", "integrations"],
["node_modules/vscode-material-icons/generated", "assets/vscode-material-icons"],
["../webview-ui/audio", "webview-ui/audio"],
]

copyPaths(paths, srcDir, buildDir)

let count = 0

fs.readdirSync(path.join(srcDir)).forEach((file) => {
if (file.startsWith("package.nls")) {
fs.copyFileSync(path.join(srcDir, file), path.join(buildDir, file))
count++
}
})

console.log(`[copy-src] Copied ${count} package.nls*.json files to ${buildDir}`)
})
},
},
{
name: "generate-package-json",
setup(build) {
build.onEnd(() => {
const packageJson = JSON.parse(fs.readFileSync(path.join(srcDir, "package.json"), "utf8"))

const overrideJson = JSON.parse(
fs.readFileSync(path.join(__dirname, "package.nightly.json"), "utf8"),
)

const generatedPackageJson = generatePackageJson({
packageJson,
overrideJson,
substitution: ["roo-cline", "roo-code-nightly"],
})

fs.writeFileSync(path.join(buildDir, "package.json"), JSON.stringify(generatedPackageJson, null, 2))
console.log(`[generate-package-json] Generated package.json`)
})
},
},
{
name: "copy-wasms",
setup(build) {
build.onEnd(() => {
copyWasms(srcDir, distDir)
})
},
},
{
name: "copy-locales",
setup(build) {
build.onEnd(() => {
copyLocales(srcDir, distDir)
})
},
},
]

/**
* @type {import('esbuild').BuildOptions}
*/
const extensionBuildOptions = {
...buildOptions,
plugins,
entryPoints: [path.join(srcDir, "extension.ts")],
outfile: path.join(distDir, "extension.js"),
external: ["vscode"],
}

/**
* @type {import('esbuild').BuildOptions}
*/
const workerBuildOptions = {
...buildOptions,
entryPoints: [path.join(srcDir, "workers", "countTokens.ts")],
outdir: path.join(distDir, "workers"),
}

const [extensionBuildContext, workerBuildContext] = await Promise.all([
esbuild.context(extensionBuildOptions),
esbuild.context(workerBuildOptions),
])

await Promise.all([
extensionBuildContext.rebuild(),
extensionBuildContext.dispose(),

workerBuildContext.rebuild(),
workerBuildContext.dispose(),
])
}

main().catch((e) => {
console.error(e)
process.exit(1)
})
25 changes: 25 additions & 0 deletions apps/vscode-nightly/eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": ["camelCase", "PascalCase"]
}
],
"@typescript-eslint/semi": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": ["dist"]
}
20 changes: 20 additions & 0 deletions apps/vscode-nightly/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@roo-code/vscode-nightly",
"description": "Nightly build for the Roo Code VSCode extension.",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"build": "rimraf build && pnpm --filter @roo-code/build build && node esbuild.mjs --production && pnpm --filter @roo-code/vscode-webview build --mode nightly",
"vsix": "pnpm build && cd build && mkdirp ../../../bin && npx vsce package --no-dependencies --out ../../../bin",
"clean": "rimraf build"
},
"dependencies": {
"@roo-code/build": "workspace:^"
},
"devDependencies": {
"@vscode/vsce": "3.3.2",
"esbuild": "^0.25.0",
"mkdirp": "^3.0.1",
"rimraf": "^6.0.1"
}
}
8 changes: 8 additions & 0 deletions apps/vscode-nightly/package.nightly.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "roo-code-nightly",
"displayName": "Roo Code Nightly",
"publisher": "RooVeterinaryInc",
"version": "0.0.1",
"icon": "assets/icons/icon-nightly.png",
"scripts": {}
}
4 changes: 2 additions & 2 deletions evals/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ code --install-extension redhat.java &>/dev/null || exit 1
code --install-extension ms-python.python&>/dev/null || exit 1
code --install-extension rust-lang.rust-analyzer &>/dev/null || exit 1

if ! code --list-extensions 2>/dev/null | grep -q "rooveterinaryinc.roo-cline"; then
code --install-extension rooveterinaryinc.roo-cline &>/dev/null || exit 1
if ! code --list-extensions 2>/dev/null | grep -q "RooVeterinaryInc.roo-cline"; then
code --install-extension RooVeterinaryInc.roo-cline &>/dev/null || exit 1
fi

echo "✅ Done"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"test": "turbo test --log-order grouped --output-logs new-only",
"format": "turbo format --log-order grouped --output-logs new-only",
"build": "pnpm --filter roo-cline vsix",
"build:nightly": "pnpm --filter @roo-code/vscode-nightly vsix",
"changeset": "changeset",
"knip": "knip --include files",
"update-contributors": "node scripts/update-contributors.js"
Expand Down
25 changes: 25 additions & 0 deletions packages/build/eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": ["camelCase", "PascalCase"]
}
],
"@typescript-eslint/semi": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": ["dist"]
}
17 changes: 17 additions & 0 deletions packages/build/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@roo-code/build",
"description": "ESBuild utilities for Roo Code.",
"private": true,
"type": "module",
"exports": "./dist/index.js",
"scripts": {
"build": "tsc"
},
"devDependencies": {
"@types/node": "^22.15.20",
"vitest": "^3.1.3"
},
"dependencies": {
"zod": "^3.24.2"
}
}
Loading