Skip to content

Add a render-only ./render entry for read-only viewers - #4

Merged
wass08 merged 1 commit into
mainfrom
render-entry
Nov 11, 2026
Merged

wass08 merged 1 commit into
mainfrom
render-entry

Conversation

@wass08

@wass08 wass08 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Read-only viewers can now render the Nature kinds without @pascal-app/editor:

import { treesRenderPlugin } from '@pascal-app/plugin-trees/render'

What's split

Each kind (trees:tree, trees:flower, trees:grass) now has a *definition.render.ts, a *definition.edit.ts and a composing *definition.ts.

  • Render half: kind, schema, schemaVersion, defaults, category, bake: 'replace', capabilities (movable/rotatable/selectable/dragBounds/floorPlaced), the per-node proxy renderer, the instanced system, bakeReplaceRenderer, the read-only floorplan symbol, presentation and mcp text.
  • Edit half: snapProfile, parametrics, the tree rotate handles, preview, tool, toolHints.
  • Root only: the find-sync catalog side effect and treesHostPanel.

treesPlugin spreads the render plugin's identity and lists the composed definitions. Plugin contract v1, the kind names, schema versions, defaults and bake policy are unchanged. No kind declares migrations. package.json adds a ./render export that follows the root's raw-source convention (types/default → ./src/render.ts).

Verification

  • bun run check-types: passes.
  • bun test: 16 pass. The new src/render.test.ts checks that the render plugin has the same id, apiVersion, kinds, schemas, versions, bake policy, defaults and renderer/system/plan modules as the root plugin. It also checks that render definitions carry none of the editor's edit-contribution fields and that root definitions still carry theirs.
  • bun run check:render (new, also added to CI): bundles ./render with Bun.build, following every static and lazy import including peer packages. It fails if anything resolves to @pascal-app/editor or next. A negative probe bundles the root entry and must catch its editor imports. Passes on Bun 1.4.4 and on CI's 1.3.0.
  • The composed definitions have the same keys and capability keys as main, checked by comparing before and after.
  • Not run: an in-browser render of a scene through a render-only viewer host.

🤖 Generated with Claude Code

Split each kind (trees:tree, trees:flower, trees:grass) into a render half
(schema, defaults, capabilities, renderer, system, bake replacement renderer,
read-only plan) and an edit half (snapProfile, parametrics, handles, preview,
tool, toolHints). treesPlugin composes both, so editing hosts are unchanged;
treesRenderPlugin from @pascal-app/plugin-trees/render loads without
@pascal-app/editor. check:render bundles ./render with Bun.build and fails on
any @pascal-app/editor or next import, with a negative probe on the root entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wass08
wass08 merged commit cbaf450 into main Nov 11, 2026
1 check passed
@wass08
wass08 deleted the render-entry branch November 11, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant