- Create the root folder:
- Create monorepo's
package.json
:
nano monorepo/package.json
- with following contents:
{
"name": "@project/monorepo",
"private": "true",
"version": "0.0.0",
"workspaces": [
"packages/*",
"apps/*"
],
"dependencies": {
"bun": "latest",
"bun-types": "latest",
"typescript": "latest"
}
}
- Create workspace package folder:
mkdir -p monorepo/packages/package-a
- Create the package's
package.json
:
nano monorepo/packages/package-a/package.json
- With follwoing content:
{
"name": "@project/package-a",
"private": "true",
"version": "0.0.0",
"dependencies": {
"bun": "latest",
"bun-types": "latest",
"typescript": "latest"
}
}
- Create monorepo's app folder:
mkdir -p monorepo/apps/app-a
- Create the app's
package.json
:
nano monorepo/apps/app-a/package.json
- With the following content:
{
"name": "@project/app-a",
"private": "true",
"version": "0.0.0",
"dependencies": {
"bun": "latest",
"bun-types": "latest",
"typescript": "latest"
}
}
- Install the monorepo's dependencies by running
bun install
from the monorepo's root folder:
cd monorepo && bun install