@hyperfrontend/features/nx/generators/feature

feature

Nx feature generator. A thin wrapper that scaffolds a hyperfrontend feature by delegating to the SDK's headless hf init (config resolution, contract loading, entry wiring). Registered via the package's generators.json.

Usage

nx generate @hyperfrontend/features:feature \
  --name=clock --contract=./clock.contract.json --entry=./src/main.ts --directory=apps/clock
OptionRequiredDescription
nameyesFeature name.
contractyesPath to the contract file, relative to the target directory.
entryyesEntry file the generated glue import is wired into.
directorynoDirectory to scaffold into, relative to the workspace root.
versionnoFeature version string.
urlnoURL the generated connector loads the feature from.

API Reference

ƒ Functions

§function

default(tree: Tree, options: FeatureGeneratorSchema): Promise<void>

Scaffold a hyperfrontend feature by delegating to the SDK's hf init.
The generator is a thin wrapper: it resolves the target directory from the workspace tree and forwards options to runInit in headless mode, which owns config resolution, contract loading, entry wiring, and writing to disk.

Parameters

NameTypeDescription
§tree
Tree
The Nx virtual file-system tree, used only to resolve the root.
§options
FeatureGeneratorSchema
Generator options forwarded to the SDK runner.

Returns

Promise<void>
A promise that resolves once scaffolding completes.

Example

Scaffold a feature in a project directory

nx generate \@hyperfrontend/features:feature \
  --name=clock --contract=./clock.contract.json --entry=./src/main.ts --directory=apps/clock