@expo/steps 1.0.13 → 1.0.15
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 +3 -2
- package/dist_commonjs/BuildStepContext.d.ts +2 -1
- package/dist_commonjs/BuildStepContext.js.map +1 -1
- package/dist_commonjs/cli/cli.cjs +1 -1
- package/dist_commonjs/cli/cli.js.map +1 -1
- package/dist_esm/BuildStepContext.d.ts +2 -1
- package/dist_esm/BuildStepContext.js +3 -2
- package/dist_esm/BuildStepContext.js.map +1 -1
- package/dist_esm/cli/cli.js +1 -1
- package/dist_esm/cli/cli.js.map +1 -1
- package/package.json +2 -2
|
@@ -9,11 +9,12 @@ 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, workingDirectory) {
|
|
12
|
+
constructor(buildId, logger, skipCleanup, runtimePlatform, projectSourceDirectory, workingDirectory) {
|
|
13
13
|
this.buildId = buildId;
|
|
14
14
|
this.logger = logger;
|
|
15
15
|
this.skipCleanup = skipCleanup;
|
|
16
16
|
this.runtimePlatform = runtimePlatform;
|
|
17
|
+
this.projectSourceDirectory = projectSourceDirectory;
|
|
17
18
|
this.stepById = {};
|
|
18
19
|
this.baseWorkingDirectory = path_1.default.join(os_1.default.tmpdir(), 'eas-build', buildId);
|
|
19
20
|
this.workingDirectory = workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : path_1.default.join(this.baseWorkingDirectory, 'project');
|
|
@@ -29,7 +30,7 @@ class BuildStepContext {
|
|
|
29
30
|
return this.stepById[stepId].getOutputValueByName(outputId);
|
|
30
31
|
}
|
|
31
32
|
child({ logger, workingDirectory, } = {}) {
|
|
32
|
-
return new BuildStepContext(this.buildId, logger !== null && logger !== void 0 ? logger : this.logger, this.skipCleanup, this.runtimePlatform, workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : this.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);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
exports.BuildStepContext = BuildStepContext;
|
|
@@ -6,10 +6,11 @@ export declare class BuildStepContext {
|
|
|
6
6
|
readonly logger: bunyan;
|
|
7
7
|
readonly skipCleanup: boolean;
|
|
8
8
|
readonly runtimePlatform: BuildRuntimePlatform;
|
|
9
|
+
readonly projectSourceDirectory: string;
|
|
9
10
|
readonly baseWorkingDirectory: string;
|
|
10
11
|
readonly workingDirectory: string;
|
|
11
12
|
private stepById;
|
|
12
|
-
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, workingDirectory?: string);
|
|
13
|
+
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, projectSourceDirectory: string, workingDirectory?: string);
|
|
13
14
|
registerStep(step: BuildStep): void;
|
|
14
15
|
getStepOutputValue(path: string): string | undefined;
|
|
15
16
|
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,
|
|
1
|
+
{"version":3,"file":"BuildStepContext.js","sourceRoot":"","sources":["../src/BuildStepContext.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAKxB,qDAAsD;AACtD,2CAAoD;AAGpD,MAAa,gBAAgB;I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ACpB,IAAI,CAAC,sBAAsB,EAC3B,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,IAAI,CAAC,gBAAgB,CAC1C,CAAC;IACJ,CAAC;CACF;AA9CD,4CA8CC","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 baseWorkingDirectory: 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 workingDirectory?: string\n ) {\n this.baseWorkingDirectory = path.join(os.tmpdir(), 'eas-build', buildId);\n this.workingDirectory = workingDirectory ?? path.join(this.baseWorkingDirectory, '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 workingDirectory ?? this.workingDirectory\n );\n }\n}\n"]}
|
|
@@ -16,7 +16,7 @@ const logger = (0, logger_1.createLogger)({
|
|
|
16
16
|
});
|
|
17
17
|
async function runAsync(configPath, workingDirectory, runtimePlatform) {
|
|
18
18
|
const fakeBuildId = (0, uuid_1.v4)();
|
|
19
|
-
const ctx = new BuildStepContext_js_1.BuildStepContext(fakeBuildId, logger, false, runtimePlatform, workingDirectory);
|
|
19
|
+
const ctx = new BuildStepContext_js_1.BuildStepContext(fakeBuildId, logger, false, runtimePlatform, workingDirectory, workingDirectory);
|
|
20
20
|
const parser = new BuildConfigParser_js_1.BuildConfigParser(ctx, { configPath });
|
|
21
21
|
const workflow = await parser.parseAsync();
|
|
22
22
|
await workflow.executeAsync();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,yCAA4C;AAC5C,+BAAoC;AAEpC,kEAA4D;AAC5D,gEAA0D;AAC1D,4CAAkD;AAGlD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC;IAC1B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,KAAK,UAAU,QAAQ,CACrB,UAAkB,EAClB,gBAAwB,EACxB,eAAqC;IAErC,MAAM,WAAW,GAAG,IAAA,SAAM,GAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,IAAI,sCAAgB,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,yCAA4C;AAC5C,+BAAoC;AAEpC,kEAA4D;AAC5D,gEAA0D;AAC1D,4CAAkD;AAGlD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC;IAC1B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,KAAK,UAAU,QAAQ,CACrB,UAAkB,EAClB,gBAAwB,EACxB,eAAqC;IAErC,MAAM,WAAW,GAAG,IAAA,SAAM,GAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,IAAI,sCAAgB,CAC9B,WAAW,EACX,MAAM,EACN,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,CACjB,CAAC;IAC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AAC","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 workingDirectory: 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 workingDirectory,\n workingDirectory\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 relativeWorkingDirectoryPath = process.argv[3];\nconst platform: BuildRuntimePlatform = (process.argv[4] ??\n process.platform) as BuildRuntimePlatform;\n\nif (!relativeConfigPath || !relativeWorkingDirectoryPath) {\n console.error('Usage: yarn cli config.yml path/to/working/directory [darwin|linux]');\n process.exit(1);\n}\n\nconst configPath = path.resolve(process.cwd(), relativeConfigPath);\nconst workingDirectory = path.resolve(process.cwd(), relativeWorkingDirectoryPath);\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"]}
|
|
@@ -6,10 +6,11 @@ export declare class BuildStepContext {
|
|
|
6
6
|
readonly logger: bunyan;
|
|
7
7
|
readonly skipCleanup: boolean;
|
|
8
8
|
readonly runtimePlatform: BuildRuntimePlatform;
|
|
9
|
+
readonly projectSourceDirectory: string;
|
|
9
10
|
readonly baseWorkingDirectory: string;
|
|
10
11
|
readonly workingDirectory: string;
|
|
11
12
|
private stepById;
|
|
12
|
-
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, workingDirectory?: string);
|
|
13
|
+
constructor(buildId: string, logger: bunyan, skipCleanup: boolean, runtimePlatform: BuildRuntimePlatform, projectSourceDirectory: string, workingDirectory?: string);
|
|
13
14
|
registerStep(step: BuildStep): void;
|
|
14
15
|
getStepOutputValue(path: string): string | undefined;
|
|
15
16
|
child({ logger, workingDirectory, }?: {
|
|
@@ -3,11 +3,12 @@ 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, workingDirectory) {
|
|
6
|
+
constructor(buildId, logger, skipCleanup, runtimePlatform, projectSourceDirectory, workingDirectory) {
|
|
7
7
|
this.buildId = buildId;
|
|
8
8
|
this.logger = logger;
|
|
9
9
|
this.skipCleanup = skipCleanup;
|
|
10
10
|
this.runtimePlatform = runtimePlatform;
|
|
11
|
+
this.projectSourceDirectory = projectSourceDirectory;
|
|
11
12
|
this.stepById = {};
|
|
12
13
|
this.baseWorkingDirectory = path.join(os.tmpdir(), 'eas-build', buildId);
|
|
13
14
|
this.workingDirectory = workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : path.join(this.baseWorkingDirectory, 'project');
|
|
@@ -23,7 +24,7 @@ export class BuildStepContext {
|
|
|
23
24
|
return this.stepById[stepId].getOutputValueByName(outputId);
|
|
24
25
|
}
|
|
25
26
|
child({ logger, workingDirectory, } = {}) {
|
|
26
|
-
return new BuildStepContext(this.buildId, logger !== null && logger !== void 0 ? logger : this.logger, this.skipCleanup, this.runtimePlatform, workingDirectory !== null && workingDirectory !== void 0 ? workingDirectory : this.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);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
//# 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,
|
|
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;QALT,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAS;QACpB,oBAAe,GAAf,eAAe,CAAsB;QACrC,2BAAsB,GAAtB,sBAAsB,CAAQ;QAPxC,aAAQ,GAA8B,EAAE,CAAC;QAU/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QACzE,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IAC9F,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,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 baseWorkingDirectory: 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 workingDirectory?: string\n ) {\n this.baseWorkingDirectory = path.join(os.tmpdir(), 'eas-build', buildId);\n this.workingDirectory = workingDirectory ?? path.join(this.baseWorkingDirectory, '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 workingDirectory ?? this.workingDirectory\n );\n }\n}\n"]}
|
package/dist_esm/cli/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ const logger = createLogger({
|
|
|
11
11
|
});
|
|
12
12
|
async function runAsync(configPath, workingDirectory, runtimePlatform) {
|
|
13
13
|
const fakeBuildId = uuidv4();
|
|
14
|
-
const ctx = new BuildStepContext(fakeBuildId, logger, false, runtimePlatform, workingDirectory);
|
|
14
|
+
const ctx = new BuildStepContext(fakeBuildId, logger, false, runtimePlatform, workingDirectory, workingDirectory);
|
|
15
15
|
const parser = new BuildConfigParser(ctx, { configPath });
|
|
16
16
|
const workflow = await parser.parseAsync();
|
|
17
17
|
await workflow.executeAsync();
|
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,EAA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AU,EAAE,CAAC;IAC3C,MAAM,QAAQ,CAAC,YAAY,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3C,MAAM,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACrD,MAAM,QAAQ,GAAyB,CAAC,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,mCACrD,OAAO,CAAC,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,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC;AACnE,MAAM,gBAAgB,GAAG,IAAI,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,kBAAkB,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 workingDirectory: 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 workingDirectory,\n workingDirectory\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 relativeWorkingDirectoryPath = process.argv[3];\nconst platform: BuildRuntimePlatform = (process.argv[4] ??\n process.platform) as BuildRuntimePlatform;\n\nif (!relativeConfigPath || !relativeWorkingDirectoryPath) {\n console.error('Usage: yarn cli config.yml path/to/working/directory [darwin|linux]');\n process.exit(1);\n}\n\nconst configPath = path.resolve(process.cwd(), relativeConfigPath);\nconst workingDirectory = path.resolve(process.cwd(), relativeWorkingDirectoryPath);\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.15",
|
|
5
5
|
"main": "./dist_commonjs/index.cjs",
|
|
6
6
|
"types": "./dist_esm/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"node": "18.13.0",
|
|
60
60
|
"yarn": "1.22.19"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b682f465dd610b0b147a7331ad013c8290c8220e"
|
|
63
63
|
}
|