Skip to content

Commit

Permalink
build: upgrade to Angular 16 (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt authored Aug 3, 2023
1 parent d46028c commit 825a58c
Show file tree
Hide file tree
Showing 19 changed files with 5,430 additions and 4,174 deletions.
23 changes: 16 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx", "ban"],
"plugins": ["@nx", "ban"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"ban/ban": [
"error",
{ "name": "fit", "message": "The fit is forbidden" },
{ "name": "debugger", "message": "The debugger is forbidden" },
{ "name": "fdescribe", "message": "The fdescribe is forbidden" }
{
"name": "fit",
"message": "The fit is forbidden"
},
{
"name": "debugger",
"message": "The debugger is forbidden"
},
{
"name": "fdescribe",
"message": "The fdescribe is forbidden"
}
],
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -29,15 +38,15 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"parserOptions": {
"project": "./tsconfig.*?.json"
},
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
Expand Down
12 changes: 6 additions & 6 deletions apps/integration-e2e/project.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"name": "integration-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/integration-e2e/src",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/integration-e2e/cypress.json",
"tsConfig": "apps/integration-e2e/tsconfig.e2e.json",
"devServerTarget": "integration:serve:production"
}
},
"e2e-development": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/integration-e2e/cypress.json",
"tsConfig": "apps/integration-e2e/tsconfig.e2e.json",
"devServerTarget": "integration:serve:development"
}
},
"e2e-development-jit": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/integration-e2e/cypress.json",
"tsConfig": "apps/integration-e2e/tsconfig.e2e.json",
"devServerTarget": "integration:serve:development-jit"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": ["apps/integration-e2e/**/*.{js,ts}"]
},
"outputs": ["{options.outputFile}"]
}
},
"tags": ["app"],
"implicitDependencies": ["integration"],
"name": "integration-e2e"
"implicitDependencies": ["integration"]
}
2 changes: 0 additions & 2 deletions apps/integration-e2e/src/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');

module.exports = (on, config) => {};
4 changes: 2 additions & 2 deletions apps/integration/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
Expand All @@ -29,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
15 changes: 8 additions & 7 deletions apps/integration/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ module.exports = {
displayName: 'integration',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/integration',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
8 changes: 4 additions & 4 deletions apps/integration/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "integration",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/integration/src",
Expand Down Expand Up @@ -137,21 +138,20 @@
"defaultConfiguration": "development"
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"options": {
"passWithNoTests": true,
"jestConfig": "apps/integration/jest.config.ts"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": ["apps/integration/src/**/*.ts", "apps/integration/src/**/*.html"]
},
"outputs": ["{options.outputFile}"]
}
},
"tags": ["app"],
"implicitDependencies": ["until-destroy"],
"name": "integration"
"implicitDependencies": ["until-destroy"]
}
7 changes: 0 additions & 7 deletions apps/integration/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
ɵivyEnabled as ivyEnabled,
Component,
Directive,
Injectable,
Expand All @@ -16,12 +15,6 @@ import { finalize } from 'rxjs/operators';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';

describe('until-destroy runtime behavior', () => {
it('ivy has to be enabled', () => {
// This assertion has to be performed as we have to
// be sure that we're running these tests with the Ivy engine
expect(ivyEnabled).toBeTruthy();
});

it('should unsubscribe from the component property', () => {
// Arrange
@UntilDestroy({ checkProperties: true })
Expand Down
69 changes: 0 additions & 69 deletions decorate-angular-cli.js

This file was deleted.

2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');

module.exports = { projects: getJestProjects() };
14 changes: 12 additions & 2 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
const nxPreset = require('@nrwl/jest/preset').default;
const nxPreset = require('@nx/jest/preset').default;

module.exports = {
...nxPreset,
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
resolver: '@nrwl/jest/plugins/resolver',
resolver: '@nx/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],
coverageReporters: ['html', 'lcov'],
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
4 changes: 2 additions & 2 deletions libs/until-destroy-migration/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
Expand All @@ -29,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
15 changes: 8 additions & 7 deletions libs/until-destroy-migration/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ module.exports = {
displayName: 'until-destroy-migration',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/until-destroy-migration',
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
snapshotSerializers: [
Expand Down
8 changes: 4 additions & 4 deletions libs/until-destroy-migration/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "until-destroy-migration",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/until-destroy-migration/src",
Expand All @@ -13,14 +14,14 @@
}
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"options": {
"passWithNoTests": true,
"jestConfig": "libs/until-destroy-migration/jest.config.ts"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/until-destroy-migration/src/**/*.ts",
Expand All @@ -31,6 +32,5 @@
}
},
"tags": ["lib"],
"implicitDependencies": [],
"name": "until-destroy-migration"
"implicitDependencies": []
}
6 changes: 3 additions & 3 deletions libs/until-destroy/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/no-output-native": ["off"],
"@typescript-eslint/no-non-null-assertion": ["off"],
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"allow": []
Expand All @@ -21,7 +21,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
Loading

0 comments on commit 825a58c

Please sign in to comment.