create-solidrt 0.0.20 → 0.0.22

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/main.ts +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-solidrt",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "license": "MIT",
5
5
  "author": "Antoine van Wel",
6
6
  "type": "module",
package/src/main.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  // SolidRT project looks like. We shell out via `bun x` rather than depend on
4
4
  // @solidrt/cli directly, to avoid pulling its native-binary tree into the
5
5
  // scaffolder. The empty/existing-folder guard lives in `srt init`.
6
+ import pkg from "../package.json" with { type: "json" }
6
7
 
7
8
  let dir = process.argv[2]
8
9
  if (!dir || dir.startsWith("-")) {
@@ -10,7 +11,16 @@ if (!dir || dir.startsWith("-")) {
10
11
  process.exit(1)
11
12
  }
12
13
 
13
- let proc = Bun.spawnSync(["bun", "x", "@solidrt/cli", "init", dir], {
14
+ // Pin the forwarded cli to our own version. create-solidrt and @solidrt/cli are
15
+ // published in lockstep, so this keeps the scaffolder matched to the version the
16
+ // user just fetched, and forces `bun x` to resolve that exact version instead of
17
+ // silently reusing a stale bare-name cache entry. Fall back to `latest` for the
18
+ // unpublished 0.0.0 workspace version, which has no npm release to pin to.
19
+ let cli = pkg.version === "0.0.0" ? "@solidrt/cli@latest" : `@solidrt/cli@${pkg.version}`
20
+
21
+ // Forward any trailing flags (e.g. --template gallery) to `srt init` untouched.
22
+ let extra = process.argv.slice(3)
23
+ let proc = Bun.spawnSync(["bun", "x", cli, "init", dir, ...extra], {
14
24
  stdin: "inherit",
15
25
  stdout: "inherit",
16
26
  stderr: "inherit",