You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR!
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->
<!--- For ALL Contributors 👇 -->
## What was changed
<!-- Describe what has changed in this PR -->
Make `gen-commands` and `gen-docs` a binary that can be used any YAML
input.
## Why?
<!-- Tell your future self why have you made these changes -->
Temporal wants to re-use the `commandsgen` tool for other _internal_
CLIs.
**It is not supported for users outside of Temporal.**
## Checklist
<!--- add/delete as needed --->
1. Closes <!-- add issue number here -->
2. How was this tested:
<!--- Please describe how you tested your changes/how we can test them
-->
3. Any docs updates needed?
<!--- update README if applicable
or point out where to update docs.temporal.io -->
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,18 +20,18 @@ Example to run a single test case:
20
20
21
21
## Adding/updating commands
22
22
23
-
First, update [commands.yml](internal/commandsgen/commands.yml) following the rules in that file. Then to regenerate the
24
-
[commands.gen.go](internal/commands.gen.go) file from code, simply run:
23
+
First, update [commands.yaml](internal/temporalcli/commands.yaml) following the rules in that file. Then to regenerate the
24
+
[commands.gen.go](internal/temporalcli/commands.gen.go) file from code, run:
25
25
26
-
go run ./internal/cmd/gen-commands
26
+
go run ./internal/cmd/gen-commands -input internal/temporalcli/commands.yaml -pkg temporalcli -context "*CommandContext" > internal/temporalcli/commands.gen.go
27
27
28
28
This will expect every non-parent command to have a `run` method, so for new commands developers will have to implement
29
29
`run` on the new command in a separate file before it will compile.
30
30
31
31
Once a command is updated, the CI will automatically generate new docs
32
32
and create a PR in the Documentation repo with the corresponding updates. To generate these docs locally, run:
33
33
34
-
go run ./internal/cmd/gen-docs
34
+
go run ./internal/cmd/gen-docs -input internal/temporalcli/commands.yaml -output dist/docs
35
35
36
36
This will auto-generate a new set of docs to `dist/docs/`. If a new root command is added, a new file will be automatically generated, like `temporal activity` and `activity.mdx`.
0 commit comments