Skip to content

Examples

Andrew R. edited this page Jul 24, 2026 · 1 revision

Examples

ShamooTS contains 13 example directories. They are authoritative demonstrations of individual contracts, but each README states whether the example is directly deployable or requires explicit host wiring.

Example What it demonstrates Deployment note
commands Paper /shamoo-ping and /shamoo-greet with data-only PaperCommandContext Direct command context works; parameter decorators and the full pipeline are separate
complete-paper-plugin Lifecycle, generated Paper event, command, scheduled declaration Zero-constructor component; task delay is currently ignored; generated live event methods are not supplied by the data-only adapter
complete-velocity-plugin Velocity lifecycle, generated events, and command Zero-constructor component and zero-argument entrypoint hooks are required by the bundled adapter
configuration Validated ConfigSource/ConfigDecoder loaded during lifecycle In-memory source; no automatic file loader, reload, or ConfigValue injection
cross-plugin-services Versioned service contract, stable proxy, generation-aware replacement Executable in one process; deployed host facade does not expose service acquisition yet
custom-events Versioned custom events and bounded validating JSON codec In-process event bus; host-backed compiler event metadata is not automatically wired
dual-platform-plugin Common code with separate Paper and Velocity entrypoints/bundles Keep platform imports behind the matching entrypoint
economy Deployable Paper commands, validated in-memory ledger, safe item selling Balances are memory-only and reset on replacement/restart
folia Region-owned and entity-owned scheduler helpers Requires a host-supplied PaperScheduler; no scheduler DI token is currently published
hello-world Minimal deployable Paper lifecycle and entrypoint Best minimal repository example; configure the Runtime watched root before deploy/dev
hot-reload Generation replacement, draining, stable service proxy Models replacement, not in-place module hot reload or automatic state preservation
proxy-routing Typed bounded Paper-to-Velocity wire round trip Requires explicit public host implementations; does not read undocumented globals
testing Deterministic platform descriptor, DI container, lifecycle executor Contract test only; @shamoo/testing is not a server simulator

From a ShamooTS source checkout, run one example with its workspace filter:

pnpm --filter @shamoo-examples/testing typecheck
pnpm --filter @shamoo-examples/testing test

Deployable examples generally expose build, doctor, or deploy scripts. From the example directory:

pnpm typecheck
pnpm test       # when present
pnpm build
pnpm deploy --paper /absolute/shamoo-runtime-watched-root

The deploy target is always ShamooRuntime's watched root. See First Plugin for a self-contained package/config/source walkthrough and Testing for repository-wide commands.

Clone this wiki locally