@octane-xplat/devtools 0.0.0-nightly.g28d6eb6 → 0.0.0-nightly.g852be0c
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/client.d.ts +1 -3
- package/dist/client.js +0 -1
- package/dist/types.d.ts +0 -8
- package/package.json +6 -6
- package/src/client.ts +1 -4
- package/src/desktop/Shell.macos.tsrx +38 -37
- package/src/desktop/Shell.ts +0 -1
- package/src/desktop/main.macos.ts +2 -10
- package/src/desktop/target.ts +4 -2
- package/src/panel/App.tsrx +179 -779
- package/src/panel/index.ts +3 -9
- package/src/panel/main.web.tsrx +36 -42
- package/src/panel/model.ts +17 -156
- package/src/panel/panel.css +96 -218
- package/src/panel/plugin.ts +1 -10
- package/src/types.ts +0 -9
- package/src/ICON-LICENSES +0 -46
- package/src/desktop/window-size.ts +0 -1
- package/src/panel/ProjectBar.tsrx +0 -75
- package/src/panel/icons.ts +0 -124
- package/src/panel/log-scroll.macos.ts +0 -126
- package/src/panel/log-scroll.ts +0 -21
- package/src/panel/log-scroll.web.ts +0 -99
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BackendRef, type ChannelError, type DevSocket, type SessionSnapshot } from './types.ts';
|
|
2
|
-
export type { BackendRef, ChannelError,
|
|
2
|
+
export type { BackendRef, ChannelError, SessionSnapshot } from './types.ts';
|
|
3
3
|
/** The fields a panel needs from the dev server's discovery record. */
|
|
4
4
|
export interface DevtoolsServerRecord {
|
|
5
5
|
endpoint: string;
|
|
@@ -42,8 +42,6 @@ export interface DevtoolsConnection {
|
|
|
42
42
|
close(): void;
|
|
43
43
|
}
|
|
44
44
|
export interface ConnectDevtoolsOptions {
|
|
45
|
-
/** Tabs a desktop window can raise in response to app shortcuts. */
|
|
46
|
-
desktopTabs?: readonly string[];
|
|
47
45
|
/** Overrides the socket factory — the macOS JSC host has no global
|
|
48
46
|
* `WebSocket`, so native panels inject their transport here. */
|
|
49
47
|
socket?: (url: string) => DevSocket | undefined;
|
package/dist/client.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -23,14 +23,6 @@ export interface DevActionRef {
|
|
|
23
23
|
cancellable?: boolean;
|
|
24
24
|
} & Record<string, unknown>;
|
|
25
25
|
}
|
|
26
|
-
export interface SelectedElement {
|
|
27
|
-
tag: string;
|
|
28
|
-
id: string;
|
|
29
|
-
classes: string[];
|
|
30
|
-
path: string;
|
|
31
|
-
styleIds: string[];
|
|
32
|
-
component?: string;
|
|
33
|
-
}
|
|
34
26
|
/** A connected app session as the hub reports it in `ready`/`sessions`. */
|
|
35
27
|
export interface SessionSnapshot {
|
|
36
28
|
sessionId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octane-xplat/devtools",
|
|
3
|
-
"version": "0.0.0-nightly.
|
|
3
|
+
"version": "0.0.0-nightly.g852be0c",
|
|
4
4
|
"description": "Devtools channel clients for Octane Xplat — app channels, per-target Node backends, and devtools panel connections over the xplat dev hub",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -66,17 +66,17 @@
|
|
|
66
66
|
"test": "node --test tests/*.test.mts"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@octane-xplat/platform": "0.0.0-nightly.
|
|
70
|
-
"@octane-xplat/ui": "0.0.0-nightly.
|
|
69
|
+
"@octane-xplat/platform": "0.0.0-nightly.g852be0c",
|
|
70
|
+
"@octane-xplat/ui": "0.0.0-nightly.g852be0c"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"octane": ">=0.6.3 <1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@nativescript/macos-node-api": "0.5.0-beta.0",
|
|
77
|
-
"@octane-xplat/cli": "0.0.0-nightly.
|
|
78
|
-
"@octane-xplat/jsx": "0.0.0-nightly.
|
|
79
|
-
"@octane-xplat/macos-appkit": "0.0.0-nightly.
|
|
77
|
+
"@octane-xplat/cli": "0.0.0-nightly.g852be0c",
|
|
78
|
+
"@octane-xplat/jsx": "0.0.0-nightly.g852be0c",
|
|
79
|
+
"@octane-xplat/macos-appkit": "0.0.0-nightly.g852be0c",
|
|
80
80
|
"@octanejs/vite-plugin": "0.6.6",
|
|
81
81
|
"@tsrx/content-mapper": "0.1.2",
|
|
82
82
|
"@types/node": "26.6.6",
|
package/src/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type SessionSnapshot,
|
|
12
12
|
} from './types.ts'
|
|
13
13
|
|
|
14
|
-
export type { BackendRef, ChannelError,
|
|
14
|
+
export type { BackendRef, ChannelError, SessionSnapshot } from './types.ts'
|
|
15
15
|
|
|
16
16
|
/** The fields a panel needs from the dev server's discovery record. */
|
|
17
17
|
export interface DevtoolsServerRecord {
|
|
@@ -54,8 +54,6 @@ export interface DevtoolsConnection {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export interface ConnectDevtoolsOptions {
|
|
57
|
-
/** Tabs a desktop window can raise in response to app shortcuts. */
|
|
58
|
-
desktopTabs?: readonly string[]
|
|
59
57
|
/** Overrides the socket factory — the macOS JSC host has no global
|
|
60
58
|
* `WebSocket`, so native panels inject their transport here. */
|
|
61
59
|
socket?: (url: string) => DevSocket | undefined
|
|
@@ -120,7 +118,6 @@ export function connectDevtools(
|
|
|
120
118
|
version: 1,
|
|
121
119
|
instanceId: record.instanceId,
|
|
122
120
|
token: record.devtoolsToken,
|
|
123
|
-
...(options.desktopTabs ? { desktopTabs: options.desktopTabs } : {}),
|
|
124
121
|
}),
|
|
125
122
|
)
|
|
126
123
|
}
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
// launched from as preferredRoot; the apps/devtools harness passes null.
|
|
5
5
|
import '../panel/styles.ts'
|
|
6
6
|
import { useEffect, useRef, useState } from 'octane'
|
|
7
|
-
import { Center, Pressable, ScrollableArea, Text, VStack } from '@octane-xplat/ui'
|
|
8
|
-
import { NSURL, NSWorkspace } from '@octane-xplat/platform/macos'
|
|
9
|
-
import { ProjectBar } from '../panel/ProjectBar.tsrx'
|
|
10
|
-
|
|
7
|
+
import { Button, Center, HStack, Pressable, ScrollableArea, Text, VStack } from '@octane-xplat/ui'
|
|
11
8
|
import { listDevtoolsServers, nwDevSocket } from '../macos/index.macos.ts'
|
|
12
9
|
import type { ListedDevtoolsServer } from '../macos/index.macos.ts'
|
|
13
10
|
import { App } from '../panel/index.ts'
|
|
@@ -31,11 +28,12 @@ export function Shell(props: DevtoolsShellProps) @{
|
|
|
31
28
|
// Mirrors of rendered state for the poll/selftest closures.
|
|
32
29
|
const recordsRef = useRef<ListedDevtoolsServer[]>([])
|
|
33
30
|
const targetRef = useRef<ListedDevtoolsServer | null>(null)
|
|
34
|
-
//
|
|
31
|
+
// Auto-targeting applies only until the first target is chosen — auto or
|
|
32
|
+
// by click — or Switch is pressed; after that the user owns selection.
|
|
35
33
|
const autoPick = useRef(true)
|
|
36
|
-
const
|
|
34
|
+
const [onTop, setOnTop] = useState(false)
|
|
37
35
|
|
|
38
|
-
const choose = (record: ListedDevtoolsServer) => {
|
|
36
|
+
const choose = (record: ListedDevtoolsServer | null) => {
|
|
39
37
|
autoPick.current = false
|
|
40
38
|
targetRef.current = record
|
|
41
39
|
setTarget(record)
|
|
@@ -90,15 +88,15 @@ export function Shell(props: DevtoolsShellProps) @{
|
|
|
90
88
|
}, [])
|
|
91
89
|
|
|
92
90
|
useEffect(() => {
|
|
93
|
-
props.onTitle?.(
|
|
94
|
-
}, [
|
|
91
|
+
props.onTitle?.(target ? `devtools — ${basename(target.appRoot)}` : 'devtools')
|
|
92
|
+
}, [target])
|
|
95
93
|
|
|
96
94
|
useEffect(() => {
|
|
97
95
|
if (props.selftest) {
|
|
98
96
|
props.selftest.pick = (index: number) => {
|
|
99
97
|
const record = recordsRef.current[index]
|
|
100
98
|
|
|
101
|
-
if (record
|
|
99
|
+
if (record) {
|
|
102
100
|
choose(record)
|
|
103
101
|
}
|
|
104
102
|
}
|
|
@@ -106,34 +104,37 @@ export function Shell(props: DevtoolsShellProps) @{
|
|
|
106
104
|
}, [])
|
|
107
105
|
|
|
108
106
|
<VStack className="dt-root">
|
|
109
|
-
@if (projectPath) {
|
|
110
|
-
<ProjectBar
|
|
111
|
-
path={projectPath}
|
|
112
|
-
onKeepOnTop={props.onKeepOnTop}
|
|
113
|
-
onReveal={(path) =>
|
|
114
|
-
NSWorkspace.sharedWorkspace.activateFileViewerSelectingURLs([
|
|
115
|
-
NSURL.fileURLWithPath(path),
|
|
116
|
-
])
|
|
117
|
-
}
|
|
118
|
-
/>
|
|
119
|
-
}
|
|
120
107
|
@if (target !== null) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
108
|
+
const focused = target
|
|
109
|
+
|
|
110
|
+
<>
|
|
111
|
+
<HStack className="dt-target-bar">
|
|
112
|
+
<Text className="dt-target-name">{basename(focused.appRoot)}</Text>
|
|
113
|
+
<HStack className="dt-right">
|
|
114
|
+
@if (props.onKeepOnTop) {
|
|
115
|
+
<Button
|
|
116
|
+
label={onTop ? 'Unpin' : 'Keep on top'}
|
|
117
|
+
onPress={() => {
|
|
118
|
+
const next = !onTop
|
|
119
|
+
|
|
120
|
+
setOnTop(next)
|
|
121
|
+
props.onKeepOnTop?.(next)
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
}
|
|
125
|
+
<Button label="Switch…" onPress={() => choose(null)} />
|
|
126
|
+
</HStack>
|
|
127
|
+
</HStack>
|
|
128
|
+
<VStack className="dt-targeted">
|
|
129
|
+
<App
|
|
130
|
+
key={`${focused.key}:${focused.instanceId}`}
|
|
131
|
+
record={focused}
|
|
132
|
+
socket={nwDevSocket}
|
|
133
|
+
plugins={panelPlugins}
|
|
134
|
+
initialTab={props.initialTab}
|
|
135
|
+
/>
|
|
136
|
+
</VStack>
|
|
137
|
+
</>
|
|
137
138
|
} @else if (records.length === 0) {
|
|
138
139
|
<Center style={{ flex: 1 }}>
|
|
139
140
|
<Text className="dt-empty">No xplat dev servers running</Text>
|
package/src/desktop/Shell.ts
CHANGED
|
@@ -5,7 +5,6 @@ export interface DevtoolsShellProps {
|
|
|
5
5
|
preferredRoot: string | null
|
|
6
6
|
/** Tab to show on mount (DEVTOOLS_SELFTEST_TAB). */
|
|
7
7
|
initialTab?: string
|
|
8
|
-
onPresent?: () => void
|
|
9
8
|
/** Toggle the main window's level (keep-on-top); absent → no toggle shown. */
|
|
10
9
|
onKeepOnTop?: (onTop: boolean) => void
|
|
11
10
|
/** Main-window title updates: `devtools` until a server is targeted. */
|
|
@@ -9,7 +9,6 @@ import { runMacOSApp } from '@octane-xplat/macos-appkit/host'
|
|
|
9
9
|
import type { NSView } from '@octane-xplat/platform/macos'
|
|
10
10
|
import { writeFileSync } from 'node:fs'
|
|
11
11
|
import { Shell } from './Shell.macos.tsrx'
|
|
12
|
-
import { devtoolsWindowSize } from './window-size.ts'
|
|
13
12
|
|
|
14
13
|
// The project-built variant sets a Vite define for direct development launches.
|
|
15
14
|
declare const __XPLAT_DEVTOOLS_PREFERRED_ROOT__: string
|
|
@@ -29,21 +28,14 @@ const selftest: { pick?: (index: number) => void } = {}
|
|
|
29
28
|
runMacOSApp(
|
|
30
29
|
{
|
|
31
30
|
title: 'devtools',
|
|
32
|
-
size:
|
|
31
|
+
size: { width: 420, height: 720 },
|
|
33
32
|
terminateAfterLastWindowClosed: true,
|
|
34
33
|
},
|
|
35
|
-
({
|
|
34
|
+
({ window, root }) => {
|
|
36
35
|
window.contentMinSize = { width: 380, height: 360 }
|
|
37
36
|
root.render(Shell as never, {
|
|
38
37
|
preferredRoot: PREFERRED_ROOT,
|
|
39
38
|
initialTab: SELFTEST_TAB,
|
|
40
|
-
onPresent: () => {
|
|
41
|
-
if (window.miniaturized) {
|
|
42
|
-
window.deminiaturize(null)
|
|
43
|
-
}
|
|
44
|
-
window.makeKeyAndOrderFront(null)
|
|
45
|
-
app.activateIgnoringOtherApps(true)
|
|
46
|
-
},
|
|
47
39
|
onKeepOnTop: (onTop: boolean) => {
|
|
48
40
|
// NSFloatingWindowLevel (3) above NSNormalWindowLevel (0).
|
|
49
41
|
const level = onTop ? 3 : 0
|
package/src/desktop/target.ts
CHANGED
|
@@ -13,7 +13,7 @@ function normalizeRoot(path: string): string {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Order: an explicit preferred root (the app `xplat devtools` ran from) wins;
|
|
16
|
-
//
|
|
16
|
+
// a sole record auto-targets; otherwise the picker decides. Both sides are
|
|
17
17
|
// canonical real paths — Go writes appRoot through osfs.Canonical and the
|
|
18
18
|
// launcher realpaths the selected project — so trailing-slash
|
|
19
19
|
// normalization is defensive only.
|
|
@@ -25,7 +25,9 @@ export function autoTarget(
|
|
|
25
25
|
const root = normalizeRoot(preferredRoot)
|
|
26
26
|
const match = records.find((record) => normalizeRoot(record.appRoot) === root)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
if (match) {
|
|
29
|
+
return match
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
return records.length === 1 ? records[0] : null
|