Hey! Welcome to the Contribution guide, thanks for your interest in contributing to KAPLAY.
- Node.js, >24.X.X
- pnpm package manager, >9.1
# Clone repository
git clone https://github.com/kaplayjs/kaplay.git # to clone the repo.
# Enter to project dictory
cd kaplay
# Install dependencies
pnpm install
# Run dev command
pnpm dev- Pick on example to test and edit the corresponding
/examples/[name].js, or create a new file under/examplesto test anything you're working on. - The source entry point is
src/kaplay.ts, editing any files referenced will automatically trigger rebuild. Make sure not to break any existing examples. - Run
pnpm devto start the dev server and try examples.
KAPLAY API documentation is auto-generated by JSDoc comments in the source code.
Normally the definitions of components, types, interfaces (i.e: SpriteComp,
Vec2, RectComp, LifespanCompOpt) are on their own files. For example
src/components/draw/sprite.tsforSpriteCompsrc/math/math.tsforVec2src/components/draw/rect.tsforRectCompsrc/components/misc/lifespan.tsforLifespanCompOpt
Your best option is use ctrl + click on the type to go to the definition and see the JSDoc comments. Other option is to use the search feature of your IDE.
- Follow our conventional commits format. You can see how seeing the commit history.
pnpm run checkto check TypeScript.pnpm run fmtto format.
This guide should be followed for all commits to the repository, and also for issues and PRs.
A commit starts with a type, a scope, and a subject:
<type>(<scope>): <subject>
- The type is mandatory.
- We don't use the scope right now, you must omit it. This may change in the future.
- The subject must be a short description of the change. Use the imperative, present tense: "change" not "changed" nor "changes".