1.0.16 • Published 4 years ago
@peris1000tickets/common v1.0.16
This is a project that will be a shared lib for the rest of the services
$ mkdir common
$ cd common
$ npm init -yAt package.json name change it to '@peris1000tickets/common'
$ git init
$ git add .
$ git commit -m "initial commit"$ npm publish --access publicIf you got an error of type ENEEDAUTH, unauthorised etc. then use
$ npm loginand follow the process getting logged in.
The common project will be written in typescript but we will be publishing that as JS to avoid any typescript version conflicts etc.
$ cd common
$ tsc --init
$ npm install --save-dev typescript del-cli$ npm run build
$ npm version patch
$ npm publishMoving errors and middlewares folders from auth project to common project
$ cd ticketing
$ mv auth/src/errors common/src/
$ mv auth/src/middlewares common/src/
$ npm install express express-validator cookie-session jsonwebtoken @types/cookie-session @types/express @types/jsonwebtoken$ npm run pubNow to fix import errors to the auth project
$ cd auth
$ npm install @peris1000tickets/commonand fix manually the import errors.
From now on whenever a change is taking place to common project and we need this change to take place to the other projects
cd ../common
$ npm run pub
cd ../auth
$ npm update @peris1000tickets