@spicainternational/ngx-sds-components
v6.0.21
Published
Spica design system angular components.
Downloads
1,539
Readme
NgxSdsComponents
This library was generated with Angular CLI version 13.3.0.
Code scaffolding
- Create standalone component or
- Create new module
ng generate module module-name --project ngx-sds-components
. - Add components/pipes/services to it.
Run ng generate component component-name --project ngx-sds-components --skip-tests
to generate a new component.
Component tests should be done in a e2e suite so there is no need to create component tests.
You should move all domain logic to services and utils and write tests there. You should minimize the dependency on framework.
You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-sds-components
.
Note: Don't forget to add
--project ngx-sds-components
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build ngx-sds-components
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
Prior publishing it is necessary to update the change log so we keep track of changes. Usually we merge changes into the master from devops portal so you will have all the changes in the master. Now you must update the CHANGELOG.md file with list of breaking changes, features and fixes. Depending on the contents the semantic version of the package must be set.
Git aliases to help out You may find these two git aliases handy when preparing new release:
Condensed list of last 15 commits
git config alias.log15 '!f() { git log --max-count=15 --pretty="format:%C(black) %<(15,trunc)%ar %C(magenta)%h %C(green)%<(20,trunc)%an %C(white)%<(130,trunc)%s" --no-merges; }; f'
Create branch for committing CHANGELOG.md and package.json changes
alias.newrelease !f() { git checkout -b release-$1 && git push -u origin release-$1; }; f
Create and push tag to remote
git config alias.newtag '!f() { git tag $1 && git push origin $1; }; f'
To get the list of aliases defined in the repo run git config --get-regexp alias
.
After files were updated and branch pushed to origin you may proceed with publishing procedure.
Publish package on npm
Publish new package by running npm run lib:publish
This script will take care of building and publishing the package. You must have login rights on the npmjs to approve the deploy.
- Changes should be included in the change.log file.
- Each published version should have a tag on the git repo.
Creating tag
- tag name equals the version number
git tag 5.29.0
- push the tag to origin
git push origin 5.29.0
Running unit tests
Run ng test ngx-sds-components
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.