Skip to content

Commit

Permalink
Merge pull request #436 from UN-OCHA/HPC-9272
Browse files Browse the repository at this point in the history
HPC-9272: Upgrade to Nx 18
  • Loading branch information
Pl217 authored Apr 16, 2024
2 parents 831733c + 46ddea7 commit 9768527
Show file tree
Hide file tree
Showing 18 changed files with 2,026 additions and 1,314 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ testem.log
.DS_Store
Thumbs.db

.env.json
.env.json

/.nx/cache
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

/dist
/coverage

/.nx/cache
8 changes: 1 addition & 7 deletions apps/hpc-cdm-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/hpc-cdm-e2e/src/**/*.ts",
"apps/hpc-cdm-e2e/src/**/*.js"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
}
},
Expand Down
19 changes: 2 additions & 17 deletions apps/hpc-cdm/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,13 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/hpc-cdm/**/*.js",
"apps/hpc-cdm/**/*.jsx",
"apps/hpc-cdm/**/*.ts",
"apps/hpc-cdm/**/*.tsx",
"apps/hpc-cdm/src/app/components/enketo-form/enketo-core.d.ts",
"apps/hpc-cdm/**/*.spec.ts",
"apps/hpc-cdm/**/*.spec.tsx",
"apps/hpc-cdm/**/*.spec.js",
"apps/hpc-cdm/**/*.spec.jsx",
"apps/hpc-cdm/**/*.d.ts"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "apps/hpc-cdm/jest.config.ts",
"passWithNoTests": true
"jestConfig": "apps/hpc-cdm/jest.config.ts"
},
"outputs": ["{workspaceRoot}/coverage/apps/hpc-cdm"]
}
Expand Down
6 changes: 5 additions & 1 deletion apps/hpc-cdm/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"exclude": [
"**/*.spec.ts",
Expand Down
7 changes: 6 additions & 1 deletion apps/hpc-cdm/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": [
"jest",
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"include": [
"**/*.spec.ts",
Expand Down
7 changes: 2 additions & 5 deletions apps/hpc-ftsadmin-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/hpc-ftsadmin-e2e/**/*.{js,ts}"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
10 changes: 3 additions & 7 deletions apps/hpc-ftsadmin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,14 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/hpc-ftsadmin/**/*.{ts,tsx,js,jsx}"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/hpc-ftsadmin"],
"options": {
"jestConfig": "apps/hpc-ftsadmin/jest.config.ts",
"passWithNoTests": true
"jestConfig": "apps/hpc-ftsadmin/jest.config.ts"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion apps/hpc-ftsadmin/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"exclude": [
"**/*.spec.ts",
Expand Down
7 changes: 6 additions & 1 deletion apps/hpc-ftsadmin/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": [
"jest",
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"include": [
"**/*.spec.ts",
Expand Down
15 changes: 2 additions & 13 deletions libs/hpc-core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@
"generators": {},
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/hpc-core/**/*.ts",
"libs/hpc-core/**/*.spec.ts",
"libs/hpc-core/**/*.spec.tsx",
"libs/hpc-core/**/*.spec.js",
"libs/hpc-core/**/*.spec.jsx",
"libs/hpc-core/**/*.d.ts"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/hpc-core/jest.config.ts",
"passWithNoTests": true
"jestConfig": "libs/hpc-core/jest.config.ts"
},
"outputs": ["{workspaceRoot}/coverage/libs/hpc-core"]
}
Expand Down
15 changes: 2 additions & 13 deletions libs/hpc-data/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@
"generators": {},
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/hpc-data/**/*.ts",
"libs/hpc-data/**/*.spec.ts",
"libs/hpc-data/**/*.spec.tsx",
"libs/hpc-data/**/*.spec.js",
"libs/hpc-data/**/*.spec.jsx",
"libs/hpc-data/**/*.d.ts"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/hpc-data/jest.config.ts",
"passWithNoTests": true
"jestConfig": "libs/hpc-data/jest.config.ts"
},
"outputs": ["{workspaceRoot}/coverage/libs/hpc-data"]
}
Expand Down
15 changes: 2 additions & 13 deletions libs/hpc-dummy/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@
"generators": {},
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/hpc-dummy/**/*.ts",
"libs/hpc-dummy/**/*.spec.ts",
"libs/hpc-dummy/**/*.spec.tsx",
"libs/hpc-dummy/**/*.spec.js",
"libs/hpc-dummy/**/*.spec.jsx",
"libs/hpc-dummy/**/*.d.ts"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/hpc-dummy/jest.config.ts",
"passWithNoTests": true
"jestConfig": "libs/hpc-dummy/jest.config.ts"
},
"outputs": ["{workspaceRoot}/coverage/libs/hpc-dummy"]
}
Expand Down
15 changes: 2 additions & 13 deletions libs/hpc-live/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@
"generators": {},
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/hpc-live/**/*.ts",
"libs/hpc-live/**/*.spec.ts",
"libs/hpc-live/**/*.spec.tsx",
"libs/hpc-live/**/*.spec.js",
"libs/hpc-live/**/*.spec.jsx",
"libs/hpc-live/**/*.d.ts"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/hpc-live/jest.config.ts",
"passWithNoTests": true
"jestConfig": "libs/hpc-live/jest.config.ts"
},
"outputs": ["{workspaceRoot}/coverage/libs/hpc-live"]
}
Expand Down
18 changes: 2 additions & 16 deletions libs/hpc-ui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,13 @@
"generators": {},
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/hpc-ui/**/*.js",
"libs/hpc-ui/**/*.jsx",
"libs/hpc-ui/**/*.ts",
"libs/hpc-ui/**/*.tsx",
"libs/hpc-ui/**/*.spec.ts",
"libs/hpc-ui/**/*.spec.tsx",
"libs/hpc-ui/**/*.spec.js",
"libs/hpc-ui/**/*.spec.jsx",
"libs/hpc-ui/**/*.d.ts"
]
},
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/hpc-ui/jest.config.ts",
"passWithNoTests": true
"jestConfig": "libs/hpc-ui/jest.config.ts"
},
"outputs": ["{workspaceRoot}/coverage/libs/hpc-ui"]
}
Expand Down
45 changes: 24 additions & 21 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
{
"npmScope": "unocha",
"affected": {
"defaultBase": "HEAD"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"parallel": 1
}
}
},
"defaultProject": "hpc-cdm",
"generators": {
"@nrwl/next": {
Expand Down Expand Up @@ -82,16 +69,29 @@
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"e2e": {
"inputs": ["default", "^production"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"e2e": {
"inputs": ["default", "^production"]
"@nx/eslint:lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
}
},
"namedInputs": {
Expand All @@ -110,5 +110,8 @@
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/src/test-setup.[jt]s"
]
}
},
"parallel": 1,
"useInferencePlugins": false,
"defaultBase": "HEAD"
}
Loading

0 comments on commit 9768527

Please sign in to comment.