Stone.jsDocs
Paradigm

Adapters

Adapters

An adapter is a context: it captures a platform's cause, normalises it into an intention, and emits the result as a native effect. This section documents each first-party adapter A to Z. Adding one is always the same move, a decorator or a blueprint, and your domain never changes.

#The shared pattern

Every adapter is enabled the same way: install the package, add its decorator to the manifest (or its blueprint imperatively), and deploy. Adapters stack, so several can coexist and the collapse to one happens at runtime.

Install, decorate, deploy. The domain you wrote is already every one of these targets.

#The catalog

AdapterTypeDescription
@stone-js/node-http-adapter@NodeHttpA production HTTP server on Node.
@stone-js/node-cli-adapter@NodeConsoleYour handlers as CLI commands.
@stone-js/fetch-adapter@FetchOne Web-standard adapter: Cloudflare, Deno, Bun, Vercel, Netlify.
@stone-js/aws-lambda-http-adapter@AwsLambdaHttpHTTP events from API Gateway / Lambda.
@stone-js/aws-lambda-adapter@AwsLambdaGeneric (non-HTTP) Lambda invocations.
@stone-js/browser-adapter@BrowserRun in the browser (SPA, hydration).
MobilecomingReact Native / Expo, planned.

#Choosing and stacking

Pick the adapter for where you deploy; stack several to keep the choice open until runtime. The pages that follow cover each one's install, decorator and blueprint, configuration keys, platform specifics and deployment.

#How the adapter is selected

When several adapters are stacked, Stone.js resolves exactly one at run time, when the app runs, not when you build or deploy. The order is:

  1. the current adapter, if an adapterAlias names one (set per environment, so a platform can pin its own);
  2. otherwise the adapter marked default: true;
  3. otherwise the single adapter present.

So the same artifact, with Node and Lambda stacked, collapses onto Node when you run it locally and onto Lambda when it runs there, decided freshly at run time on each host.


Stone.js

Your app exists in every runtime. Until you run it.

An open-source project by Stone Foundation
Created by Mr. Stone (Evens Pierre)