create-puzzmo 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +49 -0
  2. package/package.json +19 -0
  3. package/src/index.js +29 -0
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # create-puzzmo
2
+
3
+ Scaffold a new Puzzmo game project.
4
+
5
+ ```bash
6
+ yarn create puzzmo game
7
+ npm create puzzmo game
8
+ pnpm create puzzmo game
9
+ ```
10
+
11
+ ## What it does
12
+
13
+ This is a thin shim that forwards to the `puzzmo game create` command from `@puzzmo/cli`. If the CLI isn't installed, it will be installed automatically.
14
+
15
+ ## Options
16
+
17
+ All options are forwarded to `puzzmo game create`:
18
+
19
+ ```bash
20
+ yarn create puzzmo game [accesstoken] --name <name> --url <url> --agent <agent>
21
+ ```
22
+
23
+ <!-- cspell:ignore accesstoken -->
24
+
25
+ | Option | Description |
26
+ | ----------------- | --------------------------------------------------------- |
27
+ | `[accesstoken]` | Optional Puzzmo API token for deployment setup |
28
+ | `--name <name>` | Game name (prompted if not provided) |
29
+ | `--url <url>` | Source URL to import an HTML game from |
30
+ | `--agent <agent>` | LLM agent to use: `claude`, `codex`, `gemini`, or `none` |
31
+
32
+ ## Workflow
33
+
34
+ 1. Asks for a game name
35
+ 2. Selects creation mode (currently: import from HTML page)
36
+ 3. Downloads the HTML page and all referenced assets
37
+ 4. Detects installed LLM agents (Claude Code, Codex, etc.)
38
+ 5. Installs Puzzmo migration skills
39
+ 6. Runs an automated pipeline that converts the game step-by-step:
40
+ - Convert to Vite
41
+ - Integrate Puzzmo SDK
42
+ - Wire up game completion
43
+ - Apply Puzzmo theme tokens
44
+ - Add gameplay statistics (deeds)
45
+ - Configure leaderboards
46
+ - Create app metadata
47
+ - Set up deployment
48
+
49
+ Each step is verified with a build check and committed to git.
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "create-puzzmo",
3
+ "version": "1.0.0",
4
+ "description": "Create a Puzzmo game project",
5
+ "type": "module",
6
+ "bin": "./src/index.js",
7
+ "keywords": [
8
+ "puzzmo",
9
+ "games",
10
+ "create"
11
+ ],
12
+ "author": "Puzzmo",
13
+ "license": "MIT",
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "provenance": true,
17
+ "registry": "https://registry.npmjs.org/"
18
+ }
19
+ }
package/src/index.js ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync, spawnSync } from "node:child_process"
4
+
5
+ // Forward all args to `puzzmo game create`
6
+ const args = process.argv.slice(2)
7
+
8
+ // Check if puzzmo CLI is available
9
+ try {
10
+ execSync("puzzmo --help", { stdio: "ignore" })
11
+ } catch {
12
+ console.log("Installing @puzzmo/cli...")
13
+ const pm = detectPackageManager()
14
+ spawnSync(pm === "yarn" ? "yarn" : pm, ["add", "-g", "@puzzmo/cli"], { stdio: "inherit" })
15
+ }
16
+
17
+ const result = spawnSync("puzzmo", ["game", "create", ...args], {
18
+ stdio: "inherit",
19
+ env: process.env,
20
+ })
21
+
22
+ process.exit(result.status ?? 1)
23
+
24
+ function detectPackageManager() {
25
+ const ua = process.env.npm_config_user_agent ?? ""
26
+ if (ua.startsWith("yarn")) return "yarn"
27
+ if (ua.startsWith("pnpm")) return "pnpm"
28
+ return "npm"
29
+ }