Hype Stack uses pnpm workspaces for package management and Nx for task orchestration. This gives you fast installs, shared dependencies, and intelligent build caching.
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 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:
Create a new folder in packages/:
mkdir packages/my-lib
cd packages/my-lib
pnpm init
Set the package name in package.json:
{
"name": "@hype-stack/my-lib"
}
Import it from any app:
pnpm --filter @hype-stack/backend add @hype-stack/my-lib
Nx picks up the new package automatically.
The monorepo split pays off when:
packages/ and are imported by both sides