pnpm install # installs deps + sets up husky hooks via "prepare" script
pnpm build # build the library (tsup → ESM + CJS + .d.ts)
pnpm test # run unit tests (vitest)git checkout -b feat/my-featureEdit code in packages/playstacks/src/. Run tests locally:
pnpm test # unit tests
pnpm lint # eslint
pnpm typecheck # tsc --noEmitEvery PR that changes the library must include a changeset. This is how we track what changed and auto-generate changelogs.
pnpm changesetThis prompts you to:
- Select the package — pick
@satoshai/playstacks - Choose the bump type:
patch— bug fixes, docs, internal changesminor— new features, non-breaking additionsmajor— breaking API changes
- Write a summary — one-line description of what changed (this goes into the changelog)
It creates a markdown file in .changeset/ like:
.changeset/cool-dogs-fly.md
---
"@satoshai/playstacks": minor
---
Add stx_signMessage wallet methodCommit this file alongside your code changes. One changeset per logical change — if your PR does two unrelated things, add two changesets.
When to skip: Changes that don't affect the published package (CI config, repo docs, test-only changes) don't need a changeset.
Commits must follow Conventional Commits:
type(scope): description
| Type | When to use |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change that neither fixes a bug nor adds a feature |
test |
Adding or updating tests |
chore |
Tooling, deps, CI, build changes |
Examples:
git commit -m "feat: add stx_signMessage wallet method"
git commit -m "fix: handle empty post-conditions array"
git commit -m "docs: update fee management section"
git commit -m "chore: bump @stacks/transactions to 7.4.0"Scope is optional. The commit-msg hook validates this via commitlint — the commit will be rejected if the format is wrong.
git push -u origin feat/my-featureHusky runs these automatically:
| Hook | Runs | What it does |
|---|---|---|
pre-commit |
Before every commit | pnpm lint && pnpm typecheck |
pre-push |
Before every push | pnpm test (42 unit tests) |
commit-msg |
On commit | Validates conventional commit format via commitlint |
If a hook fails, the git operation is blocked. Fix the issue and retry.
Releases are done from main using changesets.
pnpm changeset versionThis consumes all pending .changeset/*.md files and:
- Bumps
versioninpackages/playstacks/package.json - Updates
packages/playstacks/CHANGELOG.mdwith the changeset summaries - Deletes the consumed changeset files
Review the changes, then commit:
git add .
git commit -m "chore: version packages"The root CHANGELOG.md follows Keep a Changelog format and is maintained manually. Add a new entry with the version, date, and categorized changes:
## [0.2.0] - 2026-03-01
### Added
- `stx_signMessage` wallet method
### Fixed
- Handle empty post-conditions arrayCategories: Added, Changed, Fixed, Removed, Deprecated.
pnpm build
pnpm changeset publish # publishes to npm with public accessgit push && git push --tagsRun from the monorepo root:
| Script | What it does |
|---|---|
pnpm build |
Build the library (tsup → dist/) |
pnpm test |
Run unit tests (vitest) |
pnpm test:unit |
Same as pnpm test |
pnpm test:e2e:example-zest |
Run Zest E2E tests (examples/zest/) |
pnpm test:e2e:example-satoshai |
Run SatoshAI E2E tests (examples/satoshai/) |
pnpm test:e2e:test-dapp |
Run test dApp E2E tests (apps/test-dapp/) |
pnpm lint |
ESLint across all packages and examples |
pnpm typecheck |
TypeScript type checking across all packages |
pnpm clean |
Remove dist/ directories |
pnpm changeset |
Create a new changeset |
pnpm changeset version |
Consume changesets and bump versions |
pnpm changeset publish |
Publish to npm |
playstacks/
├── packages/playstacks/ # The published npm package (@satoshai/playstacks)
│ ├── src/ # Library source code
│ ├── tests/unit/ # Vitest unit tests (42 tests)
│ ├── CHANGELOG.md # Auto-generated by changesets
│ └── package.json # version: "0.2.0"
├── apps/test-dapp/ # Test dApp — exercises every wallet method
├── examples/zest/ # Real-world E2E: Zest Protocol (mainnet)
├── examples/satoshai/ # Real-world E2E: SatoshAI login (mainnet)
├── docs/ # Architecture docs and plans
├── .changeset/ # Pending changesets live here
├── .husky/ # Git hook scripts
├── CHANGELOG.md # Root changelog (manual, Keep a Changelog format)
├── eslint.config.js # ESLint flat config (TS recommended)
├── commitlint.config.js # Conventional commits enforcement
└── pnpm-workspace.yaml # Monorepo workspace config