Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .lefthook/pre-push/check.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn run lint --quiet
yarn wb lint --quiet
24 changes: 2 additions & 22 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,10 @@ pre-push:
pre-commit:
jobs:
- name: cleanup
glob: '**/*.{astro,cjs,css,cts,gql,graphql,hbs,htm,html,js,json,json5,jsonc,jsx,less,md,mdx,mjs,mts,scss,svelte,toml,ts,tsx,vue,yaml,yml}'
glob: '**/*.{astro,cjs,css,cts,gql,graphql,hbs,htm,html,java,js,json,json5,jsonc,jsx,less,md,mdx,mjs,mts,scss,svelte,toml,ts,tsx,vue,yaml,yml}'
run: |-
# Lefthook expands {staged_files} as shell-escaped args, so paths with spaces stay intact.
oxlint_files="$(printf '%s\n' {staged_files} | grep -E '(\.astro$|\.cjs$|\.cts$|\.js$|\.jsx$|\.mjs$|\.mts$|\.svelte$|\.ts$|\.tsx$|\.vue$)' || true)"
oxfmt_files="$(printf '%s\n' {staged_files} | grep -E '(\.astro$|\.cjs$|\.css$|\.cts$|\.gql$|\.graphql$|\.hbs$|\.htm$|\.html$|\.js$|\.json$|\.json5$|\.jsonc$|\.jsx$|\.less$|\.md$|\.mdx$|\.mjs$|\.mts$|\.scss$|\.svelte$|\.toml$|\.ts$|\.tsx$|\.vue$|\.yaml$|\.yml$)' | grep -v -E '(^|/)package\.json$' || true)"

package_json_files="$(printf '%s\n' {staged_files} | grep -E '(^|/)package\.json$' || true)"




if [ -n "$oxfmt_files" ]; then
node node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern '!**/package.json' $oxfmt_files
fi



if [ -n "$oxlint_files" ]; then
node node_modules/.bin/oxlint --fix $oxlint_files
fi

if [ -n "$package_json_files" ]; then
node node_modules/.bin/sort-package-json -- $package_json_files
fi
yarn wb lint --fix --format -- {staged_files}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change simplifies the pre-commit hook, for consistency and to fully align with the goal of "willboosterify"-ing the repository, the npm scripts in package.json should also be updated to use wb commands.

Currently, scripts like lint, format, and cleanup still use oxlint and oxfmt directly. This can lead to different behavior between the pre-commit hook and running the scripts manually, which can be confusing for developers.

To complete the migration and eliminate redundancy, consider updating the scripts in package.json. For example:

"scripts": {
  ...
  "cleanup": "yarn wb lint --fix --format .",
  "format": "sort-package-json && yarn wb format .",
  "format-code": "yarn wb format .",
  "lint": "yarn wb lint .",
  "lint-fix": "yarn wb lint --fix .",
  ...
}

(Note: The exact commands for wb might need to be verified.)

References
  1. The repository style guide recommends simplifying code to eliminate redundancy. Having different tools for the same task in git hooks and npm scripts introduces redundancy and inconsistency. (link)

stage_fixed: true
- name: check-migrations
glob: '**/migration.sql'
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
"scripts": {
"build": "yarn run build/core",
"build/core": "build-ts lib",
"check-all-for-ai": "yarn check-for-ai && yarn test",
"check-for-ai": "yarn install > /dev/null && yarn format > /dev/null 2> /dev/null || true && yarn lint-fix --quiet",
"cleanup": "yarn format && yarn lint-fix",
"common/ci-setup": "yarn run build/core",
"format": "sort-package-json && yarn format-code",
Expand All @@ -50,7 +48,7 @@
"test:e2e:next": "yarn build && next build e2e/next-app && playwright test --config e2e/next-app/playwright.config.ts",
"test:unit": "vitest",
"test/ci-setup": "playwright install chromium",
"typecheck": "tsgo --noEmit",
"typecheck": "wb typecheck",
"verify": "wb verify",
"verify-full": "wb verify --full"
},
Expand All @@ -71,8 +69,8 @@
"@typescript/native-preview": "7.0.0-dev.20260421.2",
"@willbooster/oxfmt-config": "1.2.2",
"@willbooster/oxlint-config": "1.4.6",
"@willbooster/wb": "13.12.9",
"build-ts": "17.1.8",
"@willbooster/wb": "13.12.10",
"build-ts": "17.1.9",
"conventional-changelog-conventionalcommits": "9.3.1",
"jsdom": "29.0.2",
"lefthook": "2.1.5",
Expand Down
138 changes: 69 additions & 69 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3525,24 +3525,17 @@ __metadata:
languageName: node
linkType: hard

