Contributing¶
Contributions are welcome. This page covers setting up a development environment and the project conventions.
Development Setup¶
The project uses bun as the package manager and script runner.
git clone https://github.com/HaoZeke/asv-perch
cd asv-perch
bun install
Available Commands¶
Command |
Description |
|---|---|
|
TypeScript check + Vite bundle to |
|
Run all tests with vitest |
|
Run ESLint |
|
Run ESLint with auto-fix |
|
TypeScript type checking (no emit) |
Project Structure¶
src/parse.tsParses asv-spyglass tabulated output into typed rows. Pure function, no side effects.
src/render.tsRenders parsed rows into the GFM comment body. Pure function, no side effects.
src/run.tsOrchestration logic. Calls GitHub APIs, runs commands, coordinates the steps.
src/index.tsEntry point. Imports and calls
run().
Testing¶
Tests use vitest and are located in test/:
test/parse.test.tsUnit tests for the parser (happy path, edge cases, malformed input)
test/render.test.tsUnit tests for comment rendering (all result combinations)
test/run.test.tsIntegration tests with mocked
@actions/*packages
The test/fixtures/comparison.txt file contains a sample asv-spyglass output
used across tests.
Build Pipeline¶
The build pipeline:
tscruns type checking (noEmit: true, does not produce files)vite buildbundles all TypeScript + npm dependencies into a singledist/index.js(ESM format)
Node.js builtins are marked as external. All @actions/* packages are inlined
since the GitHub runner does not install dependencies.
The dist/index.js file must be committed to the repository – GitHub reads it
directly when running the action.
Conventions¶
Commits follow Conventional Commits
ESLint uses
@antfu/eslint-configwith 1TBS brace style and required parensTypeScript strict mode is enabled
Documentation source files are Org-mode (
docs/orgmode/), converted to RST for Sphinx
Documentation¶
Documentation uses the org-to-sphinx pattern:
Edit
.orgfiles indocs/orgmode/Run
emacs --batch --load docs/export.elto convert to RSTRun
sphinx-build docs/source/ docs/buildto build HTML
Or with pixi:
pixi run docbld