@beemoos/oauth
v0.0.12
Published
There are two ways to test your npm package: ### Jasmine Run `ng test` and utilise the karma-test-framework. If you use Unit-Test while developing, it is very likly that your package will work in production. ### Create a empty project Especially before re
Downloads
40
Keywords
Readme
Test your system
There are two ways to test your npm package:
Jasmine
Run ng test
and utilise the karma-test-framework. If you use Unit-Test while developing, it is very likly that your package will work in production.
Create a empty project
Especially before releasing you should test your package locally. For that you run npm packagr
inside the projects root folder and after that there is a dist
folder that should contain a *.tgz
file. This is your release client if you will.
Navigate to a new folder outside this projects root folder and create a new empty Angular-Projekt wiht ng new
. If you use specific angular versions you want this package to work for, insert them into the package.json
file, remove the node_modules
folder and then run npm i
. After that, use npm install <relative path to your *.tgz-file> --save
to install your previously packed package.
If everything worked out you can basically use your package now as every other package. Run ng serve
and navigate to http://localhost:4200/
for a quick development, but also use ng serve --prod
to check if AoT-Compilation works with your module. The app will automatically reload if you change any of the source files either ways. (Keep an eye on consoles in Terminal AND Browser. Sometimes errors start occuring while running since the package is not parsed on build)
Code scaffolding
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|module
. Keep in mind that in order for you new directive|pipe|service|class|module
to work you have to insert it into the index.ts
-"chain", because everything that can not be found via these index-files will not be in your final package.
Build
Run ng packagr
to build the project. The build artifacts will be stored in the dist/
directory.
Release
Before building you open the package.json
file and edit the version
number. The convention is not set yet.
After that you build the project and navigate to your dist/
folder. Inside of that you run npm publish
. Check if everything worked by looking at the private repository browser on the Nexus
Running unit tests
Run ng test
to execute the unit tests via Karma.