@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/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");