create-solidrt 0.0.20 → 0.0.21
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/main.ts +9 -1
package/package.json
CHANGED
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,14 @@ if (!dir || dir.startsWith("-")) {
|
|
|
10
11
|
process.exit(1)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
|
|
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
|
+
let proc = Bun.spawnSync(["bun", "x", cli, "init", dir], {
|
|
14
22
|
stdin: "inherit",
|
|
15
23
|
stdout: "inherit",
|
|
16
24
|
stderr: "inherit",
|