effect-start 0.22.0 → 0.23.0
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/dist/BlobStore.d.ts +80 -0
- package/dist/BlobStore.js +19 -0
- package/dist/ChildProcess.d.ts +60 -0
- package/dist/ChildProcess.js +30 -0
- package/dist/Commander.d.ts +3 -6
- package/dist/Commander.js +6 -13
- package/dist/ContentNegotiation.d.ts +8 -9
- package/dist/ContentNegotiation.js +32 -37
- package/dist/Cookies.d.ts +47 -0
- package/dist/Cookies.js +273 -363
- package/dist/Development.d.ts +2 -2
- package/dist/Development.js +3 -4
- package/dist/Effectify.d.ts +1 -4
- package/dist/FilePathPattern.d.ts +3 -3
- package/dist/FileRouter.d.ts +5 -8
- package/dist/FileRouter.js +9 -10
- package/dist/FileRouterCodegen.d.ts +1 -1
- package/dist/FileRouterCodegen.js +33 -13
- package/dist/FileSystem.d.ts +158 -0
- package/dist/FileSystem.js +64 -125
- package/dist/Http.js +2 -6
- package/dist/PathPattern.d.ts +7 -7
- package/dist/PathPattern.js +1 -3
- package/dist/PlatformError.d.ts +24 -32
- package/dist/PlatformError.js +3 -21
- package/dist/PlatformRuntime.js +5 -10
- package/dist/Route.d.ts +14 -19
- package/dist/Route.js +8 -11
- package/dist/RouteBody.d.ts +6 -12
- package/dist/RouteBody.js +2 -2
- package/dist/RouteError.d.ts +98 -0
- package/dist/RouteError.js +55 -0
- package/dist/RouteHook.js +6 -11
- package/dist/RouteHttp.d.ts +3 -3
- package/dist/RouteHttp.js +27 -22
- package/dist/RouteMount.d.ts +16 -50
- package/dist/RouteMount.js +6 -20
- package/dist/RouteSchema.d.ts +22 -1
- package/dist/RouteSchema.js +33 -0
- package/dist/RouteSse.js +4 -10
- package/dist/RouteTree.d.ts +2 -1
- package/dist/RouteTree.js +17 -15
- package/dist/RouteTrie.d.ts +2 -2
- package/dist/RouteTrie.js +4 -9
- package/dist/SchemaExtra.d.ts +1 -1
- package/dist/Socket.d.ts +27 -0
- package/dist/Socket.js +20 -28
- package/dist/Sql.d.ts +34 -0
- package/dist/Sql.js +5 -0
- package/dist/SqlIntrospect.d.ts +91 -0
- package/dist/SqlIntrospect.js +466 -0
- package/dist/Start.d.ts +4 -6
- package/dist/Start.js +10 -2
- package/dist/StreamExtra.d.ts +1 -1
- package/dist/StreamExtra.js +9 -9
- package/dist/System.d.ts +7 -0
- package/dist/System.js +22 -0
- package/dist/TuplePathPattern.js +55 -50
- package/dist/Unique.js +7 -7
- package/dist/Values.d.ts +2 -1
- package/dist/Values.js +19 -13
- package/dist/bun/BunBlobStoreDisk.d.ts +6 -0
- package/dist/bun/BunBlobStoreDisk.js +116 -0
- package/dist/bun/BunBlobStoreS3.d.ts +11 -0
- package/dist/bun/BunBlobStoreS3.js +89 -0
- package/dist/bun/BunBlobWatcherDisk.d.ts +6 -0
- package/dist/bun/BunBlobWatcherDisk.js +60 -0
- package/dist/bun/BunBlobWatcherQueue.d.ts +6 -0
- package/dist/bun/BunBlobWatcherQueue.js +17 -0
- package/dist/bun/BunBundle.d.ts +5 -6
- package/dist/bun/BunBundle.js +7 -15
- package/dist/bun/BunChildProcessSpawner.d.ts +3 -0
- package/dist/bun/BunChildProcessSpawner.js +103 -0
- package/dist/bun/BunImportTrackerPlugin.d.ts +1 -1
- package/dist/bun/BunImportTrackerPlugin.js +3 -5
- package/dist/bun/BunRoute.d.ts +3 -2
- package/dist/bun/BunRoute.js +5 -7
- package/dist/bun/BunRuntime.js +1 -1
- package/dist/bun/BunServer.d.ts +11 -4
- package/dist/bun/BunServer.js +35 -11
- package/dist/bun/BunSql.d.ts +4 -0
- package/dist/bun/BunSql.js +81 -0
- package/dist/bun/_BunEnhancedResolve.d.ts +3 -3
- package/dist/bun/_BunEnhancedResolve.js +2 -4
- package/dist/bun/index.d.ts +1 -0
- package/dist/bun/index.js +1 -0
- package/dist/bundler/Bundle.d.ts +2 -1
- package/dist/bundler/Bundle.js +1 -1
- package/dist/bundler/BundleFiles.d.ts +5 -5
- package/dist/bundler/BundleFiles.js +10 -8
- package/dist/bundler/BundleRoute.d.ts +27 -0
- package/dist/bundler/BundleRoute.js +51 -0
- package/dist/client/ScrollState.js +2 -6
- package/dist/client/index.js +6 -8
- package/dist/console/Console.d.ts +6 -0
- package/dist/console/Console.js +26 -0
- package/dist/console/ConsoleErrors.d.ts +3 -0
- package/dist/console/ConsoleErrors.js +200 -0
- package/dist/console/ConsoleLogger.d.ts +3 -0
- package/dist/console/ConsoleLogger.js +47 -0
- package/dist/console/ConsoleMetrics.d.ts +3 -0
- package/dist/console/ConsoleMetrics.js +61 -0
- package/dist/console/ConsoleProcess.d.ts +3 -0
- package/dist/console/ConsoleProcess.js +49 -0
- package/dist/console/ConsoleStore.d.ts +144 -0
- package/dist/console/ConsoleStore.js +61 -0
- package/dist/console/ConsoleTracer.d.ts +3 -0
- package/dist/console/ConsoleTracer.js +94 -0
- package/dist/console/Simulation.d.ts +2 -0
- package/dist/console/Simulation.js +633 -0
- package/dist/console/index.d.ts +3 -0
- package/dist/console/index.js +3 -0
- package/dist/console/routes/errors/route.d.ts +10 -0
- package/dist/console/routes/errors/route.js +47 -0
- package/dist/console/routes/fiberDetail.d.ts +16 -0
- package/dist/console/routes/fiberDetail.js +38 -0
- package/dist/console/routes/fibers/route.d.ts +10 -0
- package/dist/console/routes/fibers/route.js +19 -0
- package/dist/console/routes/git/route.d.ts +11 -0
- package/dist/console/routes/git/route.js +33 -0
- package/dist/console/routes/layout.d.ts +9 -0
- package/dist/console/routes/layout.js +3 -0
- package/dist/console/routes/logs/route.d.ts +10 -0
- package/dist/console/routes/logs/route.js +32 -0
- package/dist/console/routes/metrics/route.d.ts +10 -0
- package/dist/console/routes/metrics/route.js +17 -0
- package/dist/console/routes/route.d.ts +6 -0
- package/dist/console/routes/route.js +5 -0
- package/dist/console/routes/routes/route.d.ts +6 -0
- package/dist/console/routes/routes/route.js +20 -0
- package/dist/console/routes/services/route.d.ts +6 -0
- package/dist/console/routes/services/route.js +12 -0
- package/dist/console/routes/system/route.d.ts +10 -0
- package/dist/console/routes/system/route.js +18 -0
- package/dist/console/routes/traceDetail.d.ts +16 -0
- package/dist/console/routes/traceDetail.js +14 -0
- package/dist/console/routes/traces/route.d.ts +10 -0
- package/dist/console/routes/traces/route.js +39 -0
- package/dist/console/routes/tree.d.ts +153 -0
- package/dist/console/routes/tree.js +29 -0
- package/dist/console/ui/Errors.d.ts +4 -0
- package/dist/console/ui/Errors.js +15 -0
- package/dist/console/ui/Fibers.d.ts +24 -0
- package/dist/console/ui/Fibers.js +121 -0
- package/dist/console/ui/Git.d.ts +20 -0
- package/dist/console/ui/Git.js +95 -0
- package/dist/console/ui/Logs.d.ts +4 -0
- package/dist/console/ui/Logs.js +25 -0
- package/dist/console/ui/Metrics.d.ts +4 -0
- package/dist/console/ui/Metrics.js +26 -0
- package/dist/console/ui/Routes.d.ts +8 -0
- package/dist/console/ui/Routes.js +70 -0
- package/dist/console/ui/Services.d.ts +10 -0
- package/dist/console/ui/Services.js +246 -0
- package/dist/console/ui/Shell.d.ts +10 -0
- package/dist/console/ui/Shell.js +7 -0
- package/dist/console/ui/System.d.ts +4 -0
- package/dist/console/ui/System.js +35 -0
- package/dist/console/ui/Traces.d.ts +12 -0
- package/dist/console/ui/Traces.js +179 -0
- package/dist/datastar/actions/fetch.d.ts +1 -1
- package/dist/datastar/actions/fetch.js +10 -18
- package/dist/datastar/actions/peek.js +1 -2
- package/dist/datastar/actions/setAll.js +1 -2
- package/dist/datastar/actions/toggleAll.js +1 -2
- package/dist/datastar/attributes/attr.js +1 -2
- package/dist/datastar/attributes/bind.js +10 -18
- package/dist/datastar/attributes/class.js +2 -5
- package/dist/datastar/attributes/computed.js +2 -3
- package/dist/datastar/attributes/effect.js +1 -2
- package/dist/datastar/attributes/indicator.js +2 -4
- package/dist/datastar/attributes/init.js +2 -3
- package/dist/datastar/attributes/jsonSignals.js +1 -2
- package/dist/datastar/attributes/on.js +41 -22
- package/dist/datastar/attributes/onIntersect.js +2 -3
- package/dist/datastar/attributes/onInterval.js +2 -3
- package/dist/datastar/attributes/onSignalPatch.js +2 -4
- package/dist/datastar/attributes/ref.js +1 -2
- package/dist/datastar/attributes/show.js +1 -2
- package/dist/datastar/attributes/signals.js +1 -2
- package/dist/datastar/attributes/style.js +6 -12
- package/dist/datastar/attributes/text.js +1 -2
- package/dist/datastar/engine.d.ts +13 -7
- package/dist/datastar/engine.js +76 -48
- package/dist/datastar/happydom.d.ts +1 -0
- package/dist/datastar/happydom.js +8 -0
- package/dist/datastar/index.d.ts +1 -1
- package/dist/datastar/index.js +1 -1
- package/dist/datastar/utils.js +4 -7
- package/dist/datastar/watchers/patchElements.js +24 -45
- package/dist/datastar/watchers/patchSignals.js +1 -2
- package/dist/experimental/EncryptedCookies.d.ts +2 -5
- package/dist/experimental/EncryptedCookies.js +17 -48
- package/dist/experimental/index.d.ts +0 -1
- package/dist/experimental/index.js +0 -1
- package/dist/hyper/Hyper.d.ts +2 -9
- package/dist/hyper/Hyper.js +1 -12
- package/dist/hyper/HyperHtml.d.ts +1 -1
- package/dist/hyper/HyperHtml.js +18 -12
- package/dist/hyper/HyperHtml.test.d.ts +1 -0
- package/dist/hyper/HyperHtml.test.js +197 -0
- package/dist/hyper/HyperRoute.test.js +14 -3
- package/dist/hyper/html.d.ts +11 -0
- package/dist/hyper/html.js +30 -0
- package/dist/hyper/index.d.ts +2 -0
- package/dist/hyper/index.js +1 -0
- package/dist/hyper/jsx-runtime.d.ts +1 -1
- package/dist/hyper/jsx-runtime.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lint/plugin.d.ts +86 -0
- package/dist/lint/plugin.js +341 -0
- package/dist/node/NodeFileSystem.d.ts +2 -2
- package/dist/node/NodeFileSystem.js +4 -14
- package/dist/sql/bun/index.d.ts +3 -0
- package/dist/sql/bun/index.js +75 -0
- package/dist/sql/mssql/docker.d.ts +2 -0
- package/dist/sql/mssql/docker.js +67 -0
- package/dist/sql/mssql/index.d.ts +21 -0
- package/dist/sql/mssql/index.js +113 -0
- package/dist/testing/TestLogger.js +4 -1
- package/dist/testing/index.d.ts +0 -1
- package/dist/testing/index.js +0 -1
- package/dist/testing/utils.d.ts +3 -3
- package/dist/testing/utils.js +4 -4
- package/dist/x/cloudflare/CloudflareTunnel.d.ts +2 -5
- package/dist/x/cloudflare/CloudflareTunnel.js +14 -27
- package/dist/x/datastar/Datastar.d.ts +1 -1
- package/dist/x/datastar/Datastar.js +13 -12
- package/dist/x/datastar/index.d.ts +1 -2
- package/dist/x/datastar/index.js +1 -2
- package/dist/x/tailscale/TailscaleTunnel.d.ts +15 -0
- package/dist/x/tailscale/TailscaleTunnel.js +68 -0
- package/dist/x/tailscale/index.d.ts +1 -0
- package/dist/x/tailscale/index.js +1 -0
- package/dist/x/tailwind/TailwindPlugin.js +19 -19
- package/dist/x/tailwind/compile.d.ts +2 -2
- package/dist/x/tailwind/compile.js +2 -4
- package/package.json +22 -10
- package/src/ChildProcess.ts +145 -0
- package/src/PlatformError.ts +27 -50
- package/src/Route.ts +2 -2
- package/src/RouteError.ts +76 -0
- package/src/RouteHttp.ts +13 -5
- package/src/RouteSchema.ts +96 -1
- package/src/RouteTree.ts +12 -0
- package/src/Sql.ts +51 -0
- package/src/SqlIntrospect.ts +620 -0
- package/src/Start.ts +15 -3
- package/src/System.ts +43 -0
- package/src/Values.ts +7 -0
- package/src/bun/BunChildProcessSpawner.ts +143 -0
- package/src/bun/BunRoute.ts +5 -2
- package/src/bun/BunServer.ts +22 -1
- package/src/bun/index.ts +1 -0
- package/src/bundler/BundleRoute.ts +66 -0
- package/src/console/Console.ts +42 -0
- package/src/console/ConsoleErrors.ts +213 -0
- package/src/console/ConsoleLogger.ts +56 -0
- package/src/console/ConsoleMetrics.ts +72 -0
- package/src/console/ConsoleProcess.ts +59 -0
- package/src/console/ConsoleStore.ts +187 -0
- package/src/console/ConsoleTracer.ts +107 -0
- package/src/console/Simulation.ts +814 -0
- package/src/console/console.html +340 -0
- package/src/console/index.ts +3 -0
- package/src/console/routes/errors/route.tsx +97 -0
- package/src/console/routes/fiberDetail.tsx +54 -0
- package/src/console/routes/fibers/route.tsx +45 -0
- package/src/console/routes/git/route.tsx +64 -0
- package/src/console/routes/layout.tsx +4 -0
- package/src/console/routes/logs/route.tsx +77 -0
- package/src/console/routes/metrics/route.tsx +36 -0
- package/src/console/routes/route.tsx +8 -0
- package/src/console/routes/routes/route.tsx +30 -0
- package/src/console/routes/services/route.tsx +21 -0
- package/src/console/routes/system/route.tsx +43 -0
- package/src/console/routes/traceDetail.tsx +22 -0
- package/src/console/routes/traces/route.tsx +81 -0
- package/src/console/routes/tree.ts +30 -0
- package/src/console/ui/Errors.tsx +76 -0
- package/src/console/ui/Fibers.tsx +321 -0
- package/src/console/ui/Git.tsx +182 -0
- package/src/console/ui/Logs.tsx +46 -0
- package/src/console/ui/Metrics.tsx +78 -0
- package/src/console/ui/Routes.tsx +125 -0
- package/src/console/ui/Services.tsx +273 -0
- package/src/console/ui/Shell.tsx +62 -0
- package/src/console/ui/System.tsx +131 -0
- package/src/console/ui/Traces.tsx +426 -0
- package/src/datastar/README.md +6 -1
- package/src/datastar/actions/fetch.ts +0 -1
- package/src/datastar/attributes/on.ts +40 -20
- package/src/datastar/engine.ts +51 -0
- package/src/datastar/jsx.d.ts +79 -0
- package/src/hyper/Hyper.ts +1 -16
- package/src/hyper/HyperHtml.ts +6 -4
- package/src/hyper/HyperRoute.ts +2 -1
- package/src/hyper/html.ts +47 -0
- package/src/hyper/index.ts +2 -0
- package/src/hyper/jsx.d.ts +5 -3
- package/src/index.ts +1 -0
- package/src/lint/plugin.js +129 -0
- package/src/sql/bun/index.ts +147 -0
- package/src/sql/mssql/docker.ts +117 -0
- package/src/sql/mssql/index.ts +223 -0
- package/src/sql/mssql/mssql.d.ts +41 -0
- package/src/x/cloudflare/CloudflareTunnel.ts +8 -36
- package/src/x/tailscale/TailscaleTunnel.ts +113 -0
- package/src/x/tailscale/index.ts +1 -0
- package/src/x/datastar/Datastar.ts +0 -61
- package/src/x/datastar/index.ts +0 -2
- package/src/x/datastar/jsx-datastar.d.ts +0 -60
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export interface GitFileEntry {
|
|
2
|
+
readonly status: string
|
|
3
|
+
readonly path: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface GitStatus {
|
|
7
|
+
readonly oid: string
|
|
8
|
+
readonly head: string
|
|
9
|
+
readonly upstream: string | undefined
|
|
10
|
+
readonly ahead: number
|
|
11
|
+
readonly behind: number
|
|
12
|
+
readonly tag: string | undefined
|
|
13
|
+
readonly tagDistance: number
|
|
14
|
+
readonly staged: Array<GitFileEntry>
|
|
15
|
+
readonly unstaged: Array<GitFileEntry>
|
|
16
|
+
readonly untracked: Array<string>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const xyToLabel: Record<string, string> = {
|
|
20
|
+
M: "modified",
|
|
21
|
+
A: "new file",
|
|
22
|
+
D: "deleted",
|
|
23
|
+
R: "renamed",
|
|
24
|
+
C: "copied",
|
|
25
|
+
T: "typechange",
|
|
26
|
+
U: "unmerged",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function statusLabel(code: string): string {
|
|
30
|
+
return xyToLabel[code] ?? code
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function gitStatusColor(code: string): string {
|
|
34
|
+
if (code === "D") return "#ef4444"
|
|
35
|
+
if (code === "A") return "#4ade80"
|
|
36
|
+
if (code === "R" || code === "C") return "#60a5fa"
|
|
37
|
+
if (code === "M") return "#fbbf24"
|
|
38
|
+
return "#94a3b8"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function parseGitStatus(porcelain: string, tagLine: string): GitStatus {
|
|
42
|
+
const lines = porcelain.split("\n")
|
|
43
|
+
let oid = ""
|
|
44
|
+
let head = ""
|
|
45
|
+
let upstream: string | undefined
|
|
46
|
+
let ahead = 0
|
|
47
|
+
let behind = 0
|
|
48
|
+
const staged: Array<GitFileEntry> = []
|
|
49
|
+
const unstaged: Array<GitFileEntry> = []
|
|
50
|
+
const untracked: Array<string> = []
|
|
51
|
+
|
|
52
|
+
for (const line of lines) {
|
|
53
|
+
if (line.startsWith("# branch.oid ")) {
|
|
54
|
+
oid = line.slice("# branch.oid ".length, "# branch.oid ".length + 7)
|
|
55
|
+
} else if (line.startsWith("# branch.head ")) {
|
|
56
|
+
head = line.slice("# branch.head ".length)
|
|
57
|
+
} else if (line.startsWith("# branch.upstream ")) {
|
|
58
|
+
upstream = line.slice("# branch.upstream ".length)
|
|
59
|
+
} else if (line.startsWith("# branch.ab ")) {
|
|
60
|
+
const parts = line.slice("# branch.ab ".length).split(" ")
|
|
61
|
+
ahead = parseInt(parts[0]?.slice(1) ?? "0", 10)
|
|
62
|
+
behind = parseInt(parts[1]?.slice(1) ?? "0", 10)
|
|
63
|
+
} else if (line.startsWith("1 ") || line.startsWith("2 ")) {
|
|
64
|
+
const xy = line.slice(2, 4)
|
|
65
|
+
const x = xy[0]
|
|
66
|
+
const y = xy[1]
|
|
67
|
+
const parts = line.split("\t")
|
|
68
|
+
const firstParts = parts[0].split(" ")
|
|
69
|
+
const path = parts.length > 1 ? parts[1] : firstParts[firstParts.length - 1]
|
|
70
|
+
if (x !== "." && x !== "?") staged.push({ status: x, path })
|
|
71
|
+
if (y !== "." && y !== "?") unstaged.push({ status: y, path })
|
|
72
|
+
} else if (line.startsWith("u ")) {
|
|
73
|
+
const parts = line.split("\t")
|
|
74
|
+
const path = parts.length > 1 ? parts[1] : line.split(" ").pop()!
|
|
75
|
+
staged.push({ status: "U", path })
|
|
76
|
+
} else if (line.startsWith("? ")) {
|
|
77
|
+
untracked.push(line.slice(2))
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let tag: string | undefined
|
|
82
|
+
let tagDistance = 0
|
|
83
|
+
const tagParts = tagLine.trim().split("\n")
|
|
84
|
+
if (tagParts[0] && !tagParts[0].startsWith("fatal")) {
|
|
85
|
+
tag = tagParts[0]
|
|
86
|
+
tagDistance = parseInt(tagParts[1] ?? "0", 10)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return { oid, head, upstream, ahead, behind, tag, tagDistance, staged, unstaged, untracked }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function GitKV({ label, children }: { label: string; children: any }) {
|
|
93
|
+
return (
|
|
94
|
+
<div style="display:flex;gap:8px;padding:3px 0;font-size:13px;font-family:monospace">
|
|
95
|
+
<span style="color:#6b7280;min-width:80px">{label}</span>
|
|
96
|
+
<span style="color:#e5e7eb">{children}</span>
|
|
97
|
+
</div>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function GitFileRow({ entry }: { entry: GitFileEntry }) {
|
|
102
|
+
const label = statusLabel(entry.status)
|
|
103
|
+
const color = gitStatusColor(entry.status)
|
|
104
|
+
return (
|
|
105
|
+
<div style="display:flex;gap:12px;padding:2px 0;font-size:13px;font-family:monospace">
|
|
106
|
+
<span style={`color:${color};font-style:italic;min-width:80px`}>{label}</span>
|
|
107
|
+
<span style="color:#d1d5db">{entry.path}</span>
|
|
108
|
+
</div>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function SectionHeader({ title, count }: { title: string; count: number }) {
|
|
113
|
+
return (
|
|
114
|
+
<div style="color:#fbbf24;font-size:14px;font-weight:600;padding:16px 0 6px;font-family:monospace">
|
|
115
|
+
{title} ({count})
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function GitStatusView({ status }: { status: GitStatus }) {
|
|
121
|
+
return (
|
|
122
|
+
<div style="padding:12px 16px">
|
|
123
|
+
<GitKV label="Head:">
|
|
124
|
+
<span style="color:#94a3b8;font-style:italic">{status.oid}</span>{" "}
|
|
125
|
+
<span style="color:#4ade80;font-weight:600">{status.head}</span>
|
|
126
|
+
</GitKV>
|
|
127
|
+
{status.upstream && (
|
|
128
|
+
<GitKV label="Upstream:">
|
|
129
|
+
<span style="color:#94a3b8;font-style:italic">{status.oid}</span>{" "}
|
|
130
|
+
<span style="color:#60a5fa;font-weight:600">{status.upstream}</span>
|
|
131
|
+
{(status.ahead > 0 || status.behind > 0) && (
|
|
132
|
+
<span style="color:#94a3b8">
|
|
133
|
+
{status.ahead > 0 ? ` +${status.ahead}` : ""}
|
|
134
|
+
{status.behind > 0 ? ` -${status.behind}` : ""}
|
|
135
|
+
</span>
|
|
136
|
+
)}
|
|
137
|
+
</GitKV>
|
|
138
|
+
)}
|
|
139
|
+
{status.tag && (
|
|
140
|
+
<GitKV label="Tag:">
|
|
141
|
+
<span style="color:#e5e7eb">{status.tag}</span>
|
|
142
|
+
{status.tagDistance > 0 && <span style="color:#60a5fa"> ({status.tagDistance})</span>}
|
|
143
|
+
</GitKV>
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
{status.untracked.length > 0 && (
|
|
147
|
+
<>
|
|
148
|
+
<SectionHeader title="Untracked files" count={status.untracked.length} />
|
|
149
|
+
{status.untracked.map((f) => (
|
|
150
|
+
<div style="padding:2px 0;font-size:13px;font-family:monospace;color:#d1d5db">{f}</div>
|
|
151
|
+
))}
|
|
152
|
+
</>
|
|
153
|
+
)}
|
|
154
|
+
|
|
155
|
+
{status.unstaged.length > 0 && (
|
|
156
|
+
<>
|
|
157
|
+
<SectionHeader title="Unstaged changes" count={status.unstaged.length} />
|
|
158
|
+
{status.unstaged.map((e) => (
|
|
159
|
+
<GitFileRow entry={e} />
|
|
160
|
+
))}
|
|
161
|
+
</>
|
|
162
|
+
)}
|
|
163
|
+
|
|
164
|
+
{status.staged.length > 0 && (
|
|
165
|
+
<>
|
|
166
|
+
<SectionHeader title="Staged changes" count={status.staged.length} />
|
|
167
|
+
{status.staged.map((e) => (
|
|
168
|
+
<GitFileRow entry={e} />
|
|
169
|
+
))}
|
|
170
|
+
</>
|
|
171
|
+
)}
|
|
172
|
+
|
|
173
|
+
{status.untracked.length === 0 &&
|
|
174
|
+
status.unstaged.length === 0 &&
|
|
175
|
+
status.staged.length === 0 && (
|
|
176
|
+
<div style="color:#4ade80;font-size:13px;font-family:monospace;padding:16px 0">
|
|
177
|
+
Clean working tree
|
|
178
|
+
</div>
|
|
179
|
+
)}
|
|
180
|
+
</div>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as ConsoleStore from "../ConsoleStore.ts"
|
|
2
|
+
|
|
3
|
+
function levelColor(level: string): string {
|
|
4
|
+
if (level === "DEBUG") return "#94a3b8"
|
|
5
|
+
if (level === "INFO") return "#60a5fa"
|
|
6
|
+
if (level === "WARNING") return "#fbbf24"
|
|
7
|
+
if (level === "ERROR") return "#ef4444"
|
|
8
|
+
if (level === "FATAL") return "#dc2626"
|
|
9
|
+
return "#e5e7eb"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function LogLine({ log }: { log: ConsoleStore.ConsoleLog }) {
|
|
13
|
+
const color = levelColor(log.level)
|
|
14
|
+
const time = log.date.toLocaleTimeString("en", {
|
|
15
|
+
hour12: false,
|
|
16
|
+
hour: "2-digit",
|
|
17
|
+
minute: "2-digit",
|
|
18
|
+
second: "2-digit",
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
id={`log-${log.id}`}
|
|
24
|
+
style="padding:3px 8px;border-bottom:1px solid #1f2937;font-family:monospace;font-size:12px;display:flex;align-items:baseline"
|
|
25
|
+
>
|
|
26
|
+
<span style="color:#6b7280;white-space:nowrap">{time}</span>
|
|
27
|
+
<span style={`color:${color};font-weight:600;width:56px;text-align:center;flex-shrink:0`}>
|
|
28
|
+
{log.level}
|
|
29
|
+
</span>
|
|
30
|
+
<span style="color:#e5e7eb;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis">
|
|
31
|
+
{log.message}
|
|
32
|
+
</span>
|
|
33
|
+
<a
|
|
34
|
+
href={`${ConsoleStore.store.prefix}/fibers/${log.fiberId.replace("#", "")}`}
|
|
35
|
+
style="color:#6b7280;white-space:nowrap;margin-left:8px;text-decoration:none"
|
|
36
|
+
>
|
|
37
|
+
{log.fiberId}
|
|
38
|
+
</a>
|
|
39
|
+
{log.cause && (
|
|
40
|
+
<div style="color:#ef4444;font-size:11px;padding:2px 0 0 0;white-space:pre-wrap;width:100%">
|
|
41
|
+
{log.cause}
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type * as ConsoleStore from "../ConsoleStore.ts"
|
|
2
|
+
|
|
3
|
+
function MetricValue({ metric }: { metric: ConsoleStore.ConsoleMetricSnapshot }) {
|
|
4
|
+
if (metric.type === "counter" || metric.type === "gauge") {
|
|
5
|
+
return (
|
|
6
|
+
<div style="font-size:32px;font-weight:700;color:#e5e7eb;font-family:monospace;line-height:1.1">
|
|
7
|
+
{String(metric.value)}
|
|
8
|
+
</div>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
if (metric.type === "histogram") {
|
|
12
|
+
const h = metric.value as { count: number; sum: number; min: number; max: number }
|
|
13
|
+
return (
|
|
14
|
+
<div style="display:grid;grid-template-columns:auto auto;gap:2px 12px;font-size:12px;font-family:monospace">
|
|
15
|
+
<span style="color:#6b7280">count</span>
|
|
16
|
+
<span style="color:#e5e7eb">{h.count}</span>
|
|
17
|
+
<span style="color:#6b7280">sum</span>
|
|
18
|
+
<span style="color:#e5e7eb">{h.sum.toFixed(2)}</span>
|
|
19
|
+
<span style="color:#6b7280">min</span>
|
|
20
|
+
<span style="color:#e5e7eb">{h.min.toFixed(2)}</span>
|
|
21
|
+
<span style="color:#6b7280">max</span>
|
|
22
|
+
<span style="color:#e5e7eb">{h.max.toFixed(2)}</span>
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
if (metric.type === "frequency") {
|
|
27
|
+
const occ = metric.value as Record<string, number>
|
|
28
|
+
return (
|
|
29
|
+
<div style="display:grid;grid-template-columns:auto auto;gap:2px 12px;font-size:12px;font-family:monospace">
|
|
30
|
+
{Object.entries(occ)
|
|
31
|
+
.slice(0, 10)
|
|
32
|
+
.map(([k, v]) => (
|
|
33
|
+
<>
|
|
34
|
+
<span style="color:#6b7280">{k}</span>
|
|
35
|
+
<span style="color:#e5e7eb">{v}</span>
|
|
36
|
+
</>
|
|
37
|
+
))}
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
<pre style="font-size:11px;color:#9ca3af;margin:0;white-space:pre-wrap">
|
|
43
|
+
{JSON.stringify(metric.value, null, 2)}
|
|
44
|
+
</pre>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function MetricCard({ metric }: { metric: ConsoleStore.ConsoleMetricSnapshot }) {
|
|
49
|
+
return (
|
|
50
|
+
<div style="background:#111827;border:1px solid #374151;border-radius:6px;padding:12px;min-width:200px">
|
|
51
|
+
<div style="display:flex;align-items:center;gap:8px;margin-bottom:8px">
|
|
52
|
+
<span style="color:#d1d5db;font-size:13px;font-weight:600">{metric.name}</span>
|
|
53
|
+
<span style="font-size:10px;padding:1px 6px;border-radius:4px;background:#1e3a5f;color:#60a5fa">
|
|
54
|
+
{metric.type}
|
|
55
|
+
</span>
|
|
56
|
+
</div>
|
|
57
|
+
<MetricValue metric={metric} />
|
|
58
|
+
{metric.tags.length > 0 && (
|
|
59
|
+
<div style="font-size:10px;color:#6b7280;margin-top:4px">
|
|
60
|
+
{metric.tags.map((t) => `${t.key}=${t.value}`).join(" ")}
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function MetricsGrid({ metrics }: { metrics: Array<ConsoleStore.ConsoleMetricSnapshot> }) {
|
|
68
|
+
if (metrics.length === 0) {
|
|
69
|
+
return <div class="empty">Waiting for metrics...</div>
|
|
70
|
+
}
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
{metrics.map((m) => (
|
|
74
|
+
<MetricCard metric={m} />
|
|
75
|
+
))}
|
|
76
|
+
</>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export interface RouteInfo {
|
|
2
|
+
readonly method: string
|
|
3
|
+
readonly path: string
|
|
4
|
+
readonly format: string | undefined
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function groupByPath(routes: Array<RouteInfo>): Array<{ path: string; routes: Array<RouteInfo> }> {
|
|
8
|
+
const byPath = new Map<string, Array<RouteInfo>>()
|
|
9
|
+
for (const r of routes) {
|
|
10
|
+
let group = byPath.get(r.path)
|
|
11
|
+
if (!group) {
|
|
12
|
+
group = []
|
|
13
|
+
byPath.set(r.path, group)
|
|
14
|
+
}
|
|
15
|
+
group.push(r)
|
|
16
|
+
}
|
|
17
|
+
return Array.from(byPath, ([path, routes]) => ({
|
|
18
|
+
path,
|
|
19
|
+
routes: routes.sort((a, b) => methodOrder.indexOf(a.method) - methodOrder.indexOf(b.method)),
|
|
20
|
+
})).sort((a, b) => a.path.localeCompare(b.path))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function methodColor(method: string): string {
|
|
24
|
+
if (method === "GET") return "#22c55e"
|
|
25
|
+
if (method === "POST") return "#3b82f6"
|
|
26
|
+
if (method === "PUT") return "#f59e0b"
|
|
27
|
+
if (method === "DELETE") return "#ef4444"
|
|
28
|
+
if (method === "PATCH") return "#a855f7"
|
|
29
|
+
if (method === "*") return "#6b7280"
|
|
30
|
+
return "#94a3b8"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function methodBg(method: string): string {
|
|
34
|
+
if (method === "GET") return "#052e16"
|
|
35
|
+
if (method === "POST") return "#172554"
|
|
36
|
+
if (method === "PUT") return "#422006"
|
|
37
|
+
if (method === "DELETE") return "#450a0a"
|
|
38
|
+
if (method === "PATCH") return "#3b0764"
|
|
39
|
+
return "#1e293b"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const methodOrder = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "*"]
|
|
43
|
+
|
|
44
|
+
function MethodBadge({ method }: { method: string }) {
|
|
45
|
+
return (
|
|
46
|
+
<span
|
|
47
|
+
style={`font-size:10px;font-weight:700;font-family:monospace;padding:2px 6px;border-radius:3px;background:${methodBg(method)};color:${methodColor(method)};min-width:48px;text-align:center;display:inline-block`}
|
|
48
|
+
>
|
|
49
|
+
{method}
|
|
50
|
+
</span>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function FormatBadge({ format }: { format: string }) {
|
|
55
|
+
return (
|
|
56
|
+
<span style="font-size:10px;padding:1px 6px;border-radius:3px;background:#1e3a5f;color:#60a5fa">
|
|
57
|
+
{format}
|
|
58
|
+
</span>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function ColoredPath({ path }: { path: string }) {
|
|
63
|
+
const segments = path.split("/").filter(Boolean)
|
|
64
|
+
return (
|
|
65
|
+
<span style="font-family:monospace;font-size:13px">
|
|
66
|
+
{segments.length === 0 ? (
|
|
67
|
+
<span style="color:#e2e8f0">/</span>
|
|
68
|
+
) : (
|
|
69
|
+
segments.map((seg) => {
|
|
70
|
+
const isParam = seg.startsWith(":")
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
<span style="color:#475569">/</span>
|
|
74
|
+
<span style={isParam ? "color:#c084fc" : "color:#e2e8f0"}>{seg}</span>
|
|
75
|
+
</>
|
|
76
|
+
)
|
|
77
|
+
})
|
|
78
|
+
)}
|
|
79
|
+
</span>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function PathGroup({ path, routes }: { path: string; routes: Array<RouteInfo> }) {
|
|
84
|
+
return (
|
|
85
|
+
<div style="padding:8px 12px;border-bottom:1px solid #1e293b">
|
|
86
|
+
<div style="margin-bottom:4px">
|
|
87
|
+
<ColoredPath path={path} />
|
|
88
|
+
</div>
|
|
89
|
+
<div style="display:flex;flex-wrap:wrap;gap:4px">
|
|
90
|
+
{routes.map((r) => (
|
|
91
|
+
<div style="display:flex;align-items:center;gap:6px">
|
|
92
|
+
<MethodBadge method={r.method} />
|
|
93
|
+
{r.format && <FormatBadge format={r.format} />}
|
|
94
|
+
</div>
|
|
95
|
+
))}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function RouteList({ routes }: { routes: Array<RouteInfo> }) {
|
|
102
|
+
if (routes.length === 0) {
|
|
103
|
+
return <div class="empty">No routes registered</div>
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const groups = groupByPath(routes)
|
|
107
|
+
const routeCount = routes.length
|
|
108
|
+
const pathCount = groups.length
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
<div style="padding:8px 12px;border-bottom:1px solid #1e293b;display:flex;gap:16px;font-size:12px;color:#64748b">
|
|
113
|
+
<span>
|
|
114
|
+
{pathCount} path{pathCount !== 1 ? "s" : ""}
|
|
115
|
+
</span>
|
|
116
|
+
<span>
|
|
117
|
+
{routeCount} route{routeCount !== 1 ? "s" : ""}
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
{groups.map((g) => (
|
|
121
|
+
<PathGroup path={g.path} routes={g.routes} />
|
|
122
|
+
))}
|
|
123
|
+
</>
|
|
124
|
+
)
|
|
125
|
+
}
|