Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GO_FILES := $(shell find $(GO_DIR) $(GO_COBRA_DIR) $(EXAMPLE_GO_DIR) -name '*.go

# ── Quality ──────────────────────────────────────────────────────────────────

.PHONY: check test test-ts test-go test-go-cobra test-rust test-python fmt fmt-ts fmt-go fmt-rust fmt-python
.PHONY: check test test-ts test-go test-go-cobra test-go-release test-rust test-python fmt fmt-ts fmt-go fmt-rust fmt-python

check: ## Full parity gate
node scripts/check.mjs
Expand All @@ -31,10 +31,13 @@ test-ts: ## Run TypeScript tests
pnpm --dir $(TS_DIR) test

test-go: ## Run Go SDK tests
cd $(GO_DIR) && go test ./...
cd $(GO_DIR) && GOWORK=off go test ./...

test-go-cobra: ## Run Go Cobra adapter tests
cd $(GO_COBRA_DIR) && go test ./...
sh scripts/check-go-cobra.sh

test-go-release: ## Verify packaged Go modules from an external consumer
sh scripts/check-go-release.sh

test-rust: ## Run Rust SDK tests
cargo test --manifest-path $(RUST_DIR)/Cargo.toml
Expand Down Expand Up @@ -62,11 +65,13 @@ fmt-python: ## Lint and format Python code

.PHONY: generate generate-check

generate: ## Refresh generated host constants
generate: ## Refresh generated host constants and Go test fixtures
node scripts/sync-hosts.mjs
node scripts/sync-go-testdata.mjs

generate-check: ## Verify generated host constants
generate-check: ## Verify generated host constants and Go test fixtures
node scripts/sync-hosts.mjs --check
node scripts/sync-go-testdata.mjs --check

# ── Examples ─────────────────────────────────────────────────────────────────

Expand Down
10 changes: 10 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ Do not tag the release branch. Do not publish packages by hand during the normal

The release workflow publishes npm, PyPI, and crates.io packages, creates the `go/vX.Y.Z` and `go-cobra/vX.Y.Z` tags, creates the GitHub Release, and runs the public install smoke check.

The Go modules share the same release version. No workspace or local replacement
is committed. Source checks copy the modules to a temporary directory and add a
one-off replacement there so the Cobra adapter can test unreleased core APIs.
Release checks disable workspace resolution and verify both module archives from
a temporary consumer:

```bash
make test-go-release
```

## First npm Release

npm trusted publishing is configured in the npm package settings. For the first package version, the package settings may not exist yet.
Expand Down
2 changes: 0 additions & 2 deletions go-cobra/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
)

replace github.com/lathe-cli/kitup/go => ../go
2 changes: 2 additions & 0 deletions go-cobra/go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/lathe-cli/kitup/go v0.1.3 h1:7eEW8mDr5MbXFaTwr2dlnH8ebg+3Kmhj2/j4d9YfQNQ=
github.com/lathe-cli/kitup/go v0.1.3/go.mod h1:dZgJDmFRKjaFBZyaP1qlzOB9IEafnf1/ai4KX4hMA4c=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
Expand Down
17 changes: 13 additions & 4 deletions go-cobra/skill_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ import (
"path/filepath"
"strings"
"testing"
"testing/fstest"

kitup "github.com/lathe-cli/kitup/go"
)

func testBundle() kitup.SkillBundle {
return kitup.FSBundle(fstest.MapFS{
"basic/SKILL.md": {
Data: []byte("---\nname: basic\ndescription: Basic skill.\n---\n"),
},
}, "basic")
}

func TestSkillCommandInstallsWithCoreFlags(t *testing.T) {
home := t.TempDir()
var out bytes.Buffer
cmd := NewSkillCommand(Options{
AppID: "example-cli",
Bundle: kitup.DirectoryBundle(filepath.Join("..", "testdata", "skills", "basic")),
Bundle: testBundle(),
Home: home,
Out: &out,
})
Expand All @@ -36,7 +45,7 @@ func TestInstallCommandPromptsForScopeBeforeInstall(t *testing.T) {
var out bytes.Buffer
cmd := NewSkillCommand(Options{
AppID: "example-cli",
Bundle: kitup.DirectoryBundle(filepath.Join("..", "testdata", "skills", "basic")),
Bundle: testBundle(),
Home: home,
CWD: workspace,
StdinTTY: true,
Expand Down Expand Up @@ -71,7 +80,7 @@ func TestInstallCommandForceOverwritesUnmanaged(t *testing.T) {
var out bytes.Buffer
cmd := NewSkillCommand(Options{
AppID: "example-cli",
Bundle: kitup.DirectoryBundle(filepath.Join("..", "testdata", "skills", "basic")),
Bundle: testBundle(),
Home: home,
Out: &out,
})
Expand All @@ -89,7 +98,7 @@ func TestInstallCommandForceOverwritesUnmanaged(t *testing.T) {
func TestInstallCommandReturnsCoreFlagError(t *testing.T) {
cmd := NewInstallCommand(Options{
AppID: "example-cli",
Bundle: kitup.DirectoryBundle(filepath.Join("..", "testdata", "skills", "basic")),
Bundle: testBundle(),
Home: t.TempDir(),
})
cmd.SetArgs([]string{"--scope", "bad"})
Expand Down
4 changes: 2 additions & 2 deletions go/kitup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type goldenCase struct {

func TestGoldenCases(t *testing.T) {
var file goldenFile
readJSON(t, "../testdata/cases/bundled-skill-install.json", &file)
readJSON(t, "testdata/cases/bundled-skill-install.json", &file)
for _, tc := range file.Cases {
t.Run(tc.ID, func(t *testing.T) {
root := t.TempDir()
Expand Down Expand Up @@ -530,7 +530,7 @@ func repoPathFromCase(path string) string {
if filepath.IsAbs(path) {
return path
}
return filepath.Join("..", path)
return path
}

func hostIDs(hosts []Host) []string {
Expand Down
Loading
Loading