native

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 37 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 core.RegisteredBundles().

The two functions exist because exactly one bundle, selftestkit, must be visible to `nflow self test` and invisible to every other command. That is the only sanctioned delta. Everything else — macros, pipeline, scope, include, and the rest — is available to every command, in every .nflow file, without a @require line.

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() []core.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 Directives

func Directives() *core.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() []core.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() []core.Bundle

SelftestBundles returns Bundles plus the bundles that exist only to exercise other bundles' fixtures.

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.

This is the only difference between the production environment and the self-test environment. If you add to this list, you are widening the delta; consider whether the bundle can be exposed via @require instead.

func SelftestBundlesFrom added in v0.15.0

func SelftestBundlesFrom(bundles []core.Bundle) []core.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

This section is empty.

Jump to

Keyboard shortcuts

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