Loading files
91ad16cd4This file is pinned to the selected release. Download the original to open it in your design tool.
# Stack-chan simulator sample MOD
`stackchan-sample-mod.xsa` is a small prebuilt Moddable MOD archive for browser-simulator smoke testing.
The checked-in archive targets XS 17.8.2, matching the supported simulator and CoreS3 profiles.
`ui.test.mjs` checks this version so an SDK update cannot leave an incompatible sample behind.
It was built from `sample-mod/manifest.json`, whose `mod.js` exports Stack-chan-style hooks:
```js
export function onLaunch() {
trace('[sample-mod] onLaunch from browser simulator sample\n')
return true
}
export async function onContextCreated(robot) {
trace('[sample-mod] onContextCreated from browser simulator sample\n')
robot.setColor?.('primary', 0x30, 0xe0, 0xff)
robot.setColor?.('secondary', 0xff, 0x70, 0xd8)
await robot.showBalloon?.('sample .xsa OK', { timeout: 1500 })
}
```
To rebuild it with Moddable SDK 9.5.0, use the release configuration so the
archive does not embed host-specific source paths:
```sh
cd firmware
npm run mod:build -- ../web/simulator/samples/sample-mod/manifest.json --mode=release
cp dist/bin/esp32/release/sample-mod/sample-mod.xsa ../web/simulator/samples/stackchan-sample-mod.xsa
```
The file is intended for exercising download/upload/persistence and launch-archive plumbing; it is not a production MOD example. After installing it and clicking **Restart simulator**, the face colors should change to cyan/pink and a `sample .xsa OK` balloon should appear.