Skip to content

Commit e6d2e84

Browse files
feat: support Angular 12 (#214)
1 parent 68924e4 commit e6d2e84

File tree

10 files changed

+91
-85
lines changed

10 files changed

+91
-85
lines changed

.eslintrc.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"overrides": [
66
{
77
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8-
"parserOptions": {
9-
"project": ["/tsconfig.*?.json"]
10-
},
118
"rules": {
129
"@nrwl/nx/enforce-module-boundaries": [
1310
"error",

.github/workflows/ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
name: ci
22

3-
on: pull_request
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
48

59
jobs:
6-
build_and_test:
10+
build_test_release:
711
strategy:
812
matrix:
913
os: [ubuntu-latest, windows-latest]
1014
node: [12, 14, 16]
1115
runs-on: ${{ matrix.os }}
16+
1217
steps:
1318
- uses: actions/checkout@v2
1419
- name: use Node.js ${{ matrix.node-version }}
@@ -21,3 +26,9 @@ jobs:
2126
run: npm run build -- --skip-nx-cache
2227
- name: test
2328
run: npm run test -- --ci --code-coverage
29+
- name: Release
30+
if: github.repository == 'testing-library/angular-testing-library' && github.ref == 'refs/heads/main' && matrix.node-version == 16 && matrix.os == 'ubuntu-latest'
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
run: npx semantic-release

.github/workflows/release.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

angular.json

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,25 @@
1515
"build": {
1616
"builder": "@angular-devkit/build-angular:browser",
1717
"options": {
18-
"aot": true,
1918
"outputPath": "dist/apps/example-app",
2019
"index": "apps/example-app/src/index.html",
2120
"main": "apps/example-app/src/main.ts",
2221
"polyfills": "apps/example-app/src/polyfills.ts",
2322
"tsConfig": "apps/example-app/tsconfig.app.json",
24-
"assets": ["apps/example-app/src/favicon.ico", "apps/example-app/src/assets"],
25-
"styles": ["apps/example-app/src/styles.css"],
26-
"scripts": []
23+
"assets": [
24+
"apps/example-app/src/favicon.ico",
25+
"apps/example-app/src/assets"
26+
],
27+
"styles": [
28+
"apps/example-app/src/styles.css"
29+
],
30+
"scripts": [],
31+
"vendorChunk": true,
32+
"extractLicenses": false,
33+
"buildOptimizer": false,
34+
"sourceMap": true,
35+
"optimization": false,
36+
"namedChunks": true
2737
},
2838
"configurations": {
2939
"production": {
@@ -43,13 +53,14 @@
4353
"outputHashing": "all",
4454
"sourceMap": false,
4555
"namedChunks": false,
46-
"aot": true,
4756
"extractLicenses": true,
4857
"vendorChunk": false,
4958
"buildOptimizer": true
5059
}
5160
},
52-
"outputs": ["{options.outputPath}"]
61+
"outputs": [
62+
"{options.outputPath}"
63+
]
5364
},
5465
"serve": {
5566
"builder": "@angular-devkit/build-angular:dev-server",
@@ -71,7 +82,13 @@
7182
"lint": {
7283
"builder": "@nrwl/linter:eslint",
7384
"options": {
74-
"lintFilePatterns": ["apps/example-app/**/*.ts", "apps/example-app/**/*.html"]
85+
"lintFilePatterns": [
86+
"apps/example-app/**/*.ts",
87+
"apps/example-app/**/*.html",
88+
"apps/example-app/src/**/*.html",
89+
"apps/example-app/src/**/*.html",
90+
"apps/example-app/src/**/*.html"
91+
]
7592
}
7693
},
7794
"test": {
@@ -80,7 +97,9 @@
8097
"jestConfig": "apps/example-app/jest.config.js",
8198
"setupFile": "apps/example-app/src/test-setup.ts"
8299
},
83-
"outputs": ["coverage/"]
100+
"outputs": [
101+
"coverage/"
102+
]
84103
}
85104
}
86105
},
@@ -106,7 +125,13 @@
106125
"lint": {
107126
"builder": "@nrwl/linter:eslint",
108127
"options": {
109-
"lintFilePatterns": ["projects/testing-library/**/*.ts", "projects/testing-library/**/*.html"]
128+
"lintFilePatterns": [
129+
"projects/testing-library/**/*.ts",
130+
"projects/testing-library/**/*.html",
131+
"projects/testing-library/src/**/*.html",
132+
"projects/testing-library/src/**/*.html",
133+
"projects/testing-library/src/**/*.html"
134+
]
110135
}
111136
},
112137
"build": {
@@ -129,7 +154,9 @@
129154
"jestConfig": "projects/testing-library/jest.config.js",
130155
"setupFile": "projects/testing-library/test-setup.ts"
131156
},
132-
"outputs": ["coverage/projects/testing-library"]
157+
"outputs": [
158+
"coverage/projects/testing-library"
159+
]
133160
}
134161
}
135162
},
@@ -155,7 +182,13 @@
155182
"lint": {
156183
"builder": "@nrwl/linter:eslint",
157184
"options": {
158-
"lintFilePatterns": ["projects/jest-utils/**/*.ts", "projects/jest-utils/**/*.html"]
185+
"lintFilePatterns": [
186+
"projects/jest-utils/**/*.ts",
187+
"projects/jest-utils/**/*.html",
188+
"projects/jest-utils/src/**/*.html",
189+
"projects/jest-utils/src/**/*.html",
190+
"projects/jest-utils/src/**/*.html"
191+
]
159192
}
160193
},
161194
"build": {
@@ -175,9 +208,11 @@
175208
"jestConfig": "projects/jest-utils/jest.config.js",
176209
"setupFile": "projects/jest-utils/test-setup.ts"
177210
},
178-
"outputs": ["coverage/projects/jest-utils"]
211+
"outputs": [
212+
"coverage/projects/jest-utils"
213+
]
179214
}
180215
}
181216
}
182217
}
183-
}
218+
}

