Bootstrap Scene: Model / Engine / React split - #8
Merged
Conversation
Copies the shared .ai/ instruction corpus and its Copilot/Claude/Codex adapters, root build/lint/format config (Directory.Build.props, Directory.Packages.props, .editorconfig, .globalconfig, tsconfig, vitest, eslint, yarn workspace tooling), and CI workflows (dotnet/JS build, NuGet + npm trusted publishing, semver label gate) from Cratis/Arc, the closest real dual-stack framework repo (Stage turned out to be .NET-only). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Records for the element hierarchy (harvested from Studio's wireframe tool's SceneObject/UIElement/FrameworkElement/Control/Panel shape, stripped of editor-only concerns), layouts (flow and freeform arrangement per slot, width x height size classes), forms (the three population/mapping tiers), contribution points and navigation, and ui profiles/themes. No React, DOM or CSS vocabulary anywhere in this project — Scene.React and future renderers map these primitives to their own platform. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Every consumer of this package also has the DOM's own global Element type in scope (react/vite tsconfig pulls in the DOM lib), so the bare name would shadow it at every import site. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Follow-up to the previous commit's rename — the type reference edits didn't make it into that commit alongside the file rename. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Mirrors every Cratis.Scene.Model record/enum as a TypeScript interface/enum plus a co-located own-property-names const array (interfaces have no runtime shape, so the const is what the parity spec actually inspects). Both sides assert their own reflected/declared shape against a shared scene-model-shape.json manifest independently (Model.Specs/ for_SceneModelShape on the C# side, model/for_shape on the TS side) -- verified end-to-end: 11 C# specs and 38 TS tests all pass against the same manifest. Also: - fixes the root package.json/root tsconfig.json/eslint config, which still referenced Arc's own packages after being copied wholesale during the bootstrap commit - brings over Arc's TypeScript-7-compatibility yarn plugin, needed by the same typescript-eslint version pin - converts the shared vitest.setup.ts to plain JS (vitest.setup.js) and drops its @cratis/fundamentals import (a Scene.Model dependency Arc has but Scene does not) -- also sidesteps a Vite 8 oxc-transform bug where a setup file outside every package's own tsconfig rootDir fails to resolve a tsconfig at all Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Renderer<TOutput> is the contract Scene.React implements -- one method per concrete element kind Scene.Model ships (ContentControl, ItemsControl, ExternalComponent, Panel), so Scene.Native/Scene.Desktop are sibling positions rather than special cases. renderElement() walks a resolved tree bottom-up, delegating binding resolution (an ItemsControl's itemsSource) to an injected BindingResolver rather than solving it here -- the actual profile/contribution/layout/theme resolution engines are Scene#2 through #5, layered on top of this walk. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Implements Scene.Engine's Renderer contract against real React/DOM (SceneElementView + createReactRenderer), plus a small `core` component set (core:text, core:button, core:card) -- the minimum vocabulary Scene#3's package resolution always falls back to. An unresolved ExternalComponent renders a visibly broken placeholder rather than silently disappearing. Storybook is wired at the package level (aliased straight to scene.model/scene.engine source for a fast dev loop) with two stories covering a resolved tree and an unresolved component; `yarn build-storybook` succeeds end to end. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
Cratis.Scene.Model(C#) — the platform-agnostic Screen object model: theSceneElement → VisualElement → FrameworkElement → Control → Panel/ItemsControl/ContentControl/ExternalComponentelement hierarchy,Layout(flow and freeform arrangement per slot, width × height size classes),Form(the three population/mapping tiers), contribution points and navigation, andUiProfile/Theme. No React, DOM or CSS vocabulary anywhere in this project.@cratis/scene.model— the TypeScript mirror, hand-maintained and guarded by a real cross-language parity spec: a sharedscene-model-shape.jsonmanifest that both a C# spec (reflection over the assembly) and a TypeScript spec (walking each type's ownPropertyNamesconst) assert against independently, so a desync on either side fails its own build.@cratis/scene.engine— theRenderer<TOutput>contract a renderer implements (one method per concrete element kind), and arenderElement()tree walk. Binding resolution is injected via aBindingResolvercallback rather than solved here — the profile/contribution/layout/theme resolution engines are separate, later issues.@cratis/scene.react— implements the renderer contract against real React/DOM, with a smallcorecomponent set (core:text/button/card) and Storybook wired at the package level..ai/instruction corpus and its Copilot/Claude/Codex adapters, build/lint/format config, and CI workflows (dotnet + JS build, NuGet + npm trusted publishing, semver label gate) — copied fromCratis/Arc, the closest real dual-stack framework repo.Notes
StudioIssues#156), not here.dotnet build/dotnet testclean (Debug + Release, 0 warnings),yarn ciclean across all three JS packages,yarn build-storybooksucceeds, and the parity spec genuinely fails on both sides when deliberately desynced (verified, then reverted).(#1)