Skip to content

Commit

Permalink
Merge pull request #7 from strider2038/next
Browse files Browse the repository at this point in the history
Next version
  • Loading branch information
strider2038 authored Nov 24, 2024
2 parents 04b1f96 + dc25f9c commit 44eb3f4
Show file tree
Hide file tree
Showing 74 changed files with 3,980 additions and 3,248 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.23'
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ After any update run `digen generate` command to generate container and factorie

### Service definition options

To set up service definition options use tags:
To set up service definition use tags:

* tag `di` for quick options;
* tag `factory_name` to set up factory filename (without extension);
* tag `public_name` to override service getter for public container.

To set up quick options use tag `di` with combination of values:

* `set` - to generate setters for internal and public containers;
* `close` - to generate closer method call;
Expand Down Expand Up @@ -102,9 +108,12 @@ Workaround: don't use struct by values as services or set `required` option to g
* [x] move contracts into separate package
* [x] generate README.md for root package
* [x] ability to choose specific file for factory func
* [x] ability to set public definition name
* [x] check app version in config
* [ ] custom close functions
* [ ] describe basic app example
* [ ] add complex app example with tests and fake repository
* [ ] ability to set definition name
* [ ] multi container config
* [ ] parse from multiple definition files (may encounter potential conflicts for imports)
* [ ] definitions updater
* [ ] write doc
Expand Down
13 changes: 9 additions & 4 deletions cmd/digen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package main
import (
"os"

"github.com/earthboundkid/versioninfo/v2"
"github.com/pterm/pterm"
"github.com/strider2038/digen/internal/console"
"github.com/strider2038/digen/internal/app"
)

var (
Expand All @@ -13,9 +14,13 @@ var (
)

func main() {
err := console.Execute(
console.Version(version),
console.BuildTime(date),
if version == "" {
version = versioninfo.Short()
date = versioninfo.LastCommit.String()
}
err := app.Execute(
app.SetVersion(version),
app.SetBuildTime(date),
)
if err != nil {
pterm.Error.Println(err)
Expand Down
57 changes: 35 additions & 22 deletions examples/basic/di/container.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions examples/basic/di/internal/bitset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 32 additions & 20 deletions examples/basic/di/internal/container.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions examples/basic/di/internal/lookup/container.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/basic/digen.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
di:
definitions_file: di/internal/definitions/container.go
version: v0.1
container:
dir: di
Loading

0 comments on commit 44eb3f4

Please sign in to comment.