Skip to content

Latest commit

 

History

History
346 lines (231 loc) · 7.32 KB

File metadata and controls

346 lines (231 loc) · 7.32 KB

Contributing

VectorRen is an open invitation to build small, sharp, joyful SVG games.
This project is intentionally simple, intentionally transparent, and intentionally fun.
Contributions are welcome — as long as they follow the philosophy that makes VectorRen work.

This document explains how to contribute without breaking the spirit of the project.


Folder Overview

Folder Purpose
docs/ Project documentation (philosophy, principles, specs, guidelines)
games/ Individual games — each self-contained in its own subfolder
site/ Production site — to test it use the local dev server (localhost:3000)
test-harness/ Shared test runner for all games (Vitest + jsdom)

1. Start Small

VectorRen is built on small, self‑contained games.
If your idea requires:

  • a framework
  • a build step
  • a shared engine
  • or a dependency tree

…it probably doesn’t belong here.

Start with something tiny.
If it sparks joy, grow it.


2. Read the Core Docs First

Before contributing, read:

These documents define the project’s identity.
If your contribution aligns with them, you’re on the right track.


3. Behavior First, Code Second

Every contribution begins with behavior, not code.

Write the behavior in Given / When / Then form:

Given an initial state  
When something happens  
Then the outcome should be clear

If you can’t express the behavior clearly, the feature isn’t ready.


4. Tests Encode Behavior

After writing the behavior, encode it in a test.
Tests should:

  • read like a story
  • avoid implementation details
  • be deterministic
  • be assistant‑friendly

Tests are documentation.
Write them for humans.


5. Keep Games Self‑Contained

Each game lives in its own folder and shares no code with others.

Do not create:

  • shared engines
  • shared utilities
  • shared physics
  • shared rendering code

VectorRen shares ideas, not code.


6. Keep Code Explainable

Contributions should be:

  • readable in one sitting
  • predictable
  • free of clever abstractions
  • easy to debug in DevTools
  • easy for Coding Assistants to understand

If a future contributor would struggle to understand your code, simplify it.


7. SVG Is the Renderer

All rendering must use SVG.
No Canvas.
No WebGL.
No hybrid layers.

Use:

  • groups for structure
  • transforms for motion
  • CSS for style
  • defs + use for instancing

SVG is the engine.
Treat it with respect.


8. No Build Step, No Dependencies

VectorRen runs in a browser tab.
That’s the whole point.

Avoid:

  • bundlers
  • compilers
  • preprocessors
  • dependency forests

If your contribution requires a build step, rethink it.


9. Keep the DOM Shallow

SVG scenes should be:

  • shallow
  • semantic
  • easy to inspect
  • easy to debug

If someone can’t understand the scene graph in DevTools, simplify it.


10. Use Consistent Naming

Follow the naming conventions:

  • nouns for state
  • verbs for behavior
  • lower camel case for JS
  • kebab case for files
  • semantic IDs and classes in SVG

Consistency helps both humans and assistants.


11. Work With Assistants, Not Against Them

Coding Assistants are collaborators.
To help them help you:

  • write clear behavior specs
  • use consistent naming
  • avoid synonyms for the same concept
  • avoid clever abstractions
  • keep files small and focused

Assistants thrive on clarity.
So does VectorRen.


12. Submit Clean Pull Requests

A good PR:

  • includes behavior specs
  • includes tests
  • includes documentation
  • includes readable code
  • does not include unrelated changes
  • does not introduce dependencies
  • does not break the philosophy

Small, intentional PRs are easier to review and easier to merge.

PRs over ~200 lines will be reviewed more slowly. If your change is large, consider splitting it into smaller pieces with clear, independent purposes.


13. Respect the Aesthetic

VectorRen games should feel like vector games:

  • crisp lines
  • geometric shapes
  • neon glows
  • minimalism
  • wireframe vibes

Avoid raster textures, faux‑3D hacks, or anything that breaks the aesthetic.


14. Follow the Fun

VectorRen is a renaissance — a return to joyful building.

If your contribution feels heavy, complicated, or joyless, stop and rethink it.
If it sparks joy, you’re on the right path.


15. Development Setup

VectorRen uses NPM only as a lightweight host and test runner, not as a build system. There is no bundler, no transpiler, and no compile step.

The repository has three independent NPM projects — each in its own subfolder:

Folder Purpose
site/ Local dev server (serves the site at localhost:3000)
test-harness/ Shared test runner for all games (Vitest + jsdom)
games/<name>/ Per-game test runner (Vitest, no DOM)

To run the site locally:

cd site
npm start

Open your browser to http://localhost:3000. No install step required — npx serve is used directly.

To run the shared test harness:

cd test-harness
npm install
npm test

To run a game's own tests:

cd games/vectoroids
npm install
npm test

If your contribution requires more than this, it is probably too complex for VectorRen.


16. Running Tests

Tests live in two places:

  • test-harness/tests/ — integration-style behavior specs that test game logic using jsdom (Vitest)
  • games/<name>/tests/ — game-level specs that test pure logic without the DOM (Vitest)

Tests are:

  • deterministic
  • behavior-driven
  • written to be read by humans and assistants

Run the shared test harness:

cd test-harness
npm test

Run a specific game's tests:

cd games/vectoroids
npm test

Watch mode (re-runs on file save):

npm run test:watch

Tests always encode the behavior you wrote in Given / When / Then form. If the behavior changes, the tests change first.


17. Filing Issues

If you find a bug, have an idea, or want to propose something:

  1. Open an Issue
  2. Keep it small
  3. Describe the behavior, not the implementation
  4. Include a minimal reproduction if it is a bug
  5. Link to any relevant docs (Philosophy, Principles, SVG Guidelines, etc.)

Issues that align with the project’s philosophy are easier to act on. Issues that do not will be closed quickly and kindly.


18. Proposing New Games

New games are welcome — as long as they follow the VectorRen ethos.

A good game proposal:

  • starts tiny
  • has a clear behavior spec
  • uses SVG as the renderer
  • avoids dependencies
  • fits the aesthetic (crisp lines, geometric shapes, neon vibes)
  • can be understood in one sitting

If your idea requires a shared engine, a physics library, or a build step, it is not a VectorRen game.

Propose something small. If it sparks joy, we will grow it.

Final Note

Contributing to VectorRen isn’t about adding features.
It’s about adding clarity, craft, and delight.

Build small.
Build sharp.
Build with intention.
And above all — have fun.