1.0.16 • Published 2 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 -y
At package.json
name change it to '@peris1000tickets/common'
$ git init
$ git add .
$ git commit -m "initial commit"
$ npm publish --access public
If you got an error of type ENEEDAUTH, unauthorised etc. then use
$ npm login
and 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 publish
Moving 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 pub
Now to fix import errors to the auth project
$ cd auth
$ npm install @peris1000tickets/common
and 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