mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
src/next is src (the main export), src/next-node is src/node with short subpaths (/http, /workers, /plugins, /plugins/runtime, /app, /surfaces, /web, /react, /tui, /tui/launcher); the foundations get /json and /watch; Chord v1 moves to src/old (/old, /old/node) until p2 runs on v2; tests and docs move likewise (test/, docs/, test/old, docs/old). Durable and env import the foundations from their subpaths.
8 lines
423 B
TypeScript
8 lines
423 B
TypeScript
// Another single-file plugin: a line naming the server, through the server's module of the API.
|
|
|
|
import { constant, defineFacet, local, str } from "@acme/app/v3";
|
|
import { serverName } from "@acme/app/v3/server";
|
|
|
|
const Clock = local("example.clock", { version: 1, params: {}, members: { text: str() } });
|
|
|
|
export default defineFacet((host) => host.serve(Clock, () => ({ text: constant(`ticking on ${serverName()}`) })));
|