Skip to content

Commit 481db3d

Browse files
committed
Align release setup with Vite+ recommendations
1 parent 16df166 commit 481db3d

11 files changed

Lines changed: 191 additions & 472 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
- name: Create release PR or publish
3030
uses: changesets/action@v1
3131
with:
32-
# `pnpm` isn't on PATH under setup-vp; drive the scripts through `vp run`.
33-
version: vp run version-packages
34-
publish: vp run release
32+
# `pnpm` isn't on PATH under setup-vp; run the local Changesets binary through `vp exec`.
33+
version: vp exec -w changeset version
34+
publish: vp run -r --concurrency-limit 1 build && vp exec -w changeset publish
3535
env:
3636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3737
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"ready": "vp run -w check && vp run -r test && vp run -r build",
8-
"prepare": "vp config",
9-
"changeset": "changeset",
10-
"version-packages": "changeset version",
11-
"release": "vp run -r --concurrency-limit 1 build && changeset publish"
7+
"prepare": "vp config"
128
},
139
"devDependencies": {
1410
"@changesets/cli": "^2.31.0",
11+
"vite": "catalog:",
1512
"vite-plus": "catalog:"
1613
},
1714
"engines": {

packages/propel/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
},
5757
"scripts": {
5858
"dev": "vp pack --watch",
59-
"prepublishOnly": "vp run build",
6059
"storybook": "storybook dev -p 6006"
6160
},
6261
"dependencies": {
@@ -78,17 +77,18 @@
7877
"@types/react": "^19.2.17",
7978
"@types/react-dom": "^19.2.3",
8079
"@typescript/native-preview": "catalog:",
81-
"@vitest/browser-playwright": "4.1.9",
82-
"@vitest/coverage-v8": "4.1.9",
80+
"@vitest/browser-playwright": "catalog:",
81+
"@vitest/coverage-v8": "catalog:",
8382
"playwright": "catalog:",
8483
"react": "^19.2.7",
8584
"react-dom": "^19.2.7",
8685
"storybook": "^10.4.6",
8786
"storybook-addon-pseudo-states": "^10.4.6",
8887
"tailwindcss": "catalog:",
8988
"typescript": "^6.0.3",
89+
"vite": "catalog:",
9090
"vite-plus": "catalog:",
91-
"vitest": "4.1.9",
91+
"vitest": "catalog:",
9292
"wrangler": "4.107.0"
9393
},
9494
"peerDependencies": {

packages/propel/scripts/pack-retry.mjs

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

packages/propel/vite.config.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference types="vitest/config" />
21
import { existsSync, readdirSync } from "node:fs";
32
// Build one entry per primitive/component/hook so each is published as its own
43
// subpath. The three component tiers each get a group: `base` (Base UI extensions),
@@ -14,12 +13,21 @@ import path from "node:path";
1413
import { fileURLToPath } from "node:url";
1514

1615
import { storybookTest } from "@storybook/addon-vitest/vitest-plugin";
17-
import { playwright } from "@vitest/browser-playwright";
1816
import { defineConfig } from "vite-plus";
17+
import { playwright } from "vite-plus/test/browser-playwright";
1918
import { configDefaults } from "vite-plus/test/config";
2019

2120
const dirname =
2221
typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
22+
const agentIgnorePatterns = ["**/.claude/**", "**/.agents/**"];
23+
const taskInput = [
24+
{ auto: true },
25+
"!**/.agents/**",
26+
"!**/.claude/**",
27+
"!dist/**",
28+
"!node_modules/.vite-temp/**",
29+
"!storybook-static/**",
30+
];
2331

2432
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
2533
function subpathEntries(): Record<string, string> {
@@ -78,30 +86,29 @@ export default defineConfig({
7886
run: {
7987
tasks: {
8088
build: {
81-
command: "node ./scripts/pack-retry.mjs",
82-
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
89+
command: "vp pack",
90+
input: taskInput,
8391
output: ["dist/**"],
8492
},
8593
"build-storybook": {
8694
command: "storybook build",
87-
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
95+
input: taskInput,
8896
output: ["storybook-static/**"],
8997
},
9098
check: {
9199
command: "vp check",
92-
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
100+
input: taskInput,
93101
output: [],
94102
},
95103
test: {
96104
command: "vp test",
97-
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
105+
input: taskInput,
98106
output: [],
99107
},
100108
},
101109
},
102-
// Keep vite's dev/test server out of nested agent worktrees (`.claude/worktrees/<name>`,
103-
// full second checkouts living inside the workspace root). See the root `vite.config.ts`.
104-
server: { watch: { ignored: ["**/.claude/**"] } },
110+
// Keep vite's dev/test server out of local agent state. See the root `vite.config.ts`.
111+
server: { watch: { ignored: agentIgnorePatterns } },
105112
// Pre-bundle every story's deps in a single optimizer pass at server start. Without this the
106113
// browser discovers deps lazily, so a late story importing a not-yet-bundled dep triggers a
107114
// mid-run re-optimize; that commits a new bundle, reloads the page, and 404s the module
@@ -116,7 +123,7 @@ export default defineConfig({
116123
// Vitest ignores `.gitignore`, so its file discovery would otherwise crawl those
117124
// worktree checkouts (each carries a duplicate copy of every story). The storybook
118125
// project below extends this config, so the exclude applies to it too.
119-
exclude: [...configDefaults.exclude, "**/.claude/**"],
126+
exclude: [...configDefaults.exclude, ...agentIgnorePatterns],
120127
// The standard Storybook Vitest-addon project: one chromium browser instance running
121128
// every story as a test (render → play → a11y gate). See the addon docs:
122129
// https://storybook.js.org/docs/writing-tests/integrations/vitest-addon

packages/propel/vitest.shims.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/// <reference types="@vitest/browser-playwright" />
1+
/// <reference types="vite-plus/test/browser-playwright" />

0 commit comments

Comments
 (0)