mirror of
https://github.com/max-sixty/worktrunk.git
synced 2026-11-22 00:52:51 +08:00
Document hooks in user config (#1845)
The user config (`~/.config/worktrunk/config.toml`) supports hooks via `OverridableConfig.hooks`, but the user config documentation didn't mention them. The project config docs had a hooks section with the full TOML format reference — this adds a comparable section to user config and deduplicates the project config side. - Added `### Hooks` section to user config docs with the three formats (string, named table, pipeline) and user-vs-project differentiation - Replaced the duplicate TOML block in project config hooks with a cross-reference to the user config section > _This was written by Claude Code on behalf of @max-sixty_ --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
0d7fe83130
commit
491108a782
@@ -131,6 +131,24 @@
|
||||
#
|
||||
# Aliases defined here apply to all projects. For project-specific aliases, use the project config (https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.
|
||||
#
|
||||
# ### Hooks
|
||||
#
|
||||
# See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; project hooks (https://worktrunk.dev/config/#project-configuration) apply only to that repository.
|
||||
#
|
||||
# # Single command
|
||||
# pre-start = "npm ci"
|
||||
#
|
||||
# # Multiple named commands (concurrent for post-*, sequential for pre-*)
|
||||
# [pre-merge]
|
||||
# test = "npm test"
|
||||
# build = "npm run build"
|
||||
#
|
||||
# # Pipeline — list of maps, run in order (each map concurrent)
|
||||
# post-start = [
|
||||
# { install = "npm ci" },
|
||||
# { build = "npm run build", server = "npm run dev" }
|
||||
# ]
|
||||
#
|
||||
# ### User project-specific settings
|
||||
#
|
||||
# For context:
|
||||
|
||||
+1
-18
@@ -6,24 +6,7 @@
|
||||
#
|
||||
# ## Hooks
|
||||
#
|
||||
# See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
|
||||
#
|
||||
# Single command:
|
||||
#
|
||||
# pre-start = "npm ci"
|
||||
#
|
||||
# Multiple named commands (concurrent for post-*, sequential for pre-*):
|
||||
#
|
||||
# [pre-merge]
|
||||
# test = "npm test"
|
||||
# build = "npm run build"
|
||||
#
|
||||
# Pipeline — list of maps, run in order (each map concurrent):
|
||||
#
|
||||
# post-start = [
|
||||
# { install = "npm ci" },
|
||||
# { build = "npm run build", server = "npm run dev" }
|
||||
# ]
|
||||
# Project hooks apply to this repository only. Format is the same as user hooks (https://worktrunk.dev/config/#hooks); see `wt hook --help` for hook types, execution order, and examples.
|
||||
#
|
||||
# ## Dev server URL
|
||||
#
|
||||
|
||||
+21
-24
@@ -223,6 +223,26 @@ url = "echo http://localhost:{{ branch | hash_port }}"
|
||||
|
||||
Aliases defined here apply to all projects. For project-specific aliases, use the [project config](@/config.md#project-configuration) `[aliases]` section instead.
|
||||
|
||||
### Hooks
|
||||
|
||||
See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; [project hooks](@/config.md#project-configuration) apply only to that repository.
|
||||
|
||||
```toml
|
||||
# Single command
|
||||
pre-start = "npm ci"
|
||||
|
||||
# Multiple named commands (concurrent for post-*, sequential for pre-*)
|
||||
[pre-merge]
|
||||
test = "npm test"
|
||||
build = "npm run build"
|
||||
|
||||
# Pipeline — list of maps, run in order (each map concurrent)
|
||||
post-start = [
|
||||
{ install = "npm ci" },
|
||||
{ build = "npm run build", server = "npm run dev" }
|
||||
]
|
||||
```
|
||||
|
||||
### User project-specific settings
|
||||
|
||||
For context:
|
||||
@@ -346,30 +366,7 @@ Location: `.config/wt.toml` (checked into version control and shared with the te
|
||||
|
||||
## Hooks
|
||||
|
||||
See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
|
||||
|
||||
Single command:
|
||||
|
||||
```toml
|
||||
pre-start = "npm ci"
|
||||
```
|
||||
|
||||
Multiple named commands (concurrent for post-*, sequential for pre-*):
|
||||
|
||||
```toml
|
||||
[pre-merge]
|
||||
test = "npm test"
|
||||
build = "npm run build"
|
||||
```
|
||||
|
||||
Pipeline — list of maps, run in order (each map concurrent):
|
||||
|
||||
```toml
|
||||
post-start = [
|
||||
{ install = "npm ci" },
|
||||
{ build = "npm run build", server = "npm run dev" }
|
||||
]
|
||||
```
|
||||
Project hooks apply to this repository only. Format is the same as [user hooks](@/config.md#hooks); see `wt hook --help` for hook types, execution order, and examples.
|
||||
|
||||
## Dev server URL
|
||||
|
||||
|
||||
@@ -222,6 +222,26 @@ url = "echo http://localhost:{{ branch | hash_port }}"
|
||||
|
||||
Aliases defined here apply to all projects. For project-specific aliases, use the [project config](https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.
|
||||
|
||||
### Hooks
|
||||
|
||||
See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; [project hooks](https://worktrunk.dev/config/#project-configuration) apply only to that repository.
|
||||
|
||||
```toml
|
||||
# Single command
|
||||
pre-start = "npm ci"
|
||||
|
||||
# Multiple named commands (concurrent for post-*, sequential for pre-*)
|
||||
[pre-merge]
|
||||
test = "npm test"
|
||||
build = "npm run build"
|
||||
|
||||
# Pipeline — list of maps, run in order (each map concurrent)
|
||||
post-start = [
|
||||
{ install = "npm ci" },
|
||||
{ build = "npm run build", server = "npm run dev" }
|
||||
]
|
||||
```
|
||||
|
||||
### User project-specific settings
|
||||
|
||||
For context:
|
||||
@@ -345,30 +365,7 @@ Location: `.config/wt.toml` (checked into version control and shared with the te
|
||||
|
||||
## Hooks
|
||||
|
||||
See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
|
||||
|
||||
Single command:
|
||||
|
||||
```toml
|
||||
pre-start = "npm ci"
|
||||
```
|
||||
|
||||
Multiple named commands (concurrent for post-*, sequential for pre-*):
|
||||
|
||||
```toml
|
||||
[pre-merge]
|
||||
test = "npm test"
|
||||
build = "npm run build"
|
||||
```
|
||||
|
||||
Pipeline — list of maps, run in order (each map concurrent):
|
||||
|
||||
```toml
|
||||
post-start = [
|
||||
{ install = "npm ci" },
|
||||
{ build = "npm run build", server = "npm run dev" }
|
||||
]
|
||||
```
|
||||
Project hooks apply to this repository only. Format is the same as [user hooks](https://worktrunk.dev/config/#hooks); see `wt hook --help` for hook types, execution order, and examples.
|
||||
|
||||
## Dev server URL
|
||||
|
||||
|
||||
+21
-24
@@ -1799,6 +1799,26 @@ url = "echo http://localhost:{{ branch | hash_port }}"
|
||||
|
||||
Aliases defined here apply to all projects. For project-specific aliases, use the [project config](@/config.md#project-configuration) `[aliases]` section instead.
|
||||
|
||||
### Hooks
|
||||
|
||||
See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; [project hooks](@/config.md#project-configuration) apply only to that repository.
|
||||
|
||||
```toml
|
||||
# Single command
|
||||
pre-start = "npm ci"
|
||||
|
||||
# Multiple named commands (concurrent for post-*, sequential for pre-*)
|
||||
[pre-merge]
|
||||
test = "npm test"
|
||||
build = "npm run build"
|
||||
|
||||
# Pipeline — list of maps, run in order (each map concurrent)
|
||||
post-start = [
|
||||
{ install = "npm ci" },
|
||||
{ build = "npm run build", server = "npm run dev" }
|
||||
]
|
||||
```
|
||||
|
||||
### User project-specific settings
|
||||
|
||||
For context:
|
||||
@@ -1922,30 +1942,7 @@ Location: `.config/wt.toml` (checked into version control and shared with the te
|
||||
|
||||
## Hooks
|
||||
|
||||
See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
|
||||
|
||||
Single command:
|
||||
|
||||
```toml
|
||||
pre-start = "npm ci"
|
||||
```
|
||||
|
||||
Multiple named commands (concurrent for post-*, sequential for pre-*):
|
||||
|
||||
```toml
|
||||
[pre-merge]
|
||||
test = "npm test"
|
||||
build = "npm run build"
|
||||
```
|
||||
|
||||
Pipeline — list of maps, run in order (each map concurrent):
|
||||
|
||||
```toml
|
||||
post-start = [
|
||||
{ install = "npm ci" },
|
||||
{ build = "npm run build", server = "npm run dev" }
|
||||
]
|
||||
```
|
||||
Project hooks apply to this repository only. Format is the same as [user hooks](@/config.md#hooks); see `wt hook --help` for hook types, execution order, and examples.
|
||||
|
||||
## Dev server URL
|
||||
|
||||
|
||||
@@ -190,6 +190,24 @@ Creates [2m~/.config/worktrunk/config.toml[0m with the following content:
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# Aliases defined here apply to all projects. For project-specific aliases, use the project config (https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# ### Hooks[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; project hooks (https://worktrunk.dev/config/#project-configuration) apply only to that repository.[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# # Single command[0m
|
||||
[107m [0m [2m# pre-start = "npm ci"[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# # Multiple named commands (concurrent for post-*, sequential for pre-*)[0m
|
||||
[107m [0m [2m# [pre-merge][0m
|
||||
[107m [0m [2m# test = "npm test"[0m
|
||||
[107m [0m [2m# build = "npm run build"[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# # Pipeline — list of maps, run in order (each map concurrent)[0m
|
||||
[107m [0m [2m# post-start = [[0m
|
||||
[107m [0m [2m# { install = "npm ci" },[0m
|
||||
[107m [0m [2m# { build = "npm run build", server = "npm run dev" }[0m
|
||||
[107m [0m [2m# ][0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# ### User project-specific settings[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# For context:[0m
|
||||
@@ -310,24 +328,7 @@ With [2m--project[0m, creates [2m.config/wt.toml[0m in the current repositor
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# ## Hooks[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# Single command:[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# pre-start = "npm ci"[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# Multiple named commands (concurrent for post-*, sequential for pre-*):[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# [pre-merge][0m
|
||||
[107m [0m [2m# test = "npm test"[0m
|
||||
[107m [0m [2m# build = "npm run build"[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# Pipeline — list of maps, run in order (each map concurrent):[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# post-start = [[0m
|
||||
[107m [0m [2m# { install = "npm ci" },[0m
|
||||
[107m [0m [2m# { build = "npm run build", server = "npm run dev" }[0m
|
||||
[107m [0m [2m# ][0m
|
||||
[107m [0m [2m# Project hooks apply to this repository only. Format is the same as user hooks (https://worktrunk.dev/config/#hooks); see `wt hook --help` for hook types, execution order, and examples.[0m
|
||||
[107m [0m [2m#[0m
|
||||
[107m [0m [2m# ## Dev server URL[0m
|
||||
[107m [0m [2m#[0m
|
||||
|
||||
@@ -236,6 +236,24 @@ Command templates that run with [2mwt step <name>[0m. See [2mwt step[0m alia
|
||||
|
||||
Aliases defined here apply to all projects. For project-specific aliases, use the project config [2m[aliases][0m section instead.
|
||||
|
||||
[32mHooks[0m
|
||||
|
||||
See [2mwt hook --help[0m for hook types, execution order, template variables, and examples. User hooks apply to all projects; project hooks apply only to that repository.
|
||||
|
||||
[107m [0m [2m# Single command[0m
|
||||
[107m [0m [2mpre-start = [0m[2m[32m"npm ci"[0m
|
||||
[107m [0m
|
||||
[107m [0m [2m# Multiple named commands (concurrent for post-*, sequential for pre-*)[0m
|
||||
[107m [0m [2m[36m[pre-merge][0m
|
||||
[107m [0m [2mtest = [0m[2m[32m"npm test"[0m
|
||||
[107m [0m [2mbuild = [0m[2m[32m"npm run build"[0m
|
||||
[107m [0m
|
||||
[107m [0m [2m# Pipeline — list of maps, run in order (each map concurrent)[0m
|
||||
[107m [0m [2mpost-start = [[0m
|
||||
[107m [0m [2m { install = [0m[2m[32m"npm ci"[0m[2m },[0m
|
||||
[107m [0m [2m { build = [0m[2m[32m"npm run build"[0m[2m, server = [0m[2m[32m"npm run dev"[0m[2m }[0m
|
||||
[107m [0m [2m][0m
|
||||
|
||||
[32mUser project-specific settings[0m
|
||||
|
||||
For context:
|
||||
@@ -347,24 +365,7 @@ Location: [2m.config/wt.toml[0m (checked into version control and shared with
|
||||
|
||||
[1m[32mHooks[0m
|
||||
|
||||
See [2mwt hook --help[0m for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
|
||||
|
||||
Single command:
|
||||
|
||||
[107m [0m [2mpre-start = [0m[2m[32m"npm ci"[0m
|
||||
|
||||
Multiple named commands (concurrent for post-*, sequential for pre-*):
|
||||
|
||||
[107m [0m [2m[36m[pre-merge][0m
|
||||
[107m [0m [2mtest = [0m[2m[32m"npm test"[0m
|
||||
[107m [0m [2mbuild = [0m[2m[32m"npm run build"[0m
|
||||
|
||||
Pipeline — list of maps, run in order (each map concurrent):
|
||||
|
||||
[107m [0m [2mpost-start = [[0m
|
||||
[107m [0m [2m { install = [0m[2m[32m"npm ci"[0m[2m },[0m
|
||||
[107m [0m [2m { build = [0m[2m[32m"npm run build"[0m[2m, server = [0m[2m[32m"npm run dev"[0m[2m }[0m
|
||||
[107m [0m [2m][0m
|
||||
Project hooks apply to this repository only. Format is the same as user hooks; see [2mwt hook --help[0m for hook types, execution order, and examples.
|
||||
|
||||
[1m[32mDev server URL[0m
|
||||
|
||||
|
||||
Reference in New Issue
Block a user