瀏覽代碼

Simplify `npm install` by automatically installing npm-run-all

cte 1 年之前
父節點
當前提交
7681a98842
共有 5 個文件被更改,包括 47 次插入43 次删除
  1. 1 1
      .github/workflows/changeset-release.yml
  2. 5 5
      .github/workflows/code-qa.yml
  3. 3 7
      .github/workflows/marketplace-publish.yml
  4. 30 27
      README.md
  5. 8 3
      package.json

+ 1 - 1
.github/workflows/changeset-release.yml

@@ -37,7 +37,7 @@ jobs:
           cache: 'npm'
             
       - name: Install Dependencies
-        run: npm run install:ci
+        run: npm run install:all
 
       # Check if there are any new changesets to process
       - name: Check for changesets

+ 5 - 5
.github/workflows/code-qa.yml

@@ -20,7 +20,7 @@ jobs:
           node-version: '18'
           cache: 'npm'
       - name: Install dependencies
-        run: npm run install:ci
+        run: npm run install:all
       - name: Compile
         run: npm run compile
       - name: Check types
@@ -39,7 +39,7 @@ jobs:
           node-version: '18'
           cache: 'npm'
       - name: Install dependencies
-        run: npm run install:ci
+        run: npm run install:all
       - name: Run knip checks
         run: npm run knip
 
@@ -54,7 +54,7 @@ jobs:
           node-version: '18'
           cache: 'npm'
       - name: Install dependencies
-        run: npm run install:ci
+        run: npm run install:all
       - name: Run unit tests
         run: npx jest --silent
 
@@ -69,7 +69,7 @@ jobs:
           node-version: '18'
           cache: 'npm'
       - name: Install dependencies
-        run: npm run install:ci
+        run: npm run install:all
       - name: Run unit tests
         working-directory: webview-ui
         run: npx jest --silent
@@ -109,7 +109,7 @@ jobs:
           node-version: '18'
           cache: 'npm'
       - name: Install dependencies
-        run: npm run install:ci
+        run: npm run install:all
       - name: Create env.integration file
         working-directory: e2e
         run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.integration

+ 3 - 7
.github/workflows/marketplace-publish.yml

@@ -11,7 +11,7 @@ jobs:
   publish-extension:
     runs-on: ubuntu-latest
     permissions:
-      contents: write  # Required for pushing tags
+      contents: write # Required for pushing tags.
     if: >
         ( github.event_name == 'pull_request' &&
         github.event.pull_request.base.ref == 'main' &&
@@ -33,13 +33,9 @@ jobs:
       - name: Install Dependencies
         run: |
           npm install -g vsce ovsx
-          npm run install:ci
-
+          npm run install:all
       - name: Create .env file
-        run: |
-          echo "# PostHog API Keys for telemetry" > .env
-          echo "POSTHOG_API_KEY=${{ secrets.POSTHOG_API_KEY }}" >> .env
-
+        run: echo "POSTHOG_API_KEY=${{ secrets.POSTHOG_API_KEY }}" >> .env
       - name: Package Extension
         run: |
           current_package_version=$(node -p "require('./package.json').version")

+ 30 - 27
README.md

@@ -115,37 +115,40 @@ Make Roo Code work your way with:
 ## Local Setup & Development
 
 1. **Clone** the repo:
-    ```bash
-    git clone https://github.com/RooVetGit/Roo-Code.git
-    ```
+
+```sh
+git clone https://github.com/RooVetGit/Roo-Code.git
+```
+
 2. **Install dependencies**:
-    ```bash
-    npm run install:all
-    ```
-
-if that fails, try:
-    ```bash
-    npm run install:ci
-    ```
-
-3. **Build** the extension:
-    ```bash
-    npm run build
-    ```
-    - A `.vsix` file will appear in the `bin/` directory.
-4. **Install** the `.vsix` manually if desired:
-    ```bash
-    code --install-extension bin/roo-code-4.0.0.vsix
-    ```
-5. **Start the webview (Vite/React app with HMR)**:
-    ```bash
-    npm run dev
-    ```
-6. **Debug**:
-    - Press `F5` (or **Run** → **Start Debugging**) in VSCode to open a new session with Roo Code loaded.
+
+```sh
+npm run install:all
+```
+
+3. **Start the webview (Vite/React app with HMR)**:
+
+```sh
+npm run dev
+```
+
+4. **Debug**:
+   Press `F5` (or **Run** → **Start Debugging**) in VSCode to open a new session with Roo Code loaded.
 
 Changes to the webview will appear immediately. Changes to the core extension will require a restart of the extension host.
 
+Alternatively you can build a .vsix and install it directly in VSCode:
+
+```sh
+npm run build
+```
+
+A `.vsix` file will appear in the `bin/` directory which can be installed with:
+
+```sh
+code --install-extension bin/roo-cline-<version>.vsix
+```
+
 We use [changesets](https://github.com/changesets/changesets) for versioning and publishing. Check our `CHANGELOG.md` for release notes.
 
 ---

+ 8 - 3
package.json

@@ -230,23 +230,28 @@
 		"build": "npm run build:webview && npm run vsix",
 		"build:webview": "cd webview-ui && npm run build",
 		"compile": "tsc -p . --outDir out && node esbuild.js",
-		"install:all": "npm-run-all -p install-*",
-		"install:ci": "npm install npm-run-all && npm run install:all",
+		"install:all": "npm install npm-run-all && npm run install:_all",
+		"install:_all": "npm-run-all -p install-*",
 		"install-extension": "npm install",
 		"install-webview-ui": "cd webview-ui && npm install",
 		"install-e2e": "cd e2e && npm install",
+		"install-benchmark": "cd benchmark && npm install",
 		"lint": "npm-run-all -p lint:*",
 		"lint:extension": "eslint src --ext ts",
 		"lint:webview-ui": "cd webview-ui && npm run lint",
 		"lint:e2e": "cd e2e && npm run lint",
+		"lint:benchmark": "cd benchmark && npm run lint",
 		"check-types": "npm-run-all -p check-types:*",
 		"check-types:extension": "tsc --noEmit",
 		"check-types:webview-ui": "cd webview-ui && npm run check-types",
 		"check-types:e2e": "cd e2e && npm run check-types",
+		"check-types:benchmark": "cd benchmark && npm run check-types",
 		"package": "npm run build:webview && npm run check-types && npm run lint && node esbuild.js --production",
 		"pretest": "npm run compile",
 		"dev": "cd webview-ui && npm run dev",
-		"test": "jest && cd webview-ui && npm run test",
+		"test": "npm-run-all -p test:*",
+		"test:extension": "jest",
+		"test:webview": "cd webview-ui && npm run test",
 		"prepare": "husky",
 		"publish:marketplace": "vsce publish && ovsx publish",
 		"publish": "npm run build && changeset publish && npm install --package-lock-only",