https://github.com/toolsplus/nx-forge-examples
https://github.com/toolsplus/nx-forge-examples
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/toolsplus/nx-forge-examples
- Owner: toolsplus
- Created: 2024-03-04T05:11:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-13T04:50:00.000Z (about 1 year ago)
- Last Synced: 2025-02-13T05:27:43.573Z (about 1 year ago)
- Language: TypeScript
- Size: 1.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nx Forge Examples
[](https://github.com/toolsplus/nx-forge-examples/actions/workflows/ci-main.yml)
This repository contains example [Nx Forge](https://github.com/toolsplus/nx-forge) setups with different tooling.
## General setup
This workspace is a standard Nx workspace. However, some default configurations in [the `nx.json`](https://nx.dev/reference/nx-json#nxjson) worth mentioning:
### Package executor
We define a default `package` target configuration in the `nx.json` > `targetDefaults.package` that defines that the package target depends on the build target, i.e. before running the package target the build target has to complete.
To enable the `package` target on a Forge app project simply add the following `package` target definition to the project's project.json: `"package": {}`.
### Forge executor
The plugin adds an inferred `forge` executor target to all projects it detects as Forge apps (projects that contain a manifest.yml). This allows you to run arbitrary Forge CLI commands for any Forge app.
To run any Forge CLI command for a Forge app project run:
```shell
nx forge variables list
```
## Running tasks
To execute tasks with Nx use the following syntax:
```
nx <...options>
```
You can also run multiple targets:
```
nx run-many -t
```
..or add `-p` to filter specific projects
```
nx run-many -t -p
```
Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/core-features/run-tasks).
## Explore the Project Graph
Run `nx graph` to show the graph of the workspace.
It will show tasks that you can run with Nx.