feat: embed full rhwp-studio editor via Deno workspace - #9
Merged
Conversation
Restructure OpenHWP from a read-only SVG viewer into a thin native shell around the full upstream rhwp-studio editor (menus, toolbar, tables, formatting, undo, open/save), mirroring golbin/hop's overlay approach but targeting deno-desktop (CEF) instead of Tauri. - Deno workspace: root deno.json with apps/desktop as the member. - apps/desktop: the deno-desktop shell — serves the built studio bundle over local HTTP, opens the window, installs a minimal native menu. File/Edit stay with the studio (File System Access needs the webview gesture a native menu can't carry). - apps/studio-host: builds the pristine upstream studio into dist/. vendor/rhwp-core is @rhwp/core@0.7.19 (wasm-bindgen pkg/), supplied as the @wasm alias so the Rust/wasm-pack step is skipped. - scripts/setup-rhwp.ts: materializes third_party/rhwp via a blob-filtered cone-sparse checkout (~80 MB, not the 1.1 GB monorepo), pinned in config/rhwp-studio-overrides.json. - scripts/build-studio.ts: supplies pkg/, disables the PWA service worker, drops sample docs, runs the upstream Vite build (base=/), restores the tree. - run-openhwp driver + SKILL rewritten to serve the studio bundle and gate on the editor booting (verified: boots to ready in headless Chrome). third_party/ and apps/studio-host/dist/ are gitignored (built via `deno task setup && deno task build:studio`). No source overrides yet — the web File System Access bridge works in CEF as-is.
Iteration 1 of the review-fix loop on PR #9 surfaced a broken CI and several robustness/correctness issues in the new tooling. CI (was red on PR #9): - ci.yml `check` ran `deno check main.ts` (root main.ts was deleted) → now `deno task check` (checks apps/desktop/main.ts via the workspace). - ci.yml `smoke` ran the driver with no bundle (dist is gitignored) → now sets up Node, runs `deno task setup` + `deno task build:studio` first. Stale "serve src/ui" comment corrected. Tooling robustness: - setup-rhwp.ts: force-checkout the pin when re-pinning so a build-dirtied worktree can't block it, and reconcile sparse paths on every run; validate the manifest (non-empty repo/tag, 40-char commit SHA, non-empty sparsePaths) before feeding it to git. - build-studio.ts: run `npm install` on every build (a re-pin no longer builds against stale node_modules); narrow the swallowed `Deno.remove` catches to NotFound; preserve the build error if config restore fails. - setup-rhwp.ts / build-studio.ts: resolve ROOT via `import.meta.dirname` instead of `URL.pathname` (the latter percent-encodes spaces in the path). Shell / driver: - main.ts: bind the UI server to 127.0.0.1 on an ephemeral port (Deno.serve defaults to 0.0.0.0:8000) and preflight the studio bundle, failing with the build command instead of opening a blank window. - driver.ts: bind to loopback; settle both cleanups independently so a browser.close() rejection can't mask a smoke failure or leak the port. Docs: README.md / README.en.md / CONTRIBUTING.md described the removed SVG-viewer layout ("no application code yet", `deno desktop main.ts`); updated the status, build/run commands, and the Node prerequisite. Verified: deno task check / lint / fmt --check pass; setup recovers a dirty checkout; build:studio rebuilds a SW-free dist; the driver boots the editor to ready in headless Chrome.
amondnet
marked this pull request as ready for review
July 24, 2026 01:41
Greptile SummaryIntroduces a Deno workspace that embeds the upstream rhwp-studio editor.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the follow-up review scope. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
M[upstream manifest] --> S[setup-rhwp sparse checkout]
S --> B[build-studio]
V[vendored rhwp core WASM] --> B
B --> D[studio-host dist]
D --> H[Deno desktop HTTP shell]
H --> W[CEF editor window]
Reviews (2): Last reviewed commit: "fix(setup): fetch the pinned commit befo..." | Re-trigger Greptile |
Greptile P1: the re-pin path force-checked-out the manifest commit without
fetching. The blob:none partial clone only holds history up to clone time, so
bumping the manifest to a newer upstream commit would fail ("commit not
available locally"). Fetch it (blobless) first; GitHub serves a tag-reachable
SHA directly, and an already-present commit fetches as a fast no-op.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Restructures OpenHWP from a read-only SVG viewer into a thin native shell around the full upstream rhwp-studio editor (menus, toolbar, tables, formatting, undo, open/save) — the foundation for Phase 2 편집/저장 (edit/save). This mirrors
golbin/hop's overlay approach, but targetsdeno desktop(CEF) instead of Tauri.Key finding that makes this small: openhwp runs the studio in a normal
http://127.0.0.1CEF context, so it uses upstream's webWasmBridge+ the File System Access API (showOpenFilePicker/showSaveFilePicker), which work in CEF as-is. So the unmodified upstream studio is already a working offline editor — zero source overrides needed in this phase.What changed
deno.jsonwithapps/desktopas the member.apps/desktop— the deno-desktop shell: serves the built studio bundle over local HTTP, opens the window, installs a minimal native menu (Reload / DevTools). File/Edit stay with the studio — File System Access pickers need the transient user activation a native-menu →executeJspath can't carry.apps/studio-host— builds the pristine upstream studio intodist/.vendor/rhwp-coreis@rhwp/core@0.7.19(the wasm-bindgenpkg/), supplied as the@wasmalias so the Rust/wasm-pack step is skipped (withPROVENANCE.json).scripts/setup-rhwp.ts— materializesthird_party/rhwpvia a blob-filtered cone-sparse checkout (~80 MB, not the 1.1 GB monorepo), pinned inconfig/rhwp-studio-overrides.json.scripts/build-studio.ts— suppliespkg/, disables the PWA service worker (guarded so a future upstream reformat fails loudly), drops sample docs, runs the upstream Vite build (--base=/), restores the tree.run-openhwpdriver + SKILL — rewritten to serve the studio bundle and gate on the editor booting (static shell + engine reaching ready, no page errors).third_party/andapps/studio-host/dist/are gitignored; build them withdeno task setup && deno task build:studio.Verification
deno task check/deno lint/deno fmt --check— all pass.run-openhwpdriver — PASS: the embedded editor boots to ready in headless Chrome (#sb-message→ `HWP 파일을 선택해주세요.`), full toolbar renders, no page errors.Later phases (not this PR): native menu ↔ studio dispatcher overrides, branding, HWPX-save gating,
deno desktop buildinstallers + submodule-aware CI.Related issue
N/A — Phase 1 of the edit/save restructure.
Checklist
deno test) — nodeno testsuite; therun-openhwpdriver is the smoke test (verified: editor boots)deno lint/deno fmt --check)Summary by cubic
Embeds the full upstream rhwp‑studio editor in a thin Deno desktop shell and adds tooling to build and run it offline. Also fixes CI and hardens the setup/build/driver so the editor reliably boots in both desktop and headless modes.
New Features
rhwp-studioserved byapps/desktopwith a minimal native menu (Reload/DevTools); File/Edit remain in‑web for the File System Access API.apps/desktop(shell) andapps/studio-host(builds studiodist/); vendored@rhwp/core@0.7.19supplied as the@wasmalias to skip Rust.scripts/setup-rhwp.ts(sparse, pinnedthird_party/rhwp) andscripts/build-studio.ts(copiespkg/, disables PWA SW, runs Vite). Driver serves the studio bundle, waits for ready, and writesscreenshots/studio.png.Bug Fixes
deno task checkand builds the studio (deno task setup && deno task build:studio) before the headless smoke test; adds Node for Vite.127.0.0.1on an ephemeral port and preflights the studio bundle; fails fast with the build command if missing.setup-rhwp.tsvalidates the manifest, fetches the pinned commit before re‑pinning, force‑checks out the pin, and reconciles sparse paths on every run.build-studio.tsrunsnpm installeach build, narrows NotFound catches, and preserves the original build error on restore. Docs updated with Node/npm build requirement.Written for commit d416d54. Summary will update on new commits.