Skip to content

Commit

Permalink
chore: merge pull request #46 from threeal/audit-nx
Browse files Browse the repository at this point in the history
Audit Nx Tasks
  • Loading branch information
threeal authored Aug 10, 2023
2 parents 79a10f1 + 2693c84 commit 6d69a38
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
}
46 changes: 7 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {}
}

0 comments on commit 6d69a38

Please # to comment.