Skip to content

Commit

Permalink
fix: adopt knip to wireit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiefORZ committed Oct 31, 2023
1 parent 97b9df2 commit 67a6715
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile

# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v1

- name: Build
run: pnpm run build

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile

# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v1


- name: Build
run: pnpm run build
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,8 @@ dist
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

#wireit
.wireit
.eslintcache
5 changes: 3 additions & 2 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"@types/semver",
"conventional-changelog",
"conventional-changelog-conventionalcommits",
"prettier-plugin-packagejson",
"prettier-plugin-tailwindcss",
"husky",
"lint-staged",
"npm-run-all",
"semver"
],
"project": ["src/**/*.ts", "src/**/*.tsx"]
Expand Down
80 changes: 70 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,74 @@
"types": "dist/src/index.d.ts",
"bin": "dist/bin/pdf-generator.js",
"scripts": {
"build": "rimraf dist && tsc",
"dev": "node --import tsx --watch ./bin/pdf-generator",
"lint": "eslint './src/**/*.{js,jsx,ts,tsx}' --fix",
"precommit": "lint-staged",
"prepare": "husky install",
"release": "release-it",
"test": "npm-run-all test:*",
"test:knip": "knip"
"build": "wireit",
"dev": "wireit",
"lint": "wireit",
"precommit": "wireit",
"prepare": "wireit",
"release": "wireit",
"test": "wireit",
"test:knip": "wireit"
},
"wireit": {
"build": {
"command": "tsc",
"files": [
"src/**/*",
"tsconfig.json"
],
"clean": true,
"output": [
"dist/**"
]
},
"dev": {
"command": "node --import tsx --watch ./bin/pdf-generator",
"files": [
"src/**/*",
"bin/pdf-generator"
],
"service": true
},
"lint": {
"command": "eslint './src/**/*.{js,jsx,ts,tsx}' --fix",
"files": [
"src/**/*"
],
"output": []
},
"precommit": {
"command": "lint-staged",
"files": [
"src/**/*"
],
"output": []
},
"prepare": {
"command": "husky install"
},
"release": {
"command": "release-it",
"files": [
"src/**/*",
"package.json"
],
"output": []
},
"test": {
"command": "npm-run-all test:*",
"files": [
"src/**/*"
],
"output": []
},
"test:knip": {
"command": "knip",
"files": [
"src/**/*"
],
"output": []
}
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": "eslint --fix"
Expand All @@ -33,7 +93,6 @@
"puppeteer-chromium-resolver": "^20.0.0",
"puppeteer-core": "^21.4.1",
"puppeteer-report": "^3.1.0",
"rimraf": "^5.0.5",
"typescript": "^5.2.2",
"yargs": "^17.7.2"
},
Expand All @@ -57,7 +116,8 @@
"lint-staged": "^15.0.2",
"npm-run-all": "^4.1.5",
"release-it": "^16.2.1",
"semver": "^7.5.4"
"semver": "^7.5.4",
"wireit": "^0.14.1"
},
"engines": {
"node": ">=18.17"
Expand Down
Loading

0 comments on commit 67a6715

Please sign in to comment.