Repository navigation
chore(core): refactor shared modules and platform abstraction for dual-target architecture - #4
Merged
Conversation
…webview environments
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.
🚀 Pull Request Notes: 2026-11-18
Judul PR / PR Title:
chore(core): refactor shared modules and platform abstraction for dual-target architecture🎯 Ringkasan Perubahan Utama (Summary)
PR ini merestrukturisasi arsitektur basis kode XHTML Reader Previewer menjadi Model Dual-Target (Layered Architecture) sebagai fondasi utama adaptasi menuju Antigravity 2.0 Plugin tanpa merusak fungsionalitas ekstensi VS Code yang ada. Seluruh logika inti pembaca buku (parser EPUB, dekompresi/cache ZIP, pembersihan XHTML, generator antarmuka reader, dan state management) dipisahkan ke dalam modul bersama (
src/core/) yang 100% bebas dari dependensi runtime VS Code API (vscode). Sementara itu, kode spesifik editor dipindahkan ke lapisan adapter (src/vscode/extension.ts).✨ Fitur Baru & Pembaruan (Features & Updates)
src/core/:archive.ts,epub.ts,xhtml.ts,reader-shell.ts, danstate-manager.tske dalamsrc/core/.vscodepada lapisan core, menggantikannya dengan abstraksi generikResourceUri.locateEpubContainer) menggunakannode:fs/promisesstandar dengan dukungan custom file checker.StateStorageAdapter(berbasisMementoLike) padasrc/core/state-manager.ts.InMemoryStorageAdapterdanJsonFileStorageAdapteruntuk kebutuhan runtime mandiri (Antigravity Sidecar / CLI) tanpa bergantung padavscode.workspaceState.src/core/reader-shell.tsagar mendukung komunikasi dua arah baik di lingkungan VS Code Webview (acquireVsCodeApi()) maupun di lingkungan browser mandiri / Antigravity Auxiliary Pane (fetch('/api/message')danwindow.parent.postMessage).src/vscode/:extension.tskesrc/vscode/extension.tsdengan adapter konversi URI (asVsCodeUri) untuk menjembatani tipe CoreResourceUridenganvscode.Uri.📦 Maintenance & Build Configuration
tsconfig.core.json:src/core/dengantypes: ["node"]untuk memverifikasi secara ketat bahwa lapisan core dapat dikompilasi secara independen tanpa@types/vscode.npm run check:corepadapackage.json.test/reader-shell.test.mjsuntuk memverifikasi polyfill messaging dual-mode.package.jsonagar mengarah ke lokasi baru.Catatan Reviewer / Dev Notes:
npm run check(0 errors),npm run check:core(0 errors), build esbuild sukses, dan 33 unit tests pass.chore/017-refactor-core-and-platform-abstractionsiap di-squash merge kemain.