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-56-programmatic-api
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 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
Loading