Create App Bundle
Set up the metadata and assets needed for the game to appear on Puzzmo.
Steps
- Create a
public/directory for static assets if it doesn't exist. - Add the
appBundlePlugintovite.config.ts:import {defineConfig} from "vite" import {puzzmoSimulator, appBundlePlugin} from "@puzzmo/sdk/vite" export default defineConfig({plugins: [puzzmoSimulator({slug: "your-game-slug", fixturesGlob: "/fixtures/puzzles/**/*.json"}), appBundlePlugin()], build: {outDir: "dist", assetsDir: "assets",},})TheappBundlePluginruns after the main build and producesdist/app-bundle.jsas a separate ES module library build fromsrc/appBundle.js. - Create
src/appBundle.js(orsrc/appBundle.ts) that exports therenderThumbnailfunction:
export type AppBundle = {
/** Renders a puzzle and optional state string into an SVG */
renderThumbnail(puzzleStr: string, inputStr?: string, config?: ThumbnailConfig): string
}You can find the ThumbnailConfig type definition in @puzzmo-com/sdk/types.
The function should return an SVG string that visually represents the puzzle. You could use code from the original game but the goal is a drastically simplified rendering that captures the essence of the puzzle in a small thumbnail. The thumbnail will be used on the Puzzmo platform to represent the puzzle in lists and previews.
- Verify the build output has:
- dist/index.html - All JS/CSS properly bundled - All static assets in dist/ - dist/app-bundle.js with the renderThumbnail export
Success Criteria
npm run buildcompletes without errorsdist/directory contains a complete, self-contained game- Thumbnail SVG exists and renders