fix: load source bundled plugins from pnpm workspaces

This commit is contained in:
Peter Steinberger
2026-05-02 02:05:51 +01:00
parent 89f73a5ef2
commit 8d7f4d28ce
8 changed files with 69 additions and 25 deletions

View File

@@ -22,7 +22,9 @@ falls back to npm automatically for packages that still use npm distribution.
- Node >= 22 and a package manager (npm or pnpm)
- Familiarity with TypeScript (ESM)
- For in-repo plugins: repository cloned and `pnpm install` done
- For in-repo plugins: repository cloned and `pnpm install` done. Source
checkout plugin development is pnpm-only because OpenClaw loads bundled
plugins from the `extensions/*` workspace packages.
## What kind of plugin?

View File

@@ -93,6 +93,12 @@ Bundled plugin manifests must not request dependency staging. Large or optional
plugin functionality should be packaged as a normal plugin and installed through
the same npm/git/ClawHub path as third-party plugins.
In source checkouts, OpenClaw treats the repository as a pnpm monorepo. After
`pnpm install`, bundled plugins load from `extensions/<id>` so package-local
workspace dependencies are available and edits are picked up directly. Source
checkout development is pnpm-only; plain `npm install` at the repository root is
not a supported way to prepare bundled plugin dependencies.
## Legacy cleanup
Older OpenClaw versions generated bundled-plugin dependency roots at startup or

View File

@@ -22,7 +22,9 @@ Pick a setup workflow based on how often you want updates and whether you want t
## Prereqs (from source)
- Node 24 recommended (Node 22 LTS, currently `22.14+`, still supported)
- `pnpm` preferred (or Bun if you intentionally use the [Bun workflow](/install/bun))
- `pnpm` required for source checkouts. OpenClaw loads bundled plugins from the
`extensions/*` pnpm workspace packages in dev mode, so root `npm install` does
not prepare the full source tree.
- Docker (optional; only for containerized setup/e2e — see [Docker](/install/docker))
## Tailoring strategy (so updates do not hurt)
@@ -44,7 +46,7 @@ From inside this repo, use the local CLI entry:
openclaw setup
```
If you dont have a global install yet, run it via `pnpm openclaw setup` (or `bun run openclaw setup` if you are using the Bun workflow).
If you dont have a global install yet, run it via `pnpm openclaw setup`.
## Run the Gateway from this repo
@@ -105,15 +107,6 @@ reloads on relevant source, config, and bundled-plugin metadata changes.
`pnpm openclaw setup` is the one-time local config/workspace initialization step for a fresh checkout.
`pnpm gateway:watch` does not rebuild `dist/control-ui`, so rerun `pnpm ui:build` after `ui/` changes or use `pnpm ui:dev` while developing the Control UI.
If you are intentionally using the Bun workflow, the equivalent commands are:
```bash
bun install
# First run only (or after resetting local OpenClaw config/workspace)
bun run openclaw setup
bun run gateway:watch
```
### 2) Point the macOS app at your running Gateway
In **OpenClaw.app**:
@@ -158,7 +151,7 @@ Use this when debugging auth or deciding what to back up:
## Updating (without wrecking your setup)
- Keep `~/.openclaw/workspace` and `~/.openclaw/` as “your stuff”; dont put personal prompts/config into the `openclaw` repo.
- Updating source: `git pull` + your chosen package-manager install step (`pnpm install` by default; `bun install` for Bun workflow) + keep using the matching `gateway:watch` command.
- Updating source: `git pull` + `pnpm install` + keep using `pnpm gateway:watch`.
## Linux (systemd user service)

View File

@@ -106,6 +106,12 @@ through `openclaw plugins install`.
See [Plugin dependency resolution](/plugins/dependency-resolution) for the
install-time lifecycle.
Source checkouts are pnpm workspaces. If you clone OpenClaw to hack on bundled
plugins, run `pnpm install`; OpenClaw then loads bundled plugins from
`extensions/<id>` so edits and package-local dependencies are used directly.
Plain npm root installs are for packaged OpenClaw, not source checkout
development.
## Plugin types
OpenClaw recognizes two plugin formats: