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.
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
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
|
-
//
|
|
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(`
|
|
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
|
-
|
|
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
|
})
|