/lerna-workspaces-express-typescript-template

Template to create a Typscript Lerna Workspace project with Express

Primary LanguageTypeScript

lerna-workspaces-express-typescript-template

Setting up the project

  1. Create a yarn workspaces project
yarn init -w
yarn install
  1. Add .yarnrc.yml file with the following content
nodeLinker: node-modules

npmRegistryServer: "https://registry.npmjs.org/"
  1. Then execute the following commands
yarn set version stable
yarn plugin import @yarnpkg/plugin-workspace-tools
yarn plugin import typescript
  1. Install commitizen tool
sudo npm install commitizen --global
  1. Add workspaces glob pattern to package.json
{
  ...
  
  "workspaces": [
    "packages/*"
  ],
  ...
}
  1. Install lerna as dev dependency
yarn add -D lerna
  1. Initialize lerna as independent versioning
yarn lerna init --independent
  1. Check current versions available according to the changes with
yarn lerna version
  1. You can visualize the dependencies with
npx nx graph
  1. You can check the projects in the workspace with
yarn workspaces list -v
  1. Add tyescript as dev dependency
yarn add -D typescript