@hamedb89/localghost 0.1.12 → 0.1.15
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 +31 -13
- package/dist/cli.js +499 -128
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +81 -3
- package/dist/index.js +320 -35
- package/dist/index.js.map +1 -1
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +218 -19
- package/dist/vite.js.map +1 -1
- package/docs/flows.md +29 -24
- package/docs/ghost-tunnel.md +4 -1
- package/docs/github.md +4 -4
- package/docs/localghost.1.md +32 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Buh. Friendly local hostnames for app repos.
|
|
|
9
9
|
[](https://github.com/hamedb89/localghost/actions/workflows/ci.yml)
|
|
10
10
|
[](https://github.com/hamedb89/localghost/actions/workflows/pages.yml)
|
|
11
11
|
[](https://github.com/hamedb89/localghost/actions/workflows/publish-npm.yml)
|
|
12
|
-
[](https://www.npmjs.com/package/@hamedb89/localghost)
|
|
13
13
|
|
|
14
14
|
Localghost is a tiny Node.js CLI for clean local app domains. Add it as a dev dependency, keep running the command your team already knows, and use `http://app.localhost/` instead of remembering which port belongs to which process.
|
|
15
15
|
|
|
@@ -20,9 +20,14 @@ Localghost is a tiny Node.js CLI for clean local app domains. Add it as a dev de
|
|
|
20
20
|
Install it as a dev dependency:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
+
npm install -D @hamedb89/localghost
|
|
24
|
+
pnpm add -D @hamedb89/localghost
|
|
23
25
|
yarn add -D @hamedb89/localghost
|
|
26
|
+
bun add -d @hamedb89/localghost
|
|
24
27
|
```
|
|
25
28
|
|
|
29
|
+
Use the command for your package manager; you only need one of the four lines above.
|
|
30
|
+
|
|
26
31
|
For Vite apps, add the plugin once:
|
|
27
32
|
|
|
28
33
|
```ts
|
|
@@ -37,7 +42,7 @@ export default defineConfig({
|
|
|
37
42
|
Then keep using the command your repo already expects:
|
|
38
43
|
|
|
39
44
|
```sh
|
|
40
|
-
|
|
45
|
+
npm exec localghost
|
|
41
46
|
```
|
|
42
47
|
|
|
43
48
|
On the first interactive run, Localghost can create `.localghost`, explain the `/etc/hosts` change, write `ops/local/Caddyfile`, and print the browser-facing URL:
|
|
@@ -54,7 +59,7 @@ For non-Vite apps, wrap your raw dev command:
|
|
|
54
59
|
```json
|
|
55
60
|
{
|
|
56
61
|
"scripts": {
|
|
57
|
-
"dev": "localghost run --
|
|
62
|
+
"dev": "localghost run -- next dev",
|
|
58
63
|
"dev:raw": "next dev"
|
|
59
64
|
}
|
|
60
65
|
}
|
|
@@ -74,6 +79,8 @@ Localghost detects the package manager, prefers a non-recursive `dev:raw` script
|
|
|
74
79
|
npm exec localghost -- --dry-run
|
|
75
80
|
```
|
|
76
81
|
|
|
82
|
+
Supported runtime flags such as `--https`, `--clean-caddy`, `--auto-repair`, and `--dynamic-port` are forwarded by the bare command to the underlying run lifecycle.
|
|
83
|
+
|
|
77
84
|
Create the repo-local hostname contract:
|
|
78
85
|
|
|
79
86
|
```sh
|
|
@@ -135,6 +142,15 @@ localghost ps
|
|
|
135
142
|
localghost ps --json
|
|
136
143
|
```
|
|
137
144
|
|
|
145
|
+
Give coding agents the supported workflow and repository conventions:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
localghost guide --agent
|
|
149
|
+
localghost guide --agent --json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Localghost remembers project and instance port assignments in user-level state under `~/.localghost`. The registry is used only for Localghost-managed processes; the operating-system port check remains authoritative for unrelated processes.
|
|
153
|
+
|
|
138
154
|
Check for updates:
|
|
139
155
|
|
|
140
156
|
```sh
|
|
@@ -218,14 +234,14 @@ admin.app.localhost 5174
|
|
|
218
234
|
}
|
|
219
235
|
```
|
|
220
236
|
|
|
221
|
-
### Keep
|
|
237
|
+
### Keep Your Existing Dev Command
|
|
222
238
|
|
|
223
239
|
Wrap the raw app server so teammates keep typing the normal command:
|
|
224
240
|
|
|
225
241
|
```json
|
|
226
242
|
{
|
|
227
243
|
"scripts": {
|
|
228
|
-
"dev": "localghost run --
|
|
244
|
+
"dev": "localghost run -- vite",
|
|
229
245
|
"dev:raw": "vite"
|
|
230
246
|
}
|
|
231
247
|
}
|
|
@@ -236,7 +252,7 @@ For Turborepo, wrap the dev runner and keep dev uncached:
|
|
|
236
252
|
```json
|
|
237
253
|
{
|
|
238
254
|
"scripts": {
|
|
239
|
-
"dev": "localghost run --
|
|
255
|
+
"dev": "localghost run -- turbo dev",
|
|
240
256
|
"dev:raw": "turbo dev"
|
|
241
257
|
}
|
|
242
258
|
}
|
|
@@ -307,7 +323,6 @@ export default defineLocalghostConfig({
|
|
|
307
323
|
port: 5173,
|
|
308
324
|
dynamicPort: true,
|
|
309
325
|
autoRepair: true,
|
|
310
|
-
command: ["pnpm", "dev"],
|
|
311
326
|
wwwAlias: true
|
|
312
327
|
});
|
|
313
328
|
```
|
|
@@ -329,15 +344,13 @@ export default defineLocalghostConfig({
|
|
|
329
344
|
name: "web",
|
|
330
345
|
cwd: "apps/web",
|
|
331
346
|
host: "xyz.localhost",
|
|
332
|
-
port: 5173
|
|
333
|
-
command: ["pnpm", "dev"]
|
|
347
|
+
port: 5173
|
|
334
348
|
},
|
|
335
349
|
{
|
|
336
350
|
name: "api",
|
|
337
351
|
cwd: "apps/api",
|
|
338
352
|
host: "api.xyz.localhost",
|
|
339
|
-
port: 8787
|
|
340
|
-
command: ["pnpm", "dev"]
|
|
353
|
+
port: 8787
|
|
341
354
|
}
|
|
342
355
|
]
|
|
343
356
|
});
|
|
@@ -415,7 +428,10 @@ export default defineLocalghostConfig({
|
|
|
415
428
|
});
|
|
416
429
|
```
|
|
417
430
|
|
|
418
|
-
### Public Ghost Tunnel
|
|
431
|
+
### Public Ghost Tunnel (Experimental)
|
|
432
|
+
|
|
433
|
+
> [!WARNING]
|
|
434
|
+
> Ghost Tunnel is experimental. Its configuration, transport protocol, and public APIs may change between releases. Do not rely on it for production-critical access, and review its authentication and network exposure before sharing a tunnel.
|
|
419
435
|
|
|
420
436
|
`ghostTunnel` is an opt-in production URL shape for deployed wildcard endpoints. It does not change local Caddy or `/etc/hosts` setup.
|
|
421
437
|
|
|
@@ -577,6 +593,7 @@ localghost teardown [--project name] [--remove-caddyfile]
|
|
|
577
593
|
localghost status [--ready] [--json]
|
|
578
594
|
localghost ps [--json]
|
|
579
595
|
localghost update [--json]
|
|
596
|
+
localghost release <patch|minor|major>
|
|
580
597
|
localghost dev [--config file] [--config-pattern regex] [--https|--ssl] [--auto-repair yes|no] [--trust]
|
|
581
598
|
localghost run [--config file] [--config-pattern regex] [--https|--ssl] [--auto-repair yes|no] [--trust] [--dynamic-port] -- command
|
|
582
599
|
localghost routes [--https|--ssl]
|
|
@@ -612,6 +629,7 @@ import { localGhostPlugin } from "@hamedb89/localghost/vite";
|
|
|
612
629
|
- GitHub Pages is deployed by Actions from the checked-in `site/`, `docs/`, and `assets/` sources.
|
|
613
630
|
- Preview the exact Pages artifact locally with `npm run site:serve`, then open `http://127.0.0.1:4173/`.
|
|
614
631
|
- npm publish is guarded by `prepublishOnly` and the release workflow publishes with npm provenance.
|
|
632
|
+
- To release the CLI, run `localghost release patch`, `localghost release minor`, or `localghost release major`. The command dispatches the **Release** workflow from `main`; it synchronizes version metadata, verifies the package and runtime matrix, commits and tags the bump, publishes npm, and creates a GitHub Release with generated notes. GitHub CLI must be installed and authenticated.
|
|
615
633
|
- Runtime dependencies are intentionally small: `commander` and `execa`. Vite is an optional peer dependency.
|
|
616
634
|
- No postinstall scripts, hidden Homebrew installs, surprise browser tabs, or broad hosts-file rewrites.
|
|
617
635
|
- Update checks are best-effort, cached for 24 hours, and can be disabled with `LOCALGHOST_NO_UPDATE_CHECK=1` or `--no-update-check`.
|
|
@@ -622,7 +640,7 @@ import { localGhostPlugin } from "@hamedb89/localghost/vite";
|
|
|
622
640
|
- [Rendered docs](https://hamedb89.github.io/localghost/docs/)
|
|
623
641
|
- [User flows](./docs/flows.md)
|
|
624
642
|
- [CLI reference](./docs/localghost.1.md)
|
|
625
|
-
- [Ghost Tunnel guide](./docs/ghost-tunnel.md)
|
|
643
|
+
- [Ghost Tunnel guide (experimental)](./docs/ghost-tunnel.md)
|
|
626
644
|
- [macOS widget notes](./docs/macos-widget.md)
|
|
627
645
|
- [Brand guidelines](./docs/brand.md)
|
|
628
646
|
|