Skip to content

Commit aec222f

Browse files
author
Copilot Temp
committed
Switch tooling from deno to vite-plus
1 parent bc8b39e commit aec222f

34 files changed

Lines changed: 3080 additions & 1413 deletions

.githooks/pre-commit

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

.github/workflows/ci.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v6
17-
- uses: actions/setup-node@v6
17+
- uses: voidzero-dev/setup-vp@v1
1818
with:
19-
node-version: 24
20-
- run: npm install --no-package-lock --ignore-scripts
21-
- uses: denoland/setup-deno@v2
22-
with:
23-
deno-version: latest
19+
cache: true
2420
- name: Validate source and package outputs
25-
run: deno task validate
21+
run: vp run validate
2622
test-node:
2723
runs-on: ubuntu-latest
2824
needs: validate
@@ -32,21 +28,20 @@ jobs:
3228
node-version: [22, 24]
3329
steps:
3430
- uses: actions/checkout@v6
35-
- uses: actions/setup-node@v6
31+
- uses: voidzero-dev/setup-vp@v1
3632
with:
3733
node-version: ${{ matrix.node-version }}
38-
- run: npm install --no-package-lock --ignore-scripts
39-
- run: npm x vitest run
34+
cache: true
35+
- run: npm test
4036
test-bun:
4137
runs-on: ubuntu-latest
4238
needs: validate
4339
steps:
4440
- uses: actions/checkout@v6
45-
- uses: actions/setup-node@v6
41+
- uses: voidzero-dev/setup-vp@v1
4642
with:
47-
node-version: 24
48-
- run: npm install --no-package-lock --ignore-scripts
43+
cache: true
4944
- uses: oven-sh/setup-bun@v2
5045
with:
5146
bun-version: latest
52-
- run: bun x vitest run
47+
- run: bun run test

.github/workflows/release.yml

Lines changed: 11 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,25 @@
1-
name: Release
1+
name: Publish
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
bump:
7-
description: Version bump type when version is not provided
8-
required: true
9-
default: patch
10-
type: choice
11-
options:
12-
- patch
13-
- minor
14-
- major
15-
version:
16-
description: Explicit release version (overrides bump)
17-
required: false
18-
type: string
19-
publish:
20-
description: Publish to JSR and npm (false runs dry-run commands)
21-
required: true
22-
default: true
23-
type: boolean
4+
push:
5+
tags:
6+
- "v*"
247

258
concurrency:
26-
group: release-${{ github.ref }}
9+
group: publish-${{ github.ref }}
2710
cancel-in-progress: false
2811

2912
permissions:
30-
contents: write
13+
contents: read
3114
id-token: write
3215

