You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c349e37
Browse filesBrowse the repository at this point in the historyBrowse files
feat(spec, cli)!: bundled is the one plugin packaging strategy; os plugin build refuses a native addon
ADR-0025 v2 §3.3 (ruling B′, slice 3, server half):
- spec: PluginPackagingSchema narrows to `bundled`; `manifest-deps` is a
retired value refused at every manifest door with its prescription. D2
conversion manifest-packaging-manifest-deps-removed strips it from a
stack's manifest and each packages[].manifest; D3 entry
manifest-packaging-manifest-deps-retired and its STEP18 fragment carry it
to the upgrade guide. The removal-version pin gains its JOIN row. The
`packaging` liveness row is `planned` (one-member enum, no fork to read);
the manifest state-count shard is regenerated.
- cli: os plugin build drops both manifest-deps forks (externalize + pack
package.json / lockfile) and refuses a native addon before writing the
artifact: a `.node` module in the graph, a bundled package that declares
a node-gyp build or ships a `.node` file, a `.node` file under assets/.
- The archive layout docblock, the platform checklist item
cli.plugin-manifest-build-contract (revision 4) and the generated
reference pages follow.
Claude-Session: https://claude.ai/code/session_01L6bhgWLCWkh3MaLj1qTLCe
Co-authored-by: Claude <noreply@anthropic.com>
ADR-0025 v2 §3.3 makes `bundled` the only dependency-packaging strategy. `manifest-deps` kept every dependency external and packed `package.json` and the lockfile beside the bundle, but nothing ever installed them, so a plugin built with it could not load them. A compiled `.node` addon can be neither bundled nor run by every host, so a plugin may not carry one.
14
+
15
+
-**`@objectstack/spec`**: `PluginPackagingSchema` is `['bundled']`. `manifest-deps` is a retired value: every door that parses a manifest refuses it at `packaging` with the prescription — `ManifestSchema` (an `objectstack.plugin.json` at `os plugin build`, a stack's `manifest` at `defineStack`, the ObjectQL registry), a packaged artifact's `packages[].manifest`, and the `POST /packages` install body — and TypeScript no longer admits it. The ADR-0087 D2 conversion `manifest-packaging-manifest-deps-removed` deletes the value from a stack's `manifest` and from each `packages[].manifest` (`os migrate meta --from 17`), and the D3 entry `manifest-packaging-manifest-deps-retired` carries the change to the upgrade guide. The `packaging` liveness row is `planned`: a one-member enum has no fork left to read.
16
+
-**`@objectstack/cli`**: `os plugin build` packs one strategy. It inlines every dependency except the host-provided `@objectstack/*` packages and no longer packs `package.json` or `pnpm-lock.yaml`. It refuses a native addon before it writes anything, naming each one it finds: a `.node` file the bundle imports (with its importer), a bundled package that declares a node-gyp build or ships a `.node` binary, and a `.node` file under `assets/`. An addon loaded at run time from an absolute or computed path outside every bundled package is not visible to the build.
17
+
18
+
**BREAKING** for a plugin manifest that writes `packaging: 'manifest-deps'`, and for a plugin that carries a native addon.
19
+
20
+
-**Before.**`packaging: 'manifest-deps'` built an artifact that left the dependencies out and carried `package.json` for an install step that never ran. A plugin importing a `.node` file failed in esbuild with a bare "Bundle failed"; one whose dependency located its binary at run time, or that kept a `.node` file under `assets/`, built an artifact that could not load it on a host without that binary.
21
+
-**Now.**`manifest-deps` is refused at the manifest (`objectstack.plugin.json is invalid:` names `packaging`, exit 1, no artifact). A native addon is refused by name (`Native addon refused: …`, exit 1, no artifact).
22
+
-**Fix.** Delete the `packaging` key, or write `bundled`. A stack source gets the edit from `os migrate meta --from 17` (`--write` applies it); an `objectstack.plugin.json` is edited by hand. Replace a native addon with a pure-JavaScript or WebAssembly alternative.
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
110
110
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
111
111
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
112
112
|**functions**|`Record<string, string \| { handler?: string; effect?: Enum<'pure' \| 'writes'> }> \| { name: string; handler?: string; packageId?: string; effect?: Enum<'pure' \| 'writes'> }[]`| optional | Named handler functions, lowered to the refs a JSON document carries |
@@ -289,7 +289,7 @@ This schema accepts one of the following structures:
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
293
293
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
294
294
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
295
295
@@ -352,7 +352,7 @@ This schema accepts one of the following structures:
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
356
356
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
357
357
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
358
358
|**functions**|`Record<string, string \| { handler?: string; effect?: Enum<'pure' \| 'writes'> }> \| { name: string; handler?: string; packageId?: string; effect?: Enum<'pure' \| 'writes'> }[]`| optional | Named handler functions, lowered to the refs a JSON document carries |
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
166
166
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
167
167
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
168
168
@@ -208,7 +208,7 @@ Package manifest installed through POST /api/v1/packages (AUTHORING stage; scope
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
212
212
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
213
213
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
214
214
@@ -316,7 +316,7 @@ Package manifest installed through POST /api/v1/packages (AUTHORING stage; scope
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
320
320
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
321
321
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
437
437
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
438
438
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
570
570
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
571
571
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
664
664
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
665
665
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
2117
2117
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
2118
2118
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
|**runtime**|`Enum<'node' \| 'sandbox' \| 'worker'>`| optional | Plugin trust tier the plugin declares (ADR-0025 §3.6) — enforced at the cloud marketplace publish gate (unverified publisher requesting `node` → HTTP 422 + manual review) and at boot for a plugin `os plugin install` installed: only `node` is loaded (in process, not isolated); `sandbox` and `worker` are refused until ADR-0025 M3 routes them |
|**packaging**|`Enum<'bundled'>`| optional | Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled`, the only one and the default — omit the key or write `bundled`|
66
66
|**main**|`string`| optional | Entry module of a code-bearing plugin, relative to the plugin root; `os plugin build` bundles it and writes `dist/index.mjs` here in the compiled manifest (ADR-0025 §3.4) |
67
67
|**integrity**|`Record<string, string>`| optional | Per-file content digests of the plugin artifact (ADR-0025 §3.2) |
68
68
@@ -179,12 +179,11 @@ Per-file content digests of the plugin artifact (ADR-0025 §3.2)
179
179
180
180
## PluginPackaging
181
181
182
-
Dependency packaging strategy (ADR-0025 §3.3)
182
+
Dependency packaging strategy (ADR-0025 v2 §3.3): `bundled` is the only one and the default — every dependency except the host-provided `@objectstack/*` packages is inlined into the artifact, and `os plugin build` refuses a native (`.node`) addon
0 commit comments