-
Notifications
You must be signed in to change notification settings - Fork 44
feat: add Spectacle integration for TLA+ specifications #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Y <git@younes.io>
|
/cc @will62794 ^^ |
|
There are two binary files (fonts) in this PR. Could you please specify the license for these fonts? Are these under permissive licenses? |
|
Given the existence of |
| ); | ||
| } | ||
|
|
||
| const routerOriginal = ' // m.mount(root, App)\n m.route(root, "/home",\n {\n "/home": App,\n "/eval_debug_graph": EvalDebugGraph,\n });'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this replacement robust against upstream Spectacle changing the value of routeOriginal?
| fs.writeFileSync(stylePath, style); | ||
| } | ||
|
|
||
| function patchAppJs(destDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These patches are hard to read. Have you considered generating .diff files that fetch-spectacle.js could apply using the patch tool (this is how Debian et al. .debs modify upstream packages)? That approach would improve robustness and provide proper error reporting.
|
Zooming out from the question of how to patch |
| fs.writeFileSync(appPath, code); | ||
| } | ||
|
|
||
| function patchEvalJs(destDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patching Spectacle's evaluator to support TLC!Assert should instead be done in dedicated upstream PR.
Related to #441
tlaSpectacle.opencommand and a CSP-safe webview that injects the active editor’s spec into the bundled UI while staying fully offline.tools/fetch-spectacle.js, a deterministic bundling script that clones Spectacle, whitelists essential assets, vendors JetBrains Mono & Source Code Pro fonts, strips analytics/external fonts, rewrites worker/resource paths, injects a history guard plus router-disable flag, implements TLCAssert, and emits a SHA256 manifest so reruns reproduce the bundle exactly.buildSpectacleHtmland Playwright smoke tests that serve the bundle over an internal HTTP server, stubacquireVsCodeApi, verify Spectacle renders, and run a PlusCal trace (squares.tla) to prove the injectedAssertworks.Key Decisions
history.replaceState/pushState, so Spectacle now guards those calls and can run with a router-disable mode.