Public Angular libraries used in various shiftcode projects.
Core Utilities; mainly services and some helper functions and rxjs operators. More details in README.
Angular Services working with AWS. More details in README.
Angular components/directives/pipes usable across different projects. More details in README.
Not used anymore starting with Angular 17. See necessary changes in ssr.md
Shows the mapping between the angular version and our lib versions.
Angular Version | Lib Version |
---|---|
^18 |
^6 |
^17 |
^5 |
^16 |
^4 |
^15 |
^3 |
^14 |
^2 |
^13 |
^1 |
Package manager client: npm
Individual packages can depend on each other, the dependency is resolved using ts paths (see ./tsconfig.json) make sure to build the package you depend on. Or change the tsconfig.paths to reference the files under src
directory.
Lerna is used to publish the packages and to run commands in multiple packages.
All dependencies of a library are defined as peerDependencies (except tslib)
When adding a peerDependency it must also be added to the root package.json as 'normal' dependency.
When opening a PR lerna publishes a new prerelease version with the preId -prXX.{COUNT}
.
By creating this version lerna creates a commit with the updated versions in the package.json. It does not update the PeerDependencies versions.
After merging the PR back to the master a new release is published with the graduated version (eg. 1.0.1-pr55.7
-> 1.0.1
).
If it happens that you already have another commit locally, before updating the branch with this build(release):..
commit:
use
rebase
instead ofmerge
- run
ng generate library my-lib
- change
libs/my-lib/package.json#name
to@shiftcode/ngx-my-lib
- alter
libs/my-lib/ng-package.json#dest
to./dist
- add
"assets": [ "LICENSE", "CHANGELOG.md" ],
tolibs/my-lib/ng-package.json
- alter
tsconfig.json#compilerOptions.paths
my-lib
entry to@shifcode/ng-my-lib
and edit paths according to #3 - update tsconfig files like other libs
- change from karma config to jest:
- remove
libs/my-lib/src/test.ts
- remove
libs/my-lib/karam-config.js
- in
angular.json
replace the libs test architect to"test": { "builder": "@angular-builders/jest:run" }