diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c28f98b..10d5aa9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,4 +24,4 @@ jobs: - name: Setup Tools uses: ./.github/actions/setup-tools - name: Run Checks - run: pnpm run test:pr --parallel=3 + run: pnpm run test:ci diff --git a/nx.json b/nx.json index e9dc712..595165d 100644 --- a/nx.json +++ b/nx.json @@ -1,74 +1,97 @@ { "$schema": "./node_modules/nx/schemas/nx-schema.json", "defaultBase": "main", + "useInferencePlugins": false, + "parallel": 5, + "namedInputs": { + "sharedGlobals": [ + "{workspaceRoot}/.nvmrc", + "{workspaceRoot}/package.json", + "{workspaceRoot}/tsconfig.json" + ], + "default": [ + "sharedGlobals", + "{projectRoot}/**/*", + "!{projectRoot}/**/*.md" + ], + "production": [ + "default", + "!{projectRoot}/tests/**/*", + "!{projectRoot}/eslint.config.js" + ] + }, "targetDefaults": { - "build": { - "dependsOn": [ - "^build" - ], + "test:knip": { + "cache": true, "inputs": [ - "default", - "^default" - ], - "outputs": [ - "{projectRoot}/dist", - "{projectRoot}/lib", - "{projectRoot}/out" + "{workspaceRoot}/**/*" ] }, - "test": { - "dependsOn": [ - "build" - ], + "test:sherif": { + "cache": true, "inputs": [ - "default", - "^default" + "{workspaceRoot}/**/package.json" ] }, - "test:lib": { + "test:eslint": { + "cache": true, "dependsOn": [ "^build" ], "inputs": [ "default", - "^default" + "^production", + "{workspaceRoot}/eslint.config.js" ] }, - "test:types": { + "test:lib": { + "cache": true, "dependsOn": [ "^build" ], "inputs": [ "default", - "^default" + "^production" + ], + "outputs": [ + "{projectRoot}/coverage" ] }, - "test:build": { + "test:types": { + "cache": true, "dependsOn": [ - "build" + "^build" ], "inputs": [ "default", - "^default" + "^production" ] }, - "watch": { + "build": { + "cache": true, "dependsOn": [ "^build" ], - "cache": false - }, - "pack": { - "dependsOn": [ - "^build" + "inputs": [ + "production", + "^production" ], - "cache": false + "outputs": [ + "{projectRoot}/build", + "{projectRoot}/dist", + "{projectRoot}/lib", + "{projectRoot}/out" + ] }, - "release": { + "test:build": { + "cache": true, "dependsOn": [ - "^build" + "build" ], - "cache": false + "inputs": [ + "production" + ] } - } + }, + "analytics": false } \ No newline at end of file diff --git a/package.json b/package.json index 31b15b4..96d4a3d 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,26 @@ { + "name": "tempblot-root", "private": true, "scripts": { - "build": "nx run-many -t build --projects=tempblot-parser,prettier-plugin-tempblot,tempblot-language-service,tempblot-language-server,tempblot-typescript-plugin,tempblot-vscode", - "build:vscode": "nx run tempblot-vscode:build", - "build:website": "nx run website:build", - "watch": "nx run tempblot-vscode:watch", - "pack": "nx run tempblot-vscode:pack", - "release": "nx run tempblot-vscode:release", + "build": "nx affected --target=build", + "build:all": "nx run-many --target=build", "format": "prettier --write .", - "test": "nx run-many -t test:lib --projects=tempblot-parser,prettier-plugin-tempblot,tempblot && nx run-many -t test:types --projects=tempblot-parser,tempblot && nx run-many -t test:build --projects=tempblot && nx run tempblot-workspace:sherif && nx run tempblot-workspace:knip", - "test:pr": "nx affected -t test:lib --projects=tempblot-parser,prettier-plugin-tempblot,tempblot && nx affected -t test:types --projects=tempblot-parser,tempblot && nx affected -t test:build --projects=tempblot && nx run tempblot-workspace:sherif && nx run tempblot-workspace:knip", - "test:lib": "nx run-many -t test:lib --projects=tempblot-parser,prettier-plugin-tempblot,tempblot", - "test:types": "nx run-many -t test:types --projects=tempblot-parser,tempblot", - "test:build": "nx run-many -t test:build --projects=tempblot", - "test:sherif": "nx run tempblot-workspace:sherif", - "test:knip": "nx run tempblot-workspace:knip" + "test": "pnpm run test:ci", + "test:pr": "nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build", + "test:ci": "nx run-many --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build", + "test:eslint": "nx affected --target=test:eslint", + "test:sherif": "sherif", + "test:lib": "nx affected --target=test:lib", + "test:lib:dev": "pnpm run test:lib && nx watch --all -- pnpm run test:lib", + "test:build": "nx affected --target=test:build", + "test:types": "nx affected --target=test:types", + "test:knip": "knip" + }, + "nx": { + "includedScripts": [ + "test:knip", + "test:sherif" + ] }, "devDependencies": { "@types/node": "^24.5.2", diff --git a/tools/workspace/project.json b/tools/workspace/project.json deleted file mode 100644 index 2c16a3c..0000000 --- a/tools/workspace/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "name": "tempblot-workspace", - "root": "tools/workspace", - "targets": { - "sherif": { - "executor": "nx:run-commands", - "options": { - "command": "sherif", - "cwd": "." - } - }, - "knip": { - "executor": "nx:run-commands", - "options": { - "command": "knip", - "cwd": "." - } - } - } -}