3316
jobs:
34-
release:
17+
publish:
3518
runs-on: ubuntu-latest
36-
env:
37-
RELEASE_BUMP: ${{ inputs.bump }}
38-
RELEASE_VERSION: ${{ inputs.version }}
39-
RELEASE_PUBLISH: ${{ inputs.publish }}
4019
steps:
4120
- uses: actions/checkout@v6
21+
- uses: voidzero-dev/setup-vp@v1
4222
with:
43-
fetch-depth: 0
44-
45-
- uses: actions/setup-node@v6
46-
with:
47-
node-version: 24
48-
registry-url: https://registry.npmjs.org
49-
50-
- uses: denoland/setup-deno@v2
51-
with:
52-
deno-version: v2.x
53-
54-
- name: Install npm dev dependencies
55-
run: npm install --no-package-lock --ignore-scripts
56-
57-
- name: Resolve release version
58-
id: version
59-
run: deno run -A scripts/release-helper.ts resolve >> "$GITHUB_OUTPUT"
60-
61-
- name: Ensure release tag does not already exist
62-
shell: bash
63-
run: |
64-
set -euo pipefail
65-
git fetch --tags --force
66-
if git rev-parse --verify "refs/tags/${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
67-
echo "::error::Tag already exists: ${{ steps.version.outputs.tag }}"
68-
exit 1
69-
fi
70-
71-
- name: Extract release notes from changelog
72-
env:
73-
RELEASE_VERSION: ${{ steps.version.outputs.version }}
74-
run: |
75-
export RELEASE_NOTES_FILE="$RUNNER_TEMP/release-notes.md"
76-
deno run -A scripts/release-helper.ts notes
77-
78-
- name: Sync version files
79-
env:
80-
RELEASE_VERSION: ${{ steps.version.outputs.version }}
81-
run: |
82-
npm version "$RELEASE_VERSION" --no-git-tag-version --allow-same-version
83-
deno run -A scripts/sync-package-metadata.ts
84-
85-
- name: Validate npm package contents
86-
run: npm pack --dry-run
87-
88-
- name: Run npm tests
89-
run: npm test
90-
91-
- if: env.RELEASE_PUBLISH != 'true'
92-
name: Run publish dry-runs
93-
run: |
94-
set -euo pipefail
95-
deno publish --dry-run --allow-dirty
96-
npm publish --provenance --dry-run
97-
98-
- if: env.RELEASE_PUBLISH == 'true'
99-
name: Publish to npm and JSR (idempotent)
100-
env:
101-
RELEASE_VERSION: ${{ steps.version.outputs.version }}
102-
run: |
103-
set -euo pipefail
104-
105-
if npm view "@rotu/structview@${RELEASE_VERSION}" version >/dev/null 2>&1; then
106-
echo "npm already has @rotu/structview@${RELEASE_VERSION}; skipping npm publish"
107-
else
108-
npm publish --provenance
109-
fi
110-
111-
if deno eval --quiet 'const packageMeta = await fetch("https://jsr.io/@rotu/structview/meta.json").then((response) => response.json()); const versions = packageMeta?.versions ?? {}; Deno.exit(Object.hasOwn(versions, Deno.env.get("RELEASE_VERSION") ?? "") ? 0 : 1);'; then
112-
echo "JSR already has @rotu/structview@${RELEASE_VERSION}; skipping JSR publish"
113-
else
114-
deno publish --allow-dirty
115-
fi
116-
117-
- if: env.RELEASE_PUBLISH == 'true'
118-
name: Verify published version parity
119-
env:
120-
RELEASE_VERSION: ${{ steps.version.outputs.version }}
121-
run: |
122-
set -euo pipefail
123-
124-
npm view "@rotu/structview@${RELEASE_VERSION}" version >/dev/null
125-
126-
deno eval --quiet 'const packageMeta = await fetch("https://jsr.io/@rotu/structview/meta.json").then((response) => response.json()); const versions = packageMeta?.versions ?? {}; if (!Object.hasOwn(versions, Deno.env.get("RELEASE_VERSION") ?? "")) { throw new Error(`JSR is missing version ${Deno.env.get("RELEASE_VERSION")}`); }'
127-
128-
- if: env.RELEASE_PUBLISH == 'true'
129-
name: Commit and tag release
130-
shell: bash
131-
run: |
132-
set -euo pipefail
133-
git config user.name github-actions[bot]
134-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
135-
git add package.json deno.json
136-
137-
if git diff --cached --quiet; then
138-
echo "No version changes to commit; tagging current HEAD"
139-
else
140-
git commit -m "chore(release): ${{ steps.version.outputs.tag }}"
141-
git push origin HEAD
142-
fi
143-
144-
git tag -a "${{ steps.version.outputs.tag }}" -m "Release ${{ steps.version.outputs.tag }}"
145-
git push origin "${{ steps.version.outputs.tag }}"
146-
147-
- if: env.RELEASE_PUBLISH == 'true'
148-
name: Create GitHub release
149-
env:
150-
GH_TOKEN: ${{ github.token }}
151-
run: gh release create "${{ steps.version.outputs.tag }}" --notes-file "$RUNNER_TEMP/release-notes.md"
23+
cache: true
24+
- name: Publish tagged release
25+
run: ./scripts/release.ts publish-tag "$GITHUB_REF_NAME"

.vite-hooks/pre-commit

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

.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "recommendations": ["VoidZero.vite-plus-extension-pack"] }

