Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Angular 12 #214

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["/tsconfig.*?.json"]
},
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: ci

on: pull_request
on:
push:
pull_request:
branches:
- main

jobs:
build_and_test:
build_test_release:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [12, 14, 16]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: use Node.js ${{ matrix.node-version }}
Expand All @@ -21,3 +26,9 @@ jobs:
run: npm run build -- --skip-nx-cache
- name: test
run: npm run test -- --ci --code-coverage
- name: Release
if: github.repository == 'testing-library/angular-testing-library' && github.ref == 'refs/heads/main' && matrix.node-version == 16 && matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

61 changes: 48 additions & 13 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/apps/example-app",
"index": "apps/example-app/src/index.html",
"main": "apps/example-app/src/main.ts",
"polyfills": "apps/example-app/src/polyfills.ts",
"tsConfig": "apps/example-app/tsconfig.app.json",
"assets": ["apps/example-app/src/favicon.ico", "apps/example-app/src/assets"],
"styles": ["apps/example-app/src/styles.css"],
"scripts": []
"assets": [
"apps/example-app/src/favicon.ico",
"apps/example-app/src/assets"
],
"styles": [
"apps/example-app/src/styles.css"
],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -43,13 +53,14 @@
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
},
"outputs": ["{options.outputPath}"]
"outputs": [
"{options.outputPath}"
]
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand All @@ -71,7 +82,13 @@
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/example-app/**/*.ts", "apps/example-app/**/*.html"]
"lintFilePatterns": [
"apps/example-app/**/*.ts",
"apps/example-app/**/*.html",
"apps/example-app/src/**/*.html",
"apps/example-app/src/**/*.html",
"apps/example-app/src/**/*.html"
]
}
},
"test": {
Expand All @@ -80,7 +97,9 @@
"jestConfig": "apps/example-app/jest.config.js",
"setupFile": "apps/example-app/src/test-setup.ts"
},
"outputs": ["coverage/"]
"outputs": [
"coverage/"
]
}
}
},
Expand All @@ -106,7 +125,13 @@
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["projects/testing-library/**/*.ts", "projects/testing-library/**/*.html"]
"lintFilePatterns": [
"projects/testing-library/**/*.ts",
"projects/testing-library/**/*.html",
"projects/testing-library/src/**/*.html",
"projects/testing-library/src/**/*.html",
"projects/testing-library/src/**/*.html"
]
}
},
"build": {
Expand All @@ -129,7 +154,9 @@
"jestConfig": "projects/testing-library/jest.config.js",
"setupFile": "projects/testing-library/test-setup.ts"
},
"outputs": ["coverage/projects/testing-library"]
"outputs": [
"coverage/projects/testing-library"
]
}
}
},
Expand All @@ -155,7 +182,13 @@
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["projects/jest-utils/**/*.ts", "projects/jest-utils/**/*.html"]
"lintFilePatterns": [
"projects/jest-utils/**/*.ts",
"projects/jest-utils/**/*.html",
"projects/jest-utils/src/**/*.html",
"projects/jest-utils/src/**/*.html",
"projects/jest-utils/src/**/*.html"
]
}
},
"build": {
Expand All @@ -175,9 +208,11 @@
"jestConfig": "projects/jest-utils/jest.config.js",
"setupFile": "projects/jest-utils/test-setup.ts"
},
"outputs": ["coverage/projects/jest-utils"]
"outputs": [
"coverage/projects/jest-utils"
]
}
}
}
}
}
}
9 changes: 2 additions & 7 deletions apps/example-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../../.eslintrc.json"],
"extends": "../../.eslintrc.json",
"ignorePatterns": ["!**/*"],
"overrides": [
{
Expand All @@ -25,12 +25,7 @@
"style": "kebab-case"
}
]
},
"plugins": ["@angular-eslint/eslint-plugin", "@typescript-eslint"]
},
{
"files": ["*.spec.ts"],
"extends": ["plugin:testing-library/angular", "plugin:jest-dom/recommended"]
}
},
{
"files": ["*.html"],
Expand Down
2 changes: 1 addition & 1 deletion apps/example-app/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const environment = {
* import the following file, but please comment it out in production mode
* because it will have performance impact when throw error
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
2 changes: 1 addition & 1 deletion apps/example-app/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
/** *************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/** *************************************************************************************************
* APPLICATION IMPORTS
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"semantic-release": "semantic-release"
},
"dependencies": {
"@angular/animations": "11.2.9",
"@angular/cdk": "11.2.9",
"@angular/common": "11.2.9",
"@angular/compiler": "11.2.9",
"@angular/core": "11.2.9",
"@angular/forms": "11.2.9",
"@angular/material": "11.2.9",
"@angular/platform-browser": "11.2.9",
"@angular/platform-browser-dynamic": "11.2.9",
"@angular/router": "11.2.9",
"@ngrx/store": "11.0.0",
"@angular/animations": "12.0.0",
"@angular/cdk": "12.0.0",
"@angular/common": "12.0.0",
"@angular/compiler": "12.0.0",
"@angular/core": "12.0.0",
"@angular/forms": "12.0.0",
"@angular/material": "12.0.0",
"@angular/platform-browser": "12.0.0",
"@angular/platform-browser-dynamic": "12.0.0",
"@angular/router": "12.0.0",
"@ngrx/store": "12.0.0",
"@nrwl/angular": "12.0.3",
"@nrwl/nx-cloud": "11.2.0",
"@testing-library/dom": "7.29.4",
Expand All @@ -46,20 +46,20 @@
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.1102.8",
"@angular-devkit/build-angular": "12.0.0",
"@angular-eslint/eslint-plugin": "~2.1.0",
"@angular-eslint/eslint-plugin-template": "~2.1.0",
"@angular-eslint/template-parser": "~2.1.0",
"@angular/cli": "11.2.8",
"@angular/compiler-cli": "11.2.9",
"@angular/language-service": "11.2.9",
"@angular/cli": "12.0.0",
"@angular/compiler-cli": "12.0.0",
"@angular/language-service": "12.0.0",
"@nrwl/cli": "12.0.3",
"@nrwl/eslint-plugin-nx": "12.0.3",
"@nrwl/jest": "12.0.3",
"@nrwl/linter": "12.0.3",
"@nrwl/node": "12.0.3",
"@nrwl/nx-plugin": "12.0.3",
"@nrwl/workspace": "12.0.3",
"@nrwl/workspace": "12.3.1",
"@testing-library/jest-dom": "^5.11.10",
"@types/jest": "~26.0.3",
"@types/node": "14.14.37",
Expand All @@ -76,12 +76,12 @@
"jest": "^26.1.0",
"jest-preset-angular": "8.4.0",
"lint-staged": "^10.2.11",
"ng-packagr": "11.2.4",
"ng-packagr": "12.0.0",
"prettier": "2.2.1",
"rimraf": "^3.0.2",
"semantic-release": "^17.1.1",
"ts-jest": "26.5.4",
"ts-node": "9.1.1",
"typescript": "4.1.4"
"typescript": "4.2.4"
}
}
}
4 changes: 2 additions & 2 deletions projects/testing-library/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"error",
{
"type": "attribute",
"prefix": ["atl"],
"prefix": "atl",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": ["atl"],
"prefix": "atl",
"style": "kebab-case"
}
]
Expand Down
10 changes: 5 additions & 5 deletions projects/testing-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
},
"homepage": "https://github.com/testing-library/angular-testing-library#readme",
"peerDependencies": {
"@angular/common": ">= 10.0.0 < 12",
"@angular/platform-browser": ">= 10.0.0 < 12",
"@angular/animations": ">= 10.0.0 < 12",
"@angular/router": ">= 10.0.0 < 12",
"@angular/core": ">= 10.0.0 < 12"
"@angular/common": ">= 10.0.0",
"@angular/platform-browser": ">= 10.0.0",
"@angular/animations": ">= 10.0.0",
"@angular/router": ">= 10.0.0",
"@angular/core": ">= 10.0.0"
},
"dependencies": {
"@testing-library/dom": "7.29.4",
Expand Down