Skip to content

Commit 33b9e27

Browse files
committed
refactor: update commands to use 'npx zx' for generating hooks config
1 parent ccb0f12 commit 33b9e27

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

booster/.husky/generate-config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
* Generate .git-hooks.config.json from the dist template.
55
*
66
* Usage:
7-
* zx .husky/generate-config.ts # interactive
8-
* npm run hooks:init # same via package.json script
7+
* npx zx .husky/generate-config.ts # interactive
98
*/
109

1110
import { chalk, fs } from 'zx'
@@ -46,4 +45,4 @@ await fs.writeFile(TARGET_PATH, distContents, 'utf-8')
4645

4746
console.log(chalk.green('✓ Created .git-hooks.config.json'))
4847
console.log(chalk.gray(' Edit it to enable/disable tools for each hook.'))
49-
console.log(chalk.gray(' Run `npm run hooks:init` again to reset to defaults.'))
48+
console.log(chalk.gray(' Run `npx zx .husky/generate-config.ts` again to reset to defaults.'))

booster/.husky/shared/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { ToolConfig } from './types.ts'
88
* reference by name in `.git-hooks.config.json` without repeating every field.
99
*
1010
* To run tools, list them under `hooks.<hookName>.tools` in your config file.
11-
* Run `npm run hooks:init` to generate a starter config from the dist template.
11+
* Run `npx zx .husky/generate-config.ts` to generate a starter config from the dist template.
1212
*
1313
* Tool groups for selective execution (HOOKS_ONLY env var):
1414
* - 'format': Formatting tools (Prettier, ECS)

booster/.husky/shared/workflow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export async function runHook(hookName: GitHook, fn: () => Promise<boolean>): Pr
340340

341341
if (config === null) {
342342
log.warn('No .git-hooks.config.json found.')
343-
log.info('Run `npm run hooks:init` to generate one. Quality checks skipped.')
343+
log.info('Run `npx zx .husky/generate-config.ts` to generate one. Quality checks skipped.')
344344
process.exit(0)
345345
}
346346

booster/integrate_booster.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,12 +1720,12 @@ function generate_hooks_config() {
17201720
local dist=".husky/.git-hooks.config.dist.json"
17211721
if [ ! -f "$dist" ]; then
17221722
warn " Dist config template not found at '$dist'. Skipping config generation."
1723-
warn " Run 'npm run hooks:init' manually to generate .git-hooks.config.json."
1723+
warn " Run 'npx zx .husky/generate-config.ts' manually to generate .git-hooks.config.json."
17241724
return
17251725
fi
17261726

17271727
cp "$dist" ".git-hooks.config.json" || {
1728-
warn " Failed to copy dist config. Run 'npm run hooks:init' manually."
1728+
warn " Failed to copy dist config. Run 'npx zx .husky/generate-config.ts' manually."
17291729
return
17301730
}
17311731

booster/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"version": "2.7.0",
66
"scripts": {
77
"commit": "commit",
8-
"hooks:init": "zx .husky/generate-config.ts",
98
"test": "vitest run .husky/tests",
109
"test:coverage": "vitest run .husky/tests --coverage",
1110
"prepare": "husky || true"

booster/src/lib/node.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ function generate_hooks_config() {
5757
local dist=".husky/.git-hooks.config.dist.json"
5858
if [ ! -f "$dist" ]; then
5959
warn " Dist config template not found at '$dist'. Skipping config generation."
60-
warn " Run 'npm run hooks:init' manually to generate .git-hooks.config.json."
60+
warn " Run 'npx zx .husky/generate-config.ts' manually to generate .git-hooks.config.json."
6161
return
6262
fi
6363

6464
cp "$dist" ".git-hooks.config.json" || {
65-
warn " Failed to copy dist config. Run 'npm run hooks:init' manually."
65+
warn " Failed to copy dist config. Run 'npx zx .husky/generate-config.ts' manually."
6666
return
6767
}
6868

0 commit comments

Comments
 (0)