@wazzifa/common
v1.0.21
Published
1- extract authentication related login into separate dependency --------------------------------------------------------------- you have 3 ways: 1- Copy/Paste --> Worst option 2- GIT sub module 3- Publish common code as npm package registery 4- We have a
Downloads
7
Readme
1- extract authentication related login into separate dependency
you have 3 ways: 1- Copy/Paste --> Worst option 2- GIT sub module 3- Publish common code as npm package registery 4- We have again 3 options: - Public npm - *Organization (public / private) - Self hosted npm server. 5- Let's create new project called common (npm init -y) 6- You must have your common library committed into git repos (init, add, commit) 7- Publish the package using (npm publish --access public)
To make our common libraries agnostic and work with any porject (type script, or java script) we we will write our library in type script but publish it as java script. to do so follow these steps: 1- tsc --init (create tsconfig.json file) 2- install type script (npm install typescript del-cli --save-dev) 3- transpile the type script to java script:
- in application.config -- scripts sections -- add build command, and clean -- and modify tscconfig.json to let tsc know where is the code is uncomment declaration uncomment outDir and make it "./build" 4- when you import from the module the main config determines what file to be loaded, we need to make sure it is the index.js located in the build folder not src. add also (after the main config), the "types" : "./build/index.s.ts" wat is the main type defintion "files" : "./build/**/*" everything in build what set of files we wnat to make sure it must be included in publish