Skip to content

Using the NX Plugin

The NX plugin for FeatureBoard

Installation

Terminal window
npm install @featureboard/nx-plugin@latest

Generators

add-code-gen-target

Adds the code-gen executor to a projects targets.

Required Options

  • featureBoardProductName: The name of the FeatureBoard product you want to pull the types from.
  • projectName: The name of the project to add the target to.
  • template: The type of code the target should generate [dot-net, typescript]

Optional Options

  • subFolder: The sub-folder of the project to add the generated code to. Defaults to the root of the project.
  • targetName: The name of the target. Defaults to code-gen

code-gen

Generates code based on FeatureBoard configuration.

Required Options

  • featureBoardProductName: The name of the FeatureBoard product you want to pull the types from.
  • projectName: The name of the project to add the generated code to.
  • template: “The type of the generated code [dot-net, typescript]

Optional Options

  • featureBoardApiKey: A FeatureBoard API key. This allows you to run the generator as part of a CI pipeline or other automated process, this should come from a github secret or similar and should not be checked in.
  • subFolder: The sub-folder of the project to add the generated code to. Defaults to the root of the project.

Executors

code-gen

Generates code based on FeatureBoard configuration.

Required Options

  • featureBoardProductName: The name of the FeatureBoard product you want to pull the types from.
  • template: “The type of the generated code [dot-net, typescript]

Optional Options

  • featureBoardApiKey: A FeatureBoard API key. This allows you to run the generator as part of a CI pipeline or other automated process, this should come from a github secret or similar and should not be checked in.
  • subFolder: The sub-folder of the project to add the generated code to. Defaults to the root of the project.
  • dryRun: Only show what would be generated, don’t modify files.

Running executers securely from a GitHub CI pipeline

  1. Generate a new “Reader” API key from the API Keys section of the feature board console.

  2. Add the new API key to your GitHub repository secrets.

  3. Update your CI workflow to run the executer by adding the following workflow step:

- name: Regenerate featureboard types
run: pnpm nx run-many --all --target=code-gen --featureBoardApiKey="${{ secrets.FEATUREBOARD_API_KEY }}"