Monorepo
Hype Stack uses pnpm workspaces for package management and Nx for task orchestration. This gives you fast installs, shared dependencies, and intelligent build caching.
Workspace structure
Defined in pnpm-workspace.yaml:
packages:
- "apps/*"
- "packages/*"Each app and package has its own package.json with a scoped name (@hype-stack/backend, @hype-stack/frontend).
Nx task orchestration
Nx knows the dependency graph between your apps and packages. When you run pnpm build, it builds dependencies first,
then dependents. Unchanged projects are skipped via computation caching.
The nx.json file configures:
- Task pipelines - which tasks depend on which other tasks
- Cache inputs - which files affect cache validity
- Target defaults - shared config for build, lint, typecheck targets
Adding a package
-
Create a new folder in
packages/:bashmkdir packages/my-lib cd packages/my-lib pnpm init -
Set the package name in
package.json:json{ "name": "@hype-stack/my-lib" } -
Import it from any app:
bashpnpm --filter @hype-stack/backend add @hype-stack/my-lib
Nx picks up the new package automatically.
Why not just one big app?
The monorepo split pays off when:
- Backend and frontend can be deployed independently
- Shared types live in
packages/and are imported by both sides - Nx caches builds, so unchanged apps don't rebuild
- Teams can own specific apps without stepping on each other
Every purchase and sponsorship funds my 8+ years of work on open source given freely to the community. It keeps the lights on, funds new packs, and keeps the ecosystem alive. Even a small tier means a lot. Thank you!
