Commit f3e174c
refactor(shell): extract @etherpad/shell + Platform injection seam (Phase 2a) (#32)
* docs(plan): add phase-2a shell-extract implementation plan
Plan for Phase 2a of the mobile rollout: move renderer + shared code into
a new @etherpad/shell workspace package and introduce a Platform injection
seam (setPlatform/getPlatform). The abstract Platform sub-interfaces
(storage/padView/events) from spec §4 are intentionally deferred to
Phase 2b once mobile is a real consumer driving the shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(shell): scaffold empty @etherpad/shell workspace package
* refactor(shell): move src/shared into packages/shell/src
* refactor(shell): move renderer code into packages/shell/src
* feat(shell): introduce Platform seam + wire Electron adapter
Move ipc/api.ts to platform/ipc.ts. Rename the internal RuntimeApi to the
public Platform interface and add setPlatform()/getPlatform()/
__resetPlatformForTests(). Desktop's renderer index.tsx now calls
setPlatform(createElectronPlatform()) before mounting App, decoupling
shell from window.etherpadDesktop.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(shell): move renderer tests into packages/shell/tests
Set up shell's own jsdom vitest project with a buildMockPlatform() helper
in tests/setup.ts. Install a compatibility shim that routes legacy
`window.etherpadDesktop = {...}` mutations through setPlatform() so the
existing test code continues to work unchanged.
Drop the renderer project from desktop vitest config — desktop only runs
the main project now. tsconfig.tests.json widened to include the new
spec files. Fixed pre-existing latent type errors in 4 tests that vitest
was silently tolerating (JSX.Element → React.JSX.Element, Settings
literal missing fields).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(workspace): make root pnpm scripts recurse across packages
typecheck/test/lint now run across both @etherpad/shell and @etherpad/desktop
via `pnpm -r --workspace-concurrency=1 <script>`. Adds shell's eslint
config + devDeps so the new package participates in CI lint.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: refresh CLAUDE.md, AGENTS.md, README for @etherpad/shell
Root CLAUDE.md monorepo section lists both packages now. Desktop's
AGENTS.md drops the dead `src/renderer/` / `src/shared/` paths and
points at packages/shell for shell-side code. New
packages/shell/AGENTS.md gives the package its own orientation doc.
Root README lists shell in the package table.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(shell): move E2E seam into desktop entry point
App.tsx no longer reads window.etherpadDesktop.e2eFlags. Shell now exports
a pure attachE2EHelpers(target) function and desktop's renderer/index.tsx
invokes it conditionally when the preload reports e2eFlags.enabled. Shell
src/ is now fully decoupled from runtime-specific globals.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3bd8aeb commit f3e174c
92 files changed
Lines changed: 1931 additions & 183 deletions
File tree
- docs/superpowers/plans
- packages
- desktop
- src
- preload
- renderer
- tests/renderer
- shell
- src
- components
- dialogs
- i18n
- ipc
- locales
- platform
- rail
- sidebar
- state
- styles
- tabs
- types
- validation
- tests
- components
- dialogs
- i18n
- rail
- sidebar
- state
- tabs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | | - | |
| 57 | + | |
53 | 58 | | |
54 | | - | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | | - | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments