@solidrt/cli 0.0.1-exp.9 → 0.0.1
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 +5 -5
- package/src/repl.ts +4 -1
- package/src/util.ts +1 -1
- package/src/watcher.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidrt/cli",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Antoine van Wel",
|
|
6
6
|
"type": "module",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"qrcode-generator": "^2.0.4"
|
|
20
20
|
},
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@solidrt/darwin-arm64": "0.0.1
|
|
23
|
-
"@solidrt/linux-x64-gnu": "0.0.1
|
|
24
|
-
"@solidrt/win32-x64-msvc": "0.0.1
|
|
22
|
+
"@solidrt/darwin-arm64": "0.0.1",
|
|
23
|
+
"@solidrt/linux-x64-gnu": "0.0.1",
|
|
24
|
+
"@solidrt/win32-x64-msvc": "0.0.1"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@solidrt/core": "0.0.1
|
|
27
|
+
"@solidrt/core": "0.0.1",
|
|
28
28
|
"typescript": "^5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
package/src/repl.ts
CHANGED
|
@@ -3,10 +3,13 @@ import { resolve, dirname } from "path"
|
|
|
3
3
|
import { readdirSync } from "node:fs"
|
|
4
4
|
import { state, print, printErr, broadcastStop, shutdown } from "./util"
|
|
5
5
|
import { bundle } from "./build"
|
|
6
|
-
import { startWatcher } from "./watcher"
|
|
6
|
+
import { startWatcher, stopWatcher } from "./watcher"
|
|
7
7
|
|
|
8
8
|
function cmdStop(args: string) {
|
|
9
9
|
if (!args) {
|
|
10
|
+
stopWatcher()
|
|
11
|
+
state.currentCode = null
|
|
12
|
+
state.source = undefined
|
|
10
13
|
broadcastStop()
|
|
11
14
|
print("[cli] Sent stop to all clients")
|
|
12
15
|
return
|
package/src/util.ts
CHANGED
|
@@ -11,7 +11,7 @@ export let state = {
|
|
|
11
11
|
source: undefined as string | undefined,
|
|
12
12
|
sourceDir: process.cwd(),
|
|
13
13
|
child: null as ReturnType<typeof Bun.spawn> | null,
|
|
14
|
-
server: null as BunServer<
|
|
14
|
+
server: null as BunServer<undefined> | null,
|
|
15
15
|
serverUrl: null as string | null,
|
|
16
16
|
rl: null as ReadlineInterface | null,
|
|
17
17
|
}
|
package/src/watcher.ts
CHANGED
|
@@ -5,6 +5,13 @@ import { bundle } from "./build"
|
|
|
5
5
|
|
|
6
6
|
let currentWatcher: ReturnType<typeof watch> | null = null
|
|
7
7
|
|
|
8
|
+
export function stopWatcher() {
|
|
9
|
+
if (currentWatcher) {
|
|
10
|
+
currentWatcher.close()
|
|
11
|
+
currentWatcher = null
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
export function startWatcher() {
|
|
9
16
|
if (!state.source) return
|
|
10
17
|
let watchDir = dirname(resolve(state.source))
|