diff --git a/.eslintrc.json b/.eslintrc.json index 85f44c38..74ab4641 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,9 +5,6 @@ "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "parserOptions": { - "project": ["/tsconfig.*?.json"] - }, "rules": { "@nrwl/nx/enforce-module-boundaries": [ "error", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ee20df6..90efc756 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index bf5a1886..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: release - -on: - push: - branches: - - main - -jobs: - release: - if: github.repository == 'testing-library/angular-testing-library' - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - - steps: - - uses: actions/checkout@v1 - - name: use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: install - run: npm install - - name: build - run: npm run build -- --skip-nx-cache - - name: test - run: npm run test -- --ci --code-coverage - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release diff --git a/angular.json b/angular.json index 376b9ca6..3e8b2f12 100644 --- a/angular.json +++ b/angular.json @@ -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": { @@ -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", @@ -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": { @@ -80,7 +97,9 @@ "jestConfig": "apps/example-app/jest.config.js", "setupFile": "apps/example-app/src/test-setup.ts" }, - "outputs": ["coverage/"] + "outputs": [ + "coverage/" + ] } } }, @@ -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": { @@ -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" + ] } } }, @@ -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": { @@ -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" + ] } } } } -} +} \ No newline at end of file diff --git a/apps/example-app/.eslintrc.json b/apps/example-app/.eslintrc.json index 38181327..9f90c874 100644 --- a/apps/example-app/.eslintrc.json +++ b/apps/example-app/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": ["../../.eslintrc.json"], + "extends": "../../.eslintrc.json", "ignorePatterns": ["!**/*"], "overrides": [ { @@ -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"], diff --git a/apps/example-app/src/environments/environment.ts b/apps/example-app/src/environments/environment.ts index 665463cc..85db3caf 100644 --- a/apps/example-app/src/environments/environment.ts +++ b/apps/example-app/src/environments/environment.ts @@ -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. diff --git a/apps/example-app/src/polyfills.ts b/apps/example-app/src/polyfills.ts index 1348d74b..bb20fec0 100644 --- a/apps/example-app/src/polyfills.ts +++ b/apps/example-app/src/polyfills.ts @@ -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 diff --git a/package.json b/package.json index 1c02d26d..d9a00217 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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" } -} +} \ No newline at end of file diff --git a/projects/testing-library/.eslintrc.json b/projects/testing-library/.eslintrc.json index a76c4ce4..4ad0bed8 100644 --- a/projects/testing-library/.eslintrc.json +++ b/projects/testing-library/.eslintrc.json @@ -13,7 +13,7 @@ "error", { "type": "attribute", - "prefix": ["atl"], + "prefix": "atl", "style": "camelCase" } ], @@ -21,7 +21,7 @@ "error", { "type": "element", - "prefix": ["atl"], + "prefix": "atl", "style": "kebab-case" } ] diff --git a/projects/testing-library/package.json b/projects/testing-library/package.json index 7fb78fff..29bd7073 100644 --- a/projects/testing-library/package.json +++ b/projects/testing-library/package.json @@ -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",