Skip to content

Commit

Permalink
chore: ⬆️ Migrate Nx workspace to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
avchugaev committed May 31, 2023
1 parent 01e4a78 commit 1da9cd1
Show file tree
Hide file tree
Showing 18 changed files with 2,353 additions and 26,349 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -23,12 +23,12 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getJestProjects } from '@nrwl/jest';
import { getJestProjects } from '@nx/jest';

export default {
projects: getJestProjects(),
Expand Down
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/rx/.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/rx/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ export default {
displayName: 'rx',
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/rx',
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
7 changes: 4 additions & 3 deletions libs/rx/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "rx",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/rx/src",
"prefix": "ngry",
"targets": {
"build": {
"executor": "@nrwl/angular:package",
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/libs/rx"],
"options": {
"project": "libs/rx/ng-package.json"
Expand All @@ -21,7 +22,7 @@
"defaultConfiguration": "production"
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/rx"],
"options": {
"jestConfig": "libs/rx/jest.config.ts",
Expand All @@ -30,7 +31,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": ["libs/rx/**/*.ts", "libs/rx/**/*.html"]
}
Expand Down
4 changes: 2 additions & 2 deletions libs/store/.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/store/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ export default {
displayName: 'store',
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/store',
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
7 changes: 4 additions & 3 deletions libs/store/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "store",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/store/src",
"prefix": "ngry",
"targets": {
"build": {
"executor": "@nrwl/angular:package",
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/libs/store"],
"options": {
"project": "libs/store/ng-package.json"
Expand All @@ -21,7 +22,7 @@
"defaultConfiguration": "production"
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/store"],
"options": {
"jestConfig": "libs/store/jest.config.ts",
Expand All @@ -30,7 +31,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": ["libs/store/**/*.ts", "libs/store/**/*.html"]
}
Expand Down
4 changes: 2 additions & 2 deletions libs/translate/.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/translate/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ export default {
displayName: 'translate',
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/translate',
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
7 changes: 4 additions & 3 deletions libs/translate/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "translate",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/translate/src",
"prefix": "ngry",
"targets": {
"build": {
"executor": "@nrwl/angular:package",
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/libs/translate"],
"options": {
"project": "libs/translate/ng-package.json"
Expand All @@ -21,7 +22,7 @@
"defaultConfiguration": "production"
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/translate"],
"options": {
"jestConfig": "libs/translate/jest.config.ts",
Expand All @@ -30,7 +31,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/translate/**/*.ts",
Expand Down
6 changes: 3 additions & 3 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
]
},
"generators": {
"@nrwl/angular:application": {
"@nx/angular:application": {
"style": "scss",
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "none"
},
"@nrwl/angular:library": {
"@nx/angular:library": {
"linter": "eslint",
"unitTestRunner": "jest"
},
"@nrwl/angular:component": {
"@nx/angular:component": {
"style": "scss"
}
},
Expand Down
Loading

0 comments on commit 1da9cd1

Please sign in to comment.