@hamedb89/localghost 0.1.15 → 0.3.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 +13 -2
- package/dist/cli.js +169 -27
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +40 -4
- package/dist/index.js +83 -6
- package/dist/index.js.map +1 -1
- package/dist/vite.js +13 -0
- package/dist/vite.js.map +1 -1
- package/docs/github.md +5 -5
- package/docs/localghost.1.md +6 -4
- package/package.json +1 -1
package/dist/vite.js
CHANGED
|
@@ -80,6 +80,7 @@ function registerLocalghostRun(input2, path = getLocalghostActivityPath()) {
|
|
|
80
80
|
...input2.configPath ? { configPath: input2.configPath } : {},
|
|
81
81
|
...input2.caddyfilePath ? { caddyfilePath: input2.caddyfilePath } : {},
|
|
82
82
|
...input2.caddyPid ? { caddyPid: input2.caddyPid } : {},
|
|
83
|
+
...input2.caddyPgid ? { caddyPgid: input2.caddyPgid } : {},
|
|
83
84
|
...input2.childPid ? { childPid: input2.childPid } : {},
|
|
84
85
|
...input2.childCommand ? { childCommand: input2.childCommand } : {},
|
|
85
86
|
...typeof input2.https === "boolean" ? { https: input2.https } : {},
|
|
@@ -389,6 +390,18 @@ function createLocalghostRegistry(options = {}) {
|
|
|
389
390
|
lockPath,
|
|
390
391
|
ownerToken,
|
|
391
392
|
read: readRegistry,
|
|
393
|
+
async prune() {
|
|
394
|
+
const releaseLock = await lock();
|
|
395
|
+
try {
|
|
396
|
+
const registry = await readRegistry();
|
|
397
|
+
const before = registry.leases.length;
|
|
398
|
+
pruneRegistry(registry, now(), isRunning);
|
|
399
|
+
await writeRegistry(registry);
|
|
400
|
+
return { removedLeases: before - registry.leases.length };
|
|
401
|
+
} finally {
|
|
402
|
+
await releaseLock();
|
|
403
|
+
}
|
|
404
|
+
},
|
|
392
405
|
async acquirePort(acquireOptions) {
|
|
393
406
|
const projectCwd = canonicalizeLocalghostProjectCwd(acquireOptions.projectCwd ?? cwd);
|
|
394
407
|
if (!acquireOptions.instanceKey) throw new Error("instanceKey is required");
|