Skip to content

Commit 9f55ba8

Browse files
committed
feat: add /add-ecosystem-ci skill for adding test cases
Replace CLAUDE.md documentation with an interactive skill that guides through adding new ecosystem-ci test cases. The skill prompts for repository URL, directory, node version, and commands to run.
1 parent d2ade39 commit 9f55ba8

2 files changed

Lines changed: 64 additions & 53 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
description: Add a new ecosystem-ci test case for testing real-world projects against vite-plus
3+
allowed-tools: Bash, Read, Edit, Write, WebFetch, AskUserQuestion
4+
---
5+
6+
# Add Ecosystem-CI Test Case
7+
8+
Add a new ecosystem-ci test case following this process:
9+
10+
## Step 1: Get Repository Information
11+
12+
Ask the user for the GitHub repository URL if not provided as argument: $ARGUMENTS
13+
14+
Use GitHub CLI to get repository info:
15+
```bash
16+
gh api repos/OWNER/REPO --jq '.default_branch'
17+
gh api repos/OWNER/REPO/commits/BRANCH --jq '.sha'
18+
```
19+
20+
## Step 2: Check for Subdirectory
21+
22+
Fetch the repository's root to check if the main package.json is in a subdirectory (like `web/`, `app/`, `frontend/`).
23+
24+
Ask the user:
25+
- Which directory contains the main package.json? (root or subdirectory)
26+
- What Node.js version to use? (22 or 24)
27+
- Which commands to run? (e.g., lint, build, test, type-check)
28+
29+
## Step 3: Update Files
30+
31+
1. **Add to `ecosystem-ci/repo.json`**:
32+
```json
33+
{
34+
"project-name": {
35+
"repository": "https://github.com/owner/repo.git",
36+
"branch": "main",
37+
"hash": "full-commit-sha",
38+
"directory": "web" // only if subdirectory is needed
39+
}
40+
}
41+
```
42+
43+
2. **Add to `.github/workflows/e2e-test.yml`** matrix:
44+
```yaml
45+
- name: project-name
46+
node-version: 24
47+
directory: web # only if subdirectory is needed
48+
command: |
49+
vite run lint
50+
vite run build
51+
```
52+
53+
## Step 4: Verify
54+
55+
Test the clone locally:
56+
```bash
57+
pnpm dlx tsx ecosystem-ci/clone.ts project-name
58+
```
59+
60+
## Important Notes
61+
62+
- The `directory` field is optional - only add it if the package.json is not in the project root
63+
- If `directory` is specified in repo.json, it must also be specified in the workflow matrix
64+
- `patch-project.ts` automatically handles running `vite migrate` in the correct directory

CLAUDE.md

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -106,56 +106,3 @@ pnpm -F vite-plus-cli snap-test migration-skip-vite-peer-dependency
106106
```
107107

108108
The snap test will automatically generate/update the `snap.txt` file with the command outputs. It exits with zero status even if there are output differences; you need to manually check the diffs(`git diff`) to verify correctness.
109-
110-
## Ecosystem-CI Tests
111-
112-
Ecosystem-CI tests real-world projects against vite-plus. Located in `ecosystem-ci/`.
113-
114-
### Adding a New Test Case
115-
116-
1. **Get repository info** using GitHub CLI:
117-
```bash
118-
gh api repos/OWNER/REPO --jq '.default_branch'
119-
gh api repos/OWNER/REPO/commits/BRANCH --jq '.sha'
120-
```
121-
122-
2. **Add entry to `ecosystem-ci/repo.json`**:
123-
```json
124-
{
125-
"project-name": {
126-
"repository": "https://github.com/owner/repo.git",
127-
"branch": "main",
128-
"hash": "full-commit-sha",
129-
"directory": "web" // optional: subdirectory containing package.json
130-
}
131-
}
132-
```
133-
134-
3. **Add test matrix entry to `.github/workflows/e2e-test.yml`**:
135-
```yaml
136-
- name: project-name
137-
node-version: 24
138-
directory: web # optional: must match repo.json if specified
139-
command: |
140-
vite run lint
141-
vite run build
142-
```
143-
144-
4. **Test locally**:
145-
```bash
146-
pnpm dlx tsx ecosystem-ci/clone.ts project-name
147-
```
148-
149-
### Key Files
150-
151-
- `ecosystem-ci/repo.json` - Project definitions (repository, branch, hash, optional directory)
152-
- `ecosystem-ci/clone.ts` - Clones projects to temp directory
153-
- `ecosystem-ci/patch-project.ts` - Runs `vite migrate` on cloned projects
154-
- `.github/workflows/e2e-test.yml` - CI workflow with test matrix
155-
156-
### Subdirectory Support
157-
158-
For projects where the web app is in a subdirectory (e.g., `dify/web`):
159-
- Add `"directory": "subdir"` to repo.json entry
160-
- Add `directory: subdir` to workflow matrix entry
161-
- `patch-project.ts` and workflow steps automatically use the subdirectory

0 commit comments

Comments
 (0)