gohere 0.4.1 → 0.6.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/README.md CHANGED
@@ -6,7 +6,7 @@ Tiny local dev URL launcher for `.localhost` projects.
6
6
  http://myproject.localhost
7
7
  ```
8
8
 
9
- Run `gohere` inside a package project or static folder. It starts or serves the project on a hidden local port, routes a clean `.localhost` hostname to it, and prints the URL.
9
+ Run `gohere` inside a package project, workspace root, or static folder. It starts or serves the project on a hidden local port, routes a clean `.localhost` hostname to it, and prints the URL.
10
10
 
11
11
  No script edits. No port memorization. No repo config.
12
12
 
@@ -26,14 +26,21 @@ go install github.com/roie/gohere/cmd/gohere@latest
26
26
 
27
27
  ## Quick start
28
28
 
29
- `gohere` supports package projects and static files.
29
+ `gohere` supports package projects, workspace roots, and static files.
30
30
 
31
- Run the default `dev` script from the nearest `package.json`:
31
+ Run the default command:
32
32
 
33
33
  ```bash
34
34
  gohere
35
35
  ```
36
36
 
37
+ In a package project, this runs the nearest `package.json` `dev` script. In a workspace root, this discovers workspace packages from `pnpm-workspace.yaml` or `package.json` workspaces, starts each package with a `dev` script, and gives each package its own route:
38
+
39
+ ```text
40
+ gohere web -> http://web.myrepo.localhost
41
+ gohere worker -> http://worker.myrepo.localhost
42
+ ```
43
+
37
44
  Run a named package script:
38
45
 
39
46
  ```bash
@@ -46,6 +53,35 @@ Run multiple server scripts:
46
53
  gohere dev:web dev:api
47
54
  ```
48
55
 
56
+ When one `gohere` run starts multiple services, each service can discover the others through env vars. For example, a web dev server can proxy API requests to a worker without hardcoding a port:
57
+
58
+ ```ts
59
+ target: process.env.GOHERE_WORKER_URL
60
+ ```
61
+
62
+ Use `GOHERE_<NAME>_URL` for app config. `GOHERE_<NAME>_PORT`, `GOHERE_<NAME>_TARGET`, and `GOHERE_SERVICES_JSON` are also available when multiple managed services start together. `PORT` and `TARGET` are advanced values and are only set when `gohere` controls that service port.
63
+
64
+ Run any current package script exactly as written by naming it explicitly:
65
+
66
+ ```bash
67
+ gohere dev
68
+ gohere build
69
+ gohere preview
70
+ ```
71
+
72
+ Run an explicit filesystem target:
73
+
74
+ ```bash
75
+ gohere ./dist
76
+ gohere ./apps/web
77
+ ```
78
+
79
+ Auto-refresh static pages while editing:
80
+
81
+ ```bash
82
+ gohere --live
83
+ ```
84
+
49
85
  Run a raw command:
50
86
 
51
87
  ```bash
@@ -64,6 +100,12 @@ Route to a known target port:
64
100
  gohere --target 5173 -- npm run dev
65
101
  ```
66
102
 
103
+ Use a custom port flag for tools that do not use `--port`:
104
+
105
+ ```bash
106
+ gohere --port-flag --local-port dev
107
+ ```
108
+
67
109
  Open the project URL in your browser:
68
110
 
69
111
  ```bash
@@ -79,7 +121,8 @@ CSS, images, and scripts are served normally.
79
121
  ```text
80
122
  myproject -> http://myproject.localhost
81
123
  @scope/web -> http://web.localhost
82
- repo/apps/web -> http://web.repo.localhost
124
+ ./apps/web -> http://web.repo.localhost
125
+ ./dist -> http://dist.localhost
83
126
  about.html -> http://myproject.localhost/about.html
84
127
  ```
85
128
 
@@ -88,7 +131,10 @@ about.html -> http://myproject.localhost/about.html
88
131
  ```bash
89
132
  gohere list
90
133
  gohere list --verbose
134
+ gohere list --json
91
135
  gohere stop
136
+ gohere stop web
137
+ gohere stop --all
92
138
  gohere prune
93
139
  gohere doctor
94
140
  gohere service stop
@@ -97,6 +143,10 @@ gohere uninstall
97
143
 
98
144
  `gohere list --verbose` shows host, target, status, PID, and working directory.
99
145
 
146
+ `gohere list --json` returns the same route information in a stable machine-readable format.
147
+
148
+ `gohere stop` stops routes for the current folder. `gohere stop <target>` stops a listed route by host, short host label, route name, or project name. `gohere stop --all` stops safely controllable routes and skips unverified live routes.
149
+
100
150
  Route status can be `ready`, `dead`, or `unknown`. `prune` removes only routes that are confidently dead.
101
151
 
102
152
  ## Service And Uninstall
@@ -118,29 +168,31 @@ npm uninstall -g gohere
118
168
 
119
169
  ## How it works
120
170
 
121
- `gohere` runs a local service on HTTP port `80`.
171
+ `gohere` runs one local service on HTTP port `80`.
122
172
 
123
173
  Each project gets a hidden local port. The service maps the clean `.localhost` hostname to that port using the request `Host` header.
124
174
 
175
+ First-time setup installs the local service in `~/.gohere/` and starts it in the background. After that, `gohere` only starts your project and registers its route.
176
+
177
+ The service only serves local machine traffic. On macOS, gohere uses a port `80` listener that rejects non-loopback connections before requests reach the router.
178
+
125
179
  State is stored in:
126
180
 
127
181
  ```text
128
182
  ~/.gohere/
129
183
  ```
130
184
 
131
- On Linux/WSL, first-time setup may ask for permission so the service can bind to local port `80`.
132
-
133
- On Windows, first-time setup starts the local service directly on `127.0.0.1:80`.
185
+ Linux may ask for one-time permission to bind port `80`.
134
186
 
135
187
  When used from WSL, `gohere` reuses a running Windows service automatically.
136
188
 
137
189
  ## Platform support
138
190
 
139
- Current target: Linux / WSL and Windows.
140
-
141
- Planned: macOS.
191
+ - Linux / WSL
192
+ - Windows
193
+ - macOS (experimental)
142
194
 
143
- The npm package currently targets Linux x64 and Windows x64.
195
+ The npm package includes x64 and arm64 binaries for these platforms.
144
196
 
145
197
  ## Limits
146
198
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gohere",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Tiny local dev URL launcher for .localhost projects.",
5
5
  "bin": {
6
6
  "gohere": "bin/gohere.js"
@@ -25,9 +25,11 @@
25
25
  ],
26
26
  "os": [
27
27
  "linux",
28
- "win32"
28
+ "win32",
29
+ "darwin"
29
30
  ],
30
31
  "cpu": [
31
- "x64"
32
+ "x64",
33
+ "arm64"
32
34
  ]
33
35
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file