The running pre-G indexer publishes a repository's packages only when every package directory it published last is
still in the tree; G moved contracts/go and sdk to modules/, so mesh-delivery's packages, G's renamed paths among them,
are never published and nothing importing them builds (2026-11-13, indexer journal 'its packages are not published').
These are the trees of e70754ef, unchanged, without sdk/module.json (no second module). Nothing imports them; they go
once G's indexer runs and publishes without them.
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
38 lines
968 B
Go
38 lines
968 B
Go
package sdk
|
|
|
|
import (
|
|
"encoding/json"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
// The module's one package artifact is the module's whole directory, which it says by leaving `paths` out: the manifest
|
|
// validator refuses the word "." as a path (a package artifact naming one directory).
|
|
func TestThePackageArtifactNamesNoPathForTheWholeDirectory(t *testing.T) {
|
|
raw, err := os.ReadFile("module.json")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
var m struct {
|
|
Build struct {
|
|
Artifacts []struct {
|
|
Name string `json:"name"`
|
|
Paths []string `json:"paths"`
|
|
} `json:"artifacts"`
|
|
} `json:"build"`
|
|
}
|
|
if err := json.Unmarshal(raw, &m); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(m.Build.Artifacts) != 1 {
|
|
t.Fatalf("artifacts are %+v: one", m.Build.Artifacts)
|
|
}
|
|
for _, a := range m.Build.Artifacts {
|
|
for _, p := range a.Paths {
|
|
if p == "." || p == "" {
|
|
t.Errorf("artifact %s names %q as a path: leave `paths` out for the module's whole directory", a.Name, p)
|
|
}
|
|
}
|
|
}
|
|
}
|