@solidrt/cli 0.0.50 → 0.0.51
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/AGENTS.md +20 -7
- package/agents/assets.md +32 -0
- package/agents/debugging.md +142 -0
- package/package.json +8 -6
- package/scaffold/AGENTS.md +102 -547
- package/scaffold/package.json +5 -5
- package/server/control.ts +15 -5
- package/server/main.ts +8 -8
- package/server/rebuild.ts +10 -2
- package/server/remap.ts +46 -33
- package/server/state.ts +6 -5
- package/src/args.ts +5 -7
- package/src/bundler.ts +112 -37
- package/src/commands/bundle.ts +106 -21
- package/src/commands/check.ts +7 -0
- package/src/commands/init.ts +18 -18
- package/src/commands/mcp.ts +19 -5
- package/src/commands/pack.ts +18 -8
- package/src/commands/render.ts +28 -5
- package/src/commands/server.ts +5 -5
- package/src/dev-server.ts +7 -7
- package/src/packer.ts +16 -12
- package/src/repl.ts +27 -11
- package/src/util.ts +4 -3
- package/src/watcher.ts +7 -3
package/src/util.ts
CHANGED
|
@@ -8,9 +8,10 @@ export let state = {
|
|
|
8
8
|
// What srt believes the current bundle is; the server process keeps its own
|
|
9
9
|
// latched copy for late-joining clients (see packages/cli/server/).
|
|
10
10
|
currentCode: null as string | null,
|
|
11
|
-
// The bundle's composed
|
|
12
|
-
//
|
|
13
|
-
|
|
11
|
+
// The bundle's composed sourcemaps (dev builds), keyed by module name
|
|
12
|
+
// ("main", each isolate id), sent to the server alongside reloads so it can
|
|
13
|
+
// remap logged stack traces to .tsx positions.
|
|
14
|
+
currentMaps: null as Record<string, string> | null,
|
|
14
15
|
// The bundle's version manifest (canonical JSON string, see buildManifest);
|
|
15
16
|
// travels with code reloads so clients install the push as a version.
|
|
16
17
|
currentManifest: null as string | null,
|
package/src/watcher.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, watch } from "node:fs"
|
|
|
2
2
|
import { resolve, dirname, sep, basename } from "path"
|
|
3
3
|
import { state, print, printErr } from "./util"
|
|
4
4
|
import { buildReload, sendReload, showBuildFailure, watchAllowed } from "./dev-server"
|
|
5
|
-
import { bundle } from "./bundler"
|
|
5
|
+
import { bundle, bundleMaps } from "./bundler"
|
|
6
6
|
|
|
7
7
|
let watchers: ReturnType<typeof watch>[] = []
|
|
8
8
|
|
|
@@ -25,11 +25,11 @@ async function rebuild(filename: string) {
|
|
|
25
25
|
return
|
|
26
26
|
}
|
|
27
27
|
state.currentCode = result.code
|
|
28
|
-
state.
|
|
28
|
+
state.currentMaps = bundleMaps(result)
|
|
29
29
|
state.currentManifest = result.manifest
|
|
30
30
|
await sendReload(buildReload({ code: state.currentCode, manifest: state.currentManifest }), {
|
|
31
31
|
latch: true,
|
|
32
|
-
|
|
32
|
+
maps: state.currentMaps,
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -53,6 +53,10 @@ export function startWatcher() {
|
|
|
53
53
|
watchers.push(
|
|
54
54
|
watch(watchDir, { recursive: true }, (_event, filename) => {
|
|
55
55
|
if (!filename) return
|
|
56
|
+
// Dot directories are never sources: .srt-data in particular is this
|
|
57
|
+
// server's own output (isolate bundles are .js files in there), and
|
|
58
|
+
// rebuilding on it would rebuild forever.
|
|
59
|
+
if (filename.split(sep).some((part, i, parts) => i < parts.length - 1 && part.startsWith("."))) return
|
|
56
60
|
if (!/\.(tsx?|jsx?)$/.test(filename) && !(covered && isAsset(filename))) return
|
|
57
61
|
rebuild(filename)
|
|
58
62
|
}),
|