You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
38
39
39
40
Lerna is used to publish the packages and to run commands in multiple packages.
40
41
41
-
42
42
## Dependencies
43
+
43
44
All dependencies of a library are defined as peerDependencies (except tslib)
45
+
44
46
### root dependencies + libs peerDependencies
47
+
45
48
When adding a peerDependency it must also be added to the root package.json as 'normal' dependency.
46
49
47
50
## Versioning
51
+
48
52
When opening a PR lerna publishes a new prerelease version with the preId `-prXX.{COUNT}`.
49
53
By creating this version lerna creates a commit with the updated versions in the package.json. It does not update the PeerDependencies versions.
50
54
51
55
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`).
52
56
53
57
### Hint
58
+
54
59
If it happens that you already have another commit locally, before updating the branch with this `build(release):..` commit:
60
+
55
61
> use `rebase` instead of `merge`
56
62
57
63
## Add new library
64
+
58
65
1. run `ng generate library my-lib`
59
66
2. change `libs/my-lib/package.json#name` to `@shiftcode/ngx-my-lib`
60
67
3. alter `libs/my-lib/ng-package.json#dest` to `./dist`
61
68
4. add `"assets": [ "LICENSE", "CHANGELOG.md" ],` to `libs/my-lib/ng-package.json`
62
69
5. alter `tsconfig.json#compilerOptions.paths``my-lib` entry to `@shifcode/ng-my-lib` and edit paths according to #3
63
70
6. update tsconfig files like other libs
64
71
7. change from karma config to jest:
65
-
1. remove `libs/my-lib/src/test.ts`
66
-
2. remove `libs/my-lib/karam-config.js`
67
-
3. in `angular.json` replace the libs test architect to `"test": { "builder": "@angular-builders/jest:run" }`
68
-
72
+
8. remove `libs/my-lib/src/test.ts`
73
+
9. remove `libs/my-lib/karam-config.js`
74
+
10. in `angular.json` replace the libs test architect to `"test": { "builder": "@angular-builders/jest:run" }`
0 commit comments