depsmith

module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: Apache-2.0

README

Depsmith

Language: EN | RU

Depsmith is a testing platform and framework for Go. It helps you assemble a test project from typed modules and generators: set up a shared test harness, plug in a web UI driver, describe project dependencies in depsmith.go, and generate the supporting code without wiring everything together by hand.

When It Helps

  • You have a Go service or an internal platform module.
  • You need a shared foundation for API, UI, and integration tests.
  • You want API clients, repositories, and bootstrap code to follow project conventions instead of being maintained manually.
  • You want one entrypoint that shows what can be generated in the project.

What You Get

  • modules/testsuite / suite is the typed test harness on top of Go testing for package-level hooks and shared test structure.
  • modules/uidriver / webdriver is the web UI automation module with browser primitives and related adapters.
  • apibuilder builds Go API client packages from OpenAPI.
  • genrepo builds repository code from SQL schema.
  • genbootstrap builds bootstrap/runtime code for steps and dependencies.
  • depsmith TUI runs all of that from one screen and reads config from Depsmith(root).

When Another Tool Is Better

  • You only need one generator and do not want the shared TUI workflow.
  • Hand-written code is easier for your project than a convention-based setup.
  • You do not have OpenAPI, SQL, or bootstrap definitions that generation can build from.

What It Looks Like In A Project

  1. You add depsmith.go and describe which API, repository, and bootstrap jobs the project has.
  2. You use the typed test harness and, when needed, the browser driver for web UI tests.
  3. You keep source inputs like openapi.yaml, schema.sql, and boot.go next to the domain code.
  4. You run the TUI or a specific CLI and get ready-to-use generated/... packages.

Minimal example:

package project

import (
	"path/filepath"

	"github.com/0akess/depsmith/gen/api"
	"github.com/0akess/depsmith/gen/bootstrap"
	projectcfg "github.com/0akess/depsmith/project"
	"github.com/0akess/depsmith/gen/repo"
)

func Depsmith(root string) projectcfg.Definition {
	return projectcfg.Definition{
		APIs: []genapi.Job{
			{
				BaseDir:   filepath.Join(root, "internal", "clients", "api", "catalog"),
				Bootstrap: &genapi.BootstrapBinding{},
			},
		},
		Repos: []genrepo.Job{
			{
				BaseDir:   filepath.Join(root, "internal", "repositories", "customerprofile"),
				Bootstrap: &genrepo.BootstrapBinding{},
				DSL: genrepo.DSLConfig{
					Mode: genrepo.ScaffoldSync,
				},
			},
		},
		Bootstraps: []genbootstrap.Job{
			{
				BaseDir: filepath.Join(root, "internal", "bootstrap"),
			},
		},
	}
}

Where To Start

If you are adding Depsmith to your own project, start with the Quick Start. That is the main path for a new user.

If you already know which tool you need:

If you are working inside the Depsmith repository itself:

go run ./cmd/depsmith -root ./examples/showcase

If you use Depsmith as a dependency in your own project:

go run github.com/0akess/depsmith/cmd/depsmith-tui@latest

What Gets Generated

By default, generators write artifacts next to the source inputs:

  • API: <BaseDir>/generated/genapi<job-id>
  • Repository: <BaseDir>/generated/gen<job-id>repo
  • Repo DSL: <BaseDir>/generated/gen<job-id>dsl
  • Bootstrap: <bootstrap BaseDir>/generated

Documentation

Validation

make release-check
make -C examples/showcase release-check

Directories

Path Synopsis
cmd
apibuilder command
depsmith command
depsmith-tui command
genbootstrap command
genrepo command
gen
api
modules
testsuite
Package suite provides a typed test harness on top of Go testing.
Package suite provides a typed test harness on top of Go testing.
uidriver/core
Package core provides a high-level UI driver DSL on top of Rod.
Package core provides a high-level UI driver DSL on top of Rod.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL