@expo/steps 1.0.15 → 1.0.19
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_commonjs/BuildStepContext.cjs +6 -4
- package/dist_commonjs/BuildStepContext.d.ts +3 -2
- package/dist_commonjs/BuildStepContext.js.map +1 -1
- package/dist_commonjs/BuildTemporaryFiles.cjs +1 -1
- package/dist_commonjs/BuildTemporaryFiles.js.map +1 -1
- package/dist_commonjs/cli/cli.cjs +6 -6
- package/dist_commonjs/cli/cli.js.map +1 -1
- package/dist_esm/BuildStepContext.d.ts +3 -2
- package/dist_esm/BuildStepContext.js +6 -4
- package/dist_esm/BuildStepContext.js.map +1 -1
- package/dist_esm/BuildTemporaryFiles.js +1 -1
- package/dist_esm/BuildTemporaryFiles.js.map +1 -1
- package/dist_esm/cli/cli.js +6 -6
- package/dist_esm/cli/cli.js.map +1 -1
- package/package.json +3 -4
|
@@ -9,15 +9,17 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const template_js_1 = require("./utils/template.cjs");
|
|
10
10
|
const errors_js_1 = require("./errors.cjs");
|
|
11
11
|
class BuildStepContext {
|
|
12
|
-
constructor(buildId, logger, skipCleanup, runtimePlatform, projectSourceDirectory, workingDirectory) {
|
|
12
|
+
constructor(buildId, logger, skipCleanup, runtimePlatform, projectSourceDirectory, projectTargetDirectory, workingDirectory) {
|
|
13
13
|
this.buildId = buildId;
|
|
14
14
|
this.logger = logger;
|
|
15
15
|
this.skipCleanup = skipCleanup;
|
|
16
16
|
this.runtimePlatform = runtimePlatform;
|
|
17
17
|
this.projectSourceDirectory = projectSourceDirectory;
|
|
18
|
+
this.projectTargetDirectory = projectTargetDirectory;
|
|
18
19
|
this.stepById = {};
|
|
19
|
-
this.
|
|
20
|
-
this.workingDirectory =
|
|
20
|
+
this.stepsInternalBuildDirectory = path_1.default.join(os_1.default.tmpdir(), 'eas-build', buildId);
|
|
21
|
+
this.workingDirectory =
|
|
22
|
+
workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : path_1.default.join(this.stepsInternalBuildDirectory, 'project');
|
|
21
23
|
}
|
|
22
24
|
registerStep(step) {
|
|
23
25
|
this.stepById[step.id] = step;
|
|
@@ -30,7 +32,7 @@ class BuildStepContext {
|
|
|
30
32
|
return this.stepById[stepId].getOutputValueByName(outputId);
|
|
31
33
|
}
|
|
32
34
|
child({ logger, workingDirectory, } = {}) {
|
|
33
|
-
return new BuildStepContext(this.buildId, logger !== null && logger !== void 0 ? logger : this.logger, this.skipCleanup, this.runtimePlatform, this.projectSourceDirectory, workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : this.workingDirectory);
|
|
35
|
+
return new BuildStepContext(this.buildId, logger !== null && logger !== void 0 ? logger : this.logger, this.skipCleanup, this.runtimePlatform, this.projectSourceDirectory, this.projectTargetDirectory, workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : this.workingDirectory);
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
exports.BuildStepContext = BuildStepContext;
|
|
@@ -7,10 +7,11 @@ export declare class BuildStepContext {
|
|
|
7
7
|
readonly skipCleanup: boolean;
|
|
8
8
|
readonly runtimePlatform: BuildRuntimePlatform;
|
|
9
9
|
readonly projectSourceDirectory: string;
|
|
10
|
-
readonly
|
|
10
|
+
readonly projectTargetDirectory: string;
|
|
11
|
+
readonly stepsInternalBuildDirectory: string;
|
|
11
12
|
readonly workingDirectory: string;
|
|
12
13
|
private stepById;
|
|
13
|
-
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, projectSourceDirectory: string, workingDirectory?: string);
|
|
14
|
+
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, projectSourceDirectory: string, projectTargetDirectory: string, workingDirectory?: string);
|
|
14
15
|
registerStep(step: BuildStep): void;
|
|
15
16
|
getStepOutputValue(path: string): string | undefined;
|
|
16
17
|
child({ logger, workingDirectory, }?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildStepContext.js","sourceRoot":"","sources":["../src/BuildStepContext.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAKxB,qDAAsD;AACtD,2CAAoD;AAGpD,MAAa,gBAAgB;IAM3B,YACkB,OAAe,EACf,MAAc,EACd,WAAoB,EACpB,eAAqC,EACrC,sBAA8B,EAC9C,gBAAyB;
|
|
1
|
+
{"version":3,"file":"BuildStepContext.js","sourceRoot":"","sources":["../src/BuildStepContext.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAKxB,qDAAsD;AACtD,2CAAoD;AAGpD,MAAa,gBAAgB;IAM3B,YACkB,OAAe,EACf,MAAc,EACd,WAAoB,EACpB,eAAqC,EACrC,sBAA8B,EAC9B,sBAA8B,EAC9C,gBAAyB;QANT,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAS;QACpB,oBAAe,GAAf,eAAe,CAAsB;QACrC,2BAAsB,GAAtB,sBAAsB,CAAQ;QAC9B,2BAAsB,GAAtB,sBAAsB,CAAQ;QARxC,aAAQ,GAA8B,EAAE,CAAC;QAW/C,IAAI,CAAC,2BAA2B,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAChF,IAAI,CAAC,gBAAgB;YACnB,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAAC;IAC/E,CAAC;IAEM,YAAY,CAAC,IAAe;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAChC,CAAC;IAEM,kBAAkB,CAAC,IAAY;QACpC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,6BAAe,EAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC9B,MAAM,IAAI,iCAAqB,CAAC,SAAS,MAAM,mBAAmB,CAAC,CAAC;SACrE;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAEM,KAAK,CAAC,EACX,MAAM,EACN,gBAAgB,MAId,EAAE;QACJ,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,OAAO,EACZ,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,CAAC,MAAM,EACrB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,sBAAsB,EAC3B,IAAI,CAAC,sBAAsB,EAC3B,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,IAAI,CAAC,gBAAgB,CAC1C,CAAC;IACJ,CAAC;CACF;AAjDD,4CAiDC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { bunyan } from '@expo/logger';\n\nimport { BuildStep } from './BuildStep.js';\nimport { parseOutputPath } from './utils/template.js';\nimport { BuildStepRuntimeError } from './errors.js';\nimport { BuildRuntimePlatform } from './BuildRuntimePlatform.js';\n\nexport class BuildStepContext {\n public readonly stepsInternalBuildDirectory: string;\n public readonly workingDirectory: string;\n\n private stepById: Record<string, BuildStep> = {};\n\n constructor(\n public readonly buildId: string,\n public readonly logger: bunyan,\n public readonly skipCleanup: boolean,\n public readonly runtimePlatform: BuildRuntimePlatform,\n public readonly projectSourceDirectory: string,\n public readonly projectTargetDirectory: string,\n workingDirectory?: string\n ) {\n this.stepsInternalBuildDirectory = path.join(os.tmpdir(), 'eas-build', buildId);\n this.workingDirectory =\n workingDirectory ?? path.join(this.stepsInternalBuildDirectory, 'project');\n }\n\n public registerStep(step: BuildStep): void {\n this.stepById[step.id] = step;\n }\n\n public getStepOutputValue(path: string): string | undefined {\n const { stepId, outputId } = parseOutputPath(path);\n if (!(stepId in this.stepById)) {\n throw new BuildStepRuntimeError(`Step \"${stepId}\" does not exist.`);\n }\n return this.stepById[stepId].getOutputValueByName(outputId);\n }\n\n public child({\n logger,\n workingDirectory,\n }: {\n logger?: bunyan;\n workingDirectory?: string;\n } = {}): BuildStepContext {\n return new BuildStepContext(\n this.buildId,\n logger ?? this.logger,\n this.skipCleanup,\n this.runtimePlatform,\n this.projectSourceDirectory,\n this.projectTargetDirectory,\n workingDirectory ?? this.workingDirectory\n );\n }\n}\n"]}
|
|
@@ -31,7 +31,7 @@ async function cleanUpStepTemporaryDirectoriesAsync(ctx, stepId) {
|
|
|
31
31
|
}
|
|
32
32
|
exports.cleanUpStepTemporaryDirectoriesAsync = cleanUpStepTemporaryDirectoriesAsync;
|
|
33
33
|
function getTemporaryStepDirPath(ctx, stepId) {
|
|
34
|
-
return path_1.default.join(ctx.
|
|
34
|
+
return path_1.default.join(ctx.stepsInternalBuildDirectory, 'steps', stepId);
|
|
35
35
|
}
|
|
36
36
|
function getTemporaryScriptsDirPath(ctx, stepId) {
|
|
37
37
|
return path_1.default.join(getTemporaryStepDirPath(ctx, stepId), 'scripts');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildTemporaryFiles.js","sourceRoot":"","sources":["../src/BuildTemporaryFiles.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,2DAA6B;AAE7B,+BAAoC;AAI7B,KAAK,UAAU,8BAA8B,CAClD,GAAqB,EACrB,MAAc,EACd,cAAsB;IAEtB,MAAM,UAAU,GAAG,0BAA0B,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,kBAAE,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,MAAM,mBAAmB,GAAG,cAAI,CAAC,IAAI,CAA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AE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,0BAA0B,CAAC,GAAqB,EAAE,MAAc;IACvE,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import path from 'path';\nimport fs from 'fs/promises';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BuildStepContext } from './BuildStepContext.js';\n\nexport async function saveScriptToTemporaryFileAsync(\n ctx: BuildStepContext,\n stepId: string,\n scriptContents: string\n): Promise<string> {\n const scriptsDir = getTemporaryScriptsDirPath(ctx, stepId);\n await fs.mkdir(scriptsDir, { recursive: true });\n const temporaryScriptPath = path.join(scriptsDir, `${uuidv4()}.sh`);\n await fs.writeFile(temporaryScriptPath, scriptContents);\n return temporaryScriptPath;\n}\n\nexport async function createTemporaryOutputsDirectoryAsync(\n ctx: BuildStepContext,\n stepId: string\n): Promise<string> {\n const directory = getTemporaryOutputsDirPath(ctx, stepId);\n await fs.mkdir(directory, { recursive: true });\n return directory;\n}\n\nexport async function cleanUpStepTemporaryDirectoriesAsync(\n ctx: BuildStepContext,\n stepId: string\n): Promise<void> {\n if (ctx.skipCleanup) {\n return;\n }\n const stepTemporaryDirectory = getTemporaryStepDirPath(ctx, stepId);\n await fs.rm(stepTemporaryDirectory, { recursive: true, force: true });\n ctx.logger.debug({ stepTemporaryDirectory }, 'Removed step temporary directory');\n}\nfunction getTemporaryStepDirPath(ctx: BuildStepContext, stepId: string): string {\n return path.join(ctx.stepsInternalBuildDirectory, 'steps', stepId);\n}\n\nfunction getTemporaryScriptsDirPath(ctx: BuildStepContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'scripts');\n}\n\nfunction getTemporaryOutputsDirPath(ctx: BuildStepContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'outputs');\n}\n"]}
|
|
@@ -14,22 +14,22 @@ const logger = (0, logger_1.createLogger)({
|
|
|
14
14
|
name: 'steps-cli',
|
|
15
15
|
level: 'info',
|
|
16
16
|
});
|
|
17
|
-
async function runAsync(configPath,
|
|
17
|
+
async function runAsync(configPath, relativeProjectDirectory, runtimePlatform) {
|
|
18
18
|
const fakeBuildId = (0, uuid_1.v4)();
|
|
19
|
-
const ctx = new BuildStepContext_js_1.BuildStepContext(fakeBuildId, logger, false, runtimePlatform,
|
|
19
|
+
const ctx = new BuildStepContext_js_1.BuildStepContext(fakeBuildId, logger, false, runtimePlatform, relativeProjectDirectory, relativeProjectDirectory, relativeProjectDirectory);
|
|
20
20
|
const parser = new BuildConfigParser_js_1.BuildConfigParser(ctx, { configPath });
|
|
21
21
|
const workflow = await parser.parseAsync();
|
|
22
22
|
await workflow.executeAsync();
|
|
23
23
|
}
|
|
24
24
|
const relativeConfigPath = process.argv[2];
|
|
25
|
-
const
|
|
25
|
+
const relativeProjectDirectoryPath = process.argv[3];
|
|
26
26
|
const platform = ((_a = process.argv[4]) !== null && _a !== void 0 ? _a : process.platform);
|
|
27
|
-
if (!relativeConfigPath || !
|
|
28
|
-
console.error('Usage: yarn cli config.yml path/to/
|
|
27
|
+
if (!relativeConfigPath || !relativeProjectDirectoryPath) {
|
|
28
|
+
console.error('Usage: yarn cli config.yml path/to/project/directory [darwin|linux]');
|
|
29
29
|
process.exit(1);
|
|
30
30
|
}
|
|
31
31
|
const configPath = path_1.default.resolve(process.cwd(), relativeConfigPath);
|
|
32
|
-
const workingDirectory = path_1.default.resolve(process.cwd(),
|
|
32
|
+
const workingDirectory = path_1.default.resolve(process.cwd(), relativeProjectDirectoryPath);
|
|
33
33
|
runAsync(configPath, workingDirectory, platform).catch((err) => {
|
|
34
34
|
logger.error({ err }, 'Build failed');
|
|
35
35
|
if (err instanceof errors_js_1.BuildWorkflowError) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],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C,QAAQ,CAAyB,CAAC;AAE5C,IAAI,CAAC,kBAAkB,IAAI,CAAC,4BAA4B,EAAE;IACxD,OAAO,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,MAAM,UAAU,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC;AACnE,MAAM,gBAAgB,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,4BAA4B,CAAC,CAAC;AAEnF,QAAQ,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC7D,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IACtC,IAAI,GAAG,YAAY,8BAAkB,EAAE;QACrC,MAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAC9D,KAAK,MAAM,WAAW,IAAI,GAAG,CAAC,MAAM,EAAE;YACpC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;SACpC;KACF;AACH,CAAC,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport { createLogger } from '@expo/logger';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BuildConfigParser } from '../BuildConfigParser.js';\nimport { BuildStepContext } from '../BuildStepContext.js';\nimport { BuildWorkflowError } from '../errors.js';\nimport { BuildRuntimePlatform } from '../BuildRuntimePlatform.js';\n\nconst logger = createLogger({\n name: 'steps-cli',\n level: 'info',\n});\n\nasync function runAsync(\n configPath: string,\n relativeProjectDirectory: string,\n runtimePlatform: BuildRuntimePlatform\n): Promise<void> {\n const fakeBuildId = uuidv4();\n const ctx = new BuildStepContext(\n fakeBuildId,\n logger,\n false,\n runtimePlatform,\n relativeProjectDirectory,\n relativeProjectDirectory,\n relativeProjectDirectory\n );\n const parser = new BuildConfigParser(ctx, { configPath });\n const workflow = await parser.parseAsync();\n await workflow.executeAsync();\n}\n\nconst relativeConfigPath = process.argv[2];\nconst relativeProjectDirectoryPath = process.argv[3];\nconst platform: BuildRuntimePlatform = (process.argv[4] ??\n process.platform) as BuildRuntimePlatform;\n\nif (!relativeConfigPath || !relativeProjectDirectoryPath) {\n console.error('Usage: yarn cli config.yml path/to/project/directory [darwin|linux]');\n process.exit(1);\n}\n\nconst configPath = path.resolve(process.cwd(), relativeConfigPath);\nconst workingDirectory = path.resolve(process.cwd(), relativeProjectDirectoryPath);\n\nrunAsync(configPath, workingDirectory, platform).catch((err) => {\n logger.error({ err }, 'Build failed');\n if (err instanceof BuildWorkflowError) {\n logger.error('Failed to parse the custom build config file.');\n for (const detailedErr of err.errors) {\n logger.error({ err: detailedErr });\n }\n }\n});\n"]}
|
|
@@ -7,10 +7,11 @@ export declare class BuildStepContext {
|
|
|
7
7
|
readonly skipCleanup: boolean;
|
|
8
8
|
readonly runtimePlatform: BuildRuntimePlatform;
|
|
9
9
|
readonly projectSourceDirectory: string;
|
|
10
|
-
readonly
|
|
10
|
+
readonly projectTargetDirectory: string;
|
|
11
|
+
readonly stepsInternalBuildDirectory: string;
|
|
11
12
|
readonly workingDirectory: string;
|
|
12
13
|
private stepById;
|
|
13
|
-
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, projectSourceDirectory: string, workingDirectory?: string);
|
|
14
|
+
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, projectSourceDirectory: string, projectTargetDirectory: string, workingDirectory?: string);
|
|
14
15
|
registerStep(step: BuildStep): void;
|
|
15
16
|
getStepOutputValue(path: string): string | undefined;
|
|
16
17
|
child({ logger, workingDirectory, }?: {
|
|
@@ -3,15 +3,17 @@ import path from 'path';
|
|
|
3
3
|
import { parseOutputPath } from './utils/template.js';
|
|
4
4
|
import { BuildStepRuntimeError } from './errors.js';
|
|
5
5
|
export class BuildStepContext {
|
|
6
|
-
constructor(buildId, logger, skipCleanup, runtimePlatform, projectSourceDirectory, workingDirectory) {
|
|
6
|
+
constructor(buildId, logger, skipCleanup, runtimePlatform, projectSourceDirectory, projectTargetDirectory, workingDirectory) {
|
|
7
7
|
this.buildId = buildId;
|
|
8
8
|
this.logger = logger;
|
|
9
9
|
this.skipCleanup = skipCleanup;
|
|
10
10
|
this.runtimePlatform = runtimePlatform;
|
|
11
11
|
this.projectSourceDirectory = projectSourceDirectory;
|
|
12
|
+
this.projectTargetDirectory = projectTargetDirectory;
|
|
12
13
|
this.stepById = {};
|
|
13
|
-
this.
|
|
14
|
-
this.workingDirectory =
|
|
14
|
+
this.stepsInternalBuildDirectory = path.join(os.tmpdir(), 'eas-build', buildId);
|
|
15
|
+
this.workingDirectory =
|
|
16
|
+
workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : path.join(this.stepsInternalBuildDirectory, 'project');
|
|
15
17
|
}
|
|
16
18
|
registerStep(step) {
|
|
17
19
|
this.stepById[step.id] = step;
|
|
@@ -24,7 +26,7 @@ export class BuildStepContext {
|
|
|
24
26
|
return this.stepById[stepId].getOutputValueByName(outputId);
|
|
25
27
|
}
|
|
26
28
|
child({ logger, workingDirectory, } = {}) {
|
|
27
|
-
return new BuildStepContext(this.buildId, logger !== null && logger !== void 0 ? logger : this.logger, this.skipCleanup, this.runtimePlatform, this.projectSourceDirectory, workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : this.workingDirectory);
|
|
29
|
+
return new BuildStepContext(this.buildId, logger !== null && logger !== void 0 ? logger : this.logger, this.skipCleanup, this.runtimePlatform, this.projectSourceDirectory, this.projectTargetDirectory, workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : this.workingDirectory);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
//# sourceMappingURL=BuildStepContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildStepContext.js","sourceRoot":"","sources":["../src/BuildStepContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD,MAAM,OAAO,gBAAgB;IAM3B,YACkB,OAAe,EACf,MAAc,EACd,WAAoB,EACpB,eAAqC,EACrC,sBAA8B,EAC9C,gBAAyB;
|
|
1
|
+
{"version":3,"file":"BuildStepContext.js","sourceRoot":"","sources":["../src/BuildStepContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD,MAAM,OAAO,gBAAgB;IAM3B,YACkB,OAAe,EACf,MAAc,EACd,WAAoB,EACpB,eAAqC,EACrC,sBAA8B,EAC9B,sBAA8B,EAC9C,gBAAyB;QANT,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAS;QACpB,oBAAe,GAAf,eAAe,CAAsB;QACrC,2BAAsB,GAAtB,sBAAsB,CAAQ;QAC9B,2BAAsB,GAAtB,sBAAsB,CAAQ;QARxC,aAAQ,GAA8B,EAAE,CAAC;QAW/C,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAChF,IAAI,CAAC,gBAAgB;YACnB,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAAC;IAC/E,CAAC;IAEM,YAAY,CAAC,IAAe;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAChC,CAAC;IAEM,kBAAkB,CAAC,IAAY;QACpC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC9B,MAAM,IAAI,qBAAqB,CAAC,SAAS,MAAM,mBAAmB,CAAC,CAAC;SACrE;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAEM,KAAK,CAAC,EACX,MAAM,EACN,gBAAgB,MAId,EAAE;QACJ,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,OAAO,EACZ,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,CAAC,MAAM,EACrB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,sBAAsB,EAC3B,IAAI,CAAC,sBAAsB,EAC3B,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,IAAI,CAAC,gBAAgB,CAC1C,CAAC;IACJ,CAAC;CACF","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { bunyan } from '@expo/logger';\n\nimport { BuildStep } from './BuildStep.js';\nimport { parseOutputPath } from './utils/template.js';\nimport { BuildStepRuntimeError } from './errors.js';\nimport { BuildRuntimePlatform } from './BuildRuntimePlatform.js';\n\nexport class BuildStepContext {\n public readonly stepsInternalBuildDirectory: string;\n public readonly workingDirectory: string;\n\n private stepById: Record<string, BuildStep> = {};\n\n constructor(\n public readonly buildId: string,\n public readonly logger: bunyan,\n public readonly skipCleanup: boolean,\n public readonly runtimePlatform: BuildRuntimePlatform,\n public readonly projectSourceDirectory: string,\n public readonly projectTargetDirectory: string,\n workingDirectory?: string\n ) {\n this.stepsInternalBuildDirectory = path.join(os.tmpdir(), 'eas-build', buildId);\n this.workingDirectory =\n workingDirectory ?? path.join(this.stepsInternalBuildDirectory, 'project');\n }\n\n public registerStep(step: BuildStep): void {\n this.stepById[step.id] = step;\n }\n\n public getStepOutputValue(path: string): string | undefined {\n const { stepId, outputId } = parseOutputPath(path);\n if (!(stepId in this.stepById)) {\n throw new BuildStepRuntimeError(`Step \"${stepId}\" does not exist.`);\n }\n return this.stepById[stepId].getOutputValueByName(outputId);\n }\n\n public child({\n logger,\n workingDirectory,\n }: {\n logger?: bunyan;\n workingDirectory?: string;\n } = {}): BuildStepContext {\n return new BuildStepContext(\n this.buildId,\n logger ?? this.logger,\n this.skipCleanup,\n this.runtimePlatform,\n this.projectSourceDirectory,\n this.projectTargetDirectory,\n workingDirectory ?? this.workingDirectory\n );\n }\n}\n"]}
|
|
@@ -22,7 +22,7 @@ export async function cleanUpStepTemporaryDirectoriesAsync(ctx, stepId) {
|
|
|
22
22
|
ctx.logger.debug({ stepTemporaryDirectory }, 'Removed step temporary directory');
|
|
23
23
|
}
|
|
24
24
|
function getTemporaryStepDirPath(ctx, stepId) {
|
|
25
|
-
return path.join(ctx.
|
|
25
|
+
return path.join(ctx.stepsInternalBuildDirectory, 'steps', stepId);
|
|
26
26
|
}
|
|
27
27
|
function getTemporaryScriptsDirPath(ctx, stepId) {
|
|
28
28
|
return path.join(getTemporaryStepDirPath(ctx, stepId), 'scripts');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildTemporaryFiles.js","sourceRoot":"","sources":["../src/BuildTemporaryFiles.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,GAA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AAC,CAAC;AACnF,CAAC;AACD,SAAS,uBAAuB,CAAC,GAAqB,EAAE,MAAc;IACpE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,0BAA0B,CAAC,GAAqB,EAAE,MAAc;IACvE,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,0BAA0B,CAAC,GAAqB,EAAE,MAAc;IACvE,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import path from 'path';\nimport fs from 'fs/promises';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BuildStepContext } from './BuildStepContext.js';\n\nexport async function saveScriptToTemporaryFileAsync(\n ctx: BuildStepContext,\n stepId: string,\n scriptContents: string\n): Promise<string> {\n const scriptsDir = getTemporaryScriptsDirPath(ctx, stepId);\n await fs.mkdir(scriptsDir, { recursive: true });\n const temporaryScriptPath = path.join(scriptsDir, `${uuidv4()}.sh`);\n await fs.writeFile(temporaryScriptPath, scriptContents);\n return temporaryScriptPath;\n}\n\nexport async function createTemporaryOutputsDirectoryAsync(\n ctx: BuildStepContext,\n stepId: string\n): Promise<string> {\n const directory = getTemporaryOutputsDirPath(ctx, stepId);\n await fs.mkdir(directory, { recursive: true });\n return directory;\n}\n\nexport async function cleanUpStepTemporaryDirectoriesAsync(\n ctx: BuildStepContext,\n stepId: string\n): Promise<void> {\n if (ctx.skipCleanup) {\n return;\n }\n const stepTemporaryDirectory = getTemporaryStepDirPath(ctx, stepId);\n await fs.rm(stepTemporaryDirectory, { recursive: true, force: true });\n ctx.logger.debug({ stepTemporaryDirectory }, 'Removed step temporary directory');\n}\nfunction getTemporaryStepDirPath(ctx: BuildStepContext, stepId: string): string {\n return path.join(ctx.stepsInternalBuildDirectory, 'steps', stepId);\n}\n\nfunction getTemporaryScriptsDirPath(ctx: BuildStepContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'scripts');\n}\n\nfunction getTemporaryOutputsDirPath(ctx: BuildStepContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'outputs');\n}\n"]}
|
package/dist_esm/cli/cli.js
CHANGED
|
@@ -9,22 +9,22 @@ const logger = createLogger({
|
|
|
9
9
|
name: 'steps-cli',
|
|
10
10
|
level: 'info',
|
|
11
11
|
});
|
|
12
|
-
async function runAsync(configPath,
|
|
12
|
+
async function runAsync(configPath, relativeProjectDirectory, runtimePlatform) {
|
|
13
13
|
const fakeBuildId = uuidv4();
|
|
14
|
-
const ctx = new BuildStepContext(fakeBuildId, logger, false, runtimePlatform,
|
|
14
|
+
const ctx = new BuildStepContext(fakeBuildId, logger, false, runtimePlatform, relativeProjectDirectory, relativeProjectDirectory, relativeProjectDirectory);
|
|
15
15
|
const parser = new BuildConfigParser(ctx, { configPath });
|
|
16
16
|
const workflow = await parser.parseAsync();
|
|
17
17
|
await workflow.executeAsync();
|
|
18
18
|
}
|
|
19
19
|
const relativeConfigPath = process.argv[2];
|
|
20
|
-
const
|
|
20
|
+
const relativeProjectDirectoryPath = process.argv[3];
|
|
21
21
|
const platform = ((_a = process.argv[4]) !== null && _a !== void 0 ? _a : process.platform);
|
|
22
|
-
if (!relativeConfigPath || !
|
|
23
|
-
console.error('Usage: yarn cli config.yml path/to/
|
|
22
|
+
if (!relativeConfigPath || !relativeProjectDirectoryPath) {
|
|
23
|
+
console.error('Usage: yarn cli config.yml path/to/project/directory [darwin|linux]');
|
|
24
24
|
process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
const configPath = path.resolve(process.cwd(), relativeConfigPath);
|
|
27
|
-
const workingDirectory = path.resolve(process.cwd(),
|
|
27
|
+
const workingDirectory = path.resolve(process.cwd(), relativeProjectDirectoryPath);
|
|
28
28
|
runAsync(configPath, workingDirectory, platform).catch((err) => {
|
|
29
29
|
logger.error({ err }, 'Build failed');
|
|
30
30
|
if (err instanceof BuildWorkflowError) {
|
package/dist_esm/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,KAAK,UAAU,QAAQ,CACrB,UAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,KAAK,UAAU,QAAQ,CACrB,UAAkB,EA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E;QACrC,MAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAC9D,KAAK,MAAM,WAAW,IAAI,GAAG,CAAC,MAAM,EAAE;YACpC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;SACpC;KACF;AACH,CAAC,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport { createLogger } from '@expo/logger';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BuildConfigParser } from '../BuildConfigParser.js';\nimport { BuildStepContext } from '../BuildStepContext.js';\nimport { BuildWorkflowError } from '../errors.js';\nimport { BuildRuntimePlatform } from '../BuildRuntimePlatform.js';\n\nconst logger = createLogger({\n name: 'steps-cli',\n level: 'info',\n});\n\nasync function runAsync(\n configPath: string,\n relativeProjectDirectory: string,\n runtimePlatform: BuildRuntimePlatform\n): Promise<void> {\n const fakeBuildId = uuidv4();\n const ctx = new BuildStepContext(\n fakeBuildId,\n logger,\n false,\n runtimePlatform,\n relativeProjectDirectory,\n relativeProjectDirectory,\n relativeProjectDirectory\n );\n const parser = new BuildConfigParser(ctx, { configPath });\n const workflow = await parser.parseAsync();\n await workflow.executeAsync();\n}\n\nconst relativeConfigPath = process.argv[2];\nconst relativeProjectDirectoryPath = process.argv[3];\nconst platform: BuildRuntimePlatform = (process.argv[4] ??\n process.platform) as BuildRuntimePlatform;\n\nif (!relativeConfigPath || !relativeProjectDirectoryPath) {\n console.error('Usage: yarn cli config.yml path/to/project/directory [darwin|linux]');\n process.exit(1);\n}\n\nconst configPath = path.resolve(process.cwd(), relativeConfigPath);\nconst workingDirectory = path.resolve(process.cwd(), relativeProjectDirectoryPath);\n\nrunAsync(configPath, workingDirectory, platform).catch((err) => {\n logger.error({ err }, 'Build failed');\n if (err instanceof BuildWorkflowError) {\n logger.error('Failed to parse the custom build config file.');\n for (const detailedErr of err.errors) {\n logger.error({ err: detailedErr });\n }\n }\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/steps",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.19",
|
|
5
5
|
"main": "./dist_commonjs/index.cjs",
|
|
6
6
|
"types": "./dist_esm/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"@jest/globals": "^29.4.1",
|
|
35
35
|
"@types/jest": "^29.4.0",
|
|
36
36
|
"@types/node": "^18.11.18",
|
|
37
|
-
"bunyan": "^1.8.15",
|
|
38
37
|
"chokidar-cli": "^3.0.0",
|
|
39
38
|
"eslint-plugin-async-protect": "^3.0.0",
|
|
40
39
|
"jest": "^29.4.1",
|
|
@@ -47,7 +46,7 @@
|
|
|
47
46
|
"node": ">=14.0.0"
|
|
48
47
|
},
|
|
49
48
|
"dependencies": {
|
|
50
|
-
"@expo/logger": "1.0.
|
|
49
|
+
"@expo/logger": "1.0.19",
|
|
51
50
|
"@expo/spawn-async": "^1.7.0",
|
|
52
51
|
"arg": "^5.0.2",
|
|
53
52
|
"joi": "^17.7.0",
|
|
@@ -59,5 +58,5 @@
|
|
|
59
58
|
"node": "18.13.0",
|
|
60
59
|
"yarn": "1.22.19"
|
|
61
60
|
},
|
|
62
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "49198cf3e5d08f8ec12b13400218a941b1f92349"
|
|
63
62
|
}
|