From e97eaa85be8891df8a964844d011597661620775 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 16:48:46 -0700 Subject: [PATCH] rename to docsgen Signed-off-by: Phil Prasek --- app/{commandsgen => docsgen}/convert.go | 6 +++--- app/{commandsgen => docsgen}/docs.go | 4 +++- app/{commandsgen => docsgen}/enrich.go | 6 +++--- app/{commandsgen => docsgen}/parse.go | 6 +++--- app/{commandsgen => docsgen}/tcld.yml | 2 +- app/internal/cmd/gen-docs/main.go | 10 +++++----- 6 files changed, 18 insertions(+), 16 deletions(-) rename app/{commandsgen => docsgen}/convert.go (97%) rename app/{commandsgen => docsgen}/docs.go (95%) rename app/{commandsgen => docsgen}/enrich.go (97%) rename app/{commandsgen => docsgen}/parse.go (97%) rename app/{commandsgen => docsgen}/tcld.yml (99%) diff --git a/app/commandsgen/convert.go b/app/docsgen/convert.go similarity index 97% rename from app/commandsgen/convert.go rename to app/docsgen/convert.go index 66a3f84..85474be 100644 --- a/app/commandsgen/convert.go +++ b/app/docsgen/convert.go @@ -1,6 +1,6 @@ -// Package commandsgen is built to read the YAML format described in -// temporalcli/commandsgen/commands.yml and generate code from it. -package commandsgen +// Package docsgen is built to convert the existing +// cli.Commands to a docs gen model and generate tcld docs from that +package docsgen import ( "fmt" diff --git a/app/commandsgen/docs.go b/app/docsgen/docs.go similarity index 95% rename from app/commandsgen/docs.go rename to app/docsgen/docs.go index 1869471..dc9f838 100644 --- a/app/commandsgen/docs.go +++ b/app/docsgen/docs.go @@ -1,4 +1,6 @@ -package commandsgen +// Package docsgen is built to convert the existing +// cli.Commands to a docs gen model and generate tcld docs from that +package docsgen import ( "bytes" diff --git a/app/commandsgen/enrich.go b/app/docsgen/enrich.go similarity index 97% rename from app/commandsgen/enrich.go rename to app/docsgen/enrich.go index e5bb104..953c9b1 100644 --- a/app/commandsgen/enrich.go +++ b/app/docsgen/enrich.go @@ -1,6 +1,6 @@ -// Package commandsgen is built to read the YAML format described in -// temporalcli/commandsgen/commands.yml and generate code from it. -package commandsgen +// Package docsgen is built to convert the existing +// cli.Commands to a docs gen model and generate tcld docs from that +package docsgen import ( _ "embed" diff --git a/app/commandsgen/parse.go b/app/docsgen/parse.go similarity index 97% rename from app/commandsgen/parse.go rename to app/docsgen/parse.go index 4e6496b..9574afa 100644 --- a/app/commandsgen/parse.go +++ b/app/docsgen/parse.go @@ -1,6 +1,6 @@ -// Package commandsgen is built to read the YAML format described in -// temporalcli/commandsgen/commands.yml and generate code from it. -package commandsgen +// Package docsgen is built to convert the existing +// cli.Commands to a docs gen model and generate tcld docs from that +package docsgen import ( _ "embed" diff --git a/app/commandsgen/tcld.yml b/app/docsgen/tcld.yml similarity index 99% rename from app/commandsgen/tcld.yml rename to app/docsgen/tcld.yml index c47b874..b20c0d0 100644 --- a/app/commandsgen/tcld.yml +++ b/app/docsgen/tcld.yml @@ -1251,7 +1251,7 @@ commands: short: d - name: expiry type: timestamp - description: 'the absolute timestamp (RFC3339) when the apikey will expire, example: ''2024-10-16T15:30:07-07:00''.' + description: 'the absolute timestamp (RFC3339) when the apikey will expire, example: ''2024-10-16T16:48:12-07:00''.' short: e - name: name type: string diff --git a/app/internal/cmd/gen-docs/main.go b/app/internal/cmd/gen-docs/main.go index 64c43ea..4ca99b6 100644 --- a/app/internal/cmd/gen-docs/main.go +++ b/app/internal/cmd/gen-docs/main.go @@ -7,7 +7,7 @@ import ( "path/filepath" "runtime" - "github.com/temporalio/tcld/app/commandsgen" + "github.com/temporalio/tcld/app/docsgen" "gopkg.in/yaml.v3" ) @@ -28,7 +28,7 @@ func run() error { } // Convert existing CLI commands to docs gen model - cmds, err := commandsgen.ConvertCommands() + cmds, err := docsgen.ConvertCommands() if err != nil { return fmt.Errorf("failed converting commands: %w", err) } @@ -40,20 +40,20 @@ func run() error { fmt.Printf("Error while Marshaling. %v", err) } - filePath := filepath.Join(file, "../../../../commandsgen/tcld.yml") + filePath := filepath.Join(file, "../../../../docsgen/tcld.yml") err = os.WriteFile(filePath, yamlData, 0644) if err != nil { return fmt.Errorf("unable to write command yaml into %s", filePath) } // Enrich commands - cmds, err = commandsgen.EnrichCommands(cmds) + cmds, err = docsgen.EnrichCommands(cmds) if err != nil { return fmt.Errorf("failed enriching commands: %w", err) } // Generate docs - b, err := commandsgen.GenerateDocsFiles(cmds) + b, err := docsgen.GenerateDocsFiles(cmds) if err != nil { return err }