Skip to content

Commit

Permalink
chore(deps)!: update to Angular 15, tsconfig-paths 4 (#1319)
Browse files Browse the repository at this point in the history
* 15.x.x update

* build: upgrade `tsconfig-paths` to `^4`

* build: upgrade `@types/jasmine` and `karma-jasmine-html-reporter`

* build: upgrade `puppeteer`

* chore: upgrade `MIGRATION.MD`

Co-authored-by: JeB <[email protected]>
  • Loading branch information
arturovt and just-jeb authored Nov 24, 2022
1 parent 60fc5f2 commit dd47762
Show file tree
Hide file tree
Showing 63 changed files with 2,404 additions and 3,049 deletions.
64 changes: 42 additions & 22 deletions MIGRATION.MD
Original file line number Diff line number Diff line change
@@ -1,50 +1,63 @@
# Migration from version 14 to version 15

## Custom Webpack builder

- No breaking changes (except for updating to Angular 15)

## Jest builder

- No breaking changes (except for updating to Angular 15)

# Migration from version 13 to version 14
## Custom webpack builder

- Node 12 is no longer supported
## Custom Webpack builder

- Node 12 is no longer supported

## Jest builder
## Jest builder

- Node 12 is no longer supported
- Minimal required version of Jest is 28
- Command line arguments in camelCase are no longer supported, use kebab-case instead
- The default value of `getComputedStyle` global mock is `{}` instead of `{display: 'none', appearance: ['-webkit-appearance']}`
- If you use it with custom configuration, make sure you read [this](https://github.com/thymikee/jest-preset-angular/blob/main/CHANGELOG.md#breaking-changes)
- Node 12 is no longer supported
- Minimal required version of Jest is 28
- Command line arguments in camelCase are no longer supported, use kebab-case instead
- The default value of `getComputedStyle` global mock is `{}` instead of `{display: 'none', appearance: ['-webkit-appearance']}`
- If you use it with custom configuration, make sure you read [this](https://github.com/thymikee/jest-preset-angular/blob/main/CHANGELOG.md#breaking-changes)

## Bazel builder

- Node 12 is no longer supported
- Node 12 is no longer supported

# Migration from version 12 to version 13

## Custom webpack builder
## Custom Webpack builder

No breaking changes (except for updating to Angular 13)

## Jest builder

`jest-preset-angular` has been updated to version 11.
`jest-preset-angular` has been updated to version 11.

- If you use it without custom configuration then no action required.
- If you use it with custom configuration, you might need to [update it](https://thymikee.github.io/jest-preset-angular/docs/next/guides/angular-13+/).

- If you use it without custom configuration then no action required.
- If you use it with custom configuration, you might need to [update it](https://thymikee.github.io/jest-preset-angular/docs/next/guides/angular-13+/).

# Migration from version 11 to version 12

## Custom webpack builder
## Custom Webpack builder

No breaking changes (except for updating to Angular 12)

## Jest builder (since 12.1.0)
1. Jest 27 is required now
2. `jest-preset-angular` has been updated to version 9, which uses Angular compiler instead of `ts-jest` in order to transform the TS files. Make sure you understand the implications and perform all the necessary changes to your code base as described in `jest-preset-angular` [CHANGELOG](https://github.com/thymikee/jest-preset-angular/blob/master/CHANGELOG.md).

1. Jest 27 is required now
2. `jest-preset-angular` has been updated to version 9, which uses Angular compiler instead of `ts-jest` in order to transform the TS files. Make sure you understand the implications and perform all the necessary changes to your code base as described in `jest-preset-angular` [CHANGELOG](https://github.com/thymikee/jest-preset-angular/blob/master/CHANGELOG.md).

# Migration from version 10 to version 11

## Custom webpack builder
1. `mergeStrategies` field in `customWebpackConfig` has been deprecated, use `mergeRules` instead as defined [here](https://github.com/survivejs/webpack-merge#mergewithrules).
## Custom Webpack builder

1. `mergeStrategies` field in `customWebpackConfig` has been deprecated, use `mergeRules` instead as defined [here](https://github.com/survivejs/webpack-merge#mergewithrules).

In order to make this breaking change as backward compatible as possible, the default value of `mergeRules` is the following:

```ts
{
module: {
Expand All @@ -58,33 +71,40 @@ In order to make this breaking change as backward compatible as possible, the de
},
};
```

This is as close as possible to the [`smart` merge strategy](https://github.com/survivejs/webpack-merge/tree/v4.2.2#smart-merging) that was used before, so ideally if you didn't use `mergeStrategies` then your configuration should work just as it worked before.
Otherwise you'll have to adjust the `mergeRules` in accordance with your needs.
If you don't want to invest time in learning how the `mergeRules` work or you have a complicated use case then consider using [Custom Webpack Config Function](./packages/custom-webpack#custom-webpack-config-function). This way you'll have full control over the configuration without relying on any merging mechanism.

# Migration from version 9 to version 10

## Jest builder

1. Update to Jest 26 if you still haven't.

# Migration from version 8 to version 9

## All builders

1. `@angular/architect` and `angular/core` are now direct builder dependencies, therefore no need to specify them explicitly in `package.json`

## Jest builder

1. jest-preset-angular version has been updated to 8. If you have any custom Jest configuration, make sure it matches the preset [version](https://github.com/thymikee/jest-preset-angular/releases/tag/v8.0.0).

2. If you're using Ivy (enabled by default in version 9) make sure you run `ngcc` in a `postinstall` hook. For more details refer to [this](https://github.com/just-jeb/angular-builders/issues/679#issuecomment-587525674) issue.

# Migration from version 7 to version 8

## Custom webpack builder
## Custom Webpack builder

1. `index.html` is no longer generated with Webpack. This means if your solution uses Webpack to alter `index.html` it will stop working the moment you upgrade to version 8.
Instead you should use [`indexTransform`](https://github.com/just-jeb/angular-builders/blob/master/packages/custom-webpack/README.md#index-transform) property.
Instead you should use [`indexTransform`](https://github.com/just-jeb/angular-builders/blob/master/packages/custom-webpack/README.md#index-transform) property.

## Dev-server builder

## Dev server builder
1. `@angular-builders/dev-server:generic` has been deprecated. Use [`@angular-builders/custom-webpack:dev-server`](https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack#Custom-webpack-dev-server) instead.

## Jest builder

1. Update to Jest 24 if you still haven't.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The purpose of this repository is to consolidate all the community builders for Angular build facade.

## The latest version of all the builders require Angular CLI 14
## The latest version of all the builders require Angular CLI 15

Builders' and Angular **major** versions **must** match.

Expand All @@ -13,6 +13,7 @@ Builders' and Angular **major** versions **must** match.
<details>
<summary>Click to expand</summary>

- [Version 14](https://github.com/just-jeb/angular-builders/tree/14.x.x)
- [Version 13](https://github.com/just-jeb/angular-builders/tree/13.x.x)
- [Version 12](https://github.com/just-jeb/angular-builders/tree/12.x.x)
- [Version 11](https://github.com/just-jeb/angular-builders/tree/11.x.x)
Expand Down
3 changes: 2 additions & 1 deletion examples/bazel/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"newProjectRoot": "projects",
"projects": {
"bazel-build": {
"root": "",
"architect": {
"build": {
"builder": "@angular-builders/bazel:build",
Expand All @@ -15,4 +16,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/bazel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"private": true,
"devDependencies": {
"@angular-builders/bazel": "workspace:*",
"@angular/cli": "14.0.4"
"@angular/cli": "15.0.0"
}
}
16 changes: 0 additions & 16 deletions examples/custom-webpack/full-cycle-app/.browserslistrc

This file was deleted.

11 changes: 8 additions & 3 deletions examples/custom-webpack/full-cycle-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"outputPath": "dist/full-cycle-app",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
Expand Down Expand Up @@ -100,9 +102,12 @@
"test": {
"builder": "@angular-builders/custom-webpack:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
Expand Down
34 changes: 17 additions & 17 deletions examples/custom-webpack/full-cycle-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
},
"private": true,
"dependencies": {
"@angular/animations": "14.2.9",
"@angular/common": "14.2.9",
"@angular/compiler": "14.2.9",
"@angular/core": "14.2.9",
"@angular/forms": "14.2.9",
"@angular/platform-browser": "14.2.9",
"@angular/platform-browser-dynamic": "14.2.9",
"@angular/router": "14.2.9",
"@angular/animations": "15.0.0",
"@angular/common": "15.0.0",
"@angular/compiler": "15.0.0",
"@angular/core": "15.0.0",
"@angular/forms": "15.0.0",
"@angular/platform-browser": "15.0.0",
"@angular/platform-browser-dynamic": "15.0.0",
"@angular/router": "15.0.0",
"rxjs": "7.5.7",
"tslib": "2.4.1",
"zone.js": "0.11.8"
"zone.js": "0.12.0"
},
"devDependencies": {
"@angular-builders/custom-webpack": "workspace:*",
"@angular-devkit/build-angular": "14.0.4",
"@angular/cli": "14.0.4",
"@angular/compiler-cli": "14.2.9",
"@angular/language-service": "14.2.9",
"@types/jasmine": "3.10.6",
"@angular-devkit/build-angular": "15.0.0",
"@angular/cli": "15.0.0",
"@angular/compiler-cli": "15.0.0",
"@angular/language-service": "15.0.0",
"@types/jasmine": "4.3.0",
"@types/node": "16.18.3",
"cypress": "10.11.0",
"html-webpack-plugin": "5.5.0",
Expand All @@ -39,9 +39,9 @@
"karma-chrome-launcher": "3.1.1",
"karma-coverage": "2.2.0",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "1.7.0",
"puppeteer": "13.7.0",
"karma-jasmine-html-reporter": "2.0.0",
"puppeteer": "19.2.2",
"ts-node": "10.9.1",
"typescript": "4.7.4"
"typescript": "4.8.2"
}
}
52 changes: 0 additions & 52 deletions examples/custom-webpack/full-cycle-app/src/polyfills.ts

This file was deleted.

19 changes: 0 additions & 19 deletions examples/custom-webpack/full-cycle-app/src/test.ts

This file was deleted.

3 changes: 1 addition & 2 deletions examples/custom-webpack/full-cycle-app/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
Expand Down
7 changes: 4 additions & 3 deletions examples/custom-webpack/full-cycle-app/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"module": "es2022",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"importHelpers": true,
"target": "es2015",
"target": "es2022",
"useDefineForClassFields": false,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"es2022",
"dom"
],
"paths": {
Expand Down
4 changes: 0 additions & 4 deletions examples/custom-webpack/full-cycle-app/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"node"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
Expand Down
16 changes: 0 additions & 16 deletions examples/custom-webpack/sanity-app-esm/.browserslistrc

This file was deleted.

Loading

0 comments on commit dd47762

Please sign in to comment.