Skip to content

Commit c28897c

Browse files
committed
feat: update gobake project page to v0.3.0
1 parent 666251a commit c28897c

File tree

6 files changed

+54
-49
lines changed

6 files changed

+54
-49
lines changed

public/projects/gobake/details.txt

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ go install github.com/fezcode/gobake/cmd/gobake@latest
1414
gobake init
1515
```
1616

17-
This creates a `recipe.piml` and a `Recipe.go`.
17+
The `init` command is smart: it handles `go mod init` (if needed), scaffolds your `recipe.piml` and `Recipe.go`, and runs `go mod tidy` to automatically pull in the `github.com/fezcode/gobake` library as a dependency.
1818

1919
2. **Run a task:**
2020

@@ -26,23 +26,31 @@ go install github.com/fezcode/gobake/cmd/gobake@latest
2626

2727
### Commands
2828

29-
* `gobake init`: Scaffolds a new `Recipe.go` and `recipe.piml`.
29+
* `gobake init`: Scaffolds a new `Recipe.go` and `recipe.piml`. Handles `go.mod` and dependencies.
3030
* `gobake version`: Displays the current version of gobake.
3131
* `gobake help`: Displays the list of commands and available tasks.
3232
* `gobake bump [patch|minor|major]`: Increments the version in `recipe.piml`.
3333

3434
### The `Recipe.go` File
3535

3636
```go
37-
package main
38-
import "github.com/fezcode/gobake"
39-
40-
func main() {
41-
bake := gobake.NewEngine()
42-
bake.LoadRecipeInfo("recipe.piml")
43-
bake.Task("build", "Builds the binary", func(ctx *gobake.Context) error {
44-
return ctx.BakeBinary("linux", "amd64", "bin/app")
45-
})
46-
bake.Execute()
37+
//go:build gobake
38+
package bake_recipe
39+
40+
import (
41+
"fmt"
42+
"github.com/fezcode/gobake"
43+
)
44+
45+
func Run(bake *gobake.Engine) error {
46+
if err := bake.LoadRecipeInfo("recipe.piml"); err != nil {
47+
return fmt.Errorf("error loading recipe.piml: %v", err)
48+
}
49+
50+
bake.Task("build", "Builds the binary", func(ctx *gobake.Context) error {
51+
return ctx.BakeBinary("linux", "amd64", "bin/app")
52+
})
53+
54+
return nil
4755
}
4856
```

public/projects/gobake/examples.txt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
This recipe builds your application for Windows, Linux, and macOS.
66

77
```go
8-
package main
8+
//go:build gobake
9+
package bake_recipe
910

1011
import (
1112
"fmt"
1213
"github.com/fezcode/gobake"
1314
)
1415

15-
func main() {
16-
bake := gobake.NewEngine()
16+
func Run(bake *gobake.Engine) error {
1717
bake.LoadRecipeInfo("recipe.piml")
1818

1919
bake.Task("release", "Build for all platforms", func(ctx *gobake.Context) error {
@@ -28,9 +28,9 @@ func main() {
2828
}
2929

3030
for _, p := range platforms {
31-
output := fmt.Sprintf("dist/%s-%s-%s%s",
31+
output := fmt.Sprintf("dist/%s-%s-%s%s",
3232
bake.Info.Name, p.OS, p.Arch, p.Ext)
33-
33+
3434
err := ctx.BakeBinary(p.OS, p.Arch, output, "-ldflags", "-s -w")
3535
if err != nil {
3636
return err
@@ -39,7 +39,7 @@ func main() {
3939
return nil
4040
})
4141

42-
bake.Execute()
42+
return nil
4343
}
4444
```
4545

@@ -56,12 +56,12 @@ This recipe installs `stringer` and uses it to generate code before building.
5656

5757
**Recipe.go:**
5858
```go
59-
package main
59+
//go:build gobake
60+
package bake_recipe
6061

6162
import "github.com/fezcode/gobake"
6263

63-
func main() {
64-
bake := gobake.NewEngine()
64+
func Run(bake *gobake.Engine) error {
6565
bake.LoadRecipeInfo("recipe.piml")
6666

6767
bake.Task("generate", "Generates code", func(ctx *gobake.Context) error {
@@ -73,13 +73,10 @@ func main() {
7373
return ctx.Run("go", "generate", "./...")
7474
})
7575

76-
bake.Task("build", "Builds app", func(ctx *gobake.Context) error {
77-
if err := ctx.Run("gobake", "generate"); err != nil {
78-
return err
79-
}
76+
bake.TaskWithDeps("build", "Builds app", []string{"generate"}, func(ctx *gobake.Context) error {
8077
return ctx.Run("go", "build", ".")
8178
})
8279

83-
bake.Execute()
80+
return nil
8481
}
8582
```

public/projects/gobake/guide.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Instead of relying on fragile shell scripts or complex Makefiles, `gobake` uses:
66
1. **Engine:** The core Go library that manages tasks.
77
2. **Context:** A helper object passed to every task, providing access to the shell, logging, and metadata.
8-
3. **Recipe:** The `Recipe.go` file that ties it all together.
8+
3. **Recipe:** The `Recipe.go` file (using `//go:build gobake`) that ties it all together.
99

1010
# CLI Command Reference
1111

1212
## Project Management
1313

14-
* **`gobake init`**: Initialize a new project in the current directory.
14+
* **`gobake init`**: Initialize a new project in the current directory. Automates `go mod` and dependencies.
1515
* **`gobake version`**: Show the current version of gobake.
1616
* **`gobake help`**: Show the list of available commands and project tasks.
1717
* **`gobake template <git-url>`**: Clone a repository and initialize it.
@@ -20,6 +20,8 @@ Instead of relying on fragile shell scripts or complex Makefiles, `gobake` uses:
2020

2121
* **`gobake add-tool <url>`**: Adds a tool to the `(tools)` list in `recipe.piml`.
2222
* **`gobake add-dep <url>`**: Adds a library dependency to `go.mod`.
23+
* **`gobake remove-tool <url>`**: Removes a tool from `recipe.piml`.
24+
* **`gobake remove-dep <url>`**: Removes a dependency.
2325

2426
## Versioning
2527

@@ -40,7 +42,7 @@ The `recipe.piml` file is the single source of truth for your project.
4042

4143
# Task Management
4244

43-
Tasks are defined using `bake.Task(name, description, function)`.
45+
Tasks are defined in the `Run(*gobake.Engine)` function using `bake.Task(name, description, function)`.
4446

4547
## Task Dependencies
4648

public/projects/gobake/hero.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# gobake
22
A Go-native build orchestrator, type-safe and dependency-free.
3-
(version) 0.2.2
3+
(version) 0.3.0
44

55
**gobake** is a Go-native build orchestrator. It replaces Makefiles and shell scripts with a single, type-safe `Recipe.go` file. Inspired by `nob.h`, it allows you to write your build logic in Go, which is then compiled and executed on the fly.

public/projects/gobake/terminal.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ btnLink: #installation
99
:::card
1010
type: code
1111
title: Define Recipe
12-
code: bake.Task("build", func(ctx) {
13-
return ctx.Bake("bin/app")
14-
})
12+
code: bake.Task("build", "Build app", func(ctx) { return ctx.Bake("bin/app") })
1513
btnText: GUIDE!
1614
btnLink: #docs
1715
:::

public/projects/projects.piml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@
3232
(date) 2025-11-08
3333
(image) /images/projects/piml.webp
3434

35+
> (project)
36+
(slug) gobake
37+
(title) gobake
38+
(style) ruby
39+
(repo_link) https://github.com/fezcode/gobake
40+
(pinned) false
41+
(isActive) true
42+
(technologies)
43+
> Go
44+
> Build Tool
45+
> Orchestrator
46+
> Automation
47+
(shortDescription) gobake is a Go-native build orchestrator. It replaces Makefiles and shell scripts with a single, type-safe Recipe.go file.
48+
(date) 2026-02-18
49+
(image) /images/projects/gobake/gobake-banner.png
50+
3551
> (project)
3652
(slug) bm
3753
(title) bm - bookmark manager
@@ -109,22 +125,6 @@
109125
(photoCreditText) Photo by Tim Simon
110126
(photoCreditLink) https://unsplash.com/photos/a-plane-flying-in-the-sky-with-a-lot-of-clouds-g3XW9EerLmE
111127

112-
> (project)
113-
(slug) gobake
114-
(title) gobake
115-
(style) ruby
116-
(repo_link) https://github.com/fezcode/gobake
117-
(pinned) false
118-
(isActive) true
119-
(technologies)
120-
> Go
121-
> Build Tool
122-
> Orchestrator
123-
> Automation
124-
(shortDescription) gobake is a Go-native build orchestrator. It replaces Makefiles and shell scripts with a single, type-safe Recipe.go file.
125-
(date) 2026-02-12
126-
(image) /images/projects/gobake/gobake-banner.png
127-
128128
> (project)
129129
(slug) nocturnote
130130
(title) Nocturnote

0 commit comments

Comments
 (0)