1.0.0 • Published 5 years ago
@madeitarchi/common v1.0.0
#Common libray
1) Create Organisation
Into https://www.npmjs.com/ signin or signup and then create an organisation (top right corner). It has to be a unique name.
1) init npm
npm init1) Add scripts inside package.json :
"clean": "del ./build/*",
"build": "npm run clean && tsc",Warning: package name has to be the @/common
1) init Typescript:
npx tsc --init1) Init git:
git initcreate .gitignore file and add node_modules and build folder
add and commit all
git add .
git commit -m "Initial Commit"1) Publish it to validate the functioning:
npm publish --access publicwarning: if there is an error you have to login
npm login
npm notice Log in on https://registry.npmjs.org/
Username: ****
Password: ****
Email: (this IS public) ****1) Add another script to help publish easily:
"pub": "git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish"1) Create src:
src
-- index.ts (import all files here => export * from './errors/r...';)
-- folders (middlewares, errors, ...)