Forge
Plugins

Nx Plugin

Plugin for building custom Forge plugins

@bjb-forge/nx-plugin-project

Installation

npx @bjb-forge/cli add @bjb-forge/nx-plugin-project

Plugin Options

{
  "plugin": "@bjb-forge/nx-plugin-project/nx-plugin",
  "options": {}
}
OptionTypeDescription
build.targetNamestringThe name of the build target
lint.targetNamestringThe name of the lint target
test.targetNamestringThe name of the test target

Inferred Targets

build

Compiles the Nx plugin package using TypeScript.

Condition: Nx plugin projects matching **/nx-*-project/package.json

lint

Runs ESLint to check code quality.

Condition: Nx plugin projects matching **/nx-*-project/package.json

test

Runs unit tests using Jest.

Condition: Nx plugin projects matching **/nx-*-project/package.json

Generators

plugin-project

Create a custom Forge plugin.

nx g @bjb-forge/nx-plugin-project:plugin-project [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory where the plugin is placed
scopestringNoforgeImport path scope
withE2eProjectbooleanNotrueGenerate an e2e project for the plugin
withInitGeneratorbooleanNotrueGenerate an init generator

inferred-config

Add inferred configuration support to a plugin.

nx g @bjb-forge/nx-plugin-project:inferred-config [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory of the plugin project

init-generator

Add an init generator to a plugin.

nx g @bjb-forge/nx-plugin-project:init-generator [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory of the plugin project

On this page