Pin the generator version used by your project. See theSelene ECS guidefor package imports and dev_build configuration.
Use --check source.mbt ... to verify the generated companions without writingfiles. CI can pass all tracked MoonBit sources to detect missing companions.
The resource marker generates a type identity. Initialize its value explicitlywith world.insert_resource(value) or app.insert_resource(value). Read itwith world.resource(), or use world.get_resource() to handle a missing value.Resource markers with factory arguments are rejected.
State markers generate one @state.StateKey[T] and an implementation of@state.StateType, and attach its shared set method to the declared type.Use GamePhase::set(Playing) in a running system to request a transition inthe active World. Import Milky2018/selene/state as @state in that package.The state type must implement Eq, usually with #derive(Eq). The markerdoes not implement Resource for the state value or initialize a World.Use app.init_state(initial) explicitly. See thestate guide for transitions and lifecyclesystems. Generic declarations and multiple Selene markers on one type are rejected.
For a planned 0.40.0 Selene release, publish development generators as0.40.0-beta1, 0.40.0-beta2, and so on:
moon run --target wasm publish.mbtx -- 0.40.0-beta1 --codegen-only
This command updates CI, example rules, documentation pins, and generatedcompanions after the published executable becomes available. Record thesedevelopment changes under Unreleased.
The full moon run --target wasm publish.mbtx -- 0.40.0 release publishes stable codegen first,validates its consumers, then publishes core and WebGPU with the same stableversion. See the release process.