"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260420.1"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260421.2":
version: 7.0.0-dev.20260421.2
resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260421.2"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260420.1"
conditions: os=darwin & cpu=x64
"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260426.1"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

Expand All @@ -3553,10 +3546,10 @@ __metadata:
languageName: node
linkType: hard

"@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260420.1"
conditions: os=linux & cpu=arm64
"@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260426.1"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

Expand All @@ -3567,10 +3560,10 @@ __metadata:
languageName: node
linkType: hard

"@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260420.1"
conditions: os=linux & cpu=arm
"@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260426.1"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard

Expand All @@ -3581,10 +3574,10 @@ __metadata:
languageName: node
linkType: hard

"@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260420.1"
conditions: os=linux & cpu=x64
"@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260426.1"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

Expand All @@ -3595,10 +3588,10 @@ __metadata:
languageName: node
linkType: hard

"@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260420.1"
conditions: os=win32 & cpu=arm64
"@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260426.1"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard

Expand All @@ -3609,10 +3602,10 @@ __metadata:
languageName: node
linkType: hard

"@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260420.1"
conditions: os=win32 & cpu=x64
"@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260426.1"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

Expand All @@ -3623,17 +3616,24 @@ __metadata:
languageName: node
linkType: hard

"@typescript/native-preview@npm:7.0.0-dev.20260420.1":
version: 7.0.0-dev.20260420.1
resolution: "@typescript/native-preview@npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260426.1"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@typescript/native-preview@npm:7.0.0-dev.20260421.2":
version: 7.0.0-dev.20260421.2
resolution: "@typescript/native-preview@npm:7.0.0-dev.20260421.2"
dependencies:
"@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260420.1"
"@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260421.2"
dependenciesMeta:
"@typescript/native-preview-darwin-arm64":
optional: true
Expand All @@ -3651,21 +3651,21 @@ __metadata:
optional: true
bin:
tsgo: bin/tsgo.js
checksum: 10c0/618c2e8e7497e0b5185b7aed942db6fa0c041667a061b33e354b839185b05387c6b164097ada0c479f846dc4a42163983c69850e91e07958fe42a4acce0af1cb
checksum: 10c0/79dbb7e5204c5906bcb3a2946209162efbaac9c8fa78ffeccb8b6718661a5b40f988d60b27350ad538cc1a4143524e5fc97b04fa4767bd42a036000f226438db
languageName: node
linkType: hard

"@typescript/native-preview@npm:7.0.0-dev.20260421.2":
version: 7.0.0-dev.20260421.2
resolution: "@typescript/native-preview@npm:7.0.0-dev.20260421.2"
"@typescript/native-preview@npm:7.0.0-dev.20260426.1":
version: 7.0.0-dev.20260426.1
resolution: "@typescript/native-preview@npm:7.0.0-dev.20260426.1"
dependencies:
"@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260421.2"
"@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260426.1"
"@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260426.1"
"@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260426.1"
"@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260426.1"
"@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260426.1"
"@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260426.1"
"@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260426.1"
dependenciesMeta:
"@typescript/native-preview-darwin-arm64":
optional: true
Expand All @@ -3683,7 +3683,7 @@ __metadata:
optional: true
bin:
tsgo: bin/tsgo.js
checksum: 10c0/79dbb7e5204c5906bcb3a2946209162efbaac9c8fa78ffeccb8b6718661a5b40f988d60b27350ad538cc1a4143524e5fc97b04fa4767bd42a036000f226438db
checksum: 10c0/ed9fd99f155ef56fc7c4bcefa8e23443284fcef05f62dc16258dfac79217ac39ce15a634cffa56712e1fe83849f913721b357c0ccd164e169c3faaec06caae7e
languageName: node
linkType: hard

