@loucompanion/forge-bridge 0.1.3-dev.9853a1d8c458 → 0.1.3-dev.9bc5014a2270

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/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const forgeBridgeVersion = "0.1.3-dev.9853a1d8c458";
1
+ export declare const forgeBridgeVersion = "0.1.3-dev.9bc5014a2270";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const forgeBridgeVersion = "0.1.3-dev.9853a1d8c458";
1
+ export const forgeBridgeVersion = "0.1.3-dev.9bc5014a2270";
@@ -30,14 +30,7 @@ export declare function createDirectoryLink(sourcePath: string, targetPath: stri
30
30
  export declare function lockfilesDiffer(baseCheckoutPath: string, worktreePath: string, packageRootRelative: string): Promise<boolean>;
31
31
  export declare function requiresInstallFallback(entry: WarmPathEntry, baseCheckoutPath: string, worktreePath: string, sourceExists: boolean): Promise<string | null>;
32
32
  export declare function declaresNativeModules(packageRootPath: string): Promise<boolean>;
33
- export interface NpmLaunchOptions {
34
- readonly env?: NodeJS.ProcessEnv;
35
- readonly execPath?: string;
36
- readonly platform?: NodeJS.Platform;
37
- readonly homeDir?: string;
38
- readonly candidates?: readonly string[];
39
- }
40
- export declare function resolveNpmLaunch(args: readonly string[], options?: NpmLaunchOptions): {
33
+ export declare function resolveNpmLaunch(args: readonly string[]): {
41
34
  command: string;
42
35
  args: readonly string[];
43
36
  };
@@ -1,6 +1,4 @@
1
- import { existsSync, realpathSync } from "node:fs";
2
1
  import fs from "node:fs/promises";
3
- import os from "node:os";
4
2
  import path from "node:path";
5
3
  import { NodeProcessRunner } from "../shared/process/process.js";
6
4
  import { isSubPath } from "../shared/path/path.js";
@@ -289,47 +287,12 @@ async function sha256File(filePath) {
289
287
  const content = await fs.readFile(filePath);
290
288
  return crypto.createHash("sha256").update(content).digest("hex");
291
289
  }
292
- export function resolveNpmLaunch(args, options = {}) {
293
- const env = options.env ?? process.env;
294
- const execPath = options.execPath ?? process.execPath;
295
- const npmExecPath = env.npm_execpath;
296
- if (npmExecPath) {
297
- return { command: execPath, args: [npmExecPath, ...args] };
298
- }
299
- const platform = options.platform ?? process.platform;
300
- if (platform !== "win32") {
301
- for (const candidate of options.candidates ?? defaultNpmCliCandidates(execPath, options.homeDir ?? os.homedir())) {
302
- const resolvedCandidate = tryResolveNpmCandidate(candidate);
303
- if (resolvedCandidate) {
304
- return { command: execPath, args: [resolvedCandidate, ...args] };
305
- }
306
- }
290
+ export function resolveNpmLaunch(args) {
291
+ if (process.env.npm_execpath) {
292
+ return { command: process.execPath, args: [process.env.npm_execpath, ...args] };
307
293
  }
308
294
  return { command: "npm", args };
309
295
  }
310
- function tryResolveNpmCandidate(candidate) {
311
- try {
312
- if (!existsSync(candidate)) {
313
- return null;
314
- }
315
- return realpathSync(candidate);
316
- }
317
- catch {
318
- return null;
319
- }
320
- }
321
- function defaultNpmCliCandidates(execPath, homeDir) {
322
- const execDir = path.dirname(execPath);
323
- return [
324
- path.join(execDir, "npm"),
325
- path.join(execDir, "npm-cli.js"),
326
- path.join(execDir, "..", "lib", "node_modules", "npm", "bin", "npm-cli.js"),
327
- "/usr/bin/npm",
328
- "/usr/local/bin/npm",
329
- path.join(homeDir, ".npm-global", "bin", "npm"),
330
- path.join(homeDir, ".npm-global", "lib", "node_modules", "npm", "bin", "npm-cli.js")
331
- ];
332
- }
333
296
  const defaultCommandExecutor = {
334
297
  async run(cwd, command, args) {
335
298
  const result = await defaultProcessRunner.run({ command, cwd, args });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loucompanion/forge-bridge",
3
- "version": "0.1.3-dev.9853a1d8c458",
3
+ "version": "0.1.3-dev.9bc5014a2270",
4
4
  "description": "Forge runner bridge CLI for connecting local developer machines to Forge dispatch.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",