Skip to content

Commit 6f5ae4d

Browse files
lir-navcoolir-navcoo
authored andcommitted
docs: Phase D.I7b.17 close-out (HANDOVER + engine + README)
Updates per docs-update-procedure: - HANDOVER.md: status line bumped (HEAD 7254273, 963 tests, engine 2.3.0); ali-mirror status now reads D.I7b.1-17 complete. - engine.md: version 2.2.0 -> 2.3.0; init() description updated to mention options.theme application; InitOptions example shows the theme: 'dark' field; init.test.ts test count 7 -> 9. - README.md: 961 -> 963 tests. Memory file sapu-lowcode-engine-status.md + MEMORY.md index were updated separately in the same session (see feedback-update-memory-after-changes).
1 parent 7254273 commit 6f5ae4d

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

docs/HANDOVER.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
## TL;DR
66

77
- **仓库**: https://github.com/lir-navcoo/lowcode-engine
8-
- **当前分支**: `main` @ `1664e9f` (干净,已推 origin)
8+
- **当前分支**: `main` @ `7254273` (干净,已推 origin)
99
- **下次发布**: **2.2.0**,代码 + 测试 + 构建全部就绪,**但 npm publish 阻塞**(见下)
10-
- **测试**: 961 unit passed + 1 skipped (vitest 2.1, happy-dom) + 11 e2e (Playwright 1.60)
10+
- **测试**: 963 unit passed + 1 skipped (vitest 2.1, happy-dom) + 11 e2e (Playwright 1.60)
1111
- **Demo polish** (commit `5b3f2b1`): StatusBar (live engine state via createPortal), theme toggle (`setTheme` / `onThemeChange`), locale toggle (`engine.i18n.setLocale` + 10 registered keys), 4-preset schema picker. `yarn demo:build` 522KB / 156KB gzipped, 899ms.
1212
- **类型检查**: 0 errors (14 包 + demo)
13-
- **包版本**: 14 个 `@monbolc/*` 包 — designer 2.28.0 (D + D.I7b.1-15), editor-skeleton 2.4.0 (D.I7b.4), plugin-setters 2.3.0 (D.I7b.16), types 2.3.0 (D.I2), others 2.2.0
13+
- **包版本**: 14 个 `@monbolc/*` 包 — designer 2.28.0 (D + D.I7b.1-15), editor-skeleton 2.4.0 (D.I7b.4), plugin-setters 2.3.0 (D.I7b.16), engine 2.3.0 (D.I7b.17), types 2.3.0 (D.I2), others 2.2.0
1414
- **Post-v2.4 features** (代码已就绪, 都在 main 上): Dragon P1–P10 重构(ali-faithful) + P11 outline delete + P12 engine.commands + P14 键盘快捷键 + P15 plugin-authoring docs。详情见 `memory/sapu-lowcode-engine-status.md` 的 "Dragon refactor + P11–P18 follow-ups" 段。
1515
- **ali-mirror 计划**: Phase A + B + C.X + C.Y + C.Z + C.AA + C.AB + C.AC + C.AD + C.AE + D (10 commits, 5000+ LoC) + D.I7b.1-15 (designer) + D.I7b.16 (plugin-setters unregisterSetter) 全部完成。**Phase D + D.I7b.1-15 收官(designer);Phase D + D.I7b.16 收官(plugin-setters)**。Phase E (asset pipeline + icon font + iframe-mode simulator) 仍待办。详见 `~/.claude/plans/dynamic-marinating-rabbit.md``docs/ROADMAP.md`
1616

@@ -158,7 +158,7 @@ yarn install
158158
# 构建 (14 个包)
159159
yarn build
160160

161-
# 测试 (vitest, 961 unit; playwright, 11 e2e)
161+
# 测试 (vitest, 963 unit; playwright, 11 e2e)
162162
yarn test
163163
yarn test:e2e
164164

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SapuLowcodeEngine Documentation
22

