diff --git a/.gitignore b/.gitignore index ba6b67a..e5ac5bd 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ go.work.sum .env # Binary -/keystone* +/draft* diff --git a/.gitmodules b/.gitmodules index 4883ac7..a256c07 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "assets/testdata/api_tmpl"] path = assets/testdata/api_tmpl - url = git@gitea.fernandovideira.com:FernandoJVideira/api_tmpl.git + url = git@git.fernandovideira.com:FernandoJVideira/api_tmpl.git + branch = dev diff --git a/Makefile b/Makefile index 9e94625..4ce4cc4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PKG_NAME="gitea.fernandovideira.com/FernandoJVideira/keystone" +PKG_NAME="git.fernandovideira.com/FernandoJVideira/draft" version: @go run -ldflags "-X ${PKG_NAME}/cmd.version=v1.0.0" ./main.go version @@ -8,16 +8,16 @@ build: prepare-embed @GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-X ${PKG_NAME}/cmd.version=v0.0.1" -o $(OUTPUT) ./main.go windows: - @$(MAKE) build GOOS=windows GOARCH=amd64 OUTPUT=keystone_windows_amd64.exe + @$(MAKE) build GOOS=windows GOARCH=amd64 OUTPUT=draft_windows_amd64.exe win-arm: - @$(MAKE) build GOOS=windows GOARCH=arm64 OUTPUT=keystone_windows_arm64.exe + @$(MAKE) build GOOS=windows GOARCH=arm64 OUTPUT=draft_windows_arm64.exe linux: - @$(MAKE) build GOOS=linux GOARCH=amd64 OUTPUT=keystone_linux_amd64 + @$(MAKE) build GOOS=linux GOARCH=amd64 OUTPUT=draft_linux_amd64 mac: - @$(MAKE) build GOOS=darwin GOARCH=arm64 OUTPUT=keystone_darwin_arm64 + @$(MAKE) build GOOS=darwin GOARCH=arm64 OUTPUT=draft_darwin_arm64 prepare-embed: @git submodule update --init --recursive diff --git a/README.md b/README.md index 95c4dc7..aaa5610 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Keystone +# Draft -A powerful CLI tool for bootstrapping Go API projects with best practices built-in. Keystone helps you quickly scaffold production-ready Go APIs with support for both HTTP (REST) and gRPC architectures. +A powerful CLI tool for bootstrapping Go API projects with best practices built-in. Draft helps you quickly scaffold production-ready Go APIs with support for both HTTP (REST) and gRPC architectures. ## Features @@ -17,8 +17,8 @@ A powerful CLI tool for bootstrapping Go API projects with best practices built- ### From Source ```bash -git clone https://github.com/yourusername/keystone.git -cd keystone +git clone git@git.fernandovideira.com:FernandoJVideira/draft.git +cd draft make build ``` @@ -38,14 +38,14 @@ make windows make win-arm ``` -The compiled binary will be named `basalt` (or `basalt.exe` on Windows). +The compiled binary will be named `draft__` (e.g. `draft_darwin_arm64`, or `draft_windows_amd64.exe` on Windows). ## Usage ### Create a New API Project ```bash -keystone new api +draft new api ``` This interactive command will: @@ -67,7 +67,7 @@ This interactive command will: ### Generate a New Service ```bash -keystone new service +draft new service ``` Creates a new service file in `internal/service/` with: @@ -78,7 +78,7 @@ Creates a new service file in `internal/service/` with: ### Generate a New Handler ```bash -keystone new handler +draft new handler ``` Creates a new handler in the appropriate directory: @@ -88,7 +88,7 @@ Creates a new handler in the appropriate directory: ### Generate a Cryptographic Key ```bash -keystone new key +draft new key ``` Generates a secure random key for use in your application (default: 32 characters). @@ -96,12 +96,12 @@ Generates a secure random key for use in your application (default: 32 character ### Check Version ```bash -keystone version +draft version ``` ## Project Structure -When you create a new project, Keystone generates a structured Go API with: +When you create a new project, Draft generates a structured Go API with: ``` your-project/ @@ -153,8 +153,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail ## Author -Built by LKResuts for internal usage to bootstrap Go APIs. - ---- - -**Note:** The binary is compiled as `basalt`, but the CLI tool is referred to as `keystone` in documentation and usage. \ No newline at end of file +Built by LKResuts for internal usage to bootstrap Go APIs. \ No newline at end of file diff --git a/assets/testdata/api_tmpl b/assets/testdata/api_tmpl index 961bdd8..310c8f2 160000 --- a/assets/testdata/api_tmpl +++ b/assets/testdata/api_tmpl @@ -1 +1 @@ -Subproject commit 961bdd81d4542bbf1f247095def56effae6ef3d2 +Subproject commit 310c8f221161ffc57b6bb8f465c6f019522d08e2 diff --git a/cmd/api.go b/cmd/api.go index 34cfc4a..188eb6a 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "gitea.fernandovideira.com/FernandoJVideira/keystone/assets" + "git.fernandovideira.com/FernandoJVideira/draft/assets" "github.com/manifoldco/promptui" "github.com/spf13/cobra" ) @@ -19,8 +19,8 @@ func init() { var apiCmd = &cobra.Command{ Use: "api", - Short: "Create a new Keystone API project", - Long: `Create a new Keystone API project with the necessary structure and files.`, + Short: "Create a new Draft API project", + Long: `Create a new Draft API project with the necessary structure and files.`, Run: genProject, } diff --git a/cmd/handler.go b/cmd/handler.go index fa7aecb..4bb8489 100644 --- a/cmd/handler.go +++ b/cmd/handler.go @@ -23,7 +23,7 @@ func init() { var handlerCmd = &cobra.Command{ Use: "handler", Short: "Create a new handler", - Long: `Create a new handler for your Keystone project.`, + Long: `Create a new handler for your Draft project.`, Run: genHandler, } diff --git a/cmd/helpers.go b/cmd/helpers.go index b654dcf..175754c 100644 --- a/cmd/helpers.go +++ b/cmd/helpers.go @@ -11,7 +11,7 @@ import ( "strings" "text/template" - "gitea.fernandovideira.com/FernandoJVideira/keystone/assets" + "git.fernandovideira.com/FernandoJVideira/draft/assets" ) const ( diff --git a/cmd/key.go b/cmd/key.go index 2878ea3..1e37cae 100644 --- a/cmd/key.go +++ b/cmd/key.go @@ -16,7 +16,7 @@ var defaultSize = 32 var keyCmd = &cobra.Command{ Use: "key [size]", Short: "Generate a new cryptographic key", - Long: `Generate a new cryptographic key for use in Keystone projects.`, + Long: `Generate a new cryptographic key for use in Draft projects.`, Run: func(cmd *cobra.Command, args []string) { var keyLength int if cmd.Flags().Lookup("size").Changed { diff --git a/cmd/new.go b/cmd/new.go index 0f08067..8646e54 100644 --- a/cmd/new.go +++ b/cmd/new.go @@ -4,7 +4,7 @@ import ( "github.com/spf13/cobra" ) -const oldModuleName = "github.com/FernandoJVideira/simple_bank" +const oldModuleName = "github.com/FernandoJVideira/api_tmpl" const srcDir = "embedded/api_tmpl" type MainTemplateData struct { @@ -18,7 +18,7 @@ func init() { var newCmd = &cobra.Command{ Use: "new", - Short: "Create a new Keystone project", - Long: `Create a new Keystone project with the necessary structure and files.`, + Short: "Create a new Draft project", + Long: `Create a new Draft project with the necessary structure and files.`, Run: genProject, } diff --git a/cmd/root.go b/cmd/root.go index 1ec5764..a3314d9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -8,9 +8,9 @@ import ( ) var rootCmd = &cobra.Command{ - Use: "keystone", - Short: "Keystone is a CLI tool for bootstrapping Go APIs", - Long: `Keystone is a CLI tool built by LKResuts for internal usage to bootstrap Go APIs`, + Use: "draft", + Short: "Draft is a CLI tool for bootstrapping Go APIs", + Long: `Draft is a CLI tool built by LKResuts for internal usage to bootstrap Go APIs`, } func Execute() { diff --git a/cmd/service.go b/cmd/service.go index 83e3a74..7780a8f 100644 --- a/cmd/service.go +++ b/cmd/service.go @@ -24,7 +24,7 @@ type ServiceTemplateData struct { var serviceCmd = &cobra.Command{ Use: "service", Short: "Create a new service", - Long: `Create a new service for your Keystone project.`, + Long: `Create a new service for your Draft project.`, Run: genService, } diff --git a/cmd/version.go b/cmd/version.go index 45b99b6..ec46eb9 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -15,9 +15,9 @@ func init() { var versionCmd = &cobra.Command{ Use: "version", - Short: "Display the version of Keystone", - Long: `Display the current version of the Keystone CLI tool.`, + Short: "Display the version of Draft", + Long: `Display the current version of the Draft CLI tool.`, Run: func(cmd *cobra.Command, args []string) { - fmt.Printf("Keystone CLI version: %s\n", version) + fmt.Printf("Draft CLI version: %s\n", version) }, } diff --git a/go.mod b/go.mod index da40ee8..0fd6545 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitea.fernandovideira.com/FernandoJVideira/keystone +module git.fernandovideira.com/FernandoJVideira/draft go 1.25.5 diff --git a/main.go b/main.go index bb38bd2..fcec31c 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import "gitea.fernandovideira.com/FernandoJVideira/keystone/cmd" +import "git.fernandovideira.com/FernandoJVideira/draft/cmd" func main() { cmd.Execute() diff --git a/tools/sync_templates.go b/tools/sync_templates.go index 07ffe84..41cb907 100644 --- a/tools/sync_templates.go +++ b/tools/sync_templates.go @@ -13,7 +13,7 @@ import ( const ( sourceDir = "assets/testdata/api_tmpl" targetDir = "assets/embedded" - oldModuleName = "github.com/FernandoJVideira/simple_bank" + oldModuleName = "github.com/FernandoJVideira/api_tmpl" moduleTemplate = "{{ .ModuleName }}" )