aispritejs Changelog
This content is not available in your language yet.
0.5.5 - 2026-06-08
Section titled “0.5.5 - 2026-06-08”Changed
Section titled “Changed”- Project home migrated to the
isluminaGitHub org; published from there via npm trusted publisher (OIDC + SLSA provenance). Version realigned from the0.1.xline to the shared ai*js family version0.5.5— no API changes; the runtime is unchanged from0.1.3.
0.1.3 - 2026-06-05
Section titled “0.1.3 - 2026-06-05”- Docs: a “When you DON’T need aispritejs” threshold section and a complete, runnable 6-frame
explosion (play-once FX)
/pixiquickstart (examples/02-explosion-pixi); no source/API changes.
0.1.2 - 2026-06-05
Section titled “0.1.2 - 2026-06-05”Changed
Section titled “Changed”- JSON Schema:
animationsnow requires at least one entry (minProperties: 1), matchingstatesand the runtime (which already rejects an empty animations map viaInvalidGraphError).
- Reject non-finite (
Infinity/NaN)speed,duration, anddefaultFrameDurationat compile time (InvalidGraphError); clamp non-finitedtto 0 inupdate()— previously these silently corrupted looping playback (frame stuck at 0 /NaNaccumulation).
0.1.1 - 2026-06-03
Section titled “0.1.1 - 2026-06-03”First release published through the OIDC publish.yml pipeline (npm trusted
publisher), so the npm tarball carries SLSA build provenance — 0.1.0 was
published locally without it. No source/API changes.
Changed
Section titled “Changed”- Docs: corrected the AI Generated badge to the actual authoring model,
Claude Code Opus 4.8, inREADME.mdandREADME_ZHTW.md(matching the family’s model-attribution convention).
0.1.0 - 2026-06-03
Section titled “0.1.0 - 2026-06-03”Initial release — the input-driven core plus the PixiJS v8 adapter, atlas parser, and JSON Schema (roadmap modules 1–4).
createSpriteAnimator(graph)— the public factory returning aSpriteAnimator. No exported class constructor (family convention: public API =createX). Implemented as closures, so methods never depend onthis.- Inputs — three kinds driving the visual state machine:
Number(continuous, e.g.speed) andBoolean(toggle, e.g.isGrounded), set viasetInput(name, value).Trigger(one-shot, e.g.jump), fired viafireTrigger(name); stays pending across frames until a transition consumes it.- O(1) lookup; unknown names throw
UnknownInputError, kind mismatches throwInputTypeError, andNaNis rejected.
- Transition graph —
StateDef(animation key +loop/onEnd/speed),TransitionCondition(Equals/NotEquals/GreaterThan/LessThan/Trigger), andTransitionDefwith Any-State (from: "*") and integerpriority. Resolution is deterministic: highest priority then declared order, taking the first effective transition. A self-targeting transition is effective only if it consumes a Trigger (a Number/Boolean self-loop cannot restart the clip every frame). update(deltaMs)— advances the timer bydt × speed(negativedtclamps to0), evaluates transitions, computes the active frame from cumulative per-frame durations + loop, and firesonCompleteonce for a finished non-looping clip followed by anyonEndauto-transition. No per-frame allocation.- Outputs —
activeState,activeFrameKey,activeFrameIndexfor renderer adapters. - Typed emitters —
onStateChange((to, from) => …)andonComplete((state) => …), each returning an unsubscribe and accepting{ signal, once }. Own minimal implementation; does not importaieventjsor any sibling. - Lifecycle —
reset()returns to the initial state and restores input defaults without releasing buffers (firesonStateChangeonly if the state changed);dispose()is idempotent and makes subsequent mutators throwSpriteAnimatorDisposedError. - Fail-fast validation —
createSpriteAnimatorvalidates every cross-reference the type system cannot (missing animation, unknown transition target, operator/kind compatibility, positive durations and speed,onEndvsloop) and throwsInvalidGraphError. - Atlas-shaped input — the graph consumes PixiJS-v8-native
animations/framesblocks (only frame keys +durationare read by the core), augmented with theaispritejsinputs/states/transitionsblock. A foreign event-drivenstatesblock is ignored. - Docs — README (canonical) +
README_ZHTW.md,STABILITY.md,CONTRIBUTING.md,ROADMAP.md,llms.txt/llms-full.txt, and a runnable Node example (examples/01-platformer-inputs).
Added — aispritejs/pixi adapter
Section titled “Added — aispritejs/pixi adapter”createPixiSpriteAnimator(sprite, graph, textures, options?)on theaispritejs/pixisubpath — binds the renderer-agnostic core to a PixiJS v8Sprite. On eachupdate(dt)it runs the core machine and, when the active frame changes, swaps the sprite’s texture and applies that frame’s atlas anchor (texture.defaultAnchor) — preserving non-centre / foot pivots ({ applyAnchor: false }opts out). Accepts aSpritesheetor a frame-key →Texturemap.MissingTextureError— fail-fast at construction when a frame key the graph references has no texture (carries.keys).pixi.jsdeclared as an optionalpeerDependency(peerDependenciesMeta.optional). The adapter imports it type-only, so the built subpath contains no runtimepixi.jsrequire; the core never imports the adapter.- Guard: if a playing
AnimatedSpriteis passed (it extendsSprite), its internal playback is stopped on bind so its ticker cannot fight the adapter’s texture swaps. The adapter expects a plainSprite.
Added — aispritejs/atlas parser + JSON Schema
Section titled “Added — aispritejs/atlas parser + JSON Schema”parseAtlas(atlas, control?)andloadAtlas(atlas, control?)on theaispritejs/atlassubpath — turn a parsed PixiJS-v8 atlas into aSpriteGraph(or a readySpriteAnimator). The atlas supplies the universalanimations/frames; the input-driven control comes from the atlas itself (augmented shape) or from thecontrolargument.- Ignores a foreign event-driven
statesblock — the FSM{ initial, definitions }shape emitted by other tools is detected and skipped; pass anaispritejscontrol block instead. Verified against the real family pipeline atlas (test/fixtures/reimu-atlas.json). InvalidAtlasErrorfor structural problems (fail-fast); semantic problems surface asInvalidGraphErrorfrom the core.- JSON Schema shipped at
schemas/aispritejs-graph.schema.json(draft 2020-12), exported asaispritejs/schema, describing the input-driven graph. The parser mirrors it in code, so there is no runtime schema-validator dependency.
Guarantees (CI)
Section titled “Guarantees (CI)”- Strict TypeScript (
strict+noUncheckedIndexedAccess+exactOptionalPropertyTypes), noany. - Dual ESM + CJS build via
tsup;sideEffects: false;.+/pixi+/atlas+/schemasubpath exports; per-subpath gzip budgets. - Zero runtime dependencies; the root import graph contains no
pixi.js, DOM, or canvas API. prepublishOnlygate: typecheck → lint → coverage → build → verify:exports → verify:llms → check:size. Coverage at 100 % statements / branches / functions / lines (above the family floor of 95 / 90 / 100 / 100). Core gzip ≈ 3.5 KB.- OIDC + SLSA provenance publish on tag-push.