medentee-backend-packages v0.0.1
Medentee backend packages
This is monorepo packages repo, managed by Lerna.
All instructions provided for
npmpackage manager. Feel free to useyarn, if preferred.
Install
Install dependencies
npm run bootAdd new repo dependency
Read Lerna add command.
lerna add <package>[@version] [--dev] [--exact] [--peer]Add Package dependency
By adding new dependency to the Package, please consider to user peer dependency with * version. It will be useful in the target projects, where your Package will be used.
lerna add package-1 --scope=package-2 --peerIf it's needed to add one package as dependency of another one, add appropriate reference in the tsconfig.json file of a target package
"references": [
{
"path": "../enums"
}
]New Package
In order to create a new Package you can use generate script. Follow provided instructions then:
npm run generateScrip generate uses SAO to scaffold new package based on template. See template folder for initial data.
Commands
This repo contains a set of predefined scripts, designed to help developers in the development of packages.
Command: Commit
Use the following script to commit changes into GIT repo:
npm run cmThis command uses git-cz to help organize and support change-logs in the GIT repo.
Command: Format
Quick format of only changed files
npm run formatCommand: Format All
Format of all the files in the repo
npm run format:allCommand: Scripts
In order to simplify management of multiple packages this repo uses NPS
utility files are
package-scrips*.js
View list of packages
npm run scripts:listBuild all packages
npm run scripts:buildClean all packages
npm run scripts:cleanRebuild all packages
npm run scripts:rebuildTo perform specific script on particular package, use the following structure:
npm run scripts <command>.<package>For example:
npm run scripts build.modelsCommand: Publish
npm run pubCommand performs publishing of all changed packages into NPM registry.
First of all, create personal .npmrc file in the root folder with a private token. The target NPM registry and auth token will be used from this file.
.npmrcfile added to.gitignore, but make sure that your personal token not commited into the repo.
Command: Pack .tar.gz package for local usage
cd packages/{{package-name}} && yarn pack5 years ago