diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 11e9273f..f47933f3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -39,7 +39,7 @@ jobs: run: yarn clean - name: Build dist - run: yarn build + run: yarn nx build - name: Check diff run: git diff --exit-code HEAD diff --git a/nx.json b/nx.json index ca0baf0c..aa2afa4c 100644 --- a/nx.json +++ b/nx.json @@ -6,5 +6,33 @@ "cacheableOperations": ["build", "format", "lint", "sort"] } } + }, + "namedInputs": { + "dependencies": ["{projectRoot}/.pnp.*", "{projectRoot}/package.json"] + }, + "targetDefaults": { + "build": { + "dependsOn": ["lint"], + "inputs": [ + "dependencies", + "{projectRoot}/src/**/*.mts", + "{projectRoot}/tsconfig.json" + ] + }, + "format": { + "dependsOn": ["sort"], + "inputs": ["dependencies", "{projectRoot}/**/*", "{projectRoot}/**/.*"] + }, + "lint": { + "dependsOn": ["format"], + "inputs": [ + "dependencies", + "{projectRoot}/src/**/*", + "{projectRoot}/.eslintrc.json" + ] + }, + "sort": { + "inputs": ["dependencies"] + } } } diff --git a/package.json b/package.json index 47354265..cdf5e08e 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,12 @@ "dist" ], "scripts": { - "build": "nx exec -- tsc", - "clean": "nx exec -- rimraf dist", - "format": "nx exec -- prettier --write .", - "lint": "nx exec -- eslint src", - "sort": "nx exec -- sort-package-json", - "test": "nx exec -- jest" + "build": "tsc", + "clean": "rimraf dist", + "format": "prettier --write .", + "lint": "eslint src", + "sort": "sort-package-json", + "test": "jest" }, "dependencies": { "chalk": "^4.1.2", @@ -56,37 +56,5 @@ "typescript": "^5.1.6" }, "packageManager": "yarn@3.6.1", - "nx": { - "namedInputs": { - "default": [ - "{projectRoot}/**/*" - ] - }, - "targets": { - "build": { - "inputs": [ - "default" - ], - "dependsOn": [ - "lint" - ] - }, - "format": { - "inputs": [ - "default" - ], - "dependsOn": [ - "sort" - ] - }, - "lint": { - "inputs": [ - "default" - ], - "dependsOn": [ - "format" - ] - } - } - } + "nx": {} }