Public Access
chore: rename keystone to draft
Rename the module, CLI command name, and all references from keystone/basalt to draft, and fix the stale build/README content found along the way.
This commit is contained in:
1 parent
8293794d13
commit
d7e4c554d8
16 files changed
+39
-42
No files matched your search
+1
-1
@@ -30,4 +30,4 @@ go.work.sum
|
||||
.env
|
||||
|
||||
# Binary
|
||||
/keystone*
|
||||
/draft*
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
[submodule "assets/testdata/api_tmpl"]
|
||||
path = assets/testdata/api_tmpl
|
||||
url = git@gitea.fernandovideira.com:FernandoJVideira/api_tmpl.git
|
||||
url = [email protected]:FernandoJVideira/api_tmpl.git
|
||||
branch = dev
|
||||
@@ -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
|
||||
|
||||
@@ -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 [email protected]: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_<os>_<arch>` (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/
|
||||
@@ -154,7 +154,3 @@ 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.
|
||||
Vendored
+1
-1
Submodule assets/testdata/api_tmpl updated: 961bdd81d4...310c8f2211.
+3
-3
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"gitea.fernandovideira.com/FernandoJVideira/keystone/assets"
|
||||
"git.fernandovideira.com/FernandoJVideira/draft/assets"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+3
-3
@@ -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,
|
||||
}
|
||||
+3
-3
@@ -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() {
|
||||
|
||||
+1
-1
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -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)
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
module gitea.fernandovideira.com/FernandoJVideira/keystone
|
||||
module git.fernandovideira.com/FernandoJVideira/draft
|
||||
|
||||
go 1.25.5
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
import "gitea.fernandovideira.com/FernandoJVideira/keystone/cmd"
|
||||
import "git.fernandovideira.com/FernandoJVideira/draft/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
|
||||
@@ -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 }}"
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user