native

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Overview

Package native is the single source of truth for the bundle set the shipped nflow CLI loads.

Every CLI subcommand that touches a .nflow file — run, lint, expand, build, catalog, list, show, and selftest — must build its runner config from Bundles() or SelftestBundles(). No command constructs its own list. No command calls compiler.RegisteredBundles().

SelftestBundles adds the fixture-only helpers and optional extensions needed to exercise repository packages. These are not loaded into ordinary flow runs unless the source explicitly requires the extension.

If you find yourself wanting a third list, don't. Either add the bundle to Bundles() so it is always present, or register it and load it via @require. A new list means a new environment, and that is the class of bug this package exists to prevent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bundles

func Bundles() []compiler.Bundle

Bundles returns the complete set of bundles the shipped CLI loads.

Do not append to Bundles() from a caller. Every bundle the CLI has is already in this list. A caller that needs an additional bundle either uses @require in the source or builds its own config from scratch — never both, because BuildConfig rejects a duplicate ID.

func BundlesWithRetryConfig added in v0.30.0

func BundlesWithRetryConfig(cfg retry.Config) []compiler.Bundle

BundlesWithRetryConfig returns the standard native set with a caller-selected retry policy. All other bundles and defaults are identical to Bundles.

func Directives

func Directives() *compiler.DirectiveTable

Directives returns the standard directive table. It includes @macro, @scope, @pipeline, @include, @require, and every other directive the shipped CLI understands.

func Primaries

func Primaries() []compiler.PrimaryExtension

Primaries returns the primary extensions contributed by the native set. It is the table a caller reaches for when it needs to parse a source fragment without going through CompileAction — for example, a diagnostic tool that wants the parser surface but not the runner.

func SelftestBundles added in v0.14.0

func SelftestBundles() []compiler.Bundle

SelftestBundles returns Bundles plus bundles used only for conformance testing. Optional extensions are deliberately excluded from Bundles(), but their fixtures still run here so every repository extension has a verified self-test suite.

selftestkit ships cov.* actions and a cov.items stream source. Its fixtures live in other bundles' nflows/ directories and reference those actions. A production pipeline must never see cov.*, so selftestkit is not in Bundles(). A self-test fixture must always find them, so it is here. Optional in-tree bundles such as config_yaml are also included here so their conformance fixtures run without making the capabilities part of the default bundle set. Language execution is supplied by github.com/nexssp/lang/nexssflow through the external @require harness.

These bundles are not in the ordinary CLI set unless explicitly required. Keep this set aligned with extension packages so the self-test environment can compile and execute every extension fixture.

func SelftestBundlesFrom added in v0.15.0

func SelftestBundlesFrom(bundles []compiler.Bundle) []compiler.Bundle

SelftestBundlesFrom adds the self-test-only bundle to an existing native bundle set. Callers that own bundle lifetimes can reuse their cached set instead of invoking every native factory a second time.

Types

type BuildBundle added in v0.36.0

type BuildBundle struct {
	ID         string
	ImportPath string
}

BuildBundle identifies a shipped Go package needed by a generated build.

func PlanBuild added in v0.36.0

func PlanBuild(sources []compiler.BuildSource, requirements []requireext.Requirement, all bool) ([]BuildBundle, error)

PlanBuild composes the shipped preset, mandatory grammar providers and extension-owned contributions. Optional bundles require an explicit @require. The caller supplies fragments from the existing preprocessing lifecycle.

Jump to

Keyboard shortcuts

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