Skip to content

Commit c4d5940

Browse files
chore: add copilot agent configs (vitejs#20422)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
1 parent 554847b commit c4d5940

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/copilot-instructions.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This is a TypeScript project that implements a frontend build tooling called Vite. Please follow these guidelines when contributing:
2+
3+
## Code Standards
4+
5+
### Required Before Each Commit
6+
7+
- Run `pnpm run lint` to ensure that your code adheres to the code standards.
8+
- Run `pnpm run format` to format your code.
9+
10+
### Development Flow
11+
12+
- Build: `pnpm run build`
13+
- Test: `pnpm run test` (uses Vitest and Playwright)
14+
15+
## Repository Structure
16+
17+
- `docs/`: Documentation.
18+
- `packages/create-vite`: Contains the source code for the `create-vite` command.
19+
- `packages/plugin-legacy`: Contains the source code for `@vitejs/plugin-legacy`.
20+
- `packages/vite`: Contains the source code for the Vite core.
21+
- `playground/`: E2E tests
22+
23+
## Key Guidelines
24+
25+
1. Follow TypeScript best practices.
26+
2. Maintain existing code structure and organization.
27+
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.
28+
4. Never write comments that explain what the code does. Instead, write comments that explain why the code does what it does.
29+
5. Suggest changes to the documentation if public API changes are made.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
paths:
5+
- .github/workflows/copilot-setup-steps.yml
6+
pull_request:
7+
paths:
8+
- .github/workflows/copilot-setup-steps.yml
9+
10+
jobs:
11+
copilot-setup-steps:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
21+
22+
- name: Set node version to 22
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: "pnpm"
27+
28+
- name: Install deps
29+
run: pnpm install
30+
31+
# Install playwright's binary under custom directory to cache
32+
- name: (non-windows) Set Playwright path and Get playwright version
33+
if: runner.os != 'Windows'
34+
run: |
35+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
36+
PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')"
37+
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
38+
- name: (windows) Set Playwright path and Get playwright version
39+
if: runner.os == 'Windows'
40+
run: |
41+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
42+
$env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')"
43+
echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV
44+
45+
- name: Install Playwright
46+
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
47+
run: pnpm playwright install chromium

0 commit comments

Comments
 (0)