feat(start): in-process mode (createServer, no jss spawn) — embeddable jspod#59
Closed
melvincarvalho wants to merge 1 commit into
Closed
feat(start): in-process mode (createServer, no jss spawn) — embeddable jspod#59melvincarvalho wants to merge 1 commit into
melvincarvalho wants to merge 1 commit into
Conversation
Adds `start({ inProcess: true })`: maps the same options to
javascript-solid-server's createServer() and listens in the current
process instead of spawning the `jss` binary. Lets jspod embed in
single-process runtimes (nodejs-mobile, Electron, tests) where forking
a CLI isn't possible, while still returning the same handle shape
(url/port/host/root/ready/exit/stop, plus the Fastify instance).
Post-readiness logic (seedPodFiles + bootstrap + open) is factored into
a shared afterReady() used by both paths, so the in-process pod gets the
same jspod onboarding pages.
Note: bootstrap still installs apps via git clone+push, which needs git
+ child-process spawning — unavailable in git-less runtimes (Android).
There the 'error' handler fires harmlessly and the embedder seeds apps
itself; a git-less install is a follow-up. Refs #58.
This was referenced May 24, 2026
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
Adds an in-process mode to the programmatic
start()API:start({ inProcess: true })runs JSS viajavascript-solid-server'screateServer().listen()in the current process instead of spawning thejssbinary.This lets jspod embed in single-process runtimes — nodejs-mobile (the Android app, js-pod/android), Electron, tests — where forking a CLI binary isn't possible. Today the Android app bypasses jspod entirely and calls
createServerdirectly, losing jspod's onboarding/bundling and drifting off jspod's JSS version; with this it can use jspod as the wrapper.Closes #58.
What it does
jssCLI args to acreateServeroptions object (root, port, host, conneg, notifications, git, mashlibModule, idp/public, singleUser/singleUserPassword, provisionKeys, idpIssuer).TOKEN_SECRETin env (JSS reads it there) and listens.{ url, port, host, root, ready, exit, stop }— plusinProcess: trueandserver(the Fastify instance) for advanced embedders.seedPodFiles+ bootstrap + open) into a sharedafterReady()used by both paths, so the in-process pod still gets jspod's seeded welcome/signin/account pages.idpIssueris passed with a trailing slash so it matches JSS's discovery-doc issuer (RFC 9207 / strict solid-oidc clients).Tested (this machine, no spawn)
inProcess: true.GET /200,/.well-known/openid-configuration200 (issuerhttp://localhost:PORT/),/idp200.seedPodFilesran (GET /body grew from the bare-JSS index to jspod's welcome page).stop()closes cleanly.Known follow-up (not in this PR)
Bootstrap installs apps via
git clone+ push to the pod's git-receive endpoint. That needs agitbinary and child-process spawning — unavailable in git-less single-process runtimes (nodejs-mobile). There the bootstrap'serrorhandler fires harmlessly and the embedder seeds apps its own way (the Android app uses a jsDelivr fetch). A git-less install path (fetch files + write/PUT) is the natural next step so embedders inherit jspod's bundling too.Notes
issue-56-programmatic-api(this stacks on the programmaticstart()API; that branch isn't ongh-pagesyet).