@powerhousedao/pieces-framework 6.2.3-dev.13 → 6.2.3-dev.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,10 +100,26 @@ import { httpClient, HttpMethod } from "@powerhousedao/pieces-framework/common";
|
|
|
100
100
|
`entry` is the built module, relative to the package root: `ph build`
|
|
101
101
|
emits `pieces/<name>/index.ts` to `dist/node/pieces/<name>/index.mjs`.
|
|
102
102
|
|
|
103
|
-
4. **Build.** `ph build`
|
|
104
|
-
`dist/node/pieces`,
|
|
105
|
-
|
|
106
|
-
the
|
|
103
|
+
4. **Build.** `ph build` bundles each `pieces/<name>/index.ts` on its own
|
|
104
|
+
into `dist/node/pieces/<name>/index.mjs`, with everything but node
|
|
105
|
+
built-ins inlined — the framework, its dependencies and the shared set that
|
|
106
|
+
document models and subgraphs leave to the host — because a host runs a
|
|
107
|
+
piece in a forked worker with no `node_modules` beside it. It then loads
|
|
108
|
+
each built piece once, in a child process, and writes two files next to it:
|
|
109
|
+
`descriptor.json`, the piece's own `metadata()` in the Activepieces
|
|
110
|
+
`PieceMetadata` shape (display name, logo, auth, every action and trigger
|
|
111
|
+
with its properties), and a `package.json` that makes the directory a
|
|
112
|
+
complete bundle. The `pieces` list in `dist/powerhouse.manifest.json` gets
|
|
113
|
+
each piece's version, description, `bundle` and `descriptor` paths, so a
|
|
114
|
+
registry can offer the piece before anyone installs the package.
|
|
115
|
+
|
|
116
|
+
A package that ships only pieces is still an ordinary reactor package: it
|
|
117
|
+
carries the same boilerplate as any other, including a root `index.ts`,
|
|
118
|
+
`document-models/index.ts`, `editors/index.ts` and `style.css`, even when
|
|
119
|
+
those are empty. `ph build` runs every step for it unchanged, so there is
|
|
120
|
+
no piece-only mode to know about. The host that runs pieces on a reactor
|
|
121
|
+
(the workflow runtime) reads the `pieces` list, imports each `entry` and
|
|
122
|
+
serves `ctx.reactor`.
|
|
107
123
|
|
|
108
124
|
Bundling with esbuild to ESM instead of `ph build`? `form-data`, which
|
|
109
125
|
`./common` uses, is CommonJS, so pass
|
package/package.json
CHANGED