Skip to content

Commit

Permalink
build: update nx to v16
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus-Ende committed Apr 9, 2024
1 parent a9083a3 commit 316bfc4
Show file tree
Hide file tree
Showing 17 changed files with 12,328 additions and 10,081 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand All @@ -11,7 +11,7 @@
},
"plugins": ["jest"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -28,15 +28,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
73 changes: 0 additions & 73 deletions angular.json

This file was deleted.

4 changes: 2 additions & 2 deletions decorate-angular-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const cp = require('child_process');
const isWindows = os.platform() === 'win32';
let output;
try {
output = require('@nrwl/workspace').output;
output = require('@nx/workspace').output;
} catch (e) {
console.warn(
'Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed.'
'Angular CLI could not be decorated to enable computation caching. Please ensure @nx/workspace is installed.'
);
process.exit(0);
}
Expand Down
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');

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

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* 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/ng-mockito/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"
],
"parserOptions": {
Expand All @@ -32,7 +32,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
17 changes: 9 additions & 8 deletions libs/ng-mockito/integration/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ export default {
displayName: 'ng-mockito-integration',

setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../../coverage/libs/ng-mockito/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$)'],
preset: '../../../jest.preset.js',
Expand Down
29 changes: 29 additions & 0 deletions libs/ng-mockito/integration/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "ng-mockito-integration",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/ng-mockito/integration/src",
"prefix": "qp",
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["libs/ng-mockito/integration/src/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/ng-mockito/integration/jest.config.ts",
"passWithNoTests": true
},
"outputs": ["{workspaceRoot}/coverage/libs/ng-mockito/integration"]
}
},
"generators": {
"@schematics/angular:component": {
"style": "scss"
}
},
"tags": ["scope:ng-mockito"]
}
4 changes: 2 additions & 2 deletions libs/ng-mockito/ng-mockito/.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"
],
"parserOptions": {
Expand All @@ -32,7 +32,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
17 changes: 9 additions & 8 deletions libs/ng-mockito/ng-mockito/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ export default {
displayName: 'ng-mockito-ng-mockito',

setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../../coverage/libs/ng-mockito/ng-mockito',
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$)'],
preset: '../../../jest.preset.js',
Expand Down
42 changes: 42 additions & 0 deletions libs/ng-mockito/ng-mockito/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "ng-mockito",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/ng-mockito/ng-mockito/src",
"prefix": "qp",
"targets": {
"build": {
"executor": "@nx/angular:package",
"options": {
"tsConfig": "libs/ng-mockito/ng-mockito/tsconfig.lib.json",
"project": "libs/ng-mockito/ng-mockito/ng-package.json",
"updateBuildableProjectDepsInPackageJson": true
},
"configurations": {
"production": {
"tsConfig": "libs/ng-mockito/ng-mockito/tsconfig.lib.prod.json"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["libs/ng-mockito/ng-mockito/src/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/ng-mockito/ng-mockito/jest.config.ts",
"passWithNoTests": true
},
"outputs": ["{workspaceRoot}/coverage/libs/ng-mockito/ng-mockito"]
}
},
"generators": {
"@schematics/angular:component": {
"style": "scss"
}
},
"tags": ["scope:ng-mockito"]
}
2 changes: 1 addition & 1 deletion libs/ng-mockito/ng-mockito/src/lib/ts-mockito-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function isClass(anything: unknown) {
}
}

function getMockedClass<T>(mock: T): Type<T> {
function getMockedClass<T extends object>(mock: T): Type<T> {
if (!('__tsmockitoMocker' in mock)) {
const constructorName = (mock as any).constructor?.name;
if (constructorName === '') {
Expand Down
Loading

0 comments on commit 316bfc4

Please sign in to comment.