build-strap 5.0.3 → 5.0.4-dev.106
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/package.json +2 -2
- package/src/aws.d.ts +3 -3
- package/src/brew.d.ts +1 -1
- package/src/docker.d.ts +2 -2
- package/src/docker.volume.d.ts +1 -1
- package/src/dockerCompose.d.ts +7 -7
- package/src/env.d.ts +2 -2
- package/src/fs.d.ts +4 -4
- package/src/gh.d.ts +1 -1
- package/src/git.d.ts +3 -3
- package/src/macos.d.ts +1 -0
- package/src/macos.js +12 -0
- package/src/npm.d.ts +2 -2
- package/src/run.d.ts +1 -1
- package/src/ssh.d.ts +1 -1
- package/src/tgz.d.ts +1 -1
- package/src/version.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-strap",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4-dev.106",
|
|
4
4
|
"description": "Node scripts for building things",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"authors": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"bytes": "^3.1.1",
|
|
21
21
|
"chokidar": "^3.5.2",
|
|
22
22
|
"cross-spawn": "^7.0.3",
|
|
23
|
-
"fs-extra": "^
|
|
23
|
+
"fs-extra": "^11.1.0",
|
|
24
24
|
"get-port": "^6.0.0",
|
|
25
25
|
"glob": "^8.0.1",
|
|
26
26
|
"is-reachable": "^5.1.1",
|
package/src/aws.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpawnOptions } from './cp.js';
|
|
2
|
-
export declare const aws: (args: string[], options?: SpawnOptions
|
|
3
|
-
export declare const ensureAwsCredentialsSet: (message?: string
|
|
4
|
-
export declare const chamber: (args: string[], options?: SpawnOptions
|
|
2
|
+
export declare const aws: (args: string[], options?: SpawnOptions) => Promise<import("./cp.js").SpawnResult>;
|
|
3
|
+
export declare const ensureAwsCredentialsSet: (message?: string) => Promise<void>;
|
|
4
|
+
export declare const chamber: (args: string[], options?: SpawnOptions) => Promise<import("./cp.js").SpawnResult>;
|
|
5
5
|
export declare const chamberRead: (target: string, varName: string) => Promise<string>;
|
package/src/brew.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SpawnOptions } from './cp.js';
|
|
2
2
|
export declare const ensureBrewInstalled: () => Promise<void>;
|
|
3
|
-
export declare const brew: (args: string[], options?: SpawnOptions
|
|
3
|
+
export declare const brew: (args: string[], options?: SpawnOptions) => Promise<import("./cp.js").SpawnResult>;
|
|
4
4
|
export declare const brewBundleCheck: (brewFile: string) => Promise<boolean>;
|
|
5
5
|
export declare const brewBundleInstall: (brewFile: string) => Promise<void>;
|
|
6
6
|
export declare const ensureBrewfileInstalled: (brewFile: string) => Promise<void>;
|
package/src/docker.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface DockerImage {
|
|
|
27
27
|
size: number;
|
|
28
28
|
tag: string;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export type DockerImageFilter = (i: DockerImage) => boolean;
|
|
31
31
|
export declare function dockerImages(repo?: null | string, filter?: null | DockerImageFilter): Promise<DockerImage[]>;
|
|
32
32
|
export declare function getDockerId(tag?: string, repo?: null | string): Promise<string>;
|
|
33
33
|
export declare function getUntaggedDockerIds(repo?: string, filter?: null | DockerImageFilter): Promise<string[]>;
|
|
@@ -68,5 +68,5 @@ export declare function copyFilesFromDockerImage({ filePaths, ignoreErrors, imag
|
|
|
68
68
|
export declare const dockerIsRunning: () => Promise<boolean>;
|
|
69
69
|
export declare const ensureDockerRunning: (timeoutSeconds?: number) => Promise<void>;
|
|
70
70
|
export declare const ensureDockerInstalled: () => Promise<void>;
|
|
71
|
-
export declare const ensureDockerForMacConfigured: (desiredConfig?: Record<string, unknown>
|
|
71
|
+
export declare const ensureDockerForMacConfigured: (desiredConfig?: null | Record<string, unknown>) => Promise<void>;
|
|
72
72
|
export {};
|
package/src/docker.volume.d.ts
CHANGED
package/src/dockerCompose.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DockerContainer } from './docker.container.js';
|
|
2
2
|
import { DockerNetwork, DockerNetworkCreateOptions } from './docker.network.js';
|
|
3
3
|
import { DockerVolume, DockerVolumeCreateOptions } from './docker.volume.js';
|
|
4
|
-
export
|
|
4
|
+
export type DockerComposeResourceTracker = {
|
|
5
5
|
cleaning: null | Promise<void>;
|
|
6
6
|
containers: Map<string, DockerContainer>;
|
|
7
7
|
networks: Map<string, DockerNetwork>;
|
|
@@ -9,12 +9,12 @@ export declare type DockerComposeResourceTracker = {
|
|
|
9
9
|
volumes: Map<string, DockerVolume>;
|
|
10
10
|
};
|
|
11
11
|
export declare const dockerComposeCreateResourceTracker: () => DockerComposeResourceTracker;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type DockerComposeEnvDef = string[] | Record<string, string>;
|
|
13
|
+
type DockerComposeULimitDef = number | {
|
|
14
14
|
hard: number;
|
|
15
15
|
soft: number;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
type DockerComposeULimitsDef = Record<string, DockerComposeULimitDef>;
|
|
18
18
|
interface DockerComposeServiceDef {
|
|
19
19
|
command?: string[];
|
|
20
20
|
container_name?: string;
|
|
@@ -69,9 +69,9 @@ interface ParsedNetworkInfo {
|
|
|
69
69
|
networks: string[];
|
|
70
70
|
runArgs: string[];
|
|
71
71
|
}
|
|
72
|
-
export declare const dockerComposeCreateNetworks: (names?:
|
|
73
|
-
export declare const dockerComposeCreateVolumes: (names?: string[]
|
|
74
|
-
|
|
72
|
+
export declare const dockerComposeCreateNetworks: (names?: null | string[], dockerCompose?: null | (string | DockerCompose), tracker?: DockerComposeResourceTracker) => Promise<void>;
|
|
73
|
+
export declare const dockerComposeCreateVolumes: (names?: string[], dockerCompose?: null | (string | DockerCompose), tracker?: DockerComposeResourceTracker) => Promise<void>;
|
|
74
|
+
type HealthCheckFn = (result: UpResult) => Promise<void>;
|
|
75
75
|
interface UpOptions {
|
|
76
76
|
avoidConflicts?: boolean;
|
|
77
77
|
cmd?: string[];
|
package/src/env.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface AppendToEnvOptions {
|
|
|
21
21
|
}
|
|
22
22
|
export declare const appendToEnv: (content: string | StringGenFn, { envFile, testContent }?: AppendToEnvOptions) => Promise<void>;
|
|
23
23
|
export declare const appendEnvVar: (name: string, value: string, { envFile }?: ReadShellEnvVarOptions) => Promise<void>;
|
|
24
|
-
export declare const ensureEnvVarValue: (name: string, value: string, opts?: ReadShellEnvVarOptions
|
|
25
|
-
export declare const ensureEnvVarSet: (name: string, getValue: () => Promise<string>, opts?: ReadShellEnvVarOptions
|
|
24
|
+
export declare const ensureEnvVarValue: (name: string, value: string, opts?: ReadShellEnvVarOptions) => Promise<void>;
|
|
25
|
+
export declare const ensureEnvVarSet: (name: string, getValue: () => Promise<string>, opts?: ReadShellEnvVarOptions) => Promise<void>;
|
|
26
26
|
export declare const ensureProcessPathEnvIncludes: (binPath: string) => void;
|
|
27
27
|
export {};
|
package/src/fs.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
|
-
export declare const readDir: (pattern: string, options?: glob.IOptions
|
|
2
|
+
export declare const readDir: (pattern: string, options?: glob.IOptions) => Promise<string[]>;
|
|
3
3
|
export declare const moveDir: (source: string, target: string) => Promise<void>;
|
|
4
4
|
export declare const copyDir: (source: string, target: string, fileGlob?: string, globOptions?: null | glob.IOptions, renameFn?: (name: string) => string) => Promise<void>;
|
|
5
|
-
export declare const cleanDir: (pattern: string, globOptions?:
|
|
5
|
+
export declare const cleanDir: (pattern: string, globOptions?: glob.IOptions | false) => Promise<void>;
|
|
6
6
|
export declare const producedPathExists: (producer: () => Promise<string>) => Promise<boolean>;
|
|
7
7
|
export declare const copyIfMissing: (src: string, dest: string) => Promise<void>;
|
|
8
|
-
export
|
|
8
|
+
export type StringGenFn = () => string | Promise<string>;
|
|
9
9
|
export declare const writeIfMissing: (dest: string, content: string | StringGenFn) => Promise<boolean>;
|
|
10
|
-
export declare const appendIfMissing: (dest: string, content: string | StringGenFn, testContent?: string | StringGenFn
|
|
10
|
+
export declare const appendIfMissing: (dest: string, content: string | StringGenFn, testContent?: string | StringGenFn) => Promise<void>;
|
package/src/gh.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpawnOptions } from './cp.js';
|
|
2
|
-
export declare const gh: (args: string[], options?: SpawnOptions
|
|
2
|
+
export declare const gh: (args: string[], options?: SpawnOptions) => Promise<import("./cp.js").SpawnResult>;
|
|
3
3
|
export declare const ghRepoClone: (repo: string, repoDir: string) => Promise<void>;
|
|
4
4
|
export declare const ensureGhRepo: (repo: string, { rootDir, targetDir, targetName, }?: {
|
|
5
5
|
rootDir?: string | undefined;
|
package/src/git.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SpawnOptions } from './cp.js';
|
|
2
|
-
export declare const git: (args: string[], opts?: SpawnOptions
|
|
3
|
-
export declare const gitOutput: (args: string[], opts?: SpawnOptions
|
|
2
|
+
export declare const git: (args: string[], opts?: SpawnOptions) => Promise<import("./cp.js").SpawnResult>;
|
|
3
|
+
export declare const gitOutput: (args: string[], opts?: SpawnOptions) => Promise<string>;
|
|
4
4
|
export declare function gitBranch(): Promise<string>;
|
|
5
5
|
export declare function gitRevId(): Promise<string>;
|
|
6
|
-
|
|
6
|
+
type GitInfo = {
|
|
7
7
|
branch: string;
|
|
8
8
|
revision: string;
|
|
9
9
|
};
|
package/src/macos.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const mountDmg: (dmgPath: string, mountPath: string) => Promise<void>;
|
|
2
2
|
export declare const unmountDmg: (mountPath: string) => Promise<void>;
|
|
3
3
|
export declare const ensureXcodeCmdInstalled: (ignoreNonMac?: boolean) => Promise<void>;
|
|
4
|
+
export declare const ensureRosettaInstalled: (ignoreNonMac?: boolean) => Promise<void>;
|
package/src/macos.js
CHANGED
|
@@ -34,3 +34,15 @@ export const ensureXcodeCmdInstalled = async (ignoreNonMac = true) => {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
export const ensureRosettaInstalled = async (ignoreNonMac = true) => {
|
|
38
|
+
if (!isMac()) {
|
|
39
|
+
if (!ignoreNonMac) {
|
|
40
|
+
throw new Error('Cannot install Rosetta on non-macOS');
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!(await fs.pathExists('/usr/libexec/rosetta'))) {
|
|
45
|
+
buildLog('Installing Rosetta...');
|
|
46
|
+
await spawn('softwareupdate', ['--install-rosetta', '--agree-to-license']);
|
|
47
|
+
}
|
|
48
|
+
};
|
package/src/npm.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SpawnOptions, SpawnResult } from './cp.js';
|
|
2
|
-
export
|
|
2
|
+
export type NpmCreds = {
|
|
3
3
|
email?: string;
|
|
4
4
|
password?: string;
|
|
5
5
|
username?: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type NpmConfig = {
|
|
8
8
|
access?: 'public' | 'restricted';
|
|
9
9
|
dryRun?: boolean;
|
|
10
10
|
name?: string;
|
package/src/run.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function format(time?: Date): string;
|
|
2
2
|
export declare function buildLog(msg: string, time?: Date): void;
|
|
3
|
-
export
|
|
3
|
+
export type RunnableModule<Args extends string[], Result> = ((...args: Args) => Promise<Result>) | {
|
|
4
4
|
default: (...args: Args) => Promise<Result>;
|
|
5
5
|
};
|
|
6
6
|
export declare function run<Args extends string[], Result>(fn: RunnableModule<Args, Result>, ...options: Args): Promise<Result>;
|
package/src/ssh.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ensureSshKeyGenerated: (keyPath?: string
|
|
1
|
+
export declare const ensureSshKeyGenerated: (keyPath?: string) => Promise<string>;
|
package/src/tgz.d.ts
CHANGED