Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JavaScriptSolidServer/jspod
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: gh-pages
Choose a base ref
...
head repository: JavaScriptSolidServer/jspod
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: issue-58-inprocess-start
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on May 23, 2026

  1. Add programmatic start() API alongside CLI (#56)

    Split jspod into:
    
    - lib/start.js — exports start(options) returning a handle
      { url, port, host, root, ready, exit, stop }. Pod-startup logic,
      no process.exit, no banner, no signal handlers.
    - lib/index.js — barrel export ({ start, formatUrl }).
    - index.js — thin CLI shell. argv parsing, banner, install subcommand,
      SIGINT/SIGTERM handlers that call handle.stop() then process.exit.
      Behaviour identical to pre-refactor CLI.
    
    package.json gets main + exports map pointing at lib/index.js, so
    `import { start } from 'jspod'` works for host programs (e.g.
    solid-desktop) that want to embed jspod in-process instead of
    spawning the CLI as a child.
    
    Smoke-tested both surfaces:
    - CLI: node index.js --port 5455 --no-bootstrap → ready, served GET /,
      SIGINT → clean SIGTERM to JSS → exit 0.
    - API: start({ port, root, open:false, bootstrap:false }) → ready
      resolves true, fetch returns 200, stop() returns {code:0,signal:null}
      and is idempotent.
    - Bare-specifier import via `file:` install → imports 'jspod' and gets
      { start, formatUrl } as expected.
    melvincarvalho committed May 23, 2026
    Configuration menu
    Copy the full SHA
    a27ae7d View commit details
    Browse the repository at this point in the history

Commits on May 24, 2026

  1. feat(start): in-process mode — run JSS via createServer, no jss spawn

    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.
    melvincarvalho committed May 24, 2026
    Configuration menu
    Copy the full SHA
    288dd00 View commit details
    Browse the repository at this point in the history
Loading