SDK and CLI for building Rifted mods.
A mod is TypeScript: card bodies read like ordinary code, the build product
is data — a GCF document (s-expressions as JSON) the engine loads
directly, fluent locale files for every string, and a verified .rmod
archive for distribution.
const pkg = Pkg('ex')
const coins = pkg.playerState('coins')
pkg.card('gambit', {
name: 'Gambit',
cooldown: 2, scale: 'hyp', tags: ['attack'],
params: { base: 5 },
onPlay({ params }) {
const roll = rand(1, 6).as('roll')
when(roll.gt(4).and(coins.spend(2)), () => {
dmg('weakest_enemy', params.base.scaled().mul(roll))
addStack(1)
}).otherwise(() => selfDmg(roll.div(2).ceil()))
},
})
export default pkg- @rifted/sdk — the typed authoring surface: collector-style
card bodies, content composers, localization, GCF schema,
.rmodpacking - @rifted/cli —
init,build,validate,pack,inspect,diff,typegen,locales:scaffold,locales:check
bun add -g @rifted/cli
rifted init my-mod
cd my-mod && bun install
rifted build --watch
rifted packbun install
bun run build
bun testThe SDK's contract with the engine is enforced by equivalence tests: the
engine's own examples.gcf.json and vanilla.gcf.json are authored in SDK
style under packages/sdk/tests/content/ and must build into deep-equal
documents. If the engine's GCF format changes, update the fixtures and the
authored content together.
we use changesets to manage versions and changelogs. when you make a change that should be released:
- make your changes on a feature branch
- run
bun changeset— pick the affected packages and bump type (patch/minor/major) - commit the generated
.changeset/*.mdfile along with your changes - open a PR
once merged, a "release packages" PR will be opened automatically. merging that PR publishes the affected packages to npm.
MIT