- (Optional) Install
nvmfor your operating system: https://github.com/nvm-sh/nvm - Install
node(Use version number you need)nvm node --lts - Install
pnpmfrom: https://pnpm.io/installation
E.g.curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm - Install
@microsoft/rush: https://rushjs.io/pages/developer/new_developer/ E.g. npm install -g @microsoft/rush - Create empty git repository and clone it on local machine, and cd into it.
E.g.git clone https://github.com/<user>/<repo>.git
Run the following commands to create backend package:
mkdir -p pkgs/api
cd pkgs/apiFollow instructions from Heft guide to setup backend project: https://rushstack.io/pages/heft_tutorials/getting_started/
E.g. copy package.json, start.ts, tsconfig.json as shown to api directory.
Run the following commands:
pnpm install --save-dev @rushstack/heft
pnpm install --save-dev typescript
pnpm install --save-dev --save-exact @types/node
pnpm install --global @rushstack/heftAdd following lines to the "scripts" section in package.json
"build": "heft build --clean",
"start": "node lib/start.js"Now you can build and run the project using following commands:
pnpm run build
pnpm run startInstall Rush: https://rushjs.io/pages/maintainer/setup_new_repo/
npm install -g @microsoft/rush
rush initEdit rush.json and add an entry like this under the "projects" section:
"projects": [
{
"packageName": "pkgs",
"projectFolder": "pkgs/api"
}
]Change name field in package.json
"name": "pkgs"Run the following commands to build and run the project using rush
cd <repo-root>
rush update
cd pkgs/api
rushx build
rushx start