visual-remote 0.1.1 → 0.1.3
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/README.md +25 -25
- package/apps/cli/dist/index.js +28 -6
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -16,22 +16,23 @@
|
|
|
16
16
|
Node.js와 pnpm 버전은 각각 `.nvmrc`와 `package.json`에 고정되어 있습니다.
|
|
17
17
|
다른 Node.js 버전에서는 `engine-strict` 설정으로 설치가 중단됩니다.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## 가장 빠른 사용
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
기존 앱이 실행 중인 프로젝트에서 그 주소만 전달합니다.
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
25
|
-
visual init
|
|
26
|
-
visual dev
|
|
27
|
-
visual doctor
|
|
24
|
+
npx --yes visual-remote@latest http://localhost:9011
|
|
28
25
|
```
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
명령이 출력한 `Gateway` 주소로 접속하면 Visual Remote가 포함된 같은 화면이
|
|
28
|
+
열립니다. 원래 `localhost:9011` 화면은 그대로 유지됩니다. `10001`이 사용 중이면
|
|
29
|
+
`10002`, `10003` 순서로 빈 Gateway 포트를 자동 선택합니다.
|
|
30
|
+
|
|
31
|
+
전역 설치를 선호하면 다음처럼 사용합니다.
|
|
31
32
|
|
|
32
33
|
```bash
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
npm install --global visual-remote
|
|
35
|
+
visual http://localhost:9011
|
|
35
36
|
```
|
|
36
37
|
|
|
37
38
|
## 빠른 시작
|
|
@@ -81,26 +82,23 @@ corepack pnpm test
|
|
|
81
82
|
|
|
82
83
|
## 기존 개발 서버에 연결
|
|
83
84
|
|
|
84
|
-
먼저 대상
|
|
85
|
-
|
|
85
|
+
먼저 대상 애플리케이션을 평소처럼 실행합니다. 다음 예시는 애플리케이션이
|
|
86
|
+
`localhost:9011`에서 실행 중인 경우입니다.
|
|
86
87
|
|
|
87
88
|
```bash
|
|
88
|
-
|
|
89
|
-
--upstream http://127.0.0.1:10002 \
|
|
90
|
-
--listen 10001 \
|
|
91
|
-
--public-url https://visual.example.com
|
|
89
|
+
npx --yes visual-remote@latest http://localhost:9011
|
|
92
90
|
```
|
|
93
91
|
|
|
94
|
-
브리지는 `
|
|
92
|
+
브리지는 `10001`부터 빈 포트를 찾아 다음과 같은 주소를 출력합니다.
|
|
95
93
|
|
|
96
94
|
```text
|
|
97
|
-
Gateway: http://
|
|
98
|
-
|
|
99
|
-
Open:
|
|
95
|
+
Gateway: http://localhost:10001
|
|
96
|
+
Upstream: http://localhost:9011/
|
|
97
|
+
Open: http://localhost:10001
|
|
100
98
|
```
|
|
101
99
|
|
|
102
|
-
브라우저에서는 출력된
|
|
103
|
-
필요하지 않습니다.
|
|
100
|
+
브라우저에서는 출력된 `Gateway` 또는 `Open` 주소를 엽니다. 별도의 페어링 링크나
|
|
101
|
+
토큰은 필요하지 않습니다.
|
|
104
102
|
|
|
105
103
|
Portr를 사용한다면 원래 개발 서버 포트가 아니라 브리지 Gateway 포트 `10001`을
|
|
106
104
|
노출해야 합니다. 앱 화면, 개발 서버의 HMR, 브리지 제어 채널이 한 출처를
|
|
@@ -108,7 +106,7 @@ Portr를 사용한다면 원래 개발 서버 포트가 아니라 브리지 Gate
|
|
|
108
106
|
항상 사용한다면 `.visualdev/config.local.yaml`의 `gateway.publicUrl`로도 설정할 수
|
|
109
107
|
있습니다.
|
|
110
108
|
|
|
111
|
-
##
|
|
109
|
+
## 선택 사항: 앱 실행까지 함께 관리
|
|
112
110
|
|
|
113
111
|
대상 저장소 루트에서 `visual init`을 실행하면 패키지 매니저와 `dev` 스크립트를
|
|
114
112
|
감지해 `.visualdev/config.yaml`을 생성합니다. 기존 파일은 덮어쓰지 않습니다.
|
|
@@ -210,6 +208,7 @@ Overlay에서 `작업 보드 ↗`를 다시 눌러 새 세션을 엽니다. 연
|
|
|
210
208
|
현재 제공하는 명령은 다음과 같습니다.
|
|
211
209
|
|
|
212
210
|
```bash
|
|
211
|
+
npx visual-remote http://localhost:9011
|
|
213
212
|
visual init
|
|
214
213
|
visual attach --help
|
|
215
214
|
visual dev --help
|
|
@@ -217,9 +216,10 @@ visual status
|
|
|
217
216
|
visual doctor
|
|
218
217
|
```
|
|
219
218
|
|
|
220
|
-
-
|
|
221
|
-
- `attach`:
|
|
222
|
-
- `
|
|
219
|
+
- 기본 명령: 전달한 기존 앱 주소 앞에 브리지를 연결합니다.
|
|
220
|
+
- `attach`: 기본 명령의 명시적 이름이며 기존 사용법과 호환됩니다.
|
|
221
|
+
- `init`: 선택적으로 앱 실행까지 관리할 때 기본 설정을 생성합니다.
|
|
222
|
+
- `dev`: `init` 설정을 사용해 앱과 브리지를 함께 실행하는 선택 명령입니다.
|
|
223
223
|
- `status`: 현재 Git 작업 트리의 브리지 실행 상태를 확인합니다.
|
|
224
224
|
- `doctor`: Git, 설정 파일, 개발 명령과 Codex 사용 가능 여부를 점검합니다.
|
|
225
225
|
|
package/apps/cli/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
4
5
|
import { resolve as resolve8 } from "node:path";
|
|
5
6
|
import { pathToFileURL } from "node:url";
|
|
6
7
|
import { Command, InvalidArgumentError } from "commander";
|
|
@@ -565,7 +566,7 @@ Content-Length: 0\r
|
|
|
565
566
|
}
|
|
566
567
|
}
|
|
567
568
|
function gatewayDisplayHost(host) {
|
|
568
|
-
if (host === "0.0.0.0" || host === "::") return "
|
|
569
|
+
if (host === "0.0.0.0" || host === "::") return "localhost";
|
|
569
570
|
return host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
570
571
|
}
|
|
571
572
|
function createGatewayServer(options) {
|
|
@@ -5352,14 +5353,28 @@ function setExitCode(dependencies, code) {
|
|
|
5352
5353
|
}
|
|
5353
5354
|
}
|
|
5354
5355
|
function createCli(dependencies = {}) {
|
|
5355
|
-
const program = new Command().name("visual").description("Visual Remote Dev Bridge").version("0.1.
|
|
5356
|
+
const program = new Command().name("visual").description("Visual Remote Dev Bridge").version("0.1.3");
|
|
5356
5357
|
program.command("init").description("Create .visualdev/config.yaml for the current project").action(async () => {
|
|
5357
5358
|
const result = await initializeVisualDev(dependencies);
|
|
5358
5359
|
output(dependencies, formatInitResult(result));
|
|
5359
5360
|
});
|
|
5360
|
-
program.command("attach").description("Attach the Bridge to an existing development server").
|
|
5361
|
-
async (options) => {
|
|
5362
|
-
const
|
|
5361
|
+
program.command("attach [upstream]", { isDefault: true }).description("Attach the Bridge to an existing development server").option("--upstream <url>", "existing development server URL").option("--listen <port>", "gateway port (10001 or above)", parsePort).option("--host <host>", "gateway bind host (default: 0.0.0.0)").option("--public-url <url>", "public Gateway URL opened in the browser").action(
|
|
5362
|
+
async (upstream, options) => {
|
|
5363
|
+
const upstreamUrl = options.upstream ?? upstream;
|
|
5364
|
+
if (upstreamUrl === void 0) {
|
|
5365
|
+
throw new Error(
|
|
5366
|
+
"Provide the running app URL, for example: npx visual-remote http://localhost:9011"
|
|
5367
|
+
);
|
|
5368
|
+
}
|
|
5369
|
+
const bridge = await startAttachBridge(
|
|
5370
|
+
{
|
|
5371
|
+
upstream: upstreamUrl,
|
|
5372
|
+
...options.listen === void 0 ? {} : { listen: options.listen },
|
|
5373
|
+
...options.host === void 0 ? {} : { host: options.host },
|
|
5374
|
+
...options.publicUrl === void 0 ? {} : { publicUrl: options.publicUrl }
|
|
5375
|
+
},
|
|
5376
|
+
dependencies
|
|
5377
|
+
);
|
|
5363
5378
|
output(dependencies, formatBridgeSummary(bridge));
|
|
5364
5379
|
await runBridgeUntilSignal(bridge);
|
|
5365
5380
|
}
|
|
@@ -5388,8 +5403,15 @@ function createCli(dependencies = {}) {
|
|
|
5388
5403
|
async function main(argv = process.argv, dependencies = {}) {
|
|
5389
5404
|
await createCli(dependencies).parseAsync(argv);
|
|
5390
5405
|
}
|
|
5406
|
+
function isDirectEntry(entryPath2) {
|
|
5407
|
+
try {
|
|
5408
|
+
return pathToFileURL(realpathSync(resolve8(entryPath2))).href === import.meta.url;
|
|
5409
|
+
} catch {
|
|
5410
|
+
return false;
|
|
5411
|
+
}
|
|
5412
|
+
}
|
|
5391
5413
|
var entryPath = process.argv[1];
|
|
5392
|
-
if (entryPath !== void 0 &&
|
|
5414
|
+
if (entryPath !== void 0 && isDirectEntry(entryPath)) {
|
|
5393
5415
|
void main().catch((error) => {
|
|
5394
5416
|
process.stderr.write(
|
|
5395
5417
|
`${error instanceof Error ? error.message : "Unknown Visual Bridge error"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual-remote",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Visual bridge from a running web UI to Codex in its Git worktree",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"packages/overlay/dist/viewer.js"
|
|
18
18
|
],
|
|
19
19
|
"bin": {
|
|
20
|
-
"visual": "./apps/cli/dist/index.js"
|
|
20
|
+
"visual": "./apps/cli/dist/index.js",
|
|
21
|
+
"visual-remote": "./apps/cli/dist/index.js"
|
|
21
22
|
},
|
|
22
23
|
"publishConfig": {
|
|
23
24
|
"access": "public",
|
|
@@ -42,11 +43,11 @@
|
|
|
42
43
|
"tsx": "^4.23.1",
|
|
43
44
|
"typescript": "^7.0.2",
|
|
44
45
|
"vitest": "^4.1.10",
|
|
46
|
+
"@visual-remote/cli": "0.1.0",
|
|
45
47
|
"@visual-remote/bridge-core": "0.1.0",
|
|
48
|
+
"@visual-remote/gateway": "0.1.0",
|
|
46
49
|
"@visual-remote/protocol": "0.1.0",
|
|
47
|
-
"@visual-remote/overlay": "0.1.0"
|
|
48
|
-
"@visual-remote/cli": "0.1.0",
|
|
49
|
-
"@visual-remote/gateway": "0.1.0"
|
|
50
|
+
"@visual-remote/overlay": "0.1.0"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
52
53
|
"build": "corepack pnpm run build:overlay && corepack pnpm run build:server",
|