mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Fix Roo Code Nightly package.json generation (#4098)
This commit is contained in:
parent
d4c00e58ed
commit
9d9880a74b
10 changed files with 30 additions and 12 deletions
|
|
@ -8,7 +8,7 @@
|
|||
"scripts": {
|
||||
"lint": "eslint src --ext=ts --max-warnings=0",
|
||||
"check-types": "tsc --noEmit",
|
||||
"test": "vitest --globals --run",
|
||||
"test": "vitest run",
|
||||
"build": "tsc",
|
||||
"clean": "rimraf dist .turbo"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// npx vitest --globals run src/__tests__/index.test.ts
|
||||
// npx vitest run src/__tests__/index.test.ts
|
||||
|
||||
import { generatePackageJson } from "../index.js"
|
||||
|
||||
|
|
@ -67,6 +67,11 @@ describe("generatePackageJson", () => {
|
|||
group: "navigation@6",
|
||||
when: "activeWebviewPanelId == roo-cline.TabPanelProvider",
|
||||
},
|
||||
{
|
||||
command: "roo-cline.accountButtonClicked",
|
||||
group: "navigation@6",
|
||||
when: "activeWebviewPanelId == roo-cline.TabPanelProvider && config.roo-cline.rooCodeCloudEnabled",
|
||||
},
|
||||
],
|
||||
},
|
||||
submenus: [
|
||||
|
|
@ -175,6 +180,11 @@ describe("generatePackageJson", () => {
|
|||
group: "navigation@6",
|
||||
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider",
|
||||
},
|
||||
{
|
||||
command: "roo-code-nightly.accountButtonClicked",
|
||||
group: "navigation@6",
|
||||
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider && config.roo-code-nightly.rooCodeCloudEnabled",
|
||||
},
|
||||
],
|
||||
},
|
||||
submenus: [
|
||||
|
|
|
|||
|
|
@ -213,12 +213,12 @@ function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: s
|
|||
return Object.entries(obj).reduce(
|
||||
(acc, [key, ary]) => ({
|
||||
...acc,
|
||||
[key.replace(from, to)]: ary.map((item) => {
|
||||
[key.replaceAll(from, to)]: ary.map((item) => {
|
||||
const transformedItem = { ...item }
|
||||
|
||||
for (const prop of props) {
|
||||
if (prop in item && typeof item[prop] === "string") {
|
||||
transformedItem[prop] = item[prop].replace(from, to)
|
||||
transformedItem[prop] = item[prop].replaceAll(from, to)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: s
|
|||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function transformArray<T>(arr: any[], from: string, to: string, idProp: string): T[] {
|
||||
return arr.map(({ [idProp]: id, ...rest }) => ({
|
||||
[idProp]: id.replace(from, to),
|
||||
[idProp]: id.replaceAll(from, to),
|
||||
...rest,
|
||||
}))
|
||||
}
|
||||
|
|
@ -242,7 +242,7 @@ function transformRecord<T>(obj: Record<string, any>, from: string, to: string):
|
|||
return Object.entries(obj).reduce(
|
||||
(acc, [key, value]) => ({
|
||||
...acc,
|
||||
[key.replace(from, to)]: value,
|
||||
[key.replaceAll(from, to)]: value,
|
||||
}),
|
||||
{} as T,
|
||||
)
|
||||
|
|
|
|||
8
packages/build/vitest.config.ts
Normal file
8
packages/build/vitest.config.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { defineConfig } from "vitest/config"
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "node",
|
||||
},
|
||||
})
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
"scripts": {
|
||||
"lint": "eslint src --ext=ts --max-warnings=0",
|
||||
"check-types": "tsc --noEmit",
|
||||
"test": "vitest --globals --run",
|
||||
"test": "vitest run",
|
||||
"clean": "rimraf dist .turbo"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// npx vitest run --globals src/__tests__/RefreshTimer.test.ts
|
||||
// npx vitest run src/__tests__/RefreshTimer.test.ts
|
||||
|
||||
import { Mock } from "vitest"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
"scripts": {
|
||||
"lint": "eslint src --ext=ts --max-warnings=0",
|
||||
"check-types": "tsc --noEmit",
|
||||
"test": "vitest --globals --run",
|
||||
"test": "vitest run",
|
||||
"clean": "rimraf dist .turbo"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
"scripts": {
|
||||
"lint": "eslint src --ext=ts --max-warnings=0",
|
||||
"check-types": "tsc --noEmit",
|
||||
"test": "vitest --globals --run",
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"npm:publish:test": "tsup --outDir npm/dist && cd npm && npm publish --dry-run",
|
||||
"npm:publish": "tsup --outDir npm/dist && cd npm && npm publish",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// npx vitest run --globals api/providers/fetchers/__tests__/openrouter.spec.ts
|
||||
// npx vitest run api/providers/fetchers/__tests__/openrouter.spec.ts
|
||||
|
||||
import * as path from "path"
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@
|
|||
"lint": "eslint . --ext=ts --max-warnings=0",
|
||||
"check-types": "tsc --noEmit",
|
||||
"pretest": "turbo run bundle --cwd ..",
|
||||
"test": "jest -w=40% && vitest run --globals",
|
||||
"test": "jest -w=40% && vitest run",
|
||||
"format": "prettier --write .",
|
||||
"bundle": "node esbuild.mjs",
|
||||
"vscode:prepublish": "pnpm bundle --production",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue