create-puzzmo 1.0.11 → 1.0.12

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-puzzmo",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Create a Puzzmo game project",
5
5
  "type": "module",
6
6
  "bin": "./src/index.js",
package/src/index.js CHANGED
@@ -8,15 +8,15 @@ const args = process.argv.slice(2)
8
8
  // Detect the package manager that invoked this script
9
9
  const pm = detectPackageManager()
10
10
 
11
- // Fetch the actual latest version from the registry to avoid npm cache staleness
11
+ // Resolve the actual latest version from the registry to avoid npm cache staleness
12
12
  const version = await fetchLatestVersion("@puzzmo/cli")
13
- console.log(`Installing @puzzmo/cli@${version}...`)
14
- spawnSync("npm", ["install", "-g", `@puzzmo/cli@${version}`], { stdio: "inherit" })
13
+ console.log(`Running @puzzmo/cli@${version}...`)
15
14
 
16
15
  // Pass --pm so the CLI knows which package manager to use in generated files
17
16
  const extraArgs = args.includes("--pm") ? [] : ["--pm", pm]
18
17
 
19
- const result = spawnSync("puzzmo", ["game", "create", ...args, ...extraArgs], {
18
+ // Use npx with the exact version to avoid stale global installs
19
+ const result = spawnSync("npx", [`@puzzmo/cli@${version}`, "game", "create", ...args, ...extraArgs], {
20
20
  stdio: "inherit",
21
21
  env: process.env,
22
22
  })