CONTRIBUTING.md
Contributing
Setup
Requires Node 22.23.4 or newer (see .nvmrc) and pnpm.
sh
| 1 | pnpm install |
| 2 | pnpm dev # site at http://localhost:4321 |
Layout
The repo is a pnpm workspace. The library lives in packages/astro-dither and the documentation site in site. The site only imports the package by name, which proves the package exports work. See "Repository layout" in the root README for the file tree.
Adding an effect
- Write a
field(vec2 uv, vec2 res, float t)GLSL function inpackages/astro-dither/src/lib/effects.ts. It returns a tone 0 to 1 (negative means transparent) and reads its params asp_<name>uniforms.hash21,vnoiseandfbmhelpers are provided. - Add a registry entry with
params,stillTime,paletteandspeed. - Add a test in
ordered-dither.test.ts(registry coverage runs over every entry; add a param-parse assertion for anything non-trivial). - Add a row to the effects table in
packages/astro-dither/README.md. - Add a tile to
site/src/pages/examples.astro.
Before opening a pull request
sh
| 1 | pnpm test # vitest |
| 2 | pnpm check # astro check on package and site |
| 3 | pnpm build # site build |
If you changed what the package ships, also run pnpm --filter astro-dither pack and check the tarball contents.
Style
- Short imperative commit messages ("add horizon effect", "fix shebang line endings").
- Plain language in docs, no em dashes.
- Add an entry to
packages/astro-dither/CHANGELOG.mdfor user-facing changes.