@hyperfrontend/features/nx/executors

executors

Nx executors for hyperfrontend features: build packages a feature's shell by delegating to the SDK's headless hf build, serve runs the SDK dev server as a long-lived target.

import { runBuildExecutor, serveExecutor } from '@hyperfrontend/features/nx/executors'

const result = await runBuildExecutor({ config: './feature.config.json' }, context)

Executors

ExecutorPurpose
buildBuilds the feature's shell package against the executing project's root; explains a missing rollup binding.
serveStarts the dev server, yields the startup result, and keeps the servers alive until a shutdown signal arrives.

When a build fails, the executor checks whether rollup's native binding for the current platform is installed and, when it is missing, prints the exact install command for the workspace's package manager on stderr.

Usage

{
  "targets": {
    "build": {
      "executor": "@hyperfrontend/features:build",
      "options": { "config": "./feature.config.json" }
    },
    "serve": {
      "executor": "@hyperfrontend/features:serve",
      "options": { "port": "4600" }
    }
  }
}

See the build and serve docs for the full option tables.

API Reference§

◈ Interfaces

§interface

BuildExecutorSchema

Options for the build executor; mirrors schema.json.
Properties
§config?:stringPath to the feature config object.
§out?:stringOutput directory for the built shell.
§protocol?:stringSecurity envelope to enforce at build time: none, v3, or v4.
§name?:stringFeature name override.
§version?:stringFeature version override.
§url?:stringURL the generated shell loads the feature from.
§contract?:stringPath to the contract file.
§allowOpen?:booleanAcknowledge an explicit none protocol and build an open, unauthenticated shell.
§interface

ServeExecutorSchema

Options for the serve executor; mirrors schema.json.
Properties
§config?:stringPath to the dev-server config object.
§apps?:stringPath to the dev-server apps array.
§port?:stringPort the dev server's debug UI listens on.

● Variables

§type

runBuildExecutor

Build a hyperfrontend feature's shell package by delegating to the SDK's hf build.
Maps the executor options to headless CLI flags and runs the build against the executing project's root directory.
Example

Running the executor programmatically

const result = await runBuildExecutor({ config: './feature.config.json' }, context)
§type

serveExecutor

Serve a hyperfrontend feature dev server by delegating to the SDK's hf dev.
Long-running async-iterator executor: it starts the dev server, yields the startup result, stays alive until a shutdown signal, then closes the servers.
Example

Consuming the executor's startup result programmatically

const iterator = serveExecutor({ port: '4600' }, context)
const startup = await iterator.next()