Skip to content

Executors

Documents the executors provided by the Nx Forge plugin.

Append --help or -h for any of the plugin executors to explore all available options.

Forge

shell
nx forge <nx-forge-app-name> <forge-cli-options>

Runs any Forge CLI command in the <nx-forge-app-name> output directory. Refer to the Forge CLI reference documentation for a list of all available commands.

INFO

Where a custom executor is provided by Nx Forge, prefer using the custom executor over calling the Forge CLI directly.

Options

OptionTypeDescriptionDefault
--outputPathstring
[required]
Output path of the Forge app files.-

Nx Forge-provided executors ensure that the Nx project configuration is updated where necessary when the Forge command has run. For example, registering a Forge app using nx forge <nx-forge-app-name> register will invoke the Forge CLI directly and only update the Forge app ID in the manifest file in the output directory. The next time you run nx run <nx-forge-app-name>:build the manifest file in the output path will be overwritten. The correct way to do this is to run nx run <nx-forge-app-name>:register, which will update the app ID of the manifest.yml within the <nx-forge-app-name> project root.

Package

shell
nx run <nx-forge-app-name>:package

Packages the Forge app project named <nx-forge-app-name> into a deployable artifact accepted by the Forge platform. Expects the build output from <nx-forge-app-name> app to be available in the outputPath directory.

INFO

The package executor is intended to be used with a standard Nx build target, for example, Webpack or esbuild. Refer to the migration guide for more information.

Options

OptionTypeDescriptionDefault
--outputPathstring [required]Output path of the generated files.-
--resourcePathstringPath where resource files such as Custom UI output is placed relative to the outputPath.-
--resourceOutputPathMapobjectMap of resource project names to their respective output path.{}
--tsConfigstringPath for the TypeScript configuration file, relative to the current project."tsconfig.app.json"
--uiKit2PackagingbooleanEnables UI Kit compatible packaging (experimental).false

This executor will copy the output of dependent resource project builds to the resourcePath directory. To do this, the executor tries to infer the output path of dependent resources (Custom UI, UI Kit) from the dependent project's build target configuration as follows:

  1. if a mapping is defined using resourceOutputPathMap use the mapping
  2. else if the build target definition has options.outputPath define use that
  3. else use the build target's outputs definition, if there is only one entry

In cases where the output path cannot be inferred or is inferred incorrectly, the output path should be defined explicitly using the resourceOutputPathMap option.

Deploy

shell
nx run <nx-forge-app-name>:deploy

Deploys the Forge app project named <nx-forge-app-name> to the Forge platform.

Mirrors the deploy command of the Forge CLI.

Options

OptionTypeDescriptionDefault
--environment
-e
stringEnvironment to deploy to."development"
--verifybooleanRun pre-deployment checks.true
--interactivebooleanRun deployment with or without input prompts.true
--verbose
-v
booleanRun deployment in verbose mode.false
--manifestTransformstringA JSONata expression that transforms the manifest.yml content before the deployment.-

For details on how to use the manifestTransform parameter, refer to the guide on transforming the manifest.

Register

shell
nx run <nx-forge-app-name>:register

Registers the Forge app project named <nx-forge-app-name> with the Forge platform. This command will automatically update the manifest file in the <nx-forge-app-name> project with the generated app id.

Mirrors the register command of the Forge CLI.

Options

OptionTypeDescriptionDefault
--appNamestring [required]Name of the app on the Forge platform. The app name can include dashes, spaces, and underscores. Defaults to the project name-
--developerSpaceId
-s
stringID of the Forge developer space this app should be part of-
--acceptTerms
-y
booleanAutomatically accept terms and conditions in non-interactive mode-
--verbose
-v
booleanRun registration in verbose mode.false

Tunnel Experimental

shell
nx tunnel <nx-forge-app-name>

Starts the tunnel target for all Custom UI projects defined in the manifest.yml of the Forge app project named <nx-forge-app-name> on their specified tunnel port. After that, starts a build process in watch mode for the Forge app itself, before ultimately, starting the Forge tunnel process for the Forge app.

Mirrors the tunnel command of the Forge CLI.

Options

OptionTypeDescriptionDefault
--debug
-d
booleanRun Forge tunnel in debug mode.false
--verbose
-v
booleanRun Forge tunnel in verbose mode.false

Released under the MIT License.