apps/example-app/.eslintrc.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["../../.eslintrc.json"],
2+
"extends": "../../.eslintrc.json",
33
"ignorePatterns": ["!**/*"],
44
"overrides": [
55
{
@@ -25,12 +25,7 @@
2525
"style": "kebab-case"
2626
}
2727
]
28-
},
29-
"plugins": ["@angular-eslint/eslint-plugin", "@typescript-eslint"]
30-
},
31-
{
32-
"files": ["*.spec.ts"],
33-
"extends": ["plugin:testing-library/angular", "plugin:jest-dom/recommended"]
28+
}
3429
},
3530
{
3631
"files": ["*.html"],

apps/example-app/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export const environment = {
1212
* import the following file, but please comment it out in production mode
1313
* because it will have performance impact when throw error
1414
*/
15-
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
15+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

apps/example-app/src/polyfills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
/** *************************************************************************************************
6969
* Zone JS is required by default for Angular itself.
7070
*/
71-
import 'zone.js/dist/zone'; // Included with Angular CLI.
71+
import 'zone.js'; // Included with Angular CLI.
7272

7373
/** *************************************************************************************************
7474
* APPLICATION IMPORTS

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
"semantic-release": "semantic-release"
2626
},
2727
"dependencies": {
28-
"@angular/animations": "11.2.9",
29-
"@angular/cdk": "11.2.9",
30-
"@angular/common": "11.2.9",
31-
"@angular/compiler": "11.2.9",
32-
"@angular/core": "11.2.9",
33-
"@angular/forms": "11.2.9",
34-
"@angular/material": "11.2.9",
35-
"@angular/platform-browser": "11.2.9",
36-
"@angular/platform-browser-dynamic": "11.2.9",
37-
"@angular/router": "11.2.9",
38-
"@ngrx/store": "11.0.0",
28+
"@angular/animations": "12.0.0",
29+
"@angular/cdk": "12.0.0",
30+
"@angular/common": "12.0.0",
31+
"@angular/compiler": "12.0.0",
32+
"@angular/core": "12.0.0",
33+
"@angular/forms": "12.0.0",
34+
"@angular/material": "12.0.0",
35+
"@angular/platform-browser": "12.0.0",
36+
"@angular/platform-browser-dynamic": "12.0.0",
37+
"@angular/router": "12.0.0",
38+
"@ngrx/store": "12.0.0",
3939
"@nrwl/angular": "12.0.3",
4040
"@nrwl/nx-cloud": "11.2.0",
4141
"@testing-library/dom": "7.29.4",
@@ -46,20 +46,20 @@
4646
"zone.js": "~0.11.4"
4747
},
4848
"devDependencies": {
49-
"@angular-devkit/build-angular": "0.1102.8",
49+
"@angular-devkit/build-angular": "12.0.0",
5050
"@angular-eslint/eslint-plugin": "~2.1.0",
5151
"@angular-eslint/eslint-plugin-template": "~2.1.0",
5252
"@angular-eslint/template-parser": "~2.1.0",
53-
"@angular/cli": "11.2.8",
54-
"@angular/compiler-cli": "11.2.9",
55-
"@angular/language-service": "11.2.9",
53+
"@angular/cli": "12.0.0",
54+
"@angular/compiler-cli": "12.0.0",
55+
"@angular/language-service": "12.0.0",
5656
"@nrwl/cli": "12.0.3",
5757
"@nrwl/eslint-plugin-nx": "12.0.3",
5858
"@nrwl/jest": "12.0.3",
5959
"@nrwl/linter": "12.0.3",
6060
"@nrwl/node": "12.0.3",
6161
"@nrwl/nx-plugin": "12.0.3",
62-
"@nrwl/workspace": "12.0.3",
62+
"@nrwl/workspace": "12.3.1",
6363
"@testing-library/jest-dom": "^5.11.10",
6464
"@types/jest": "~26.0.3",
6565
"@types/node": "14.14.37",
@@ -76,12 +76,12 @@
7676
"jest": "^26.1.0",
7777
"jest-preset-angular": "8.4.0",
7878
"lint-staged": "^10.2.11",
79-
"ng-packagr": "11.2.4",
79+
"ng-packagr": "12.0.0",
8080
"prettier": "2.2.1",
8181
"rimraf": "^3.0.2",
8282
"semantic-release": "^17.1.1",
8383
"ts-jest": "26.5.4",
8484
"ts-node": "9.1.1",
85-
"typescript": "4.1.4"
85+
"typescript": "4.2.4"
8686
}
87-
}
87+
}

projects/testing-library/.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"error",
1414
{
1515
"type": "attribute",
16-
"prefix": ["atl"],
16+
"prefix": "atl",
1717
"style": "camelCase"
1818
}
1919
],
2020
"@angular-eslint/component-selector": [
2121
"error",
2222
{
2323
"type": "element",
24-
"prefix": ["atl"],
24+
"prefix": "atl",
2525
"style": "kebab-case"
2626
}
2727
]

projects/testing-library/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
},
2323
"homepage": "https://github.com/testing-library/angular-testing-library#readme",
2424
"peerDependencies": {
25-
"@angular/common": ">= 10.0.0 < 12",
26-
"@angular/platform-browser": ">= 10.0.0 < 12",
27-
"@angular/animations": ">= 10.0.0 < 12",
28-
"@angular/router": ">= 10.0.0 < 12",
29-
"@angular/core": ">= 10.0.0 < 12"
25+
"@angular/common": ">= 10.0.0",
26+
"@angular/platform-browser": ">= 10.0.0",
27+
"@angular/animations": ">= 10.0.0",
28+
"@angular/router": ">= 10.0.0",
29+
"@angular/core": ">= 10.0.0"
3030
},
3131
"dependencies": {
3232
"@testing-library/dom": "7.29.4",

0 commit comments

Comments
 (0)