Adds apps/editor/lib/bootstrap.ts that calls loadPlugin(builtinPlugin) as a module-side-effect on first import. Imported from scene-loader.tsx so it runs on the client side where the editor mounts. Idempotency guard handles HMR re-execution (would otherwise throw on duplicate registerNode). For the empty plugin this commit, the entire call is a no-op — included now so future commits that add real node kinds only need to push them onto builtinPlugin.nodes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
18 lines
606 B
TypeScript
18 lines
606 B
TypeScript
import { loadPlugin } from '@pascal-app/core'
|
|
import { builtinPlugin } from '@pascal-app/nodes'
|
|
|
|
// Idempotency guard: HMR can reload this module, but `registerNode` throws on
|
|
// duplicate kinds. The flag lives in the module closure so it's reset on a
|
|
// hard reload but survives within a session.
|
|
let loaded = false
|
|
|
|
export function loadBuiltinNodes(): void {
|
|
if (loaded) return
|
|
loaded = true
|
|
void loadPlugin(builtinPlugin)
|
|
}
|
|
|
|
// Run as a side effect on first import so any consumer of this module gets a
|
|
// populated registry without remembering to call the function explicitly.
|
|
loadBuiltinNodes()
|