diff --git a/.husky/pre-commit b/.husky/pre-commit index dfff054d..41226d35 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -12,3 +12,5 @@ printf '%s\n' "$STAGED_FILES" | while IFS= read -r FILE; do git add "$FILE" fi done + +npx nx affected --target tsc-check || exit 1 diff --git a/apps/api/project.json b/apps/api/project.json index a1781cda..de2875e7 100644 --- a/apps/api/project.json +++ b/apps/api/project.json @@ -74,6 +74,13 @@ "passWithNoTests": true }, "outputs": ["coverage/apps/api"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/api/tsconfig.app.json" + }, + "outputs": ["dist/out-tsc/apps/api"] } } } diff --git a/apps/client-core-components-e2e/project.json b/apps/client-core-components-e2e/project.json index 22e82df8..492d48f7 100644 --- a/apps/client-core-components-e2e/project.json +++ b/apps/client-core-components-e2e/project.json @@ -25,6 +25,13 @@ "lintFilePatterns": ["apps/client-core-components-e2e/**/*.ts"] }, "outputs": ["{options.outputFile}"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/client-core-components-e2e/tsconfig.e2e.json" + }, + "outputs": ["dist/out-tsc/apps/client-core-components-e2e"] } } } diff --git a/apps/client-diagnostics-e2e/project.json b/apps/client-diagnostics-e2e/project.json index 09753e51..111ec48a 100644 --- a/apps/client-diagnostics-e2e/project.json +++ b/apps/client-diagnostics-e2e/project.json @@ -25,6 +25,13 @@ "lintFilePatterns": ["apps/client-diagnostics-e2e/**/*.ts"] }, "outputs": ["{options.outputFile}"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/client-diagnostics-e2e/tsconfig.e2e.json" + }, + "outputs": ["dist/out-tsc/apps/client-diagnostics-e2e"] } } } diff --git a/apps/client-e2e/project.json b/apps/client-e2e/project.json index 4fa7e1a9..12b703b4 100644 --- a/apps/client-e2e/project.json +++ b/apps/client-e2e/project.json @@ -25,6 +25,13 @@ "lintFilePatterns": ["apps/client-e2e/**/*.ts"] }, "outputs": ["{options.outputFile}"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/client-e2e/tsconfig.e2e.json" + }, + "outputs": ["dist/out-tsc/apps/client-e2e"] } } } diff --git a/apps/client/project.json b/apps/client/project.json index 6a245420..b71ef08e 100644 --- a/apps/client/project.json +++ b/apps/client/project.json @@ -131,6 +131,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/client/tsconfig.app.json" + }, + "outputs": ["dist/out-tsc/apps/client"] } } } diff --git a/apps/documentation-e2e/project.json b/apps/documentation-e2e/project.json index e8201e93..9215f37f 100644 --- a/apps/documentation-e2e/project.json +++ b/apps/documentation-e2e/project.json @@ -25,6 +25,13 @@ "lintFilePatterns": ["apps/documentation-e2e/**/*.ts"] }, "outputs": ["{options.outputFile}"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/documentation-e2e/tsconfig.e2e.json" + }, + "outputs": ["dist/out-tsc/apps/documentation-e2e"] } } } diff --git a/apps/documentation/project.json b/apps/documentation/project.json index 8e196987..b389d4cc 100644 --- a/apps/documentation/project.json +++ b/apps/documentation/project.json @@ -187,6 +187,13 @@ "passWithNoTests": true }, "outputs": ["coverage/apps/documentation"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/documentation/tsconfig.app.json" + }, + "outputs": ["dist/out-tsc/apps/documentation"] } } } diff --git a/apps/elements-e2e/project.json b/apps/elements-e2e/project.json index 940ed8f9..7f054616 100644 --- a/apps/elements-e2e/project.json +++ b/apps/elements-e2e/project.json @@ -25,6 +25,13 @@ "lintFilePatterns": ["apps/elements-e2e/**/*.ts"] }, "outputs": ["{options.outputFile}"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/elements-e2e/tsconfig.e2e.json" + }, + "outputs": ["dist/out-tsc/apps/elements-e2e"] } } } diff --git a/apps/elements-testing-e2e/project.json b/apps/elements-testing-e2e/project.json index 31bff243..f3a50721 100644 --- a/apps/elements-testing-e2e/project.json +++ b/apps/elements-testing-e2e/project.json @@ -25,6 +25,13 @@ "lintFilePatterns": ["apps/elements-testing-e2e/**/*.ts"] }, "outputs": ["{options.outputFile}"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/elements-testing-e2e/tsconfig.e2e.json" + }, + "outputs": ["dist/out-tsc/apps/elements-testing-e2e"] } } } diff --git a/apps/elements-testing/project.json b/apps/elements-testing/project.json index 8f8d879e..2da76f60 100644 --- a/apps/elements-testing/project.json +++ b/apps/elements-testing/project.json @@ -68,6 +68,13 @@ "passWithNoTests": true }, "outputs": ["coverage/apps/elements-testing"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/elements-testing/tsconfig.app.json" + }, + "outputs": ["dist/out-tsc/apps/elements-testing"] } } } diff --git a/apps/elements/project.json b/apps/elements/project.json index 5c7d8952..dc5f956a 100644 --- a/apps/elements/project.json +++ b/apps/elements/project.json @@ -121,6 +121,13 @@ "passWithNoTests": true }, "outputs": ["coverage/apps/elements"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/elements/tsconfig.app.json" + }, + "outputs": ["dist/out-tsc/apps/elements"] } } } diff --git a/apps/server-dev/project.json b/apps/server-dev/project.json index 7a6b8168..82a5f317 100644 --- a/apps/server-dev/project.json +++ b/apps/server-dev/project.json @@ -53,6 +53,13 @@ "passWithNoTests": true }, "outputs": ["coverage/apps/server-dev"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/server-dev/tsconfig.app.json" + }, + "outputs": ["dist/out-tsc/apps/server-dev"] } } } diff --git a/apps/server-prod/project.json b/apps/server-prod/project.json index 605d5882..28f2a7e3 100644 --- a/apps/server-prod/project.json +++ b/apps/server-prod/project.json @@ -48,6 +48,13 @@ "passWithNoTests": true }, "outputs": ["coverage/apps/server-prod"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "apps/server-prod/tsconfig.app.json" + }, + "outputs": ["dist/out-tsc/apps/server-prod"] } } } diff --git a/libs/backend-auth/project.json b/libs/backend-auth/project.json index d8793549..228d8911 100644 --- a/libs/backend-auth/project.json +++ b/libs/backend-auth/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/backend-auth"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/backend-auth/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/backend-auth"] } } } diff --git a/libs/backend-diagnostics/project.json b/libs/backend-diagnostics/project.json index 4f9781d4..42469858 100644 --- a/libs/backend-diagnostics/project.json +++ b/libs/backend-diagnostics/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/backend-diagnostics"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/backend-diagnostics/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/backend-diagnostics"] } } } diff --git a/libs/backend-gql/project.json b/libs/backend-gql/project.json index 98a6942a..35e2e89b 100644 --- a/libs/backend-gql/project.json +++ b/libs/backend-gql/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/backend-gql"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/backend-gql/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/backend-gql"] } } } diff --git a/libs/backend-grpc/project.json b/libs/backend-grpc/project.json index 977b1710..74d4415f 100644 --- a/libs/backend-grpc/project.json +++ b/libs/backend-grpc/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/backend-grpc"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/backend-grpc/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/backend-grpc"] } } } diff --git a/libs/backend-interfaces/project.json b/libs/backend-interfaces/project.json index 260ddc1c..21570363 100644 --- a/libs/backend-interfaces/project.json +++ b/libs/backend-interfaces/project.json @@ -30,6 +30,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/backend-interfaces"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/backend-interfaces/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/backend-interfaces"] } } } diff --git a/libs/backend-logger/project.json b/libs/backend-logger/project.json index 05baf0ab..81f90f49 100644 --- a/libs/backend-logger/project.json +++ b/libs/backend-logger/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/backend-logger"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/backend-logger/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/backend-logger"] } } } diff --git a/libs/backend-websocket/project.json b/libs/backend-websocket/project.json index b385097a..1c945ce2 100644 --- a/libs/backend-websocket/project.json +++ b/libs/backend-websocket/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/backend-websocket"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/backend-websocket/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/backend-websocket"] } } } diff --git a/libs/client-chatbot/project.json b/libs/client-chatbot/project.json index db4ece91..98a1b338 100644 --- a/libs/client-chatbot/project.json +++ b/libs/client-chatbot/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-chatbot"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-chatbot/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-chatbot"] } } } diff --git a/libs/client-core-components/project.json b/libs/client-core-components/project.json index 6391e017..5a0ad7c9 100644 --- a/libs/client-core-components/project.json +++ b/libs/client-core-components/project.json @@ -48,6 +48,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-core-components"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-core-components/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-core-components"] } } } diff --git a/libs/client-core/project.json b/libs/client-core/project.json index 7c037f0b..5e8e771b 100644 --- a/libs/client-core/project.json +++ b/libs/client-core/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-core"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-core/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-core"] } } } diff --git a/libs/client-d3-charts/project.json b/libs/client-d3-charts/project.json index b54b9fab..a60ac209 100644 --- a/libs/client-d3-charts/project.json +++ b/libs/client-d3-charts/project.json @@ -36,6 +36,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-d3-charts"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-d3-charts/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-d3-charts"] } } } diff --git a/libs/client-diagnostics/project.json b/libs/client-diagnostics/project.json index 71ed2804..45c807f6 100644 --- a/libs/client-diagnostics/project.json +++ b/libs/client-diagnostics/project.json @@ -48,6 +48,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-diagnostics"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-diagnostics/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-diagnostics"] } } } diff --git a/libs/client-directives/project.json b/libs/client-directives/project.json index 11f35826..1e03c3c2 100644 --- a/libs/client-directives/project.json +++ b/libs/client-directives/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-directives"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-directives/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-directives"] } } } diff --git a/libs/client-gql/project.json b/libs/client-gql/project.json index 428e4ad3..b30010ec 100644 --- a/libs/client-gql/project.json +++ b/libs/client-gql/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-gql"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-gql/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-gql"] } } } diff --git a/libs/client-grpc/project.json b/libs/client-grpc/project.json index fa5d1f87..c66b976d 100644 --- a/libs/client-grpc/project.json +++ b/libs/client-grpc/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-grpc"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-grpc/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-grpc"] } } } diff --git a/libs/client-material/project.json b/libs/client-material/project.json index 1e98a68b..093e81e1 100644 --- a/libs/client-material/project.json +++ b/libs/client-material/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-material"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-material/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-material"] } } } diff --git a/libs/client-pwa-offline/project.json b/libs/client-pwa-offline/project.json index 664ada2b..aa59564a 100644 --- a/libs/client-pwa-offline/project.json +++ b/libs/client-pwa-offline/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-pwa-offline"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-pwa-offline/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-pwa-offline"] } } } diff --git a/libs/client-services/project.json b/libs/client-services/project.json index 683221a3..80f12408 100644 --- a/libs/client-services/project.json +++ b/libs/client-services/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-services"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-services/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-services"] } } } diff --git a/libs/client-sidebar/project.json b/libs/client-sidebar/project.json index b47b1e31..4d33b2ce 100644 --- a/libs/client-sidebar/project.json +++ b/libs/client-sidebar/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-sidebar"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-sidebar/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-sidebar"] } } } diff --git a/libs/client-store-chatbot/project.json b/libs/client-store-chatbot/project.json index 0b201ad4..23dc023a 100644 --- a/libs/client-store-chatbot/project.json +++ b/libs/client-store-chatbot/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store-chatbot"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store-chatbot/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store-chatbot"] } } } diff --git a/libs/client-store-http-api/project.json b/libs/client-store-http-api/project.json index f011be09..8203027c 100644 --- a/libs/client-store-http-api/project.json +++ b/libs/client-store-http-api/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store-http-api"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store-http-api/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store-http-api"] } } } diff --git a/libs/client-store-http-progress/project.json b/libs/client-store-http-progress/project.json index 2c0e4bf1..646db121 100644 --- a/libs/client-store-http-progress/project.json +++ b/libs/client-store-http-progress/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store-http-progress"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store-http-progress/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store-http-progress"] } } } diff --git a/libs/client-store-sidebar/project.json b/libs/client-store-sidebar/project.json index ed40e963..f250754d 100644 --- a/libs/client-store-sidebar/project.json +++ b/libs/client-store-sidebar/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store-sidebar"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store-sidebar/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store-sidebar"] } } } diff --git a/libs/client-store-theme/project.json b/libs/client-store-theme/project.json index 0a2e4e29..bd9ca8d9 100644 --- a/libs/client-store-theme/project.json +++ b/libs/client-store-theme/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store-theme"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store-theme/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store-theme"] } } } diff --git a/libs/client-store-user/project.json b/libs/client-store-user/project.json index a34fa452..16213e12 100644 --- a/libs/client-store-user/project.json +++ b/libs/client-store-user/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store-user"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store-user/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store-user"] } } } diff --git a/libs/client-store-websocket/project.json b/libs/client-store-websocket/project.json index 6e1f23cd..e49a044b 100644 --- a/libs/client-store-websocket/project.json +++ b/libs/client-store-websocket/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store-websocket"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store-websocket/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store-websocket"] } } } diff --git a/libs/client-store/project.json b/libs/client-store/project.json index ff17393a..c82acd5a 100644 --- a/libs/client-store/project.json +++ b/libs/client-store/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-store"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-store/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-store"] } } } diff --git a/libs/client-translate/project.json b/libs/client-translate/project.json index 4f156d31..63b31dc1 100644 --- a/libs/client-translate/project.json +++ b/libs/client-translate/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-translate"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-translate/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-translate"] } } } diff --git a/libs/client-unit-testing/project.json b/libs/client-unit-testing/project.json index a77f480a..ddb7557b 100644 --- a/libs/client-unit-testing/project.json +++ b/libs/client-unit-testing/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-unit-testing"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-unit-testing/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-unit-testing"] } } } diff --git a/libs/client-util-eliza/project.json b/libs/client-util-eliza/project.json index 21cb57a8..88eba1dd 100644 --- a/libs/client-util-eliza/project.json +++ b/libs/client-util-eliza/project.json @@ -36,6 +36,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-util-eliza"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-util-eliza/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-util-eliza"] } } } diff --git a/libs/client-util-sentry/project.json b/libs/client-util-sentry/project.json index 9b87a242..2b3d1783 100644 --- a/libs/client-util-sentry/project.json +++ b/libs/client-util-sentry/project.json @@ -19,6 +19,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-util-sentry"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-util-sentry/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-util-sentry"] } } } diff --git a/libs/client-util/project.json b/libs/client-util/project.json index 61252be8..4a5da94e 100644 --- a/libs/client-util/project.json +++ b/libs/client-util/project.json @@ -20,6 +20,13 @@ "passWithNoTests": true }, "outputs": ["coverage/libs/client-util"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/client-util/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/client-util"] } } } diff --git a/libs/proto/project.json b/libs/proto/project.json index 55d33748..dcb7fe5d 100644 --- a/libs/proto/project.json +++ b/libs/proto/project.json @@ -12,6 +12,13 @@ "lintFilePatterns": ["libs/proto/**/*.ts"] }, "outputs": ["{options.outputFile}"] + }, + "tsc-check": { + "executor": "./tools/executors/tsc:check", + "options": { + "tsConfig": "libs/proto/tsconfig.lib.json" + }, + "outputs": ["dist/out-tsc/libs/proto"] } } } diff --git a/nx.json b/nx.json index 99b14334..bf38f16b 100644 --- a/nx.json +++ b/nx.json @@ -77,7 +77,7 @@ "default": { "options": { "cacheDirectory": "/tmp/nx/nx-ng-starter", - "cacheableOperations": ["build", "lint", "test", "e2e", "build-storybook"], + "cacheableOperations": ["build", "lint", "test", "e2e", "build-storybook", "tsc-check"], "parallel": 1, "runtimeCacheInputs": ["node -v", "echo $IMPORTANT_ENV_VAR"] }, diff --git a/package.json b/package.json index 62b46cb2..f0652a67 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,18 @@ { "name": "nx-ng-starter", - "version": "1.24.5", + "version": "1.25.0", "private": true, "description": "Monorepo starter: Nx, Angular, Angular Elements, Electron, NodeJS, NestJS, Firebase.", "license": "MIT", "author": "rfprod ", "scripts": { - "affected": "nx affected", - "affected:apps": "nx affected:apps", "affected:build": "nx affected:build", "affected:dep-graph": "nx affected:dep-graph", "affected:e2e": "nx affected:e2e", - "affected:libs": "nx affected:libs", "affected:lint": "nx affected:lint", + "affected:print": "nx print-affected --select=projects", + "affected:print-apps": "nx print-affected --type=app --select=projects", + "affected:print-libs": "nx print-affected --type=lib --select=projects", "affected:test": "nx affected:test", "analyze:circular-deps": "madge --circular --extensions ts ./apps ./libs ./tools --ts-config ./tsconfig.base.json", "analyze:client": "yarn build:client:stats; npx webpack-bundle-analyzer ./dist/apps/client/stats.json", diff --git a/tools/executors/client-env/schema.json b/tools/executors/client-env/schema.json index 1a71347d..c7e45305 100644 --- a/tools/executors/client-env/schema.json +++ b/tools/executors/client-env/schema.json @@ -2,6 +2,7 @@ "$schema": "http://json-schema.org/schema", "type": "object", "cli": "nx", + "description": "Configures secret environment variables of the client applications.", "properties": { "app": { "type": "string", diff --git a/tools/executors/tsc/configure.ts b/tools/executors/tsc/configure.ts new file mode 100644 index 00000000..aeb853a1 --- /dev/null +++ b/tools/executors/tsc/configure.ts @@ -0,0 +1,87 @@ +import { ExecutorContext, getProjects, logger, ProjectConfiguration, updateProjectConfiguration } from '@nrwl/devkit'; +import { flushChanges, FsTree } from 'nx/src/generators/tree'; + +import { IExecutorOptions } from './schema'; + +interface IProjectMetadata { + name: string; + config: ProjectConfiguration; +} + +const addExecutorConfiguration = (tree: FsTree, project: IProjectMetadata) => { + const srcRoot = project.config.sourceRoot; + if (typeof srcRoot === 'undefined') { + logger.error(new Error(`The project ${project.name} does not have the 'sourceRoot' configuration option defined.`)); + process.exit(1); + } + + const suffix = project.name.includes('-e2e') + ? 'e2e' + : project.config.projectType === 'library' + ? 'lib' + : project.config.projectType === 'application' + ? 'app' + : ''; + + if (suffix === '') { + logger.error(new Error(`Could not determine a suffix for the project: ${project.name}.`)); + process.exit(1); + } + + const config = { ...project.config }; + if (typeof config.targets === 'undefined') { + logger.error(new Error(`The project ${project.name} does not have the 'targets' configuration option defined.`)); + process.exit(1); + } + if (typeof config.targets['tsc-check'] === 'undefined' && /\/src$/.test(srcRoot)) { + config.targets['tsc-check'] = { + executor: './tools/executors/tsc:check', + options: { + tsConfig: `${srcRoot.replace(/src$/, `tsconfig.${suffix}.json`)}`, + }, + outputs: [`dist/out-tsc/${srcRoot.replace(/\/src$/, '')}`], + }; + updateProjectConfiguration(tree, project.name, config); + } +}; + +const removeExecutorConfiguration = (tree: FsTree, project: IProjectMetadata) => { + const config = { ...project.config }; + if (typeof config.targets === 'undefined') { + logger.error(new Error(`The project ${project.name} does not have the 'targets' configuration option defined.`)); + process.exit(1); + } + if (typeof config.targets['tsc-check'] !== 'undefined') { + delete config.targets['tsc-check']; + } + updateProjectConfiguration(tree, project.name, config); +}; + +export default async function configureTscCheck(options: IExecutorOptions, context: ExecutorContext): Promise<{ success: boolean }> { + const tree = new FsTree(context.root, false); + const projects = getProjects(tree); + + const entries = [...projects.entries()]; + for (let i = 0, max = entries.length; i < max; i += 1) { + const project = { + name: entries[i][0], + config: entries[i][1], + }; + + if (options.cleanup === true) { + removeExecutorConfiguration(tree, project); + } else { + addExecutorConfiguration(tree, project); + } + } + + const changes = tree.listChanges(); + + flushChanges(context.root, changes); + + if (options.cleanup === true) { + logger.info(`Don't forget to remove the executor configuration target from './tools/project.json'. Find a target 'tsc-configure'.`); + } + + return { success: true }; +} diff --git a/tools/executors/tsc/executor.json b/tools/executors/tsc/executor.json new file mode 100644 index 00000000..59c70fc9 --- /dev/null +++ b/tools/executors/tsc/executor.json @@ -0,0 +1,14 @@ +{ + "executors": { + "check": { + "implementation": "./index", + "schema": "./schema.json", + "description": "Check a TypeScript project compilation using tsc." + }, + "configure": { + "implementation": "./configure", + "schema": "./schema.json", + "description": "Configure the executor - add targets to the application and library configurations." + } + } +} diff --git a/tools/executors/tsc/index.ts b/tools/executors/tsc/index.ts new file mode 100644 index 00000000..40e00190 --- /dev/null +++ b/tools/executors/tsc/index.ts @@ -0,0 +1,17 @@ +import { ExecutorContext, logger } from '@nrwl/devkit'; +import { execSync } from 'child_process'; + +import { IExecutorOptions } from './schema'; + +export default async function tscCheck(options: IExecutorOptions, context: ExecutorContext): Promise<{ success: boolean }> { + const projectName = context.projectName; + + if (typeof projectName === 'undefined') { + logger.error(new Error('Project name is not defined.')); + process.exit(1); + } + + execSync(`tsc -p ${context.cwd}/${options.tsConfig}`, { stdio: 'inherit' }); + + return { success: true }; +} diff --git a/tools/executors/tsc/package.json b/tools/executors/tsc/package.json new file mode 100644 index 00000000..712554f0 --- /dev/null +++ b/tools/executors/tsc/package.json @@ -0,0 +1,3 @@ +{ + "executors": "./executor.json" +} diff --git a/tools/executors/tsc/schema.d.ts b/tools/executors/tsc/schema.d.ts new file mode 100644 index 00000000..3cabf4dd --- /dev/null +++ b/tools/executors/tsc/schema.d.ts @@ -0,0 +1,4 @@ +export interface IExecutorOptions { + cleanup?: boolean; + tsConfig: string; +} diff --git a/tools/executors/tsc/schema.json b/tools/executors/tsc/schema.json new file mode 100644 index 00000000..9c6f1d81 --- /dev/null +++ b/tools/executors/tsc/schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/schema", + "type": "object", + "cli": "nx", + "description": "Uses tsc to check TypeScript source code for compilation errors.", + "properties": { + "cleanup": { + "type": "boolean", + "description": "If true, indicates that the executor configuration should be removed from all projects. If absent or set to false, the configuration will be added to all projects." + }, + "tsConfig": { + "type": "string", + "description": "TypeScript configuration." + } + }, + "required": ["tsConfig"] +} diff --git a/tools/project.json b/tools/project.json index 80b5f5e7..d2be1b34 100644 --- a/tools/project.json +++ b/tools/project.json @@ -55,6 +55,12 @@ }, "outputs": ["{options.outputFile}"] }, + "tsc-configure": { + "executor": "./tools/executors/tsc:configure", + "options": { + "tsConfig": "" + } + }, "update-check": { "executor": "@nrwl/workspace:run-commands", "options": {