Skip to content

Commit a62cbb1

Browse files
committed
Fix vsix builds
1 parent 2eb66c8 commit a62cbb1

File tree

12 files changed

+90
-114
lines changed

12 files changed

+90
-114
lines changed

.github/workflows/changeset-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
commit: "changeset version bump"
5757
title: "Changeset version bump"
58-
version: pnpm --filter @roo-code/vscode version-packages # This performs the changeset version bump
58+
version: pnpm --filter roo-cline version-packages # This performs the changeset version bump
5959
env:
6060
GITHUB_TOKEN: ${{ secrets.CROSS_REPO_ACCESS_TOKEN }}
6161

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ else
1212
pnpm_cmd="pnpm"
1313
fi
1414

15-
"$pnpm_cmd" --filter @roo-code/vscode generate-types
15+
"$pnpm_cmd" --filter roo-cline generate-types
1616

1717
if [ -n "$(git diff --name-only src/exports/roo-code.d.ts)" ]; then
18-
echo "Error: There are unstaged changes to roo-code.d.ts after running 'pnpm --filter @roo-code/vscode generate-types'."
18+
echo "Error: There are unstaged changes to roo-code.d.ts after running 'pnpm --filter roo-cline generate-types'."
1919
echo "Please review and stage the changes before committing."
2020
exit 1
2121
fi

