https://github.com/shiftcode/sc-ng-commons-public
contains few commonly used angular packages
https://github.com/shiftcode/sc-ng-commons-public
Last synced: 11 months ago
JSON representation
contains few commonly used angular packages
- Host: GitHub
- URL: https://github.com/shiftcode/sc-ng-commons-public
- Owner: shiftcode
- License: mit
- Created: 2022-01-21T08:44:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-20T09:46:11.000Z (about 1 year ago)
- Last Synced: 2025-02-03T11:15:15.330Z (about 1 year ago)
- Language: TypeScript
- Size: 2.52 MB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sc-ng-commons-public
Public Angular libraries used in various shiftcode projects.
> [](libs/core)\
> Core Utilities; mainly services and some helper functions and rxjs operators. More details in [README](./libs/core/README.md).
> [](libs/aws)\
> Angular Services working with AWS. More details in [README](./libs/aws/README.md).
> [](libs/components)\
> Angular components/directives/pipes usable across different projects. More details in [README](./libs/components/README.md).
> \
> Not used anymore starting with Angular 17. See necessary changes in [ssr.md](./ssr.md)
## Angular to Lib Version Mapping
Shows the mapping between the angular version and our lib versions.
| Angular Version | Lib Version |
|-----------------|-------------|
| `^19` | `^7` |
| `^18` | `^6` |
| `^17` | `^5` |
| `^16` | `^4` |
| `^15` | `^3` |
| `^14` | `^2` |
| `^13` | `^1` |
## Anatomy of this workspace
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.
## Dependencies
All dependencies of a library are defined as peerDependencies (except tslib)
### root dependencies + libs peerDependencies
When adding a peerDependency it must also be added to the root package.json as 'normal' dependency.
## Versioning
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`).
### Hint
If it happens that you already have another commit locally, before updating the branch with this `build(release):..` commit:
> use `rebase` instead of `merge`
## Add new library
1. run `ng generate library my-lib`
2. change `libs/my-lib/package.json#name` to `@shiftcode/ngx-my-lib`
3. alter `libs/my-lib/ng-package.json#dest` to `./dist`
4. add `"assets": [ "LICENSE", "CHANGELOG.md" ],` to `libs/my-lib/ng-package.json`
5. alter `tsconfig.json#compilerOptions.paths` `my-lib` entry to `@shifcode/ng-my-lib` and edit paths according to #3
6. update tsconfig files like other libs
7. change from karma config to jest:
1. remove `libs/my-lib/src/test.ts`
2. remove `libs/my-lib/karam-config.js`
3. in `angular.json` replace the libs test architect to `"test": { "builder": "@angular-builders/jest:run" }`