@solidrt/cli 0.0.36 → 0.0.37
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 +7 -7
- package/scaffold/package.json +4 -4
- package/src/args.ts +18 -8
- package/src/pack-folder.ts +2 -0
- package/src/project.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidrt/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Antoine van Wel",
|
|
6
6
|
"type": "module",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"zod": "^4.4.3"
|
|
29
29
|
},
|
|
30
30
|
"optionalDependencies": {
|
|
31
|
-
"@solidrt/darwin-arm64": "0.0.
|
|
32
|
-
"@solidrt/linux-arm64-gnu": "0.0.
|
|
33
|
-
"@solidrt/linux-x64-gnu": "0.0.
|
|
34
|
-
"@solidrt/win32-x64-msvc": "0.0.
|
|
31
|
+
"@solidrt/darwin-arm64": "0.0.37",
|
|
32
|
+
"@solidrt/linux-arm64-gnu": "0.0.37",
|
|
33
|
+
"@solidrt/linux-x64-gnu": "0.0.37",
|
|
34
|
+
"@solidrt/win32-x64-msvc": "0.0.37"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@solidrt/core": "0.0.
|
|
37
|
+
"@solidrt/core": "0.0.37",
|
|
38
38
|
"typescript": "^7"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@solidrt/flux-types": "0.0.
|
|
41
|
+
"@solidrt/flux-types": "0.0.37",
|
|
42
42
|
"@types/bun": "latest"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/scaffold/package.json
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"android": "srt client --android"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@solidrt/core": "0.0.
|
|
13
|
-
"@solidrt/components": "0.0.
|
|
12
|
+
"@solidrt/core": "0.0.37",
|
|
13
|
+
"@solidrt/components": "0.0.37"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@solidrt/cli": "0.0.
|
|
17
|
-
"@solidrt/flux-types": "0.0.
|
|
16
|
+
"@solidrt/cli": "0.0.37",
|
|
17
|
+
"@solidrt/flux-types": "0.0.37",
|
|
18
18
|
"typescript": "^7"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/src/args.ts
CHANGED
|
@@ -28,13 +28,23 @@ export let { values, positionals } = parseArgs({
|
|
|
28
28
|
allowPositionals: true,
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
-
// Storage flags for a locally spawned client
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
31
|
+
// Storage flags for a locally spawned client, forwarded only when given: with
|
|
32
|
+
// no --data-root the client resolves its platform pref path (see
|
|
33
|
+
// lattice/src/storage.rs); --client <N> selects the client<N>/ tree under
|
|
34
|
+
// either root. An explicit root is passed absolute because the client chdirs
|
|
35
|
+
// into its app sandbox at startup.
|
|
35
36
|
export function clientStorageArgs(): string[] {
|
|
36
|
-
let args
|
|
37
|
-
|
|
37
|
+
let args: string[] = []
|
|
38
|
+
let root = values["data-root"]
|
|
39
|
+
if (root) args.push("--data-root", resolve(root))
|
|
40
|
+
let client = values.client
|
|
41
|
+
if (client !== undefined) {
|
|
42
|
+
if (!/^\d+$/.test(client)) {
|
|
43
|
+
console.error(`Invalid --client value "${client}": expected a non-negative integer`)
|
|
44
|
+
process.exit(1)
|
|
45
|
+
}
|
|
46
|
+
args.push("--client", client)
|
|
47
|
+
}
|
|
38
48
|
return args
|
|
39
49
|
}
|
|
40
50
|
|
|
@@ -112,8 +122,8 @@ run/server options:
|
|
|
112
122
|
run/client options:
|
|
113
123
|
--size <WxH> Window size (default: 1280x720)
|
|
114
124
|
--stats Show the debug stats overlay (FPS, memory, frame timings)
|
|
115
|
-
--data-root <dir> Client data root (default:
|
|
116
|
-
--client <
|
|
125
|
+
--data-root <dir> Client data root (default: the platform pref path)
|
|
126
|
+
--client <N> Client number: its own data tree under the data root (default: 0)
|
|
117
127
|
|
|
118
128
|
client options:
|
|
119
129
|
--server <host[:port]> Connect to a dev server at this address (default port: 34884)
|
package/src/pack-folder.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
loadAppIdentity,
|
|
7
7
|
projectDirFor,
|
|
8
8
|
RUNTIME_VERSION,
|
|
9
|
+
SOLIDRT_VERSION,
|
|
9
10
|
type ManifestFont,
|
|
10
11
|
} from "./project"
|
|
11
12
|
import { resolvePackFonts } from "./fonts"
|
|
@@ -70,6 +71,7 @@ export function buildPackFolder(entry: string, bytecode: Buffer): PackFolder {
|
|
|
70
71
|
org: identity.org,
|
|
71
72
|
displayName: identity.displayName,
|
|
72
73
|
runtimeVersion: RUNTIME_VERSION,
|
|
74
|
+
solidrtVersion: SOLIDRT_VERSION,
|
|
73
75
|
bundle: { path: "bundle.bin", sha256: hashHex(bytecode), size: bytecode.length },
|
|
74
76
|
...(assets.length ? { assets } : {}),
|
|
75
77
|
...(fonts.length ? { fonts } : {}),
|
package/src/project.ts
CHANGED
|
@@ -61,6 +61,13 @@ function checkField(value: string, what: string) {
|
|
|
61
61
|
// derivation question is settled (see plan).
|
|
62
62
|
export const RUNTIME_VERSION = 1
|
|
63
63
|
|
|
64
|
+
// The manifest's solidrtVersion: provenance, not a compat gate like
|
|
65
|
+
// runtimeVersion - the CLI release that built the version. Published CLIs
|
|
66
|
+
// carry the real version in their package.json; the in-repo 0.0.0
|
|
67
|
+
// placeholder stamps "unknown".
|
|
68
|
+
let pkgVersion = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf8")).version
|
|
69
|
+
export const SOLIDRT_VERSION: string = pkgVersion === "0.0.0" ? "unknown" : pkgVersion
|
|
70
|
+
|
|
64
71
|
export function buildManifest(code: string, entry: string): string {
|
|
65
72
|
let identity = loadAppIdentity(entry)
|
|
66
73
|
let sha256 = new Bun.CryptoHasher("sha256").update(code).digest("hex")
|
|
@@ -68,6 +75,7 @@ export function buildManifest(code: string, entry: string): string {
|
|
|
68
75
|
return JSON.stringify({
|
|
69
76
|
appId: identity.appId,
|
|
70
77
|
runtimeVersion: RUNTIME_VERSION,
|
|
78
|
+
solidrtVersion: SOLIDRT_VERSION,
|
|
71
79
|
bundle: { path: "bundle.js", sha256, size: Buffer.byteLength(code, "utf8") },
|
|
72
80
|
...(assets.length ? { assets } : {}),
|
|
73
81
|
...(fonts.length ? { fonts } : {}),
|