Skip to content

v1.3.0

Latest

Choose a tag to compare

@cmilesio cmilesio released this 17 Oct 23:06
2367f18

Wire v1.3.0 fixes stale generation in multi-module workspaces and adds opt-in support for project-owned generation commands.

Go version requirement

Go 1.25 or later is required. The v1.2.0 module declared Go 1.19. The updated golang.org/x/tools, x/mod, x/sync, and x/sys dependencies require Go 1.25.0, so update local and CI toolchains before upgrading the Wire module or generator.

Existing provider APIs and the default generation command are preserved. The generation-command override is opt-in.

Fixed: stale provider signatures in workspace generation

After the caches were fully warm, generating multiple targets from a separate tooling module could report unchanged after a provider refactor while leaving calls to deleted types or old constructor signatures in wire_gen.go.

Wire now retains module identities and fingerprints mutable source files in sibling workspace modules and filesystem replacements. Both mtime and content modes detect these edits while retaining warm-cache reuse. Regression tests compile the regenerated targets and check that a newly missing dependency produces an error instead of cached success.

Fixes #14 through #27. Thanks to @Satont for the detailed report and cache diagnosis.

Added: custom generation commands

-generate_command is available on gen, diff, and watch. Projects can use a Go tool dependency to generate workspace-compatible directives:

go get -tool github.com/goforj/wire/cmd/wire@v1.3.0
go tool wire gen -generate_command="go tool wire" ./...

The generated directive preserves that choice on subsequent runs:

//go:generate go tool wire gen -generate_command "go tool wire"

Custom prefixes follow go generate quoting and environment-expansion rules. Wrapper commands must forward the generated arguments. Build tags and the command override are retained when regenerating, and output-cache keys distinguish different command prefixes.

Addresses #15 through #26. Thanks to @termermc for the request.

Dependency and repository maintenance

  • Update github.com/fsnotify/fsnotify from v1.7.0 to v1.10.1 and github.com/google/go-cmp from v0.6.0 to v0.7.0.
  • Update golang.org/x/tools to v0.49.0, x/mod to v0.40.0, x/sync to v0.22.0, and x/sys to v0.47.0.
  • Add dependency review, vulnerability/SBOM checks, and secret scanning; refresh pinned workflow actions.
  • Batch routine Dependabot version updates monthly.
  • Improve the development Makefile, documentation, and README artwork links.

Install

go install github.com/goforj/wire/cmd/wire@v1.3.0

Full changelog since v1.2.0