Expand Down Expand Up @@ -3795,8 +3795,8 @@ __metadata:
"@willbooster/monaco-loader": "npm:1.1.1"
"@willbooster/oxfmt-config": "npm:1.2.2"
"@willbooster/oxlint-config": "npm:1.4.6"
"@willbooster/wb": "npm:13.12.9"
build-ts: "npm:17.1.8"
"@willbooster/wb": "npm:13.12.10"
build-ts: "npm:17.1.9"
conventional-changelog-conventionalcommits: "npm:9.3.1"
jsdom: "npm:29.0.2"
lefthook: "npm:2.1.5"
Expand Down Expand Up @@ -3835,19 +3835,19 @@ __metadata:
languageName: node
linkType: hard

"@willbooster/shared-lib-node@npm:8.5.9":
version: 8.5.9
resolution: "@willbooster/shared-lib-node@npm:8.5.9"
"@willbooster/shared-lib-node@npm:8.5.13":
version: 8.5.13
resolution: "@willbooster/shared-lib-node@npm:8.5.13"
dependencies:
dotenv: "npm:17.4.2"
dotenv-expand: "npm:12.0.3"
checksum: 10c0/086f447bd058575734be525afb6fe156d6966f6c78bcb29ee05531a293e193b5571601b8cad48d94f55801b5ccf95d2bf101a5c4d7c24bfd556a9eaecb07742b
checksum: 10c0/e7e7dd32b0641654415f70fdd3d158a8e6c5e10a58752a69842531bdce3fe0d3bd2074911daf50698dc7bc2e76226f1413487b3da65404f299c9646d85b0e6d2
languageName: node
linkType: hard

"@willbooster/wb@npm:13.12.9":
version: 13.12.9
resolution: "@willbooster/wb@npm:13.12.9"
"@willbooster/wb@npm:13.12.10":
version: 13.12.10
resolution: "@willbooster/wb@npm:13.12.10"
dependencies:
chalk: "npm:5.6.2"
dotenv: "npm:17.4.2"
Expand All @@ -3859,7 +3859,7 @@ __metadata:
yargs: "npm:18.0.0"
bin:
wb: bin/index.js
checksum: 10c0/65c682bdf1cb3b01faea2e9128449e8a075e88c45c9b994bd19dbfd332b98176c1dd508f95ebf0af6e9216675a5ff92789874c927fa1281d965302b86f7f878d
checksum: 10c0/4eb226efe18f1e12938e63d46a02b45b81ccd94259fd2637e6c003d4941ee2cb2b19144299236dc9f7086e802b09b4fd355803a700f7d9fa9938474ada3d9849
languageName: node
linkType: hard

Expand Down Expand Up @@ -4179,9 +4179,9 @@ __metadata:
languageName: node
linkType: hard

"build-ts@npm:17.1.8":
version: 17.1.8
resolution: "build-ts@npm:17.1.8"
"build-ts@npm:17.1.9":
version: 17.1.9
resolution: "build-ts@npm:17.1.9"
dependencies:
"@babel/core": "npm:7.29.0"
"@babel/plugin-proposal-decorators": "npm:7.29.0"
Expand All @@ -4198,8 +4198,8 @@ __metadata:
"@rollup/plugin-replace": "npm:6.0.3"
"@rollup/plugin-terser": "npm:1.0.0"
"@rollup/pluginutils": "npm:5.3.0"
"@typescript/native-preview": "npm:7.0.0-dev.20260420.1"
"@willbooster/shared-lib-node": "npm:8.5.9"
"@typescript/native-preview": "npm:7.0.0-dev.20260426.1"
"@willbooster/shared-lib-node": "npm:8.5.13"
babel-plugin-polyfill-corejs3: "npm:0.14.2"
babel-plugin-transform-remove-console: "npm:6.9.4"
chalk: "npm:5.6.2"
Expand All @@ -4218,7 +4218,7 @@ __metadata:
yargs: "npm:18.0.0"
bin:
build-ts: bin/index.js
checksum: 10c0/57647a5babc69cff10c3f14d1c8ffdd3e7fe2a4f8179e63131d76e3cacaacb80c39434a102a4a1b7f457f78fed9cba3a7f60670b1effc9b742653f3e4b528f54
checksum: 10c0/c0ebd8da20f51a34fa9c7be54c4031a3534cce0aabc5a2a94ee4cbaceaa7dbd8cd15e0ec1a57cc64b25cb3a6c549401b6a0812267c05240e60a817ac9a463c11
languageName: node
linkType: hard

Expand Down
Loading