Refactoring: one file per node, consistent comments, shared helpers, split large modules
- Graph: nodes.ts split into nodes/<category>/<Type>.ts (62 files) with shared.ts factories and index.ts registry; NodeContext/values/NodeRegistry separated, writeTyped() replaces duplicated typed writes - Comments: one style (JSDoc on non-obvious exports, // for decisions and traps), wrong/stale comments fixed or removed, ids.ts now real 10 base-36 chars - Core: chainOf, shared worldPosition/editorPosition core, commands/require.ts, commands/naming.ts, util/list.ts, setBagValue/toPosition/propDef; dead code removed (isBehaviorAsset, SCENE_OBJECT_SCHEMA, CommandStack.subscribe, Input.axis, setMode, titleText, World.worldPosition, unused ctor params) - Editor: Inspector split into inspector/ sections, App.ts into Editor.ts + debugHook.ts + shortcuts.ts, Viewport into items.ts + symbols.ts, shared "Add collider" action, unified type labels/swatches - UI toolkit: Widget.trackHover/onPointerRelease, drawControlBox, math helpers, Popup.openBelow, Menu/Dialog/ColorPicker/ListRow in own files, named Theme sizes - Tools: seed-demo/smoke-demo and demo-check project removed, tools/lib (harness, projects, builders), e2e.mjs as runner over tools/e2e/*.mjs sections - Tests: tests/helpers.ts replaces copied fixtures and NodeContext doubles Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
3234eb480f
commit
1eb28314cf
189 files changed
+6231
-5543
No files matched your search
@@ -0,0 +1,95 @@
|
||||
import { type NodeDef, registerNode } from '../NodeRegistry';
|
||||
import { Destroy } from './action/Destroy';
|
||||
import { Log } from './action/Log';
|
||||
import { Move } from './action/Move';
|
||||
import { RestartGame } from './action/RestartGame';
|
||||
import { SetEnabled } from './action/SetEnabled';
|
||||
import { SetPosition } from './action/SetPosition';
|
||||
import { SetProperty } from './action/SetProperty';
|
||||
import { SetText } from './action/SetText';
|
||||
import { Spawn } from './action/Spawn';
|
||||
import { StopGame } from './action/StopGame';
|
||||
import { Abs } from './data/Abs';
|
||||
import { Add } from './data/Add';
|
||||
import { And } from './data/And';
|
||||
import { AxisInput } from './data/AxisInput';
|
||||
import { BooleanLiteral } from './data/Boolean';
|
||||
import { Ceil } from './data/Ceil';
|
||||
import { Clamp } from './data/Clamp';
|
||||
import { Compare } from './data/Compare';
|
||||
import { Distance } from './data/Distance';
|
||||
import { Divide } from './data/Divide';
|
||||
import { Equals } from './data/Equals';
|
||||
import { Floor } from './data/Floor';
|
||||
import { GetPosition } from './data/GetPosition';
|
||||
import { GetProperty } from './data/GetProperty';
|
||||
import { IsAsset } from './data/IsAsset';
|
||||
import { IsEnabled } from './data/IsEnabled';
|
||||
import { IsHovered } from './data/IsHovered';
|
||||
import { IsTouching } from './data/IsTouching';
|
||||
import { Join } from './data/Join';
|
||||
import { KeyIsDown } from './data/KeyIsDown';
|
||||
import { Length } from './data/Length';
|
||||
import { Max } from './data/Max';
|
||||
import { Min } from './data/Min';
|
||||
import { Modulo } from './data/Modulo';
|
||||
import { MouseButton } from './data/MouseButton';
|
||||
import { MousePosition } from './data/MousePosition';
|
||||
import { Multiply } from './data/Multiply';
|
||||
import { NameOf } from './data/NameOf';
|
||||
import { Normalize } from './data/Normalize';
|
||||
import { Not } from './data/Not';
|
||||
import { NumberLiteral } from './data/Number';
|
||||
import { ObjectByName } from './data/ObjectByName';
|
||||
import { Or } from './data/Or';
|
||||
import { Owner } from './data/Owner';
|
||||
import { Parent } from './data/Parent';
|
||||
import { Random } from './data/Random';
|
||||
import { Round } from './data/Round';
|
||||
import { Self } from './data/Self';
|
||||
import { Sqrt } from './data/Sqrt';
|
||||
import { StringLiteral } from './data/String';
|
||||
import { Subtract } from './data/Subtract';
|
||||
import { Time } from './data/Time';
|
||||
import { ToText } from './data/ToText';
|
||||
import { OnClick } from './events/OnClick';
|
||||
import { OnCollisionEnter } from './events/OnCollisionEnter';
|
||||
import { OnCollisionExit } from './events/OnCollisionExit';
|
||||
import { OnCollisionStay } from './events/OnCollisionStay';
|
||||
import { OnKeyDown } from './events/OnKeyDown';
|
||||
import { OnKeyHeld } from './events/OnKeyHeld';
|
||||
import { OnKeyUp } from './events/OnKeyUp';
|
||||
import { OnStart } from './events/OnStart';
|
||||
import { OnTimer } from './events/OnTimer';
|
||||
import { OnUpdate } from './events/OnUpdate';
|
||||
import { Branch } from './flow/Branch';
|
||||
import { Sequence } from './flow/Sequence';
|
||||
import { GetVariable } from './variable/GetVariable';
|
||||
import { SetVariable } from './variable/SetVariable';
|
||||
|
||||
/**
|
||||
* The built-in node set, one definition per file. Importing this module registers them;
|
||||
* the palette sorts by category and label, so the order here is documentation only.
|
||||
*/
|
||||
export const BUILT_IN_NODES: readonly NodeDef[] = [
|
||||
// events
|
||||
OnStart, OnUpdate, OnKeyDown, OnKeyUp, OnKeyHeld, OnTimer,
|
||||
OnCollisionEnter, OnCollisionStay, OnCollisionExit, OnClick,
|
||||
// flow
|
||||
Branch, Sequence,
|
||||
// variables
|
||||
GetVariable, SetVariable,
|
||||
// data: references and properties
|
||||
Self, Owner, Parent, ObjectByName, NameOf, IsAsset, IsEnabled, GetProperty, GetPosition,
|
||||
// data: literals and math
|
||||
NumberLiteral, BooleanLiteral, StringLiteral,
|
||||
Add, Subtract, Multiply, Divide, Min, Max, Abs, Sqrt, Clamp, Floor, Ceil, Round, Modulo, Random, Time,
|
||||
// data: text and comparison
|
||||
ToText, Join, Equals, Compare, And, Or, Not,
|
||||
// data: vectors and input
|
||||
Length, Distance, Normalize, AxisInput, KeyIsDown, MousePosition, MouseButton, IsHovered, IsTouching,
|
||||
// actions
|
||||
Move, SetPosition, SetProperty, SetEnabled, SetText, Spawn, Destroy, Log, StopGame, RestartGame,
|
||||
];
|
||||
|
||||
for (const def of BUILT_IN_NODES) registerNode(def);
|
||||
Reference in new issue
Block a user