3-
> **From-scratch rewrite** of `alibaba/lowcode-engine` v1.3.2 under the `@monbolc` npm scope. 14 packages, L0–L7 complete, 961 tests passing, zero `@alilc`/`@alifd`/`@supu` references in source.
3+
> **From-scratch rewrite** of `alibaba/lowcode-engine` v1.3.2 under the `@monbolc` npm scope. 14 packages, L0–L7 complete, 963 tests passing, zero `@alilc`/`@alifd`/`@supu` references in source.
44
55
## Index
66

@@ -41,7 +41,7 @@ This folder is the **primary source of truth for sapu-lowcode-engine**. Memory f
4141
- **React version**: 19.2.7 (peerDependency, optional; only L3+)
4242
- **TypeScript**: 5.4
4343
- **Build**: `tsc -p tsconfig.json` (CJS) + `tsc -p tsconfig.esm.json && node ../../scripts/add-js-extensions.mjs es` (ESM with `.js` extensions)
44-
- **Test**: `yarn test` (vitest 2.1, happy-dom, @testing-library/react 16) — **961 tests / 85 files, 0 failures**
44+
- **Test**: `yarn test` (vitest 2.1, happy-dom, @testing-library/react 16) — **963 tests / 85 files, 0 failures**
4545
- **Typecheck**: `yarn typecheck`**0 errors** across all 14 packages + demo
4646
- **Reference upstream** (for context, not active development): `../ali-lowcode-engine/`
4747

docs/packages/engine.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `@monbolc/lowcode-engine` (L7)
22

3-
> **Version**: 2.2.0 · **28 tests / 4 files** · **~430 LoC** (vs upstream `engine` package ~1,330 — **~68% smaller**)
3+
> **Version**: 2.3.0 · **30 tests / 4 files** · **~440 LoC** (vs upstream `engine` package ~1,330 — **~67% smaller**)
44
>
55
> The composition root. The ONE package a host installs to get a working visual editor. Sapu stance: **one `init()` call, not a chain of `register` calls**.
66
@@ -14,7 +14,7 @@ The engine package does NOT introduce new functionality — it composes what L0
1414

1515
| Export | Lines | Purpose |
1616
|---|---:|---|
17-
| `init(container, options)` | ~80 | Async composition root. Sets up the React runtime, builds the engine, registers the preset, mounts the project, returns the live `ISapuEngine`. |
17+
| `init(container, options)` | ~85 | Async composition root. Sets up the React runtime, builds the engine, registers the preset, mounts the project, applies the host's `options.theme` on boot (D.I7b.17), returns the live `ISapuEngine`. |
1818
| `destroy(engine)` | ~10 | Tears down an engine + clears the host element. |
1919
| `detectLocale()` | ~5 | Browser-default locale detection (`zh-CN` / `en-US`). |
2020
| `createDefaultPlugins()` | ~50 | Returns the 3 built-in plugins (`@sapu/builtin-outline-pane`, `@sapu/builtin-settings-panel`, `@sapu/builtin-setters`). |
@@ -32,6 +32,7 @@ const engine = await init('#app', {
3232
components: { Page, Header, /* ... */ },
3333
preset: createDefaultPreset({ theme: 'dark' }),
3434
locale: 'en-US',
35+
theme: 'dark', // D.I7b.17: applied on boot (defaults to preset.theme if omitted)
3536
});
3637

3738
const project = engine.getProject();
@@ -104,7 +105,7 @@ The `locale` flows into `engine.i18n.setLocale()`; the `theme` is stored for `ge
104105

105106
| File | Tests | Covers |
106107
|---|---:|---|
107-
| `init.test.ts` | 7 | init returns engine, throws on missing container, throws on null container, engineReady fired, destroy tears down, detectLocale for non-English and English browsers |
108+
| `init.test.ts` | 9 | init returns engine, throws on missing container, throws on null container, engineReady fired, destroy tears down, detectLocale for non-English and English browsers, init({theme:'dark'}) applies the dark theme on boot (D.I7b.17), init({}) defaults to preset theme |
108109
| `preset.test.ts` | 11 | 3-unique-plugins, idempotent init, default preset shape, override merge, partial override, initial theme light, setTheme updates data attribute, setTheme notifies, setTheme same-name no-op, unsubscribe, throw on unknown name |
109110

110111
Total: **18 tests / 2 files / 100% pass**.

0 commit comments

Comments
 (0)