Skip to content

Commit 9d9880a

Browse files
authored
Fix Roo Code Nightly package.json generation (#4098)
1 parent d4c00e5 commit 9d9880a

File tree

10 files changed

+30
-12
lines changed

10 files changed

+30
-12
lines changed

packages/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"lint": "eslint src --ext=ts --max-warnings=0",
1010
"check-types": "tsc --noEmit",
11-
"test": "vitest --globals --run",
11+
"test": "vitest run",
1212
"build": "tsc",
1313
"clean": "rimraf dist .turbo"
1414
},

packages/build/src/__tests__/index.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// npx vitest --globals run src/__tests__/index.test.ts
1+
// npx vitest run src/__tests__/index.test.ts
22

33
import { generatePackageJson } from "../index.js"
44

@@ -67,6 +67,11 @@ describe("generatePackageJson", () => {
6767
group: "navigation@6",
6868
when: "activeWebviewPanelId == roo-cline.TabPanelProvider",
6969
},
70+
{
71+
command: "roo-cline.accountButtonClicked",
72+
group: "navigation@6",
73+
when: "activeWebviewPanelId == roo-cline.TabPanelProvider && config.roo-cline.rooCodeCloudEnabled",
74+
},
7075
],
7176
},
7277
submenus: [
@@ -175,6 +180,11 @@ describe("generatePackageJson", () => {
175180
group: "navigation@6",
176181
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider",
177182
},
183+
{
184+
command: "roo-code-nightly.accountButtonClicked",
185+
group: "navigation@6",
186+
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider && config.roo-code-nightly.rooCodeCloudEnabled",
187+
},
178188
],
179189
},
180190
submenus: [

packages/build/src/esbuild.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: s
213213
return Object.entries(obj).reduce(
214214
(acc, [key, ary]) => ({
215215
...acc,
216-
[key.replace(from, to)]: ary.map((item) => {
216+
[key.replaceAll(from, to)]: ary.map((item) => {
217217
const transformedItem = { ...item }
218218

219219
for (const prop of props) {
220220
if (prop in item && typeof item[prop] === "string") {
221-
transformedItem[prop] = item[prop].replace(from, to)
221+
transformedItem[prop] = item[prop].replaceAll(from, to)
222222
}
223223
}
224224

@@ -232,7 +232,7 @@ function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: s
232232
// eslint-disable-next-line @typescript-eslint/no-explicit-any
233233
function transformArray<T>(arr: any[], from: string, to: string, idProp: string): T[] {
234234
return arr.map(({ [idProp]: id, ...rest }) => ({
235-
[idProp]: id.replace(from, to),
235+
[idProp]: id.replaceAll(from, to),
236236
...rest,
237237
}))
238238
}
@@ -242,7 +242,7 @@ function transformRecord<T>(obj: Record<string, any>, from: string, to: string):
242242
return Object.entries(obj).reduce(
243243
(acc, [key, value]) => ({
244244
...acc,
245-
[key.replace(from, to)]: value,
245+
[key.replaceAll(from, to)]: value,
246246
}),
247247
{} as T,
248248
)

packages/build/vitest.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from "vitest/config"
2+
3+
export default defineConfig({
4+
test: {
5+
globals: true,
6+
environment: "node",
7+
},
8+
})

packages/cloud/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"lint": "eslint src --ext=ts --max-warnings=0",
99
"check-types": "tsc --noEmit",
10-
"test": "vitest --globals --run",
10+
"test": "vitest run",
1111
"clean": "rimraf dist .turbo"
1212
},
1313
"dependencies": {

packages/cloud/src/__tests__/RefreshTimer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// npx vitest run --globals src/__tests__/RefreshTimer.test.ts
1+
// npx vitest run src/__tests__/RefreshTimer.test.ts
22

33
import { Mock } from "vitest"
44

packages/telemetry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"lint": "eslint src --ext=ts --max-warnings=0",
99
"check-types": "tsc --noEmit",
10-
"test": "vitest --globals --run",
10+
"test": "vitest run",
1111
"clean": "rimraf dist .turbo"
1212
},
1313
"dependencies": {

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"scripts": {
1717
"lint": "eslint src --ext=ts --max-warnings=0",
1818
"check-types": "tsc --noEmit",
19-
"test": "vitest --globals --run",
19+
"test": "vitest run",
2020
"build": "tsup",
2121
"npm:publish:test": "tsup --outDir npm/dist && cd npm && npm publish --dry-run",
2222
"npm:publish": "tsup --outDir npm/dist && cd npm && npm publish",

src/api/providers/fetchers/__tests__/openrouter.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// npx vitest run --globals api/providers/fetchers/__tests__/openrouter.spec.ts
1+
// npx vitest run api/providers/fetchers/__tests__/openrouter.spec.ts
22

33
import * as path from "path"
44

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
"lint": "eslint . --ext=ts --max-warnings=0",
343343
"check-types": "tsc --noEmit",
344344
"pretest": "turbo run bundle --cwd ..",
345-
"test": "jest -w=40% && vitest run --globals",
345+
"test": "jest -w=40% && vitest run",
346346
"format": "prettier --write .",
347347
"bundle": "node esbuild.mjs",
348348
"vscode:prepublish": "pnpm bundle --production",

0 commit comments

Comments
 (0)