Skip to content
Merged
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

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

# Package versions

## Angular Components

These packages' versions are synced:

| Package name | Package identifier | First stable version |
| ---------------------- | ----------------------- | -------------------- |
| Angular CDK | @angular/cdk | 6.0.0 |
| Angular Google Maps | @angular/google-maps | 9.0.0 |
| Angular Material | @angular/material | 6.0.0 |
| Angular YouTube Player | @angular/youtube-player | 9.0.0 |

The strategy for these packages is to resolve the latest minor version that was available when the specified
minor Angular version was first released. For example, when Angular 8.2 was released, Angular Components were only
at version 8.1, so consumers asking for _Angular version_ 8.2.x will get Angular CDK version 8.1.x.

## Developing

Install the dependencies
Expand Down
86 changes: 59 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,49 @@ Create a workflow `.yml` file in your repositories `.github/workflows` directory
### Example workflow - match Angular versions

```yaml
name: Node.js CI
name: CI workflow

on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]
angular-version:
[
6.0.x,
6.1.x,
7.0.x,
7.1.x,
7.2.x,
8.0.x,
8.1.x,
8.2.x,
9.0.x,
9.1.x,
10.0.x,
10.1.x,
10.2.x,
11.0.x,
11.1.x,
11.2.x
12.0.x
]
- 6.0.x,
- 6.1.x,
- 7.0.x,
- 7.1.x,
- 7.2.x,
- 8.0.x,
- 8.1.x,
- 8.2.x,
- 9.0.x,
- 9.1.x,
- 10.0.x,
- 10.1.x,
- 10.2.x,
- 11.0.x,
- 11.1.x,
- 11.2.x
- 12.0.x

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Use Node.js 12.x
Comment thread
LayZeeDK marked this conversation as resolved.
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: 12.x
- name: Use Angular ${{ matrix.angular-version }}
uses: ngworker/angular-versions-action@v1
uses: ngworker/angular-versions-action@v4
with:
angular-version: ${{ matrix.angular-version }}

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

### Managed packages

The following packages are managed by this action:

- `@angular/animations`
- `@angular/cdk`
- `@angular/cli`
- `@angular/common`
- `@angular/compiler`
- `@angular/compiler-cli`
- `@angular/core`
- `@angular-devkit/build-angular`
- `@angular-devkit/build-ng-packagr`
- `@angular-devkit/schematics-cli`
- `@angular/elements`
- `@angular/forms`
- `@angular/google-maps`
- `@angular/material`
- `@angular/platform-browser`
- `@angular/platform-browser-dynamic`
- `@angular/router`
- `@angular/youtube-player`
- `@types/node`
- `codelyzer`
- `ng-packagr`
- `rxjs`
- `tsickle `
- `tslib`
- `tslint`
- `ts-node`
- `typescript`
- `zone.js`

## Contributing

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.
Expand Down
14 changes: 7 additions & 7 deletions __tests__/override-angular-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
packageJsonWithV11_1Dependencies,
packageJsonWithV11_1DevDependencies,
packageJsonWithV11_1All,
packageJsonWithV11_1AllWithUnmatching,
fullPackageJson,
packageUnmatching,
packageJsonWithoutNgPackagr,
packageJsonWith11_1AllWithoutNgPackagr,
packageJsonV8WithForceDependencies
} from './package-json-versions';
import {overrideAngularVersions} from '../src/override-angular-versions';
Expand All @@ -19,7 +19,7 @@ describe(overrideAngularVersions.name, () => {
(v11_1.devDependencies as any) = {};

const actualPackageJson = overrideAngularVersions({
projectVersions: fullPackageJson,
projectVersions: fullPackageJson as any,
Comment thread
LayZeeDK marked this conversation as resolved.
angularVersions: v11_1
});

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

const actualPackageJson = overrideAngularVersions({
projectVersions: fullPackageJson,
projectVersions: fullPackageJson as any,
angularVersions: v11_1
});

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

const actualPackageJson = overrideAngularVersions({
projectVersions: fullPackageJson,
projectVersions: fullPackageJson as any,
angularVersions: v11_1
});

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

expect(actualPackageJson).toEqual(packageUnmatching);
expect(actualPackageJson).toEqual(packageJsonWithV11_1AllWithUnmatching);
});

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

const actualPackageJson = overrideAngularVersions({
projectVersions: packageJsonWithoutNgPackagr as any,
angularVersions: v11_1
});

expect(actualPackageJson).toEqual(packageJsonWith11_1AllWithoutNgPackagr);
expect(actualPackageJson).toEqual(packageJsonWithV11_1All);
});

test('add forced dependencies when not present in the package', () => {
Expand Down
4 changes: 4 additions & 0 deletions __tests__/package-json-versions/full-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ export const fullPackageJson = {
private: true,
dependencies: {
'@angular/animations': '~10.1.6',
'@angular/cdk': '~10.1.3',
'@angular/common': '~10.1.6',
'@angular/compiler': '~10.1.6',
'@angular/core': '~10.1.6',
'@angular/elements': '~10.1.6',
'@angular/forms': '~10.1.6',
'@angular/google-maps': '~10.1.3',
'@angular/material': '~10.1.3',
'@angular/platform-browser': '~10.1.6',
'@angular/platform-browser-dynamic': '~10.1.6',
'@angular/router': '~10.1.6',
'@angular/youtube-player': '~10.1.3',
rxjs: '~6.6.3',
tslib: '^2.0.0',
'zone.js': '~0.10.3'
Expand Down
2 changes: 2 additions & 0 deletions __tests__/package-json-versions/full-with-tsickle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ export const fullWithTsickleJson = {
private: true,
dependencies: {
'@angular/animations': '~8.2.0',
'@angular/cdk': '~8.1.4',
'@angular/common': '~8.2.0',
'@angular/compiler': '~8.2.0',
'@angular/core': '~8.2.0',
'@angular/elements': '~8.2.0',
'@angular/forms': '~8.2.0',
'@angular/material': '~8.1.4',
'@angular/platform-browser': '~8.2.0',
'@angular/platform-browser-dynamic': '~8.2.0',
'@angular/router': '~8.2.0',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/package-json-versions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export * from './full-with-tsickle';
export * from './v11_1-dep-overrided';
export * from './v11_1-devdep-override';
export * from './v11_1-all-override';
export * from './v11_1-all-override-with-unmatching';
export * from './package-unmatching';
export * from './package-without-ng-packagr';
export * from './v11_1-all-override-without-ng-packagr';
export * from './v8-with-forced-dependencies';
4 changes: 4 additions & 0 deletions __tests__/package-json-versions/package-without-ng-packagr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ export const packageJsonWithoutNgPackagr = {
private: true,
dependencies: {
'@angular/animations': '~10.1.6',
'@angular/cdk': '~10.1.3',
'@angular/common': '~10.1.6',
'@angular/compiler': '~10.1.6',
'@angular/core': '~10.1.6',
'@angular/elements': '~10.1.6',
'@angular/forms': '~10.1.6',
'@angular/google-maps': '~10.1.3',
'@angular/material': '~10.1.3',
'@angular/platform-browser': '~10.1.6',
'@angular/platform-browser-dynamic': '~10.1.6',
'@angular/router': '~10.1.6',
'@angular/youtube-player': '~10.1.3',
rxjs: '~6.6.3',
tslib: '^2.0.0',
'zone.js': '~0.10.3'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const packageJsonWith11_1AllWithoutNgPackagr = {
export const packageJsonWithV11_1AllWithUnmatching = {
name: 'lumberjack',
version: '0.0.0',
scripts: {
Expand Down Expand Up @@ -31,20 +31,26 @@ export const packageJsonWith11_1AllWithoutNgPackagr = {
},
private: true,
dependencies: {
unmatching: 'unmatching',
Comment thread
LayZeeDK marked this conversation as resolved.
'@angular/animations': '~11.1.0',
'@angular/cdk': '~11.1.0',
'@angular/common': '~11.1.0',
'@angular/compiler': '~11.1.0',
'@angular/core': '~11.1.0',
'@angular/elements': '~11.1.0',
'@angular/forms': '~11.1.0',
'@angular/google-maps': '~11.1.0',
'@angular/material': '~11.1.0',
'@angular/platform-browser': '~11.1.0',
'@angular/platform-browser-dynamic': '~11.1.0',
'@angular/router': '~11.1.0',
'@angular/youtube-player': '~11.1.0',
rxjs: '~6.6.0',
tslib: '^2.0.0',
'zone.js': '~0.11.3'
},
devDependencies: {
'unmatching-dev': 'unmatching-dev',
'@angular-devkit/build-angular': '~0.1101.0',
'@angular-devkit/schematics-cli': '~0.1101.0',
'@angular/cli': '~11.1.0',
Expand All @@ -70,6 +76,7 @@ export const packageJsonWith11_1AllWithoutNgPackagr = {
'karma-jasmine': '~3.3.1',
'karma-jasmine-html-reporter': '^1.5.0',
'lint-staged': '^9.5.0',
'ng-packagr': '^11.1.0',
prettier: '^2.0.5',
protractor: '~7.0.0',
'standard-version': '^6.0.1',
Expand Down
4 changes: 4 additions & 0 deletions __tests__/package-json-versions/v11_1-all-override.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ export const packageJsonWithV11_1All = {
private: true,
dependencies: {
'@angular/animations': '~11.1.0',
'@angular/cdk': '~11.1.0',
'@angular/common': '~11.1.0',
'@angular/compiler': '~11.1.0',
'@angular/core': '~11.1.0',
'@angular/elements': '~11.1.0',
'@angular/forms': '~11.1.0',
'@angular/google-maps': '~11.1.0',
'@angular/material': '~11.1.0',
'@angular/platform-browser': '~11.1.0',
'@angular/platform-browser-dynamic': '~11.1.0',
'@angular/router': '~11.1.0',
'@angular/youtube-player': '~11.1.0',
rxjs: '~6.6.0',
tslib: '^2.0.0',
'zone.js': '~0.11.3'
Expand Down
4 changes: 4 additions & 0 deletions __tests__/package-json-versions/v11_1-dep-overrided.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ export const packageJsonWithV11_1Dependencies = {
private: true,
dependencies: {
'@angular/animations': '~11.1.0',
'@angular/cdk': '~11.1.0',
'@angular/common': '~11.1.0',
'@angular/compiler': '~11.1.0',
'@angular/core': '~11.1.0',
'@angular/elements': '~11.1.0',
'@angular/forms': '~11.1.0',
'@angular/google-maps': '~11.1.0',
'@angular/material': '~11.1.0',
'@angular/platform-browser': '~11.1.0',
'@angular/platform-browser-dynamic': '~11.1.0',
'@angular/router': '~11.1.0',
'@angular/youtube-player': '~11.1.0',
rxjs: '~6.6.0',
tslib: '^2.0.0',
'zone.js': '~0.11.3'
Expand Down
4 changes: 4 additions & 0 deletions __tests__/package-json-versions/v11_1-devdep-override.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ export const packageJsonWithV11_1DevDependencies = {
private: true,
dependencies: {
'@angular/animations': '~10.1.6',
'@angular/cdk': '~10.1.3',
'@angular/common': '~10.1.6',
'@angular/compiler': '~10.1.6',
'@angular/core': '~10.1.6',
'@angular/elements': '~10.1.6',
'@angular/forms': '~10.1.6',
'@angular/google-maps': '~10.1.3',
'@angular/material': '~10.1.3',
'@angular/platform-browser': '~10.1.6',
'@angular/platform-browser-dynamic': '~10.1.6',
'@angular/router': '~10.1.6',
'@angular/youtube-player': '~10.1.3',
rxjs: '~6.6.3',
tslib: '^2.0.0',
'zone.js': '~0.10.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ export const packageJsonV8WithForceDependencies = {
private: true,
dependencies: {
'@angular/animations': '~8.0.3',
'@angular/cdk': '~8.0.2',
'@angular/common': '~8.0.3',
'@angular/compiler': '~8.0.3',
'@angular/core': '~8.0.3',
'@angular/elements': '~8.0.3',
'@angular/forms': '~8.0.3',
'@angular/material': '~8.0.2',
'@angular/platform-browser': '~8.0.3',
'@angular/platform-browser-dynamic': '~8.0.3',
'@angular/router': '~8.0.3',
Expand Down
Loading