From 7681a988426d2a554a102331c198b412f799ca70 Mon Sep 17 00:00:00 2001 From: cte Date: Mon, 10 Mar 2025 11:36:11 -0700 Subject: [PATCH] Simplify `npm install` by automatically installing npm-run-all --- .github/workflows/changeset-release.yml | 2 +- .github/workflows/code-qa.yml | 10 ++--- .github/workflows/marketplace-publish.yml | 10 ++--- README.md | 53 ++++++++++++----------- package.json | 11 +++-- 5 files changed, 45 insertions(+), 41 deletions(-) diff --git a/.github/workflows/changeset-release.yml b/.github/workflows/changeset-release.yml index 462516365b..a2bcd3f039 100644 --- a/.github/workflows/changeset-release.yml +++ b/.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 diff --git a/.github/workflows/code-qa.yml b/.github/workflows/code-qa.yml index b7292dd9ee..2e269cbd79 100644 --- a/.github/workflows/code-qa.yml +++ b/.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 diff --git a/.github/workflows/marketplace-publish.yml b/.github/workflows/marketplace-publish.yml index 4ecd2af7a2..6c9fafe9c9 100644 --- a/.github/workflows/marketplace-publish.yml +++ b/.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") diff --git a/README.md b/README.md index 59ca6d699f..f907ea480e 100644 --- a/README.md +++ b/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 - ``` +```sh +npm run install:all +``` -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. +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-.vsix +``` + We use [changesets](https://github.com/changesets/changesets) for versioning and publishing. Check our `CHANGELOG.md` for release notes. --- diff --git a/package.json b/package.json index b32a81071d..3d11264cc7 100644 --- a/package.json +++ b/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",