Forge
Plugins

Nx Plugin

Plugin for building custom Forge plugins

@bjb-forge/nx-plugin-project

Installation

npx forge 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

sync

Runs sync generators for version reset, CLI package group, and plugin documentation.

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

Generators

inferred-config

Configure plugin to support inferred configuration

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

init-generator

Configure plugin with an init generator

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

plugin-project

Create an Nx Plugin for JB.

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

On this page