Skip to content

Commit 0bcbe20

Browse files
authored
feat: support Angular Components (#31)
The following packages are now managed: - `@angular/cdk` - `@angular/google-maps` - `@angular/material` - `@angular/youtube-player` Outdated packages are not deleted, managed packages are not added. Managed packages are listed in the readme. Version sync strategy for Angular Components packages are documented in `CONTRIBUTING.md`.
1 parent 7298df2 commit 0bcbe20

20 files changed

+398
-210
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
🙏 We would ❤️ for you to contribute to `AngularVersionsAction` and help make it even better than it is today!
44

5+
# Package versions
6+
7+
## Angular Components
8+
9+
These packages' versions are synced:
10+
11+
| Package name | Package identifier | First stable version |
12+
| ---------------------- | ----------------------- | -------------------- |
13+
| Angular CDK | @angular/cdk | 6.0.0 |
14+
| Angular Google Maps | @angular/google-maps | 9.0.0 |
15+
| Angular Material | @angular/material | 6.0.0 |
16+
| Angular YouTube Player | @angular/youtube-player | 9.0.0 |
17+
18+
The strategy for these packages is to resolve the latest minor version that was available when the specified
19+
minor Angular version was first released. For example, when Angular 8.2 was released, Angular Components were only
20+
at version 8.1, so consumers asking for _Angular version_ 8.2.x will get Angular CDK version 8.1.x.
21+
522
## Developing
623

724
Install the dependencies

README.md

Lines changed: 59 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,49 @@ Create a workflow `.yml` file in your repositories `.github/workflows` directory
2020
### Example workflow - match Angular versions
2121

2222
```yaml
23-
name: Node.js CI
23+
name: CI workflow
2424

2525
on:
2626
push:
27-
branches: [main]
27+
branches:
28+
- main
2829
pull_request:
29-
branches: [main]
30+
branches:
31+
- main
3032

3133
jobs:
3234
build:
3335
runs-on: ubuntu-latest
3436

3537
strategy:
3638
matrix:
37-
node-version: [10.x, 12.x]
3839
angular-version:
39-
[
40-
6.0.x,
41-
6.1.x,
42-
7.0.x,
43-
7.1.x,
44-
7.2.x,
45-
8.0.x,
46-
8.1.x,
47-
8.2.x,
48-
9.0.x,
49-
9.1.x,
50-
10.0.x,
51-
10.1.x,
52-
10.2.x,
53-
11.0.x,
54-
11.1.x,
55-
11.2.x
56-
12.0.x
57-
]
40+
- 6.0.x,
41+
- 6.1.x,
42+
- 7.0.x,
43+
- 7.1.x,
44+
- 7.2.x,
45+
- 8.0.x,
46+
- 8.1.x,
47+
- 8.2.x,
48+
- 9.0.x,
49+
- 9.1.x,
50+
- 10.0.x,
51+
- 10.1.x,
52+
- 10.2.x,
53+
- 11.0.x,
54+
- 11.1.x,
55+
- 11.2.x
56+
- 12.0.x
5857

5958
steps:
6059
- uses: actions/checkout@v2
61-
- name: Use Node.js ${{ matrix.node-version }}
62-
uses: actions/setup-node@v1
60+
- name: Use Node.js 12.x
61+
uses: actions/setup-node@v2
6362
with:
64-
node-version: ${{ matrix.node-version }}
63+
node-version: 12.x
6564
- name: Use Angular ${{ matrix.angular-version }}
66-
uses: ngworker/angular-versions-action@v1
65+
uses: ngworker/angular-versions-action@v4
6766
with:
6867
angular-version: ${{ matrix.angular-version }}
6968

@@ -97,6 +96,39 @@ At the moment this actions supports a limited set of Angular versions listed bel
9796
- 11.2.x
9897
- 12.0.x
9998

99+
### Managed packages
100+
101+
The following packages are managed by this action:
102+
103+
- `@angular/animations`
104+
- `@angular/cdk`
105+
- `@angular/cli`
106+
- `@angular/common`
107+
- `@angular/compiler`
108+
- `@angular/compiler-cli`
109+
- `@angular/core`
110+
- `@angular-devkit/build-angular`
111+
- `@angular-devkit/build-ng-packagr`
112+
- `@angular-devkit/schematics-cli`
113+
- `@angular/elements`
114+
- `@angular/forms`
115+
- `@angular/google-maps`
116+
- `@angular/material`
117+
- `@angular/platform-browser`
118+
- `@angular/platform-browser-dynamic`
119+
- `@angular/router`
120+
- `@angular/youtube-player`
121+
- `@types/node`
122+
- `codelyzer`
123+
- `ng-packagr`
124+
- `rxjs`
125+
- `tsickle `
126+
- `tslib`
127+
- `tslint`
128+
- `ts-node`
129+
- `typescript`
130+
- `zone.js`
131+
100132
## Contributing
101133

102134
We would love you to contribute to `@ngworker/angular-versions-action`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

__tests__/override-angular-versions.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {
33
packageJsonWithV11_1Dependencies,
44
packageJsonWithV11_1DevDependencies,
55
packageJsonWithV11_1All,
6+
packageJsonWithV11_1AllWithUnmatching,
67
fullPackageJson,
78
packageUnmatching,
89
packageJsonWithoutNgPackagr,
9-
packageJsonWith11_1AllWithoutNgPackagr,
1010
packageJsonV8WithForceDependencies
1111
} from './package-json-versions';
1212
import {overrideAngularVersions} from '../src/override-angular-versions';
@@ -19,7 +19,7 @@ describe(overrideAngularVersions.name, () => {
1919
(v11_1.devDependencies as any) = {};
2020

2121
const actualPackageJson = overrideAngularVersions({
22-
projectVersions: fullPackageJson,
22+
projectVersions: fullPackageJson as any,
2323
angularVersions: v11_1
2424
});
2525

@@ -31,7 +31,7 @@ describe(overrideAngularVersions.name, () => {
3131
(v11_1.dependencies as any) = {};
3232

3333
const actualPackageJson = overrideAngularVersions({
34-
projectVersions: fullPackageJson,
34+
projectVersions: fullPackageJson as any,
3535
angularVersions: v11_1
3636
});
3737

@@ -42,7 +42,7 @@ describe(overrideAngularVersions.name, () => {
4242
const v11_1 = getAngularVersions('11.1.x');
4343

4444
const actualPackageJson = overrideAngularVersions({
45-
projectVersions: fullPackageJson,
45+
projectVersions: fullPackageJson as any,
4646
angularVersions: v11_1
4747
});
4848

@@ -57,18 +57,18 @@ describe(overrideAngularVersions.name, () => {
5757
angularVersions: v11_1
5858
});
5959

60-
expect(actualPackageJson).toEqual(packageUnmatching);
60+
expect(actualPackageJson).toEqual(packageJsonWithV11_1AllWithUnmatching);
6161
});
6262

63-
test('no add ng-packagr dependency when it is not present in the package', () => {
63+
test('add ng-packagr dependency when it is not present in the package', () => {
6464
const v11_1 = getAngularVersions('11.1.x');
6565

6666
const actualPackageJson = overrideAngularVersions({
6767
projectVersions: packageJsonWithoutNgPackagr as any,
6868
angularVersions: v11_1
6969
});
7070

71-
expect(actualPackageJson).toEqual(packageJsonWith11_1AllWithoutNgPackagr);
71+
expect(actualPackageJson).toEqual(packageJsonWithV11_1All);
7272
});
7373

7474
test('add forced dependencies when not present in the package', () => {

__tests__/package-json-versions/full-package-json.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ export const fullPackageJson = {
3232
private: true,
3333
dependencies: {
3434
'@angular/animations': '~10.1.6',
35+
'@angular/cdk': '~10.1.3',
3536
'@angular/common': '~10.1.6',
3637
'@angular/compiler': '~10.1.6',
3738
'@angular/core': '~10.1.6',
3839
'@angular/elements': '~10.1.6',
3940
'@angular/forms': '~10.1.6',
41+
'@angular/google-maps': '~10.1.3',
42+
'@angular/material': '~10.1.3',
4043
'@angular/platform-browser': '~10.1.6',
4144
'@angular/platform-browser-dynamic': '~10.1.6',
4245
'@angular/router': '~10.1.6',
46+
'@angular/youtube-player': '~10.1.3',
4347
rxjs: '~6.6.3',
4448
tslib: '^2.0.0',
4549
'zone.js': '~0.10.3'

__tests__/package-json-versions/full-with-tsickle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ export const fullWithTsickleJson = {
3232
private: true,
3333
dependencies: {
3434
'@angular/animations': '~8.2.0',
35+
'@angular/cdk': '~8.1.4',
3536
'@angular/common': '~8.2.0',
3637
'@angular/compiler': '~8.2.0',
3738
'@angular/core': '~8.2.0',
3839
'@angular/elements': '~8.2.0',
3940
'@angular/forms': '~8.2.0',
41+
'@angular/material': '~8.1.4',
4042
'@angular/platform-browser': '~8.2.0',
4143
'@angular/platform-browser-dynamic': '~8.2.0',
4244
'@angular/router': '~8.2.0',

__tests__/package-json-versions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export * from './full-with-tsickle';
33
export * from './v11_1-dep-overrided';
44
export * from './v11_1-devdep-override';
55
export * from './v11_1-all-override';
6+
export * from './v11_1-all-override-with-unmatching';
67
export * from './package-unmatching';
78
export * from './package-without-ng-packagr';
8-
export * from './v11_1-all-override-without-ng-packagr';
99
export * from './v8-with-forced-dependencies';

__tests__/package-json-versions/package-without-ng-packagr.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ export const packageJsonWithoutNgPackagr = {
3232
private: true,
3333
dependencies: {
3434
'@angular/animations': '~10.1.6',
35+
'@angular/cdk': '~10.1.3',
3536
'@angular/common': '~10.1.6',
3637
'@angular/compiler': '~10.1.6',
3738
'@angular/core': '~10.1.6',
3839
'@angular/elements': '~10.1.6',
3940
'@angular/forms': '~10.1.6',
41+
'@angular/google-maps': '~10.1.3',
42+
'@angular/material': '~10.1.3',
4043
'@angular/platform-browser': '~10.1.6',
4144
'@angular/platform-browser-dynamic': '~10.1.6',
4245
'@angular/router': '~10.1.6',
46+
'@angular/youtube-player': '~10.1.3',
4347
rxjs: '~6.6.3',
4448
tslib: '^2.0.0',
4549
'zone.js': '~0.10.3'

__tests__/package-json-versions/v11_1-all-override-without-ng-packagr.ts renamed to __tests__/package-json-versions/v11_1-all-override-with-unmatching.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const packageJsonWith11_1AllWithoutNgPackagr = {
1+
export const packageJsonWithV11_1AllWithUnmatching = {
22
name: 'lumberjack',
33
version: '0.0.0',
44
scripts: {
@@ -31,20 +31,26 @@ export const packageJsonWith11_1AllWithoutNgPackagr = {
3131
},
3232
private: true,
3333
dependencies: {
34+
unmatching: 'unmatching',
3435
'@angular/animations': '~11.1.0',
36+
'@angular/cdk': '~11.1.0',
3537
'@angular/common': '~11.1.0',
3638
'@angular/compiler': '~11.1.0',
3739
'@angular/core': '~11.1.0',
3840
'@angular/elements': '~11.1.0',
3941
'@angular/forms': '~11.1.0',
42+
'@angular/google-maps': '~11.1.0',
43+
'@angular/material': '~11.1.0',
4044
'@angular/platform-browser': '~11.1.0',
4145
'@angular/platform-browser-dynamic': '~11.1.0',
4246
'@angular/router': '~11.1.0',
47+
'@angular/youtube-player': '~11.1.0',
4348
rxjs: '~6.6.0',
4449
tslib: '^2.0.0',
4550
'zone.js': '~0.11.3'
4651
},
4752
devDependencies: {
53+
'unmatching-dev': 'unmatching-dev',
4854
'@angular-devkit/build-angular': '~0.1101.0',
4955
'@angular-devkit/schematics-cli': '~0.1101.0',
5056
'@angular/cli': '~11.1.0',
@@ -70,6 +76,7 @@ export const packageJsonWith11_1AllWithoutNgPackagr = {
7076
'karma-jasmine': '~3.3.1',
7177
'karma-jasmine-html-reporter': '^1.5.0',
7278
'lint-staged': '^9.5.0',
79+
'ng-packagr': '^11.1.0',
7380
prettier: '^2.0.5',
7481
protractor: '~7.0.0',
7582
'standard-version': '^6.0.1',

__tests__/package-json-versions/v11_1-all-override.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ export const packageJsonWithV11_1All = {
3232
private: true,
3333
dependencies: {
3434
'@angular/animations': '~11.1.0',
35+
'@angular/cdk': '~11.1.0',
3536
'@angular/common': '~11.1.0',
3637
'@angular/compiler': '~11.1.0',
3738
'@angular/core': '~11.1.0',
3839
'@angular/elements': '~11.1.0',
3940
'@angular/forms': '~11.1.0',
41+
'@angular/google-maps': '~11.1.0',
42+
'@angular/material': '~11.1.0',
4043
'@angular/platform-browser': '~11.1.0',
4144
'@angular/platform-browser-dynamic': '~11.1.0',
4245
'@angular/router': '~11.1.0',
46+
'@angular/youtube-player': '~11.1.0',
4347
rxjs: '~6.6.0',
4448
tslib: '^2.0.0',
4549
'zone.js': '~0.11.3'

__tests__/package-json-versions/v11_1-dep-overrided.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ export const packageJsonWithV11_1Dependencies = {
3232
private: true,
3333
dependencies: {
3434
'@angular/animations': '~11.1.0',
35+
'@angular/cdk': '~11.1.0',
3536
'@angular/common': '~11.1.0',
3637
'@angular/compiler': '~11.1.0',
3738
'@angular/core': '~11.1.0',
3839
'@angular/elements': '~11.1.0',
3940
'@angular/forms': '~11.1.0',
41+
'@angular/google-maps': '~11.1.0',
42+
'@angular/material': '~11.1.0',
4043
'@angular/platform-browser': '~11.1.0',
4144
'@angular/platform-browser-dynamic': '~11.1.0',
4245
'@angular/router': '~11.1.0',
46+
'@angular/youtube-player': '~11.1.0',
4347
rxjs: '~6.6.0',
4448
tslib: '^2.0.0',
4549
'zone.js': '~0.11.3'

0 commit comments

Comments
 (0)