Skip to content

Commit 44d482d

Browse files
committed
chore(nx): Upgrade to Nx 18 - align root configs
1 parent 00ff68f commit 44d482d

19 files changed

+157
-134
lines changed

apps/mfe1/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["../../.eslintrc.json"],
2+
"extends": ["../../.eslintrc.json", "../../.eslintrc.base.json"],
33
"ignorePatterns": ["!**/*"],
44
"overrides": [
55
{

apps/mfe1/federation.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,12 @@ module.exports = withNativeFederation({
1919
},
2020

2121
sharedMappings: ['@angular-architects/playground-lib'],
22+
23+
skip: [
24+
'rxjs/ajax',
25+
'rxjs/fetch',
26+
'rxjs/testing',
27+
'rxjs/webSocket',
28+
// Add further packages you don't need at runtime
29+
],
2230
});

apps/mfe1/jest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export default {
33
displayName: 'mfe1',
44
preset: '../../jest.preset.js',
55
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6-
globals: {},
76
coverageDirectory: '../../coverage/apps/mfe1',
87
transform: {
98
'^.+\\.(ts|mjs|js|html)$': [

apps/mfe1/project.json

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,47 @@
22
"name": "mfe1",
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"projectType": "application",
5-
"sourceRoot": "apps/mfe1/src",
65
"prefix": "angular-architects",
6+
"sourceRoot": "apps/mfe1/src",
7+
"tags": [],
78
"targets": {
89
"build": {
910
"executor": "@angular-architects/native-federation:build",
11+
"options": {},
12+
"configurations": {
13+
"production": {
14+
"target": "mfe1:esbuild:production"
15+
},
16+
"development": {
17+
"target": "mfe1:esbuild:development",
18+
"dev": true
19+
}
20+
},
21+
"defaultConfiguration": "production"
22+
},
23+
"serve": {
24+
"executor": "@angular-architects/native-federation:build",
25+
"options": {
26+
"target": "mfe1:serve-original:development",
27+
"rebuildDelay": 0,
28+
"dev": true,
29+
"port": 0
30+
}
31+
},
32+
"extract-i18n": {
33+
"executor": "@angular-devkit/build-angular:extract-i18n",
34+
"options": {
35+
"buildTarget": "mfe1:build"
36+
}
37+
},
38+
"esbuild": {
39+
"executor": "@angular-devkit/build-angular:application",
1040
"outputs": ["{options.outputPath}"],
1141
"options": {
1242
"outputPath": "dist/apps/mfe1",
1343
"index": "apps/mfe1/src/index.html",
14-
"main": "apps/mfe1/src/main.ts",
15-
"polyfills": "apps/mfe1/src/polyfills.ts",
44+
"browser": "apps/mfe1/src/main.ts",
45+
"polyfills": ["zone.js", "es-module-shims"],
1646
"tsConfig": "apps/mfe1/tsconfig.app.json",
1747
"assets": ["apps/mfe1/src/favicon.ico", "apps/mfe1/src/assets"],
1848
"styles": ["apps/mfe1/src/styles.css"],
@@ -32,53 +62,30 @@
3262
"maximumError": "4kb"
3363
}
3464
],
35-
"fileReplacements": [
36-
{
37-
"replace": "apps/mfe1/src/environments/environment.ts",
38-
"with": "apps/mfe1/src/environments/environment.prod.ts"
39-
}
40-
],
4165
"outputHashing": "all"
4266
},
4367
"development": {
44-
"buildOptimizer": false,
4568
"optimization": false,
46-
"vendorChunk": true,
4769
"extractLicenses": false,
48-
"sourceMap": true,
49-
"namedChunks": true
70+
"sourceMap": true
5071
}
5172
},
5273
"defaultConfiguration": "production"
5374
},
54-
"serve": {
75+
"serve-original": {
5576
"executor": "@angular-devkit/build-angular:dev-server",
77+
"options": {
78+
"port": 4201
79+
},
5680
"configurations": {
5781
"production": {
58-
"buildTarget": "mfe1:build:production"
82+
"buildTarget": "mfe1:esbuild:production"
5983
},
6084
"development": {
61-
"buildTarget": "mfe1:build:development"
85+
"buildTarget": "mfe1:esbuild:development"
6286
}
6387
},
6488
"defaultConfiguration": "development"
65-
},
66-
"extract-i18n": {
67-
"executor": "@angular-devkit/build-angular:extract-i18n",
68-
"options": {
69-
"buildTarget": "mfe1:build"
70-
}
71-
},
72-
"lint": {
73-
"executor": "@nx/eslint:lint"
74-
},
75-
"test": {
76-
"executor": "@nx/jest:jest",
77-
"outputs": ["{workspaceRoot}/coverage/apps/mfe1"],
78-
"options": {
79-
"jestConfig": "apps/mfe1/jest.config.ts"
80-
}
8189
}
82-
},
83-
"tags": []
90+
}
8491
}

apps/mfe1/src/environments/environment.prod.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/mfe1/src/environments/environment.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

apps/mfe1/tsconfig.app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": "../../dist/out-tsc",
55
"types": []
66
},
7-
"files": ["src/main.ts", "src/polyfills.ts"],
7+
"files": ["src/main.ts"],
88
"include": ["src/**/*.d.ts"],
9-
"exclude": ["**/*.test.ts", "**/*.spec.ts", "jest.config.ts"]
9+
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
1010
}

apps/mfe1/tsconfig.editor.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["**/*.ts"],
4-
"compilerOptions": {
5-
"types": ["jest", "node"]
6-
}
3+
"include": ["src/**/*.ts"],
4+
"compilerOptions": {},
5+
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
76
}

apps/mfe1/tsconfig.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
{
2-
"extends": "../../tsconfig.base.json",
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"useDefineForClassFields": false,
5+
"esModuleInterop": true,
6+
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
8+
"noImplicitOverride": true,
9+
"noPropertyAccessFromIndexSignature": true,
10+
"noImplicitReturns": true,
11+
"noFallthroughCasesInSwitch": true
12+
},
313
"files": [],
414
"include": [],
515
"references": [
616
{
7-
"path": "./tsconfig.app.json"
17+
"path": "./tsconfig.editor.json"
818
},
919
{
10-
"path": "./tsconfig.spec.json"
20+
"path": "./tsconfig.app.json"
1121
},
1222
{
13-
"path": "./tsconfig.editor.json"
23+
"path": "./tsconfig.spec.json"
1424
}
1525
],
16-
"compilerOptions": {
17-
"target": "es2020",
18-
"forceConsistentCasingInFileNames": true,
19-
"strict": true,
20-
"noImplicitOverride": true,
21-
"noPropertyAccessFromIndexSignature": true,
22-
"noImplicitReturns": true,
23-
"noFallthroughCasesInSwitch": true
24-
},
26+
"extends": "../../tsconfig.base.json",
2527
"angularCompilerOptions": {
2628
"enableI18nLegacyMessageIdFormat": false,
2729
"strictInjectionParameters": true,

apps/mfe1/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
55
"module": "commonjs",
6+
"target": "es2016",
67
"types": ["jest", "node"]
78
},
89
"files": ["src/test-setup.ts"],
9-
"include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
10+
"include": [
11+
"jest.config.ts",
12+
"src/**/*.test.ts",
13+
"src/**/*.spec.ts",
14+
"src/**/*.d.ts"
15+
]
1016
}

0 commit comments

Comments
 (0)