Repository navigation
DISCO-154: Add SDK Preview Command - #444
Draft
Philipp Koytek (philippkoytek) wants to merge 7 commits into
Draft
Philipp Koytek (philippkoytek) wants to merge 7 commits into
Philipp Koytek (philippkoytek) wants to merge 7 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
…ine-scripts The preview now blocks inline scripts by default, like published apps, and warns about each one with a hint to pass --allow-inline-scripts. Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com> Includes-AI-Code: true
|
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.




Description
Adds
content-cli sdk preview [--target http://localhost:4200] [--port 4300], a long-running local HTTPS proxy that serves a custom app's dev server to the Codespace Local preview (https://localhost:4300). Developers no longer configure HTTPS, CORS or a CSP meta tag on their own dev server, and the preview blocks what the published app blocks.preview-proxy.ts, Node built-ins only): listens onlocalhostonly and forwards every request and WebSocket upgrade to--target. It strips the target's CSP, report-only CSP,X-Frame-Optionsand CORS headers, then sets the local preview headers. When the target is down it answers 502 with a readable message, logs one warning, and recovers when the target is back. A busy port gives a clear error.preview-headers.ts): a verbatim copy oflocalPreviewHeaders()from ems-frontend (libs/common/fragments/sandbox/src/lib/policy.ts). That is the fragment gateway's sandbox policy with'self'sources andframe-ancestors https://*.celonis.cloud http://localhost:*. A spec in ems-frontend pins the object and fails when the gateway policy drifts.preview-inline-scripts.ts): dev servers inject inline scripts the published build doesn't have (React Fast Refresh's preamble). For HTML responses the proxy adds'sha256-…'hashes of each inline script toscript-src, computed the way browsers parse them, and warns once per script that it only works locally.preview-certificate.ts): a self-signedlocalhostcertificate (EC P-256; SANslocalhost,127.0.0.1,::1) fromselfsigned@5.5.0, the one new dependency. It is stored in~/.celonis-content-cli-preview, reused, and regenerated when missing, corrupt or expiring. The system trust store is never touched.sdk-preview.service.ts,module.ts): beta, needs no profile, validates--target(an http(s) origin) and--port, prints the URL and what to do about the certificate, and stops on Ctrl+C. Docs are indocs/user-guide/sdk-commands.mdanddocs/command-graph.html.Hot reload stays blocked (
connect-src 'none') on purpose, to match production; developers reload the preview instead.Relevant links
localPreviewHeaders()): https://github.com/celonis/ems-frontend/pull/75030Screen.Recording.2026-10-27.at.17.43.54.mov
Checklist
Co-Authored-By: Claude noreply@anthropic.com
Includes-AI-Code: true