generator-ng2-library
v1.0.1
Published
Generator for Angular2+ libraries
Downloads
4
Maintainers
Readme
Ng2 library generator
Generator for Angular2+ libraries
Table of Contents
Introduction
This generator is optimized for creating Angular >= 4.0.0 libraries.
This project has been created following the best practices and guidelines from Angular.io and the Packaging Angular talk from Jason Aden.
NPM Deployment
Login into your project's NPM registry. If you don't have an account yet, sign up here
npm login
Setup Semantic-release-cli
Semantic-release-cli provides you with a fully automated package publishing. Read more about the Semantic-release-cli here.
Install the npm package globally on your machine
npm install -g semantic-release-cli
then, navigate inside your library root folder and run:
semantic-release-cli setup
And answer the questions required for the installation process
just make sure to answer No
to the last one as we
already have a .travis.yml
configuration file.
? What is your npm registry? https://registry.npmjs.org/
? What is your npm username? your username
? What is your GitHub username? your username
? What is your GitHub two-factor authentication code? xxxxxxx
? What CI are you using? Travis CI
? Do you want a `.travis.yml` file with semantic-release setup? No
# Important to select No to avoid overwriting the already exisisting `.travis.yml` file.
Crypt your credentials
DEPRECATED
Generate a authentication token crypting your npm credentials with the following command:
echo -n 'username:password' | openssl base64
This will output a key like this: dXNlcm5hbWU6cGFzc3dvcmQ=
TravisCI configuration
DEPRECATED
Reach your TravisCI project settings and add a new environment variable called NPM_TOKEN
with the token previously generated.
Then create another environment variable in TravisCI called NPM_EMAIL
and set it to the npm user email address linked to your
previous login credentials used for generating the token.
Then the deployment script stored in the scripts/deploy.sh
will be responsable for automatically deploy your library
to NPM every time a new version is present in the package.json
file.
Deployment lifecycle
- Create your new code change in your local directory
- Commit your changes using Commitizen with
npm run commit
- Release a new npm version using semantic versioning with
npm version patch | minor | major
- Push your changes
- Wait for Travis to publish your new version