Repository Structure
The project is a pnpm workspace monorepo:Packages
packages/core: Zero-dependency achievement enginepackages/react: React bindings (depends on core)
Apps
apps/example: Live demo showcasing all features
Getting Started
Install Dependencies
Install all workspace dependencies using pnpm:Requirements:
- Node.js 18+
- pnpm 10.26.0+ (specified in
package.json)
Build Packages
Build all packages in the workspace:This compiles TypeScript and bundles packages using Rolldown.
Development Commands
All commands run from the repository root:Building
Type Checking
Testing
Linting
Formatting
Development Server
Making Changes
Workflow
Make Changes
Edit source files in the appropriate package:
- Core engine:
packages/core/src/ - React bindings:
packages/react/src/ - Example app:
apps/example/src/
Commit Changes
Write clear, descriptive commit messages:Commit message format:
feat:New featurefix:Bug fixdocs:Documentation changesrefactor:Code refactoringtest:Test updateschore:Build/tooling changes
Code Style
TypeScript
- Use strict mode
- Prefer
typeoverinterfacefor public API - Export types alongside implementations
- Use readonly modifiers for immutable data
React
- Use function components
- Use hooks for state/effects
- Keep components focused and composable
- Prefer named exports
Formatting
Code is automatically formatted withoxfmt. Run before committing:
Linting
Code is linted withoxlint. Fix issues before committing:
Testing Guidelines
Unit Tests
Write tests for:- New features
- Bug fixes
- Edge cases
- Public API methods
Integration Tests
Test interactions between modules:- Storage adapters with engine
- React hooks with engine
- Toast queue behavior
Example App Testing
Manually test in the example app:- Start dev server:
pnpm dev:example - Test all achievement types
- Verify localStorage persistence
- Check toast notifications
- Test tamper detection (edit localStorage)
Documentation
README Files
Update package READMEs when changing:- Public API
- Configuration options
- Usage examples
Code Comments
Add JSDoc comments for:- Public API methods
- Complex logic
- Type definitions
Changelog
Maintainers will updateCHANGELOG.md during release. Include in your PR:
- What changed
- Why it changed
- Migration notes (if breaking)
Pull Request Guidelines
Before Submitting
- Tests pass:
pnpm test - Types check:
pnpm typecheck - Linting passes:
pnpm lint - Code is formatted:
pnpm format - Example app works:
pnpm dev:example - Documentation updated
- Commit messages follow convention
PR Description
Include:- What: What does this PR do?
- Why: Why is this change needed?
- How: How does it work?
- Testing: How did you test it?
- Breaking: Any breaking changes?
Review Process
- Automated checks run on PR
- Maintainer reviews code
- Address feedback
- Approval and merge
Release Process
For maintainers onlyVersion Bumping
- Bump version in all package.json files
- Build packages
- Publish to npm
Manual Release Steps
Update Changelog
Add entry to
CHANGELOG.md with:- Version number and date
- Features, bug fixes, breaking changes
- Migration notes
Create GitHub Release
Create release on GitHub with:
- Tag (e.g.
v0.3.0) - Release notes from CHANGELOG
- Highlight breaking changes
Getting Help
Questions
- Open a GitHub Discussion
- Ask in issue comments
Bugs
- Check existing issues first
- Provide minimal reproduction
- Include version numbers
- Share error messages
Feature Requests
- Open an issue with
enhancementlabel - Describe use case
- Provide examples
- Discuss API design
