mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 20:32:12 +00:00
Resolves the longstanding `// TODO Refactor remove editor.` Drops the Editor import; constructor takes a SaveManagerDeps surface inline-built by Editor (Phase 2 idiom — same shape as CameraControllerDeps, GizmoControllerDeps, etc.). Deps surface (10 fields, single-purpose): - getVersion / setVersion — engine version (load may upgrade) - getActiveScene — proxy serialization target - getRenderer — for save thumbnail - removeTransformControls — pre-save cleanup - getCamera / refreshCamObj / changeRenderCameraAspectRatio — camera - setPositivePrompt — restore prompt on load - saveSceneState / loadSceneState — backend API current_scene_media_token moves into SaveManager as private state (only the load path used it; nothing outside SaveManager read it). The field on Editor is dropped along with the two `= null` writes in the constructor and initialize. CameraController gains refreshCamObj(scene) — re-anchors cam_obj to the named entity in the scene + sets layers. Replaces the inline post-load setup that SaveManager used to do directly. Editor.initialize also routes through the same method now (was inline at line ~410).
Frontend
This is an nx monorepo that can contain multiple apps and shared libraries.
All commands to run these projects are performed from this directory.
Install dependencies
npm install
Editor2d
Run dev server:
nx dev editor2d
artcraft
Run dev server:
nx dev artcraft
call when starting on main or a new branch:
./clean_modules
The names for @frontend and @storyteller come from the package.json file in the libs folder.
import { Login } from "@frontend/login";
import { api } from "@storyteller/api";
For shared UI components, import from @storyteller/ui-[componentname].
import { Button } from "@storyteller/ui-button";
import { Modal } from "@storyteller/ui-modal";
building:
npx nx build artcraft
npx nx build editor2d
dev:
npx nx dev artcraft
npx nx dev editor2d
# component build
1.
npx nx g @nx/react:library libs/components/toaster --import-path=@storyteller/ui-toaster --bundler=vite
npm install
2.import it first in code
3.nx sync
4.nx build
or
# frontend build
in frontend folder
% nx build -project type
% nx build artcraft
% nx dev artcraft