@open-rlb/ng-bootstrap 3.3.48 → 3.3.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +6 -6
- package/schematics/ng-add/index.js +26 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Angular component library built on Bootstrap 5.3 (signals, OnPush), with timezone-aware
|
|
4
4
|
date handling via [`@open-rlb/date-tz`](https://www.npmjs.com/package/@open-rlb/date-tz).
|
|
5
|
-
Supports **Angular
|
|
5
|
+
Supports **Angular 21 and 22** (built with Angular 21).
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-rlb/ng-bootstrap",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.49",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/cdk": ">=
|
|
6
|
-
"@angular/common": ">=
|
|
7
|
-
"@angular/core": ">=
|
|
8
|
-
"@angular/forms": ">=
|
|
9
|
-
"@angular/router": ">=
|
|
5
|
+
"@angular/cdk": ">=21.0.0 <23.0.0",
|
|
6
|
+
"@angular/common": ">=21.0.0 <23.0.0",
|
|
7
|
+
"@angular/core": ">=21.0.0 <23.0.0",
|
|
8
|
+
"@angular/forms": ">=21.0.0 <23.0.0",
|
|
9
|
+
"@angular/router": ">=21.0.0 <23.0.0",
|
|
10
10
|
"@ngx-translate/core": ">=16.0.0 <18.0.0",
|
|
11
11
|
"@open-rlb/date-tz": ">=2.1.1",
|
|
12
12
|
"bootstrap": ">=5.3.0",
|
|
@@ -7,15 +7,39 @@ const utility_1 = require("@schematics/angular/utility");
|
|
|
7
7
|
/**
|
|
8
8
|
* Dependencies the library needs at the consumer side. `@angular/{core,common,forms,router}`
|
|
9
9
|
* and `rxjs` are intentionally omitted: every Angular app already provides them.
|
|
10
|
+
* `@angular/cdk` is missing on purpose too — see {@link cdkVersion}.
|
|
10
11
|
*/
|
|
11
12
|
const DEPENDENCIES = [
|
|
12
13
|
{ name: '@open-rlb/date-tz', version: '^2.1.1', type: utility_1.DependencyType.Default },
|
|
13
14
|
{ name: '@ngx-translate/core', version: '^17.0.0', type: utility_1.DependencyType.Default },
|
|
14
|
-
{ name: '@angular/cdk', version: '^21.0.0', type: utility_1.DependencyType.Default },
|
|
15
15
|
{ name: 'bootstrap', version: '^5.3.0', type: utility_1.DependencyType.Default },
|
|
16
16
|
{ name: 'bootstrap-icons', version: '^1.11.0', type: utility_1.DependencyType.Default },
|
|
17
17
|
{ name: '@types/bootstrap', version: '^5.2.0', type: utility_1.DependencyType.Dev },
|
|
18
18
|
];
|
|
19
|
+
/** The lowest Angular major in this package's peerDependencies range. */
|
|
20
|
+
const MIN_ANGULAR_MAJOR = 21;
|
|
21
|
+
/**
|
|
22
|
+
* `@angular/cdk` ships a new major alongside every Angular major, so a hardcoded pin here
|
|
23
|
+
* starts conflicting with the app — and with this package's own peerDependencies — the moment
|
|
24
|
+
* either side moves on. Follow the app's `@angular/core` instead.
|
|
25
|
+
*/
|
|
26
|
+
function cdkVersion(tree) {
|
|
27
|
+
const major = angularCoreMajor(tree);
|
|
28
|
+
// A CDK major accepts its own Angular major and the next one, so the lowest Angular this
|
|
29
|
+
// library supports is the safe pick when the app's version cannot be read.
|
|
30
|
+
return major === null ? `^${MIN_ANGULAR_MAJOR}.0.0` : `^${major}.0.0`;
|
|
31
|
+
}
|
|
32
|
+
/** Reads the major of `@angular/core` from the consumer's package.json (`^21.1.2` → 21). */
|
|
33
|
+
function angularCoreMajor(tree) {
|
|
34
|
+
const raw = tree.read('/package.json');
|
|
35
|
+
if (!raw) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const pkg = JSON.parse(raw.toString('utf-8'));
|
|
39
|
+
const range = pkg.dependencies?.['@angular/core'] ?? pkg.devDependencies?.['@angular/core'];
|
|
40
|
+
const major = range?.match(/(\d+)/)?.[1];
|
|
41
|
+
return major ? Number(major) : null;
|
|
42
|
+
}
|
|
19
43
|
/** Keeps `.claude/skills` in step with the installed library version on every `npm install`. */
|
|
20
44
|
const SYNC_SKILLS_COMMAND = 'ng g @open-rlb/ng-bootstrap:sync-skills';
|
|
21
45
|
/** Global styles required for the Bootstrap look & feel. */
|
|
@@ -29,6 +53,7 @@ function ngAdd(options) {
|
|
|
29
53
|
return (0, schematics_1.chain)([
|
|
30
54
|
// 1. Install dependencies (a single npm install is scheduled automatically).
|
|
31
55
|
...DEPENDENCIES.map(dep => (0, utility_1.addDependency)(dep.name, dep.version, { type: dep.type })),
|
|
56
|
+
(0, utility_1.addDependency)('@angular/cdk', cdkVersion(tree), { type: utility_1.DependencyType.Default }),
|
|
32
57
|
// 2. Register Bootstrap + Bootstrap Icons global styles in angular.json.
|
|
33
58
|
addBootstrapStyles(project),
|
|
34
59
|
// 3. Wire up the library providers (modals/toasts registry, etc.).
|