.vscode/settings.json

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
{
2-
"deno.enable": true,
2+
"[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
3+
"[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
4+
"[json]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
5+
"[jsonc]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
6+
"[markdown]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
7+
"editor.defaultFormatter": "oxc.oxc-vscode",
8+
"oxc.fmt.configPath": "./vite.config.ts",
9+
"npm.scriptRunner": "vp",
10+
"editor.formatOnSave": true,
311
"editor.formatOnSaveMode": "file",
4-
"chat.tools.terminal.autoApprove": {
5-
"/^deno test --unstable --allow-read --allow-net$/": {
6-
"approve": true,
7-
"matchCommandLine": true
8-
}
9-
},
10-
"[javascript]": {
11-
"editor.defaultFormatter": "denoland.vscode-deno"
12-
},
13-
"[typescript]": {
14-
"editor.defaultFormatter": "denoland.vscode-deno"
15-
},
16-
"[json]": {
17-
"editor.defaultFormatter": "denoland.vscode-deno"
18-
},
19-
"[jsonc]": {
20-
"editor.defaultFormatter": "denoland.vscode-deno"
21-
},
22-
"[markdown]": {
23-
"editor.defaultFormatter": "denoland.vscode-deno"
12+
"editor.codeActionsOnSave": { "source.fixAll.oxc": "explicit" },
13+
"terminal.integrated.env.osx": {
14+
"PATH": "${workspaceFolder}/node_modules/.bin:${env:PATH}"
2415
}
2516
}

AGENTS.md

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,48 @@
11
# structview agent and developer notes
22

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.
54

65
## Local git hooks
76

87
Install repository hooks with:
98

109
```sh
11-
git config core.hooksPath .githooks
10+
git config core.hooksPath .vite-hooks
1211
```
1312

14-
This enables the hooks in `.githooks/`.
13+
This enables the hooks in `.vite-hooks/`.
1514

16-
1. `pre-commit`: runs `deno fmt --check` and `deno lint`.
15+
1. `pre-commit`: runs `vp staged`.
1716

1817
## Fixups
1918

2019
Run these after changing package metadata or CI/package validation behavior.
2120

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.
2924

3025
## Commands
3126

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.
4735

4836
## Releases
4937

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
5147

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.

CHANGELOG.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,24 @@
22

33
## 0.17.0-pre — 2026-04-12
44

5-
- Add variable-length `string` field: `byteLength` is now optional and defaults
6-
to the end of the struct's buffer.
7-
- Add `bytes` field: returns a live `Uint8Array` view into the struct's buffer,
8-
with optional fixed or variable length.
5+
- Add variable-length `string` field: `byteLength` is now optional and defaults to the end of the struct's buffer.
6+
- Add `bytes` field: returns a live `Uint8Array` view into the struct's buffer, with optional fixed or variable length.
97

108
## 0.16.2 — 2026-04-05
119

12-
- Fix npm package imports under Node by shipping JavaScript entrypoints instead
13-
of relying on TypeScript-only package resolution from `node_modules`.
10+
- Fix npm package imports under Node by shipping JavaScript entrypoints instead of relying on TypeScript-only package resolution from `node_modules`.
1411

1512
## 0.16.1 — 2026-04-02
1613

1714
- Align release publishing so npm and JSR stay version-synchronized.
1815

1916
## 0.16.0 — 2026-04-01
2017

21-
- BREAKING: `Struct` no longer calls `Object.preventExtensions()` during
22-
construction. If you want non-extensible instances, call
23-
`Object.preventExtensions()` yourself after object construction.
18+
- BREAKING: `Struct` no longer calls `Object.preventExtensions()` during construction. If you want non-extensible instances, call `Object.preventExtensions()` yourself after object construction.
2419

2520
## 0.15.0 — 2026-03-27
2621

27-
- cc3b63a — Fix fromDataView: enumerable, complete comment, optional setter,
28-
readonly inference (#5)
22+
- cc3b63a — Fix fromDataView: enumerable, complete comment, optional setter, readonly inference (#5)
2923

3024
## 0.14.1 — 2026-01-20
3125

@@ -41,8 +35,7 @@
4135

4236
## 0.13.0 — 2025-11-10
4337

44-
- 703ee48 — Support static `.alloc` method and static `BYTE_LENGTH` field for
45-
fixed-sized structs
38+
- 703ee48 — Support static `.alloc` method and static `BYTE_LENGTH` field for fixed-sized structs
4639

4740
## 0.12.0 — 2025-10-22
4841

0 commit comments

Comments
 (0)