35
loading...
This website collects cookies to deliver better user experience
[Workspaces] provides support to managing multiple packages from your local files system from within a singular top-level, root package.
webby
├── apps
│ ├── api/
│ └── web/
├── libs
│ ├── analytics/
│ ├── logging/
│ └── types/
├── package.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
└── tsconfig.json
ℹ️ This project is prepared on GitHub1s if you'd like to familiarize yourself with the code.
package.json
is scoped to just that piece of code, so just like before we have a great immediate overview. The real question is: Does it work?apps/web
runs fine:$ cd apps/web
$ pnpm install
Scope: all 6 workspace projects
└─ Done in 3.2s
$ pnpm start
[razzle] > Started on port 3000
pnpm install
in apps/web
actually resolved all dependencies for the whole repository, which is very nice. And all it takes to configure it are a few lines in the ppm-workspace.yaml
file, so it's all very easy to get working.apps/api
fails just as it did in the previous article:$ cd ../api
$ pnpm start
[api] TSError: ⨯ Unable to compile TypeScript:
[api] ../../libs/analytics/src/index.ts(8,3): error TS2564: Property 'uninitializedProperty' has no initializer and is not definitely assigned in the constructor.