visual-remote 0.1.1 → 0.1.2

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 CHANGED
@@ -16,22 +16,23 @@
16
16
  Node.js와 pnpm 버전은 각각 `.nvmrc`와 `package.json`에 고정되어 있습니다.
17
17
  다른 Node.js 버전에서는 `engine-strict` 설정으로 설치가 중단됩니다.
18
18
 
19
- ## npm 설치
19
+ ## 가장 빠른 사용
20
20
 
21
- npmjs에서 전역으로 설치합니다.
21
+ 기존 앱이 실행 중인 프로젝트에서 그 주소만 전달합니다.
22
22
 
23
23
  ```bash
24
- npm install --global visual-remote
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
- npx --yes visual-remote@latest init
34
- npx --yes visual-remote@latest dev
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
- 먼저 대상 애플리케이션의 개발 서버를 `10001` 이상의 포트에서 실행합니다. 다음
85
- 예시는 애플리케이션이 `0.0.0.0:10002`에서 실행 중인 경우입니다.
85
+ 먼저 대상 애플리케이션을 평소처럼 실행합니다. 다음 예시는 애플리케이션이
86
+ `localhost:9011`에서 실행 중인 경우입니다.
86
87
 
87
88
  ```bash
88
- node apps/cli/dist/index.js attach \
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
- 브리지는 `0.0.0.0:10001`에 바인딩하고 다음과 같은 주소를 출력합니다.
92
+ 브리지는 `10001`부터 포트를 찾아 다음과 같은 주소를 출력합니다.
95
93
 
96
94
  ```text
97
- Gateway: http://dev:10001
98
- Public: https://visual.example.com/
99
- Open: https://visual.example.com/
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
- - `init`: 패키지 매니저와 `dev` 스크립트를 감지해 기본 설정을 생성합니다.
221
- - `attach`: 이미 실행 중인 개발 서버 앞에 브리지를 연결합니다.
222
- - `dev`: 설정된 개발 서버와 브리지를 함께 실행합니다.
219
+ - 기본 명령: 전달한 기존 주소 앞에 브리지를 연결합니다.
220
+ - `attach`: 기본 명령의 명시적 이름이며 기존 사용법과 호환됩니다.
221
+ - `init`: 선택적으로 실행까지 관리할 기본 설정을 생성합니다.
222
+ - `dev`: `init` 설정을 사용해 앱과 브리지를 함께 실행하는 선택 명령입니다.
223
223
  - `status`: 현재 Git 작업 트리의 브리지 실행 상태를 확인합니다.
224
224
  - `doctor`: Git, 설정 파일, 개발 명령과 Codex 사용 가능 여부를 점검합니다.
225
225
 
@@ -565,7 +565,7 @@ Content-Length: 0\r
565
565
  }
566
566
  }
567
567
  function gatewayDisplayHost(host) {
568
- if (host === "0.0.0.0" || host === "::") return "dev";
568
+ if (host === "0.0.0.0" || host === "::") return "localhost";
569
569
  return host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
570
570
  }
571
571
  function createGatewayServer(options) {
@@ -5352,14 +5352,28 @@ function setExitCode(dependencies, code) {
5352
5352
  }
5353
5353
  }
5354
5354
  function createCli(dependencies = {}) {
5355
- const program = new Command().name("visual").description("Visual Remote Dev Bridge").version("0.1.1");
5355
+ const program = new Command().name("visual").description("Visual Remote Dev Bridge").version("0.1.2");
5356
5356
  program.command("init").description("Create .visualdev/config.yaml for the current project").action(async () => {
5357
5357
  const result = await initializeVisualDev(dependencies);
5358
5358
  output(dependencies, formatInitResult(result));
5359
5359
  });
5360
- program.command("attach").description("Attach the Bridge to an existing development server").requiredOption("--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(
5361
- async (options) => {
5362
- const bridge = await startAttachBridge(options, dependencies);
5360
+ 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(
5361
+ async (upstream, options) => {
5362
+ const upstreamUrl = options.upstream ?? upstream;
5363
+ if (upstreamUrl === void 0) {
5364
+ throw new Error(
5365
+ "Provide the running app URL, for example: npx visual-remote http://localhost:9011"
5366
+ );
5367
+ }
5368
+ const bridge = await startAttachBridge(
5369
+ {
5370
+ upstream: upstreamUrl,
5371
+ ...options.listen === void 0 ? {} : { listen: options.listen },
5372
+ ...options.host === void 0 ? {} : { host: options.host },
5373
+ ...options.publicUrl === void 0 ? {} : { publicUrl: options.publicUrl }
5374
+ },
5375
+ dependencies
5376
+ );
5363
5377
  output(dependencies, formatBridgeSummary(bridge));
5364
5378
  await runBridgeUntilSignal(bridge);
5365
5379
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visual-remote",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Visual bridge from a running web UI to Codex in its Git worktree",
5
5
  "type": "module",
6
6
  "repository": {