extensionrepo

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package extensionrepo runs repository tasks through the extension's export program. It owns checks, contract lookup, updates, staged install, and uninstall, as Extension repository in contract.md defines. Its test wrapper prints notices after Go's package results, as Test kit defines.

Index

Constants

View Source
const ScenarioEnv = "NCLY_TEST_SCENARIO"

ScenarioEnv names the scenario that a run of go test runs alone, for just scenario and for the repeat of signoff. When -run is ScenarioRun of that name, the test kit skips its coverage checks, which need every scenario.

Variables

This section is empty.

Functions

func Install

func Install(e extension.Extension, executable, dir string) error

Install stages executable and the embedded sidecars of e, then publishes the executable last. The kit uses it with its built executable and a scratch extensions folder.

func Main

func Main(e extension.Extension)

Main runs a repository task, then exits. The export subcommand writes embedded sidecars for the staged build.

func Notice

func Notice(message string) error

Notice records a test notice for Test to print after the packages finish. Outside Test, it writes to stdout, which go test can hide for passing packages.

func ScenarioRun added in v0.25.0

func ScenarioRun(name string) string

ScenarioRun is the -run pattern of go test that selects only the scenario testdata/script/<name>.txtar.

func Test

func Test(args []string) int

Test runs go test without its result cache, then prints notices to stderr outside Go's output filter. It accepts go test arguments, defaults to ./..., and preserves the test exit code.

func Uninstall

func Uninstall(e extension.Extension, dir string) ([]string, error)

Uninstall removes e from dir, with the executable first. It returns the paths removed, in order, and accepts an absent install.

Types

type SpecKind added in v0.25.0

type SpecKind int

SpecKind says what a line of spec.md is.

const (
	SpecText SpecKind = iota
	SpecBlank
	SpecSeparator
	SpecHeading
	SpecLabel
	SpecHeader
	SpecRow
	SpecBullet
)

The kinds of a line of spec.md. SpecText is prose.

type SpecLine added in v0.25.0

type SpecLine struct {
	Part   string
	Number int
	Kind   SpecKind
	// Cells holds the cells of a header or a row, without spaces around them.
	Cells []string
	// ID holds the spec ID that starts a row or a bullet, or "".
	ID string
	// Rest holds the text after the bold label of a SpecLabel.
	Rest string
}

A SpecLine is one line of spec.md, read as "Spec IDs" in the contract says. A part starts at a heading, or at a line that starts with a bold label, such as **Failures.**, and ends at the next one. The test kit reads the parts Failures and Acceptance, and finish reads Open lines and Limits.

func SpecLines added in v0.25.0

func SpecLines(spec string) []SpecLine

SpecLines reads each line of a spec.md. A row starts with its ID as its first cell. A bullet starts with its ID and a colon, such as - `duration`: the duration. So a bullet that only starts with code holds no ID. The header row of a table is the row above its separator.

Directories

Path Synopsis
cmd
extensionrepo command
Command extensionrepo runs repository tasks through the shared SDK, including from a downloaded Nicely module.
Command extensionrepo runs repository tasks through the shared SDK, including from a downloaded Nicely module.
Command test runs Go tests and prints their collected notices after the package results.
Command test runs Go tests and prints their collected notices after the package results.

Jump to

Keyboard shortcuts

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