.vscodeignore

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,70 @@
1-
*
2-
!dist
1+
# Default
2+
.changeset/**
3+
.github/**
4+
.husky/**
5+
.vscode/**
6+
coverage/**
7+
node_modules/**
8+
src/**
9+
scripts/**
10+
.gitignore
11+
esbuild.js
12+
jest.*
13+
**/tsconfig.json
14+
**/.eslintrc.json
15+
.prettierignore
16+
**/*.map
17+
**/*.ts
18+
**/.gitignore
19+
20+
# Custom
21+
.env.sample
22+
.git-blame-ignore-revs
23+
.gitconfig
24+
.gitattributes
25+
.tool-versions
26+
.vite-port
27+
.nvmrc
28+
.clinerules*
29+
.roomodes
30+
.rooignore
31+
.roo/**
32+
benchmark/**
33+
cline_docs/**
34+
e2e/**
35+
evals/**
36+
locales/**
37+
out/**
38+
ellipsis.yaml
39+
knip.json
40+
41+
# Ignore all webview-ui files except the build directory.
42+
# https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/frameworks/hello-world-react-cra/.vscodeignore
43+
webview-ui/src/**
44+
webview-ui/public/**
45+
webview-ui/scripts/**
46+
webview-ui/index.html
47+
webview-ui/README.md
48+
webview-ui/package.json
49+
webview-ui/package-lock.json
50+
webview-ui/node_modules/**
51+
52+
# Include codicons
53+
!node_modules/@vscode/codicons/dist/codicon.css
54+
!node_modules/@vscode/codicons/dist/codicon.ttf
55+
56+
# Include material icons
57+
!node_modules/vscode-material-icons/generated/**
58+
59+
# Include default themes JSON files used in getTheme
60+
!src/integrations/theme/default-themes/**
61+
62+
# Ignore doc assets
63+
assets/docs/**
64+
65+
# Include icons and images
66+
!assets/icons/**
67+
!assets/images/**
68+
69+
# Include .env file for telemetry
70+
!.env

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"lint": "eslint --max-warnings=0 src/**/*.ts",
66
"check-types": "tsc --noEmit",
77
"format": "prettier --write src",
8-
"test:ci": "pnpm --filter @roo-code/vscode package:development && pnpm test:run",
8+
"test:ci": "pnpm --filter roo-cline build:development && pnpm test:run",
99
"test:run": "rimraf out && tsc -p tsconfig.json && npx dotenvx run -f .env.local -- node ./out/runTest.js"
1010
},
1111
"devDependencies": {

e2e/src/runTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ async function main() {
66
try {
77
// The folder containing the Extension Manifest package.json
88
// Passed to `--extensionDevelopmentPath`
9-
const extensionDevelopmentPath = path.resolve(__dirname, "../../dist")
9+
const extensionDevelopmentPath = path.resolve(__dirname, "../../src")
1010

1111
// The path to the extension test script
1212
// Passed to --extensionTestsPath

evals/scripts/setup.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ build_extension() {
2828
echo "🔨 Building the Roo Code extension..."
2929
cd ..
3030
mkdir -p bin
31-
pnpm --filter @roo-code/vscode compile || exit 1
32-
pnpm --filter @roo-code/vscode-webview build || exit 1
31+
pnpm build:development || exit 1
3332
npx vsce package --out bin/roo-code-latest.vsix || exit 1
3433
code --install-extension bin/roo-code-latest.vsix || exit 1
3534
cd evals

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"test": "turbo test --log-order grouped --output-logs new-only",
1313
"format": "turbo format --log-order grouped --output-logs new-only",
1414
"dev": "pnpm --filter @roo-code/vscode-webview dev",
15-
"build": "pnpm --filter @roo-code/vscode build",
15+
"build": "pnpm --filter roo-cline vsix",
16+
"build:development": "pnpm --filter roo-cline build:development",
1617
"changeset": "changeset",
1718
"knip": "knip --include files",
1819
"update-contributors": "node scripts/update-contributors.js"

src/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
webview-ui

src/esbuild.js

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ const path = require("path")
55
const production = process.argv.includes("--production")
66
const watch = process.argv.includes("--watch")
77

8-
const ROOT_DIR_RELATIVE = "../dist"
9-
const ROOT_DIR = path.join(__dirname, ROOT_DIR_RELATIVE)
10-
const DIST_DIR = path.join(ROOT_DIR, "dist")
11-
128
/**
139
* @type {import('esbuild').Plugin}
1410
*/
@@ -33,7 +29,7 @@ const copyWasmFiles = {
3329
setup(build) {
3430
build.onEnd(() => {
3531
const nodeModulesDir = path.join(__dirname, "node_modules")
36-
const distDir = DIST_DIR
32+
const distDir = path.join(__dirname, "dist")
3733

3834
fs.mkdirSync(distDir, { recursive: true })
3935

@@ -74,7 +70,7 @@ const copyWasmFiles = {
7470

7571
function copyLocaleFiles() {
7672
const srcDir = path.join(__dirname, "i18n", "locales")
77-
const destDir = path.join(DIST_DIR, "i18n", "locales")
73+
const destDir = path.join(path.join(__dirname, "dist"), "i18n", "locales")
7874

7975
if (!fs.existsSync(srcDir)) {
8076
throw new Error(`Directory does not exist: ${srcDir}`)
@@ -153,91 +149,6 @@ const copyLocalesFiles = {
153149
},
154150
}
155151

156-
/**
157-
* @type {import('esbuild').Plugin}
158-
*/
159-
const copyAssets = {
160-
name: "copy-assets",
161-
setup(build) {
162-
build.onEnd(() => {
163-
const copyPaths = [
164-
["assets/icons", "assets/icons"],
165-
["assets/images", "assets/images"],
166-
["integrations/theme/default-themes", "src/integrations/theme/default-themes"],
167-
["node_modules/vscode-material-icons/generated", "node_modules/vscode-material-icons/generated"],
168-
["node_modules/@vscode/codicons/dist", "node_modules/@vscode/codicons/dist"],
169-
]
170-
171-
for (const [srcRelPath, dstRelPath] of copyPaths) {
172-
const srcDir = path.join(__dirname, srcRelPath)
173-
const dstDir = path.join(ROOT_DIR, dstRelPath)
174-
175-
if (!fs.existsSync(srcDir)) {
176-
throw new Error(`Directory does not exist: ${srcDir}`)
177-
}
178-
179-
fs.mkdirSync(dstDir, { recursive: true })
180-
let count = 0
181-
182-
function copyDir(src, dest) {
183-
const entries = fs.readdirSync(src, { withFileTypes: true })
184-
185-
for (const entry of entries) {
186-
const srcPath = path.join(src, entry.name)
187-
const dstDir = path.join(dest, entry.name)
188-
189-
if (entry.isDirectory()) {
190-
fs.mkdirSync(dstDir, { recursive: true })
191-
copyDir(srcPath, dstDir)
192-
} else {
193-
fs.copyFileSync(srcPath, dstDir)
194-
count++
195-
}
196-
}
197-
}
198-
199-
copyDir(srcDir, dstDir)
200-
console.log(`[copy-assets] Copied ${count} files from ${srcDir} to ${dstDir}`)
201-
}
202-
})
203-
},
204-
}
205-
206-
/**
207-
* @type {import('esbuild').Plugin}
208-
*/
209-
const copyPackageJson = {
210-
name: "copy-package-json",
211-
setup(build) {
212-
build.onEnd(() => {
213-
const srcDir = __dirname
214-
const srcPath = path.join(srcDir, "package.json")
215-
const dstDir = ROOT_DIR
216-
217-
if (!fs.existsSync(dstDir)) {
218-
throw new Error(`Directory does not exist: ${dstDir}`)
219-
}
220-
221-
// Copy package.json to the dist directory and rename the extension to "roo-cline".
222-
const packageJson = JSON.parse(fs.readFileSync(srcPath, "utf8"))
223-
packageJson.name = "roo-cline"
224-
fs.writeFileSync(path.join(dstDir, "package.json"), JSON.stringify(packageJson, null, 2), "utf8")
225-
console.log(`[copy-package-json] Copied package.json to ${dstDir}`)
226-
227-
// Copy all package.nls.* files to the dist directory.
228-
const nlsFiles = fs.readdirSync(srcDir).filter((file) => file.startsWith("package.nls."))
229-
let count = 0
230-
231-
for (const nlsFile of nlsFiles) {
232-
fs.copyFileSync(path.join(srcDir, nlsFile), path.join(dstDir, nlsFile))
233-
count++
234-
}
235-
236-
console.log(`[copy-package-json] Copied ${count} package.nls.*.json files to ${dstDir}`)
237-
})
238-
},
239-
}
240-
241152
/**
242153
* @type {import('esbuild').BuildOptions}
243154
*/
@@ -249,8 +160,6 @@ const extensionConfig = {
249160
plugins: [
250161
copyWasmFiles,
251162
copyLocalesFiles,
252-
copyAssets,
253-
copyPackageJson,
254163
esbuildProblemMatcherPlugin,
255164
{
256165
name: "alias-plugin",
@@ -265,7 +174,7 @@ const extensionConfig = {
265174
format: "cjs",
266175
sourcesContent: false,
267176
platform: "node",
268-
outfile: ROOT_DIR_RELATIVE + "/dist/extension.js",
177+
outfile: "dist/extension.js",
269178
external: ["vscode"],
270179
}
271180

@@ -281,7 +190,7 @@ const workerConfig = {
281190
format: "cjs",
282191
sourcesContent: false,
283192
platform: "node",
284-
outdir: ROOT_DIR_RELATIVE + "/dist/workers",
193+
outdir: "dist/workers",
285194
}
286195

287196
async function main() {

src/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@roo-code/vscode",
2+
"name": "roo-cline",
33
"displayName": "%extension.displayName%",
44
"description": "%extension.description%",
55
"publisher": "RooVeterinaryInc",
@@ -323,15 +323,13 @@
323323
"pretest": "node esbuild.js",
324324
"test": "jest -w=40% && vitest run",
325325
"format": "prettier --write .",
326-
"build": "node esbuild.js --production --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node",
327-
"build:development": "node esbuild.js",
328-
"package": "pnpm lint && pnpm check-types && pnpm build && pnpm --filter @roo-code/vscode-webview build",
329-
"package:development": "pnpm lint && pnpm check-types && pnpm build:development && pnpm --filter @roo-code/vscode-webview build",
326+
"build": "pnpm lint && pnpm check-types && node esbuild.js --production --bundle --external:vscode --format=cjs --platform=node && pnpm --filter @roo-code/vscode-webview build",
327+
"build:development": "pnpm lint && pnpm check-types && node esbuild.js && pnpm --filter @roo-code/vscode-webview build",
330328
"publish:marketplace": "vsce publish && ovsx publish",
331329
"publish": "pnpm vsix && changeset publish && pnpm install --package-lock-only",
332330
"version-packages": "changeset version && pnpm install --package-lock-only",
333-
"vscode:prepublish": "pnpm package",
334-
"vsix": "rimraf bin && mkdirp bin && npx vsce package --no-dependencies --out bin",
331+
"vscode:prepublish": "pnpm build",
332+
"vsix": "rimraf ../dist && rimraf ../bin && mkdirp ../bin && npx vsce package --no-dependencies --out ../bin",
335333
"watch": "pnpm watch:esbuild watch:tsc",
336334
"watch:esbuild": "node esbuild.js --watch",
337335
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",

0 commit comments

Comments
 (0)