Skip to content

Commit 8e92d7b

Browse files
authored
Migrate toolchain to Vite+
1 parent 607afcd commit 8e92d7b

113 files changed

Lines changed: 3310 additions & 6062 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,26 @@ jobs:
1414
- name: Begin CI...
1515
uses: actions/checkout@v4
1616

17-
- name: Install pnpm
18-
uses: pnpm/action-setup@v4
19-
20-
- name: Use Node 24
21-
uses: actions/setup-node@v4
17+
- name: Setup Vite+
18+
uses: voidzero-dev/setup-vp@v1
2219
with:
23-
node-version: 24.x
24-
cache: 'pnpm'
20+
node-version: '24'
21+
cache: true
2522

2623
- name: Install dependencies
27-
run: pnpm install --frozen-lockfile
24+
run: vp install --frozen-lockfile
2825

2926
- name: Build
30-
run: pnpm run build
31-
32-
- name: Type check
33-
run: pnpm run typecheck
27+
run: vp run --filter "./packages/*" build
3428

35-
- name: Lint
36-
run: pnpm run lint
29+
- name: Static checks
30+
run: vp check
3731

38-
- name: Format check
39-
run: pnpm run format-check
32+
- name: TypeScript comparison
33+
run: vp run --filter "./packages/*" typecheck
4034

4135
- name: Test
42-
run: pnpm run test
36+
run: vp run --filter "./packages/*" test
4337

4438
release:
4539
needs: [build]
@@ -55,17 +49,17 @@ jobs:
5549
- name: Checkout
5650
uses: actions/checkout@v4
5751

58-
- name: Install pnpm
59-
uses: pnpm/action-setup@v4
60-
61-
- name: Setup Node 24
62-
uses: actions/setup-node@v4
52+
- name: Setup Vite+
53+
uses: voidzero-dev/setup-vp@v1
6354
with:
64-
node-version: 24.x
65-
cache: 'pnpm'
55+
node-version: '24'
56+
cache: true
6657

6758
- name: Install dependencies
68-
run: pnpm install --frozen-lockfile
59+
run: vp install --frozen-lockfile
60+
61+
- name: Enable pnpm for publishing
62+
run: corepack enable pnpm
6963

7064
- name: Release
7165
id: changesets

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2+
.pnpm-store
23
packages/*/*.tgz
34
coverage
45
packages/*/coverage

.prettierignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.vite-hooks/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vp staged

.vite-hooks/pre-push

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vp run --filter "./packages/*" build
2+
vp run --filter "./packages/*" test

AGENTS.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ This repository is the Pydantic Logfire JavaScript SDK monorepo. It provides Ope
1919

2020
- Use the Node.js version in `.node-version`. The root `package.json` also enforces Node.js 24 through `engines`.
2121
- Use pnpm 10.28.0. The package manager is pinned in `packageManager`.
22+
- Use Vite+ (`vp`) for the JavaScript toolchain entrypoint. Vite+ manages Vite, Vitest, Oxlint, Oxfmt, and package build tasks.
2223
- Run workspace commands from the repository root unless a package-level command is explicitly needed.
2324

2425
## Useful Commands
2526

2627
Install dependencies:
2728

2829
```bash
29-
pnpm install
30+
vp install
3031
```
3132

3233
Build all packages:
@@ -56,15 +57,15 @@ pnpm run check
5657
Run focused checks for one package:
5758

5859
```bash
59-
pnpm --filter logfire test
60-
pnpm --filter @pydantic/logfire-node test
61-
pnpm --filter @pydantic/logfire-browser typecheck
60+
vp run logfire#test
61+
vp run @pydantic/logfire-node#test
62+
vp run @pydantic/logfire-browser#typecheck
6263
```
6364

64-
Run a single Vitest test by name from a package filter:
65+
Run a single Vite+ test by name from a package:
6566

6667
```bash
67-
pnpm --filter logfire test -- -t "test name pattern"
68+
vp run logfire#test -- -t "test name pattern"
6869
```
6970

7071
Format or verify formatting:
@@ -103,10 +104,11 @@ pnpm run changeset-add
103104
- Tests use Vitest and usually live alongside source files as `*.test.ts`.
104105
- Prefer exact assertions over fuzzy matching for stable output. Use `toBe` or `toEqual` with deterministic inputs instead of `toContain` or broad regex matching.
105106
- When testing formatted errors or stack output, mock stack strings so assertions stay deterministic.
106-
- For changes under `packages/logfire-api/src/evals`, consider the focused coverage script:
107+
- The focused eval coverage script is temporarily disabled during the Vite+ migration because Vite+ coverage currently reports mixed Vitest package versions. For eval changes, run the package tests and typecheck instead:
107108

108109
```bash
109-
pnpm --filter logfire run coverage:evals
110+
vp run logfire#test
111+
vp run logfire#typecheck
110112
```
111113

112114
## Package-Specific Notes

eslint-config.mjs

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/browser/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite",
8-
"build": "tsc && vite build",
7+
"dev": "vp dev",
8+
"build": "tsc && vp build",
99
"proxy": "tsx --env-file=.env src/proxy.ts",
10-
"preview": "vite preview"
10+
"preview": "vp preview"
1111
},
1212
"dependencies": {
1313
"@opentelemetry/auto-instrumentations-web": "catalog:",
@@ -22,7 +22,7 @@
2222
"@types/express": "^4.17.21",
2323
"logfire": "workspace:*",
2424
"tsx": "^4.7.0",
25-
"typescript": "~5.9.3",
26-
"vite": "^6.3.5"
25+
"typescript": "catalog:",
26+
"vite": "^8.0.10"
2727
}
2828
}

examples/cf-producer-worker/.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/cf-producer-worker/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
"cf-typegen": "wrangler types"
1010
},
1111
"devDependencies": {
12-
"@cloudflare/vitest-pool-workers": "^0.12.21",
13-
"@cloudflare/workers-types": "^4.20260317.1",
14-
"typescript": "^5.9.3",
15-
"vitest": "^3.2.4",
12+
"@cloudflare/vitest-pool-workers": "^0.15.1",
13+
"@cloudflare/workers-types": "^4.20260430.1",
14+
"@vitest/runner": "^4.1.5",
15+
"@vitest/snapshot": "^4.1.5",
16+
"typescript": "catalog:",
17+
"vitest": "^4.1.5",
1618
"wrangler": "^4.75.0"
1719
},
1820
"dependencies": {

0 commit comments

Comments
 (0)