Framework development
Set up the AntelopeJS core repository, test and check your changes, and follow the design and release rules of the core framework.
Contributing to the core framework
The AntelopeJS core framework is open source and accepts contributions from everyone. This page covers what is specific to the core repository, AntelopeJS/antelopejs, which publishes @antelopejs/core.
Setting up your environment
Prerequisites
- Node.js, in a version that the
enginesfield ofpackage.jsonaccepts. CI uses the version in.nvmrc. - pnpm, in the version that the
packageManagerfield ofpackage.jsondeclares - Git
- A code editor, such as Visual Studio Code
Development environment setup
# 1. Fork the repository
# Visit https://github.com/AntelopeJS/antelopejs and click "Fork"
# 2. Clone your fork
git clone https://github.com/YOUR_USERNAME/antelopejs.git
cd antelopejs
# 3. Install dependencies
pnpm install --frozen-lockfile
# 4. Create a branch
git checkout -b feat/my-improvement
Development workflow
Testing changes
Write the tests before the code when you add a feature or fix a bug:
- Write the tests that define the expected behavior.
- Change the code until the tests pass.
- Run the test suite.
# Run the unit tests under coverage, then the end-to-end suites
pnpm test
# Run the unit tests whose names match a pattern
pnpm test:unit --grep "feature name"
pnpm test runs the unit suites in test/ under coverage, which must stay at 90% or more. It then builds dist and runs the embedded runtime, package consumer and playground suites against it.
Using the playground
The repository includes a playground for manual testing. From the repository root, build the core, install the playground dependencies and start its development command:
pnpm build
pnpm --dir playground install
pnpm --dir playground dev
pnpm --dir playground dev runs ajs project run -w from the local build. Check your changes in the playground, then run pnpm test:playground for its automated checks. The playground uses the local core build, so rebuild after you change the core source.
Code quality
Run the lint and format checks while you work:
# Run oxlint and the dependency rules
pnpm lint
# Fix the lint findings that oxlint can fix
pnpm lint:fix
# Check formatting without changing files
pnpm format:check
Before you open a pull request, run pnpm run checks. It runs the type check, lint, format, knip, tests, size, ratchet, suppressions and sync checks, and prints only what failed.
Core design principles
Follow these principles when you change the framework:
| Principle | Description |
|---|---|
| Modularity | A feature is self-contained, with clear boundaries |
| Compatibility | A change keeps backward compatibility unless there is a strong reason |
| Performance | A new feature adds no significant overhead |
| Simplicity | A simple solution wins over a complex one |
| Testability | Tests cover all code |
Documentation requirements
Update the documentation in the same pull request as the code:
- Code comments. Give every public API a TSDoc comment.
- Documentation files. Update the relevant Markdown files in
docs/. - Examples. Include practical usage examples.
- Type definitions. Keep the TypeScript types accurate and complete.
Release cycle
AntelopeJS follows this release process:
- Development. Contributors build features on branches.
- Review. Maintainers review each pull request.
- Integration. Maintainers merge approved changes into the default branch.
- Testing. CI tests the integrated changes.
- Release. Maintainers publish to npm from GitHub Actions with semantic versioning. Stable releases (
latest) come from the default branch and prereleases (next) from thenextbranch. - Documentation. The release commit writes
CHANGELOG.md, and the docs are updated with it.
Getting support
If you need help with framework development:
- Ask questions in #support on the AntelopeJS Discord server
- Search the existing pull requests and issues for similar work