@weave-framework/nx
v3.4.1
Published
Nx plugin for Weave — inferred build/serve/check targets (crystal createNodesV2), executors, and generators, so a Weave app is a first-class project in an Nx monorepo.
Readme
@weave-framework/nx
An Nx plugin that makes a Weave app a first-class
project in an Nx monorepo — inferred targets, executors, and generators. Drop it into an
existing Nx workspace and your Weave apps get Nx caching, nx affected, and the project graph with
zero hand-wiring.
Install
nx add @weave-framework/nx
# or: npm i -D @weave-framework/nx and add the plugin to nx.json (below)Register the inference plugin in nx.json:
{
"plugins": ["@weave-framework/nx/plugin"]
}Inferred targets (crystal)
For every weave.config.{ts,js,json} in a project, the plugin infers three targets — no
project.json boilerplate:
| Target | Runs | Cached |
|--------|------|--------|
| build | weave build (output = the config's outDir) | ✓ |
| serve | weave dev (watch + live-reload) | — |
| check | weave check | ✓ |
nx build my-app
nx serve my-app
nx check my-appEach target runs the existing weave CLI with cwd set to the project root, so it resolves that
project's own config — the Weave CLI itself needs no Nx-specific changes.
Override the inferred target names in nx.json if they collide with another plugin:
{ "plugins": [{ "plugin": "@weave-framework/nx/plugin", "options": { "buildTargetName": "bundle" } }] }Generators
nx g @weave-framework/nx:application my-app # a Weave app project (+ build/serve/check)
nx g @weave-framework/nx:library ui-kit # a component library (imported from source)
nx g @weave-framework/nx:component UserCard --project my-app # a component into a projectExecutors (explicit wiring)
Prefer explicit project.json targets over inference? The same three are available as executors:
@weave-framework/nx:build, :serve, :check.
Zero-dependency note
@nx/devkit is a dev-time dependency of this plugin — correct and unavoidable for an Nx plugin
(it's tooling, only pulled in by Nx users). The Weave runtime, compiler, and router stay
zero-dependency; the executors shell out to the existing weave CLI rather than re-implementing the
build.
📚 Guides + full API reference: Tooling guide
License
MIT
