From 274700ee7c5630e08313c17b0217f68eb1bd82e5 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 18 Jul 2025 12:00:38 +0900 Subject: [PATCH 1/2] chore: add copilot agent configs --- .github/copilot-instructions.md | 29 ++++++++++++++ .github/workflows/copilot-setup-steps.yml | 47 +++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/copilot-instructions.md create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000000000..18a73d18aea463 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,29 @@ +This is a TypeScript project that implements a frontend build tooling called Vite. Please follow these guidelines when contributing: + +## Code Standards + +### Required Before Each Commit + +- Run `pnpm run lint` to ensure that your code adheres the code standards. +- Run `pnpm run format` to format your code. + +### Development Flow + +- Build: `pnpm run build` +- Test: `pnpm run test` (uses Vitest and Playwright) + +## Repository Structure + +- `docs/`: Documentation. +- `packages/create-vite`: Contains the source code for the `create-vite` command. +- `packages/plugin-legacy`: Contains the source code for `@vitejs/plugin-legacy`. +- `packages/vite`: Contains the source code for the Vite core. +- `playground/`: E2E tests + +## Key Guidelines + +1. Follow TypeScript best practices. +2. Maintain existing code structure and organization. +3. Write tests for new functionality. Prefer unit tests if it can be tested without using mocks. E2E tests should be added in the `playground/` directory. +4. Never write comments that explain what the code does. Instead, write comments that explain why the code does what it does. +5. Suggest changes to the documentation if public API changes are made. diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 00000000000000..bc8bf25ef37672 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,47 @@ +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 + + - name: Set node version to 22 + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + + - name: Install deps + run: pnpm install + + # Install playwright's binary under custom directory to cache + - name: (non-windows) Set Playwright path and Get playwright version + if: runner.os != 'Windows' + run: | + echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV + PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')" + echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + - name: (windows) Set Playwright path and Get playwright version + if: runner.os == 'Windows' + run: | + echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV + $env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')" + echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV + + - name: Install Playwright + # does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved + run: pnpm playwright install chromium From 84e20ac0c317bab5ece37d888ed4047eb5991054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0?= Date: Sun, 20 Jul 2025 14:36:38 +0900 Subject: [PATCH 2/2] chore: typo Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 18a73d18aea463..e031870bb9dc26 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -4,7 +4,7 @@ This is a TypeScript project that implements a frontend build tooling called Vit ### Required Before Each Commit -- Run `pnpm run lint` to ensure that your code adheres the code standards. +- Run `pnpm run lint` to ensure that your code adheres to the code standards. - Run `pnpm run format` to format your code. ### Development Flow