|
1 | 1 | # structview agent and developer notes |
2 | 2 |
|
3 | | -This file holds repository workflow documentation that is mainly useful for |
4 | | -contributors and coding agents. |
| 3 | +This file holds repository workflow documentation that is mainly useful for contributors and coding agents. |
5 | 4 |
|
6 | 5 | ## Local git hooks |
7 | 6 |
|
8 | 7 | Install repository hooks with: |
9 | 8 |
|
10 | 9 | ```sh |
11 | | -git config core.hooksPath .githooks |
| 10 | +git config core.hooksPath .vite-hooks |
12 | 11 | ``` |
13 | 12 |
|
14 | | -This enables the hooks in `.githooks/`. |
| 13 | +This enables the hooks in `.vite-hooks/`. |
15 | 14 |
|
16 | | -1. `pre-commit`: runs `deno fmt --check` and `deno lint`. |
| 15 | +1. `pre-commit`: runs `vp staged`. |
17 | 16 |
|
18 | 17 | ## Fixups |
19 | 18 |
|
20 | 19 | Run these after changing package metadata or CI/package validation behavior. |
21 | 20 |
|
22 | | -1. `deno run -A scripts/sync-package-metadata.ts`: rewrite `deno.json` from |
23 | | - `package.json` metadata. |
24 | | -2. `deno task validate`: verify formatting, lint, tests, JSR dry-run, npm pack |
25 | | - dry-run, and a Node install/import smoke test. |
26 | | -3. `npm install --no-package-lock --ignore-scripts`: refresh local dev |
27 | | - dependencies without introducing a lockfile. This is required before local |
28 | | - `deno task validate`, `npm x vitest run`, and `bun x vitest run` commands. |
| 21 | +1. `vp run jsr:sync`: rewrite `jsr.json` from `package.json` metadata. |
| 22 | +2. `vp run validate`: verify metadata sync, Vite+ static checks, Node-side tests, and the JSR dry-run. |
| 23 | +3. `vp install --ignore-scripts`: refresh local dev dependencies from the current lockfile. This is required before local `vp run validate`, `vp test run`, `npm test`, and `bun run test` commands. |
29 | 24 |
|
30 | 25 | ## Commands |
31 | 26 |
|
32 | | -Operational commands are documented here so `deno.json` only carries the main |
33 | | -aggregate validation entrypoint. |
34 | | - |
35 | | -1. `deno task validate`: verify metadata sync, format, lint, tests, JSR dry-run, |
36 | | - npm pack dry-run, and the Node smoke test. |
37 | | -2. `deno x vitest run`: run the Vitest suite through Deno. |
38 | | -3. `npm test`: run the Node-side Vitest suite and the npm install/import smoke |
39 | | - test. |
40 | | -4. `npm x vitest run`: run the Vitest suite in Node. |
41 | | -5. `bun x vitest run`: run the Vitest suite in Bun. |
42 | | -6. `npm run smoke:npm`: pack the current tree, install it into a temporary Node |
43 | | - project, and verify the installed package imports successfully. |
44 | | -7. `deno x vitest bench --run`: run the Vitest benchmark suite. |
45 | | -8. `act -W .github/workflows/ci.yml`: run the CI workflow locally when `act` is |
46 | | - installed. |
| 27 | +Operational commands are documented here so Vite+ remains the canonical command surface: `vite.config.ts` carries the custom task entrypoints, and `package.json` only keeps lifecycle hooks. |
| 28 | + |
| 29 | +1. `vp run validate`: verify metadata sync, Vite+ static checks, tests, and the JSR dry-run. |
| 30 | +2. `vp run build`: emit the npm `dist/` JavaScript files with `vp pack` while preserving the source module layout. |
| 31 | +3. `vp run check`: verify synced metadata, formatting, and type-aware linting. |
| 32 | +4. `vp test run`, `npm test`, and `bun run test`: run the test suite via the canonical Vite+ command, the Node wrapper, and the Bun wrapper. |
| 33 | +5. `vp run bench`: run the Vitest benchmark suite. |
| 34 | +6. `act -W .github/workflows/ci.yml`: run the CI workflow locally when `act` is installed. |
47 | 35 |
|
48 | 36 | ## Releases |
49 | 37 |
|
50 | | -Use the manual GitHub Actions workflow `Release` to cut a release. |
| 38 | +Releases are prepared locally and published from CI on tag push. |
| 39 | + |
| 40 | +1. Ensure `CHANGELOG.md` includes a matching `## X.Y.Z` section. |
| 41 | +2. Run `vp run release prepare <patch|minor|major|X.Y.Z>` to rehearse the release and update local version metadata. Use `vp run release dry-run <...>` if you only want the rehearsal. |
| 42 | +3. Review `package.json`, `jsr.json`, and `package-lock.json` when present, then create the release commit and annotated tag `vX.Y.Z` manually. |
| 43 | +4. Push with `git push origin HEAD --follow-tags`. |
| 44 | +5. The tag-triggered publish workflow validates the tagged commit and publishes to npm and JSR. |
| 45 | + |
| 46 | +## Tooling |
51 | 47 |
|
52 | | -1. Choose a version bump (`patch`, `minor`, `major`) or provide an explicit |
53 | | - version. |
54 | | -2. Ensure `CHANGELOG.md` includes a matching `## X.Y.Z` section. |
55 | | -3. Run with `publish=true` to publish to JSR and npm, or `publish=false` for |
56 | | - dry-run publish checks without pushing a tag or creating a GitHub release. |
57 | | -4. The release workflow uses `package.json` as the version source of truth and |
58 | | - syncs `deno.json` from it before publishing. |
| 48 | +`vite.config.ts` is the single source of truth for Vite+, lint, format, staged, and pack configuration. |
0 commit comments