UNPKG

2.5 kBTypeScriptView Raw
1/// <reference types="node" />
2import { SpawnOptions } from 'child_process';
3import { Meta, NodeVersion, Config } from '../types';
4interface SpawnOptionsExtended extends SpawnOptions {
5 prettyCommand?: string;
6}
7export declare function spawnAsync(command: string, args: string[], opts?: SpawnOptionsExtended): Promise<void>;
8export declare function execAsync(command: string, args: string[], opts?: SpawnOptionsExtended): Promise<{
9 stdout: string;
10 stderr: string;
11 code: number;
12}>;
13export declare function spawnCommand(command: string, options?: SpawnOptions): import("child_process").ChildProcess;
14export declare function execCommand(command: string, options?: SpawnOptions): Promise<boolean>;
15export declare function getNodeBinPath({ cwd }: {
16 cwd: string;
17}): Promise<string>;
18export declare function runShellScript(fsPath: string, args?: string[], spawnOpts?: SpawnOptions): Promise<boolean>;
19export declare function getSpawnOptions(meta: Meta, nodeVersion: NodeVersion): SpawnOptions;
20export declare function getNodeVersion(destPath: string, _nodeVersion?: string, _config?: Config, meta?: Meta): Promise<NodeVersion>;
21interface WalkParentDirsProps {
22 /**
23 * The highest directory, typically the workPath root of the project.
24 * If this directory is reached and it doesn't contain the file, null is returned.
25 */
26 base: string;
27 /**
28 * The directory to start searching, typically the same directory of the entrypoint.
29 * If this directory doesn't contain the file, the parent is checked, etc.
30 */
31 start: string;
32 /**
33 * The name of the file to search for, typically `package.json` or `Gemfile`.
34 */
35 filename: string;
36}
37export declare function walkParentDirs({ base, start, filename, }: WalkParentDirsProps): Promise<string | null>;
38export declare function runNpmInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta): Promise<void>;
39export declare function runBundleInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta): Promise<void>;
40export declare function runPipInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta): Promise<void>;
41export declare function runPackageJsonScript(destPath: string, scriptName: string, spawnOpts?: SpawnOptions): Promise<boolean>;
42/**
43 * @deprecate installDependencies() is deprecated.
44 * Please use runNpmInstall() instead.
45 */
46export declare const installDependencies: typeof runNpmInstall;
47export {};