Skip to content

Commit a17f996

Browse files
ascorbicclaude
andcommitted
Set up vitest-browser-astro project from template
- Rename package from @ascorbic/example to vitest-browser-astro - Update repository URLs to github.com:ascorbic/vitest-browser-astro - Update README files with project information - Rename test file from hello.test.ts to index.test.ts - Remove template setup section from CLAUDE.md - Update workspace configuration and scripts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8370415 commit a17f996

10 files changed

Lines changed: 49 additions & 43 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,12 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5-
## ⚠️ Template Setup Required
6-
7-
**This is currently a template repository.** If you see this message, you need to set up a new project by updating the following:
8-
9-
1. **Package names**: Update `@ascorbic/example` in all `package.json` files to your new package name
10-
2. **Repository URLs**: Update git repository URLs in `package.json` files
11-
3. **README files**: Update README.md files with your project information
12-
4. **Test files**: Rename `packages/example/test/hello.test.ts` to a more appropriate test name
13-
5. **Package directory**: Rename `packages/example/` to your actual package name
14-
6. **Workspace name**: Update the workspace name in the root `package.json`
15-
7. **GitHub Secrets**: Set up required secrets in GitHub repository settings:
16-
- `APP_PRIVATE_KEY` - GitHub App private key for release workflow
17-
- `APP_ID` - GitHub App ID for release workflow
18-
- `CLAUDE_CODE_OAUTH_TOKEN` - Claude Code OAuth token for PR assistant
19-
8. **npm Trusted Publishing**: Configure trusted publishing on npmjs.com for your packages to enable OIDC authentication (no NPM_TOKEN needed)
20-
21-
After setup, remove this section from CLAUDE.md.
22-
235
## Repository Structure
246

25-
This is a monorepo library template using pnpm workspaces with the following structure:
7+
This is a monorepo using pnpm workspaces with the following structure:
268

279
- **Root**: Workspace configuration and shared tooling
28-
- **packages/**: Individual library packages (currently contains `example` package)
10+
- **packages/**: Individual library packages (contains `vitest-browser-astro` package)
2911
- **demos/**: Demo applications and examples
3012

3113
## Commands

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## Library template
1+
# vitest-browser-astro
22

3-
This is a template for a library monorepo.
3+
Vitest browser mode renderer for Astro components.

demos/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"private": true,
77
"dependencies": {
8-
"@ascorbic/example": "workspace:^"
8+
"vitest-browser-astro": "workspace:^"
99
},
1010
"scripts": {
1111
"test": "echo \"Error: no test specified\" && exit 1"

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@ascorbic/workspace",
2+
"name": "vitest-browser-astro-workspace",
33
"private": true,
44
"version": "1.0.0",
5-
"description": "",
5+
"description": "Vitest browser mode renderer for Astro",
66
"scripts": {
7-
"check": "pnpm run --filter @ascorbic/* check",
8-
"test": "pnpm run --filter @ascorbic/* test",
9-
"build": "pnpm run --filter @ascorbic/* build",
7+
"check": "pnpm run --filter vitest-browser-astro check",
8+
"test": "pnpm run --filter vitest-browser-astro test",
9+
"build": "pnpm run --filter vitest-browser-astro build",
1010
"format": "prettier --write ."
1111
},
1212
"keywords": [],

packages/example/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# vitest-browser-astro
2+
3+
Vitest browser mode renderer for Astro components.
4+
5+
## Installation
6+
7+
```shell
8+
npm install vitest-browser-astro
9+
```
10+
11+
## Usage
12+
13+
Configure Vitest to use the Astro browser renderer:
14+
15+
```ts
16+
// vitest.config.ts
17+
import { defineConfig } from 'vitest/config';
18+
19+
export default defineConfig({
20+
test: {
21+
browser: {
22+
enabled: true,
23+
name: 'chromium',
24+
provider: 'playwright',
25+
providerOptions: {
26+
context: {
27+
viewport: { width: 1280, height: 720 },
28+
},
29+
},
30+
},
31+
},
32+
});
33+
```

packages/example/package.json renamed to packages/vitest-browser-astro/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@ascorbic/example",
2+
"name": "vitest-browser-astro",
33
"version": "0.0.0",
4-
"description": "",
4+
"description": "Vitest browser mode renderer for Astro",
55
"type": "module",
66
"main": "dist/index.js",
77
"files": [
@@ -26,11 +26,11 @@
2626
},
2727
"repository": {
2828
"type": "git",
29-
"url": "git+github.com:ascorbic/library-template.git",
30-
"directory": "packages/example"
29+
"url": "git+github.com:ascorbic/vitest-browser-astro.git",
30+
"directory": "packages/vitest-browser-astro"
3131
},
32-
"homepage": "https://github.com/ascorbic/library-template",
33-
"keywords": [],
32+
"homepage": "https://github.com/ascorbic/vitest-browser-astro",
33+
"keywords": ["vitest", "browser", "astro", "testing"],
3434
"author": "Matt Kane",
3535
"license": "MIT"
3636
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)