Hey! Welcome to the Contribution guide, thanks for your interest in contributing to KAPLAY.
- Node.js, >24.X.X
# Clone repository
git clone https://github.com/kaplayjs/kaplay.git # to clone the repo.
# Enter to project dictory
cd kaplay
# Install dependencies
npm install
# Run dev command
npm devAdditionally, for running tests you will need to run the following command:
npm run test:setup # This will install setup and install browsers for playwright.- 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
npm run 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.
npm run checkto check TypeScript.npm 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".