Nx monorepo with pnpm workspaces and TypeScript project references.
packages/core/ → @soundtouchjs/core (publishable library)
apps/demo/ → Development demo app (private, Vite dev server)
- Library build: TSC via
@nx/js/typescriptplugin (inferred fromtsconfig.lib.json) - Demo build: Vite via
@nx/vite/plugin(inferred fromindex.html) - Task orchestration: Nx handles dependency ordering —
builddepends on^build
- TypeScript, strict mode, ES2024 target, ESNext modules
- Module resolution:
bundler - ESM only (
"type": "module"in all package.json files) - Prettier with single quotes (see
.prettierrc) - No default exports from core library modules — use named exports in
index.ts - Prefer
import typefor type-only imports
pnpm install # Install all workspace dependencies
pnpm build # Build all projects (nx run-many -t build)
pnpm typecheck # Typecheck all projects
pnpm dev # Start demo dev server (Vite on port 8080)
pnpm prettier # Format all filesIndividual project commands:
pnpm nx build core # Build the library (TSC → packages/core/dist/)
pnpm nx build demo # Build the demo app (Vite → apps/demo/dist/)
pnpm nx dev demo # Dev server with HMR- Commit messages follow Conventional Commits with sentence-case subjects, enforced by commitlint + husky
- Releases via
nx release— bumps version, generates changelog, tags, and publishes - The demo app resolves
@soundtouchjs/coreto source (not dist) during development via a Vite alias - Workspace dependency uses
"workspace:*"protocol (pnpm) - CI runs on GitHub Actions (
.github/workflows/main.yml) - Pre-commit hook runs typecheck (skipped in CI via
$CIenv var)
- Do not add comments or docstrings to code unless the logic is non-obvious
- Do not use CommonJS (
require/module.exports) anywhere - Do not use
anytype — useunknownwith narrowing or proper generics - Do not add dependencies to the core library — it has zero runtime dependencies
- Do not commit
dist/,.nx/, or*.tsbuildinfofiles