Skip to content

Commit d2ac612

Browse files
committed
feat: update dependencies to last versions;
feat: serve at local env; fix: live reload while run several projects;
1 parent 306909d commit d2ac612

10 files changed

+30969
-42019
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

apps/code-review/jest.config.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ export default {
33
displayName: 'code-review',
44
preset: '../../jest.preset.js',
55
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6-
globals: {
7-
'ts-jest': {
8-
tsconfig: '<rootDir>/tsconfig.spec.json',
9-
stringifyContentPathRegex: '\\.(html|svg)$'
10-
}
11-
},
6+
globals: {},
127
coverageDirectory: '../../coverage/apps/code-review',
138
transform: {
14-
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular'
9+
'^.+\\.(ts|mjs|js|html)$': [
10+
'jest-preset-angular',
11+
{
12+
tsconfig: '<rootDir>/tsconfig.spec.json',
13+
stringifyContentPathRegex: '\\.(html|svg)$'
14+
}
15+
]
1516
},
1617
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
1718
snapshotSerializers: [

apps/code-review/project.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,23 @@
8282
},
8383
"serve": {
8484
"executor": "@nrwl/angular:webpack-dev-server",
85+
"options": {
86+
"port": 4201,
87+
"publicHost": "http://localhost:4201",
88+
"open": true
89+
},
8590
"configurations": {
8691
"production": {
8792
"browserTarget": "code-review:build:production"
8893
},
8994
"development": {
9095
"browserTarget": "code-review:build:development"
96+
},
97+
"local": {
98+
"browserTarget": "code-review:build:local"
9199
}
92100
},
93-
"defaultConfiguration": "development",
94-
"options": {
95-
"port": 4201,
96-
"publicHost": "localhost"
97-
}
101+
"defaultConfiguration": "development"
98102
},
99103
"extract-i18n": {
100104
"executor": "@angular-devkit/build-angular:extract-i18n",
@@ -124,7 +128,7 @@
124128
}
125129
},
126130
"serve-static": {
127-
"executor": "@nrwl/angular:file-server",
131+
"executor": "@nrwl/web:file-server",
128132
"defaultConfiguration": "development",
129133
"options": {
130134
"buildTarget": "code-review:build",

apps/host/jest.config.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ export default {
33
displayName: 'host',
44
preset: '../../jest.preset.js',
55
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6-
globals: {
7-
'ts-jest': {
8-
tsconfig: '<rootDir>/tsconfig.spec.json',
9-
stringifyContentPathRegex: '\\.(html|svg)$'
10-
}
11-
},
6+
globals: {},
127
coverageDirectory: '../../coverage/apps/host',
138
transform: {
14-
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular'
9+
'^.+\\.(ts|mjs|js|html)$': [
10+
'jest-preset-angular',
11+
{
12+
tsconfig: '<rootDir>/tsconfig.spec.json',
13+
stringifyContentPathRegex: '\\.(html|svg)$'
14+
}
15+
]
1516
},
1617
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
1718
snapshotSerializers: [

apps/host/project.json

+11-6
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,21 @@
9292
"defaultConfiguration": "production"
9393
},
9494
"serve": {
95-
"executor": "@nrwl/angular:module-federation-dev-server",
95+
"executor": "@nrwl/angular:webpack-dev-server",
96+
"options": {
97+
"port": 80,
98+
"host": "127.0.0.1",
99+
"open": true
100+
},
96101
"configurations": {
97-
"production": {
102+
"productions": {
98103
"browserTarget": "host:build:production"
99104
},
100105
"development": {
101-
"browserTarget": "host:build:local",
102-
"port": 80,
103-
"host": "127.0.0.1",
104-
"open": true
106+
"browserTarget": "host:build:development"
107+
},
108+
"local": {
109+
"browserTarget": "host:build:local"
105110
}
106111
},
107112
"defaultConfiguration": "development"

jest.preset.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
const nxPreset = require('@nrwl/jest/preset').default;
22

3-
module.exports = { ...nxPreset };
3+
module.exports = {
4+
...nxPreset,
5+
/* TODO: Update to latest Jest snapshotFormat
6+
* By default Nx has kept the older style of Jest Snapshot formats
7+
* to prevent breaking of any existing tests with snapshots.
8+
* It's recommend you update to the latest format.
9+
* You can do this by removing snapshotFormat property
10+
* and running tests with --update-snapshot flag.
11+
* Example: "nx affected --targets=test --update-snapshot"
12+
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
13+
*/
14+
snapshotFormat: { escapeString: true, printBasicPrototype: true }
15+
};

libs/assets/jest.config.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
export default {
33
displayName: 'assets',
44
preset: '../../jest.preset.js',
5-
globals: {
6-
'ts-jest': {
7-
tsconfig: '<rootDir>/tsconfig.spec.json'
8-
}
9-
},
5+
globals: {},
106
transform: {
11-
'^.+\\.[tj]sx?$': 'ts-jest'
7+
'^.+\\.[tj]sx?$': [
8+
'ts-jest',
9+
{
10+
tsconfig: '<rootDir>/tsconfig.spec.json'
11+
}
12+
]
1213
},
1314
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
1415
coverageDirectory: '../../coverage/libs/assets'

libs/shared/jest.config.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ export default {
33
displayName: 'shared',
44
preset: '../../jest.preset.js',
55
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6-
globals: {
7-
'ts-jest': {
8-
tsconfig: '<rootDir>/tsconfig.spec.json',
9-
stringifyContentPathRegex: '\\.(html|svg)$'
10-
}
11-
},
6+
globals: {},
127
coverageDirectory: '../../coverage/libs/shared',
138
transform: {
14-
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular'
9+
'^.+\\.(ts|mjs|js|html)$': [
10+
'jest-preset-angular',
11+
{
12+
tsconfig: '<rootDir>/tsconfig.spec.json',
13+
stringifyContentPathRegex: '\\.(html|svg)$'
14+
}
15+
]
1516
},
1617
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
1718
snapshotSerializers: [

0 commit comments

Comments
 (0)