@expo/steps 1.0.265 → 18.0.1
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/LICENSE +21 -100
- package/README.md +1 -1
- package/{dist_commonjs → dist}/AbstractConfigParser.d.ts +5 -5
- package/{dist_commonjs/AbstractConfigParser.cjs → dist/AbstractConfigParser.js} +22 -20
- package/{dist_commonjs → dist}/BuildConfig.d.ts +3 -3
- package/{dist_commonjs/BuildConfig.cjs → dist/BuildConfig.js} +29 -32
- package/{dist_esm → dist}/BuildConfigParser.d.ts +5 -5
- package/{dist_commonjs/BuildConfigParser.cjs → dist/BuildConfigParser.js} +40 -48
- package/{dist_esm → dist}/BuildFunction.d.ts +6 -6
- package/{dist_commonjs/BuildFunction.cjs → dist/BuildFunction.js} +23 -13
- package/{dist_commonjs → dist}/BuildFunctionGroup.d.ts +4 -4
- package/{dist_commonjs/BuildFunctionGroup.cjs → dist/BuildFunctionGroup.js} +9 -7
- package/{dist_commonjs/BuildRuntimePlatform.cjs → dist/BuildRuntimePlatform.js} +0 -1
- package/{dist_esm → dist}/BuildStep.d.ts +5 -5
- package/{dist_commonjs/BuildStep.cjs → dist/BuildStep.js} +66 -46
- package/{dist_commonjs → dist}/BuildStepContext.d.ts +4 -4
- package/{dist_commonjs/BuildStepContext.cjs → dist/BuildStepContext.js} +28 -22
- package/{dist_commonjs/StepMetrics.cjs → dist/BuildStepEnv.js} +0 -1
- package/{dist_esm → dist}/BuildStepInput.d.ts +1 -1
- package/{dist_commonjs/BuildStepInput.cjs → dist/BuildStepInput.js} +23 -19
- package/{dist_commonjs → dist}/BuildStepOutput.d.ts +1 -1
- package/{dist_commonjs/BuildStepOutput.cjs → dist/BuildStepOutput.js} +9 -7
- package/{dist_commonjs → dist}/BuildTemporaryFiles.d.ts +1 -1
- package/{dist_commonjs/BuildTemporaryFiles.cjs → dist/BuildTemporaryFiles.js} +1 -2
- package/{dist_commonjs → dist}/BuildWorkflow.d.ts +3 -3
- package/{dist_commonjs/BuildWorkflow.cjs → dist/BuildWorkflow.js} +5 -3
- package/{dist_commonjs → dist}/BuildWorkflowValidator.d.ts +1 -1
- package/{dist_commonjs/BuildWorkflowValidator.cjs → dist/BuildWorkflowValidator.js} +25 -26
- package/{dist_commonjs/BuildStepEnv.cjs → dist/StepMetrics.js} +0 -1
- package/{dist_commonjs → dist}/StepsConfigParser.d.ts +5 -5
- package/{dist_commonjs/StepsConfigParser.cjs → dist/StepsConfigParser.js} +21 -25
- package/{dist_esm → dist}/cli/cli.d.ts +3 -3
- package/{dist_commonjs/cli/cli.cjs → dist/cli/cli.js} +17 -12
- package/{dist_commonjs/errors.cjs → dist/errors.js} +7 -4
- package/dist/index.d.ts +19 -0
- package/dist/index.js +69 -0
- package/{dist_commonjs/interpolation.cjs → dist/interpolation.js} +4 -5
- package/{dist_commonjs/scripts/runCustomFunction.cjs → dist/scripts/runCustomFunction.js} +10 -11
- package/{dist_commonjs → dist}/utils/customFunction.d.ts +4 -4
- package/{dist_commonjs/utils/customFunction.cjs → dist/utils/customFunction.js} +5 -8
- package/{dist_commonjs/utils/expodash/duplicates.cjs → dist/utils/expodash/duplicates.js} +0 -1
- package/{dist_commonjs/utils/expodash/uniq.cjs → dist/utils/expodash/uniq.js} +0 -1
- package/{dist_commonjs/utils/hashFiles.cjs → dist/utils/hashFiles.js} +1 -2
- package/{dist_commonjs/utils/jsepEval.cjs → dist/utils/jsepEval.js} +4 -5
- package/{dist_commonjs/utils/nullthrows.cjs → dist/utils/nullthrows.js} +1 -2
- package/{dist_commonjs/utils/shell/bin.cjs → dist/utils/shell/bin.js} +1 -4
- package/{dist_commonjs/utils/shell/command.cjs → dist/utils/shell/command.js} +0 -1
- package/{dist_commonjs → dist}/utils/shell/spawn.d.ts +2 -2
- package/{dist_commonjs/utils/shell/spawn.cjs → dist/utils/shell/spawn.js} +0 -1
- package/{dist_commonjs/utils/template.cjs → dist/utils/template.js} +10 -11
- package/package.json +29 -44
- package/dist_commonjs/AbstractConfigParser.js.map +0 -1
- package/dist_commonjs/BuildConfig.js.map +0 -1
- package/dist_commonjs/BuildConfigParser.d.ts +0 -33
- package/dist_commonjs/BuildConfigParser.js.map +0 -1
- package/dist_commonjs/BuildFunction.d.ts +0 -45
- package/dist_commonjs/BuildFunction.js.map +0 -1
- package/dist_commonjs/BuildFunctionGroup.js.map +0 -1
- package/dist_commonjs/BuildRuntimePlatform.js.map +0 -1
- package/dist_commonjs/BuildStep.d.ts +0 -100
- package/dist_commonjs/BuildStep.js.map +0 -1
- package/dist_commonjs/BuildStepContext.js.map +0 -1
- package/dist_commonjs/BuildStepEnv.js.map +0 -1
- package/dist_commonjs/BuildStepInput.d.ts +0 -47
- package/dist_commonjs/BuildStepInput.js.map +0 -1
- package/dist_commonjs/BuildStepOutput.js.map +0 -1
- package/dist_commonjs/BuildTemporaryFiles.js.map +0 -1
- package/dist_commonjs/BuildWorkflow.js.map +0 -1
- package/dist_commonjs/BuildWorkflowValidator.js.map +0 -1
- package/dist_commonjs/StepMetrics.js.map +0 -1
- package/dist_commonjs/StepsConfigParser.js.map +0 -1
- package/dist_commonjs/cli/cli.d.ts +0 -18
- package/dist_commonjs/cli/cli.js.map +0 -1
- package/dist_commonjs/errors.js.map +0 -1
- package/dist_commonjs/index.cjs +0 -60
- package/dist_commonjs/index.d.ts +0 -19
- package/dist_commonjs/index.js.map +0 -1
- package/dist_commonjs/interpolation.js.map +0 -1
- package/dist_commonjs/scripts/runCustomFunction.js.map +0 -1
- package/dist_commonjs/utils/customFunction.js.map +0 -1
- package/dist_commonjs/utils/expodash/duplicates.js.map +0 -1
- package/dist_commonjs/utils/expodash/uniq.js.map +0 -1
- package/dist_commonjs/utils/hashFiles.js.map +0 -1
- package/dist_commonjs/utils/jsepEval.js.map +0 -1
- package/dist_commonjs/utils/nullthrows.js.map +0 -1
- package/dist_commonjs/utils/shell/bin.js.map +0 -1
- package/dist_commonjs/utils/shell/command.js.map +0 -1
- package/dist_commonjs/utils/shell/spawn.js.map +0 -1
- package/dist_commonjs/utils/template.js.map +0 -1
- package/dist_esm/AbstractConfigParser.d.ts +0 -23
- package/dist_esm/AbstractConfigParser.js +0 -61
- package/dist_esm/AbstractConfigParser.js.map +0 -1
- package/dist_esm/BuildConfig.d.ts +0 -80
- package/dist_esm/BuildConfig.js +0 -281
- package/dist_esm/BuildConfig.js.map +0 -1
- package/dist_esm/BuildConfigParser.js +0 -233
- package/dist_esm/BuildConfigParser.js.map +0 -1
- package/dist_esm/BuildFunction.js +0 -62
- package/dist_esm/BuildFunction.js.map +0 -1
- package/dist_esm/BuildFunctionGroup.d.ts +0 -23
- package/dist_esm/BuildFunctionGroup.js +0 -36
- package/dist_esm/BuildFunctionGroup.js.map +0 -1
- package/dist_esm/BuildRuntimePlatform.d.ts +0 -4
- package/dist_esm/BuildRuntimePlatform.js +0 -6
- package/dist_esm/BuildRuntimePlatform.js.map +0 -1
- package/dist_esm/BuildStep.js +0 -354
- package/dist_esm/BuildStep.js.map +0 -1
- package/dist_esm/BuildStepContext.d.ts +0 -86
- package/dist_esm/BuildStepContext.js +0 -207
- package/dist_esm/BuildStepContext.js.map +0 -1
- package/dist_esm/BuildStepEnv.d.ts +0 -1
- package/dist_esm/BuildStepEnv.js +0 -2
- package/dist_esm/BuildStepEnv.js.map +0 -1
- package/dist_esm/BuildStepInput.js +0 -150
- package/dist_esm/BuildStepInput.js.map +0 -1
- package/dist_esm/BuildStepOutput.d.ts +0 -33
- package/dist_esm/BuildStepOutput.js +0 -57
- package/dist_esm/BuildStepOutput.js.map +0 -1
- package/dist_esm/BuildTemporaryFiles.d.ts +0 -5
- package/dist_esm/BuildTemporaryFiles.js +0 -31
- package/dist_esm/BuildTemporaryFiles.js.map +0 -1
- package/dist_esm/BuildWorkflow.d.ts +0 -14
- package/dist_esm/BuildWorkflow.js +0 -55
- package/dist_esm/BuildWorkflow.js.map +0 -1
- package/dist_esm/BuildWorkflowValidator.d.ts +0 -10
- package/dist_esm/BuildWorkflowValidator.js +0 -121
- package/dist_esm/BuildWorkflowValidator.js.map +0 -1
- package/dist_esm/StepMetrics.d.ts +0 -10
- package/dist_esm/StepMetrics.js +0 -2
- package/dist_esm/StepMetrics.js.map +0 -1
- package/dist_esm/StepsConfigParser.d.ts +0 -24
- package/dist_esm/StepsConfigParser.js +0 -133
- package/dist_esm/StepsConfigParser.js.map +0 -1
- package/dist_esm/cli/cli.js +0 -61
- package/dist_esm/cli/cli.js.map +0 -1
- package/dist_esm/errors.d.ts +0 -24
- package/dist_esm/errors.js +0 -24
- package/dist_esm/errors.js.map +0 -1
- package/dist_esm/index.d.ts +0 -19
- package/dist_esm/index.js +0 -18
- package/dist_esm/index.js.map +0 -1
- package/dist_esm/interpolation.d.ts +0 -5
- package/dist_esm/interpolation.js +0 -26
- package/dist_esm/interpolation.js.map +0 -1
- package/dist_esm/scripts/runCustomFunction.d.ts +0 -1
- package/dist_esm/scripts/runCustomFunction.js +0 -100
- package/dist_esm/scripts/runCustomFunction.js.map +0 -1
- package/dist_esm/utils/customFunction.d.ts +0 -18
- package/dist_esm/utils/customFunction.js +0 -49
- package/dist_esm/utils/customFunction.js.map +0 -1
- package/dist_esm/utils/expodash/duplicates.d.ts +0 -1
- package/dist_esm/utils/expodash/duplicates.js +0 -14
- package/dist_esm/utils/expodash/duplicates.js.map +0 -1
- package/dist_esm/utils/expodash/uniq.d.ts +0 -1
- package/dist_esm/utils/expodash/uniq.js +0 -5
- package/dist_esm/utils/expodash/uniq.js.map +0 -1
- package/dist_esm/utils/hashFiles.d.ts +0 -6
- package/dist_esm/utils/hashFiles.js +0 -31
- package/dist_esm/utils/hashFiles.js.map +0 -1
- package/dist_esm/utils/jsepEval.d.ts +0 -1
- package/dist_esm/utils/jsepEval.js +0 -169
- package/dist_esm/utils/jsepEval.js.map +0 -1
- package/dist_esm/utils/nullthrows.d.ts +0 -1
- package/dist_esm/utils/nullthrows.js +0 -7
- package/dist_esm/utils/nullthrows.js.map +0 -1
- package/dist_esm/utils/shell/bin.d.ts +0 -1
- package/dist_esm/utils/shell/bin.js +0 -5
- package/dist_esm/utils/shell/bin.js.map +0 -1
- package/dist_esm/utils/shell/command.d.ts +0 -4
- package/dist_esm/utils/shell/command.js +0 -13
- package/dist_esm/utils/shell/command.js.map +0 -1
- package/dist_esm/utils/shell/spawn.d.ts +0 -15
- package/dist_esm/utils/shell/spawn.js +0 -16
- package/dist_esm/utils/shell/spawn.js.map +0 -1
- package/dist_esm/utils/template.d.ts +0 -19
- package/dist_esm/utils/template.js +0 -106
- package/dist_esm/utils/template.js.map +0 -1
- /package/{dist_commonjs → dist}/BuildRuntimePlatform.d.ts +0 -0
- /package/{dist_commonjs → dist}/BuildStepEnv.d.ts +0 -0
- /package/{dist_commonjs → dist}/StepMetrics.d.ts +0 -0
- /package/{dist_commonjs → dist}/errors.d.ts +0 -0
- /package/{dist_commonjs → dist}/interpolation.d.ts +0 -0
- /package/{dist_commonjs → dist}/scripts/runCustomFunction.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/expodash/duplicates.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/expodash/uniq.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/hashFiles.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/jsepEval.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/nullthrows.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/shell/bin.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/shell/command.d.ts +0 -0
- /package/{dist_commonjs → dist}/utils/template.d.ts +0 -0
package/dist_commonjs/index.cjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.errors = exports.BuildStep = exports.BuildFunctionGroup = exports.BuildWorkflow = exports.BuildStepGlobalContext = exports.BuildStepOutput = exports.BuildStepInputValueTypeName = exports.BuildStepInput = exports.BuildRuntimePlatform = exports.BuildFunction = exports.StepsConfigParser = exports.BuildConfigParser = exports.readAndValidateBuildConfigFromPathAsync = exports.BuildStepContext = void 0;
|
|
30
|
-
var BuildStepContext_js_1 = require("./BuildStepContext.cjs");
|
|
31
|
-
Object.defineProperty(exports, "BuildStepContext", { enumerable: true, get: function () { return BuildStepContext_js_1.BuildStepContext; } });
|
|
32
|
-
var BuildConfig_js_1 = require("./BuildConfig.cjs");
|
|
33
|
-
Object.defineProperty(exports, "readAndValidateBuildConfigFromPathAsync", { enumerable: true, get: function () { return BuildConfig_js_1.readAndValidateBuildConfigFromPathAsync; } });
|
|
34
|
-
var BuildConfigParser_js_1 = require("./BuildConfigParser.cjs");
|
|
35
|
-
Object.defineProperty(exports, "BuildConfigParser", { enumerable: true, get: function () { return BuildConfigParser_js_1.BuildConfigParser; } });
|
|
36
|
-
var StepsConfigParser_js_1 = require("./StepsConfigParser.cjs");
|
|
37
|
-
Object.defineProperty(exports, "StepsConfigParser", { enumerable: true, get: function () { return StepsConfigParser_js_1.StepsConfigParser; } });
|
|
38
|
-
var BuildFunction_js_1 = require("./BuildFunction.cjs");
|
|
39
|
-
Object.defineProperty(exports, "BuildFunction", { enumerable: true, get: function () { return BuildFunction_js_1.BuildFunction; } });
|
|
40
|
-
var BuildRuntimePlatform_js_1 = require("./BuildRuntimePlatform.cjs");
|
|
41
|
-
Object.defineProperty(exports, "BuildRuntimePlatform", { enumerable: true, get: function () { return BuildRuntimePlatform_js_1.BuildRuntimePlatform; } });
|
|
42
|
-
var BuildStepInput_js_1 = require("./BuildStepInput.cjs");
|
|
43
|
-
Object.defineProperty(exports, "BuildStepInput", { enumerable: true, get: function () { return BuildStepInput_js_1.BuildStepInput; } });
|
|
44
|
-
Object.defineProperty(exports, "BuildStepInputValueTypeName", { enumerable: true, get: function () { return BuildStepInput_js_1.BuildStepInputValueTypeName; } });
|
|
45
|
-
var BuildStepOutput_js_1 = require("./BuildStepOutput.cjs");
|
|
46
|
-
Object.defineProperty(exports, "BuildStepOutput", { enumerable: true, get: function () { return BuildStepOutput_js_1.BuildStepOutput; } });
|
|
47
|
-
var BuildStepContext_js_2 = require("./BuildStepContext.cjs");
|
|
48
|
-
Object.defineProperty(exports, "BuildStepGlobalContext", { enumerable: true, get: function () { return BuildStepContext_js_2.BuildStepGlobalContext; } });
|
|
49
|
-
var BuildWorkflow_js_1 = require("./BuildWorkflow.cjs");
|
|
50
|
-
Object.defineProperty(exports, "BuildWorkflow", { enumerable: true, get: function () { return BuildWorkflow_js_1.BuildWorkflow; } });
|
|
51
|
-
var BuildFunctionGroup_js_1 = require("./BuildFunctionGroup.cjs");
|
|
52
|
-
Object.defineProperty(exports, "BuildFunctionGroup", { enumerable: true, get: function () { return BuildFunctionGroup_js_1.BuildFunctionGroup; } });
|
|
53
|
-
var BuildStep_js_1 = require("./BuildStep.cjs");
|
|
54
|
-
Object.defineProperty(exports, "BuildStep", { enumerable: true, get: function () { return BuildStep_js_1.BuildStep; } });
|
|
55
|
-
exports.errors = __importStar(require("./errors.cjs"));
|
|
56
|
-
__exportStar(require("./interpolation.cjs"), exports);
|
|
57
|
-
__exportStar(require("./utils/shell/spawn.cjs"), exports);
|
|
58
|
-
__exportStar(require("./utils/jsepEval.cjs"), exports);
|
|
59
|
-
__exportStar(require("./utils/hashFiles.cjs"), exports);
|
|
60
|
-
//# sourceMappingURL=index.js.map
|
package/dist_commonjs/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { BuildStepContext } from './BuildStepContext.js';
|
|
2
|
-
export { readAndValidateBuildConfigFromPathAsync } from './BuildConfig.js';
|
|
3
|
-
export { BuildConfigParser } from './BuildConfigParser.js';
|
|
4
|
-
export { StepsConfigParser } from './StepsConfigParser.js';
|
|
5
|
-
export { BuildFunction } from './BuildFunction.js';
|
|
6
|
-
export { BuildRuntimePlatform } from './BuildRuntimePlatform.js';
|
|
7
|
-
export { BuildStepInput, BuildStepInputValueTypeName } from './BuildStepInput.js';
|
|
8
|
-
export { BuildStepOutput } from './BuildStepOutput.js';
|
|
9
|
-
export { BuildStepGlobalContext, ExternalBuildContextProvider } from './BuildStepContext.js';
|
|
10
|
-
export { BuildWorkflow } from './BuildWorkflow.js';
|
|
11
|
-
export { BuildStepEnv } from './BuildStepEnv.js';
|
|
12
|
-
export { BuildFunctionGroup } from './BuildFunctionGroup.js';
|
|
13
|
-
export { BuildStep } from './BuildStep.js';
|
|
14
|
-
export * as errors from './errors.js';
|
|
15
|
-
export * from './interpolation.js';
|
|
16
|
-
export * from './utils/shell/spawn.js';
|
|
17
|
-
export * from './utils/jsepEval.js';
|
|
18
|
-
export * from './utils/hashFiles.js';
|
|
19
|
-
export { StepMetric, StepMetricResult, StepMetricsCollection } from './StepMetrics.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,mDAA2E;AAAlE,yIAAA,uCAAuC,OAAA;AAChD,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAC7B,yDAAkF;AAAzE,mHAAA,cAAc,OAAA;AAAE,gIAAA,2BAA2B,OAAA;AACpD,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,6DAA6F;AAApF,6HAAA,sBAAsB,OAAA;AAC/B,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AAEtB,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,+CAA2C;AAAlC,yGAAA,SAAS,OAAA;AAClB,sDAAsC;AACtC,qDAAmC;AACnC,yDAAuC;AACvC,sDAAoC;AACpC,uDAAqC","sourcesContent":["export { BuildStepContext } from './BuildStepContext.js';\nexport { readAndValidateBuildConfigFromPathAsync } from './BuildConfig.js';\nexport { BuildConfigParser } from './BuildConfigParser.js';\nexport { StepsConfigParser } from './StepsConfigParser.js';\nexport { BuildFunction } from './BuildFunction.js';\nexport { BuildRuntimePlatform } from './BuildRuntimePlatform.js';\nexport { BuildStepInput, BuildStepInputValueTypeName } from './BuildStepInput.js';\nexport { BuildStepOutput } from './BuildStepOutput.js';\nexport { BuildStepGlobalContext, ExternalBuildContextProvider } from './BuildStepContext.js';\nexport { BuildWorkflow } from './BuildWorkflow.js';\nexport { BuildStepEnv } from './BuildStepEnv.js';\nexport { BuildFunctionGroup } from './BuildFunctionGroup.js';\nexport { BuildStep } from './BuildStep.js';\nexport * as errors from './errors.js';\nexport * from './interpolation.js';\nexport * from './utils/shell/spawn.js';\nexport * from './utils/jsepEval.js';\nexport * from './utils/hashFiles.js';\nexport { StepMetric, StepMetricResult, StepMetricsCollection } from './StepMetrics.js';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpolation.js","sourceRoot":"","sources":["../src/interpolation.ts"],"names":[],"mappings":";;AAIA,sDA8BC;AAhCD,qDAA+C;AAE/C,SAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,GAIR;IACC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,mFAAmF;QACnF,0GAA0G;QAC1G,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACtD,OAAO,IAAA,sBAAQ,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAChD,CAAC;QAED,wFAAwF;QACxF,8DAA8D;QAC9D,OAAO,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YAC/D,OAAO,GAAG,IAAA,sBAAQ,EAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;YAC3C,GAAG;YACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;SAClD,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { JobInterpolationContext } from '@expo/eas-build-job';\n\nimport { jsepEval } from './utils/jsepEval.js';\n\nexport function interpolateJobContext({\n target,\n context,\n}: {\n target: unknown;\n context: JobInterpolationContext;\n}): unknown {\n if (typeof target === 'string') {\n // If the value is e.g. `build: ${{ inputs.build }}`, we will interpolate the value\n // without changing `inputs.build` type, i.e. if it is an object it'll be like `build: {...inputs.build}`.\n if (target.startsWith('${{') && target.endsWith('}}')) {\n return jsepEval(target.slice(3, -2), context);\n }\n\n // Otherwise we replace all occurrences of `${{...}}` with the result of the expression.\n // e.g. `echo ${{ build.profile }}` becomes `echo production`.\n return target.replace(/\\$\\{\\{(.+?)\\}\\}/g, (_match, expression) => {\n return `${jsepEval(expression, context)}`;\n });\n } else if (Array.isArray(target)) {\n return target.map((value) => interpolateJobContext({ target: value, context }));\n } else if (typeof target === 'object' && target) {\n return Object.fromEntries(\n Object.entries(target).map(([key, value]) => [\n key,\n interpolateJobContext({ target: value, context }),\n ])\n );\n }\n return target;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runCustomFunction.js","sourceRoot":"","sources":["../../src/scripts/runCustomFunction.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,yCAA4C;AAE5C,wEAAyC;AAEzC,8DAAwD;AACxD,kEAGoC;AACpC,gEAA0D;AAE1D,sDAAqD;AAErD,KAAK,UAAU,wBAAwB;IACrC,MAAM,kCAAk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MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5C,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAA,gBAAM,EAAC,MAAM,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;YACjD,QAAQ,CAAC,IAAI,CACX,IAAA,qBAAU,EAAC,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;gBAClD,GAAG;gBACH,KAAK,EAAE,MAAM;aACd,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,QAAQ,KAAK,SAAS,CAAC,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC;YAChD,QAAQ,CAAC,IAAI,CACX,IAAA,qBAAU,EAAC,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;gBACzC,GAAG;gBACH,KAAK,EAAE,MAAM;aACd,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,KAAK,wBAAwB,EAAE,CAAC","sourcesContent":["import assert from 'assert';\n\nimport { createLogger } from '@expo/logger';\nimport { SpawnPromise, SpawnResult } from '@expo/spawn-async';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { BuildStepOutput } from '../BuildStepOutput.js';\nimport {\n SerializedCustomBuildFunctionArguments,\n deserializeInputs,\n} from '../utils/customFunction.js';\nimport { BuildStepContext } from '../BuildStepContext.js';\nimport { BuildStepFunction } from '../BuildStep.js';\nimport { spawnAsync } from '../utils/shell/spawn.js';\n\nasync function runCustomJsFunctionAsync(): Promise<void> {\n const customJavascriptFunctionModulePath = process.argv[2];\n const functionArgs = process.argv[3];\n\n assert(customJavascriptFunctionModulePath, 'customJavascriptFunctionModulePath is required');\n assert(functionArgs, 'serializedFunctionParams is required');\n\n let serializedFunctionArguments: SerializedCustomBuildFunctionArguments;\n try {\n serializedFunctionArguments = JSON.parse(functionArgs);\n } catch (e) {\n console.error('Failed to parse serializedFunctionParams');\n throw e;\n }\n\n const logger = createLogger({\n name: 'customFunctionLogger',\n streams: [\n {\n type: 'raw',\n stream: {\n write: (rec: any) => {\n if (rec) {\n switch (rec.level) {\n case 20: // Debug level\n if (rec.msg) {\n console.debug(rec.msg);\n }\n break;\n case 30: // Info level\n if (rec.msg) {\n console.log(rec.msg);\n }\n break;\n case 40: // Warn level\n if (rec.msg) {\n console.warn(rec.msg);\n }\n break;\n case 50: // Error level\n case 60: // Fatal level\n if (rec.msg) {\n console.error(rec.msg);\n }\n break;\n default:\n break;\n }\n }\n },\n },\n },\n ],\n });\n\n const ctx = BuildStepContext.deserialize(serializedFunctionArguments.ctx, logger);\n const inputs = deserializeInputs(serializedFunctionArguments.inputs);\n const outputs = Object.fromEntries(\n Object.entries(serializedFunctionArguments.outputs).map(([id, output]) => [\n id,\n BuildStepOutput.deserialize(output),\n ])\n );\n const env = serializedFunctionArguments.env;\n const envBefore = cloneDeep(serializedFunctionArguments.env);\n\n let customModule: { default: BuildStepFunction };\n try {\n customModule = await require(customJavascriptFunctionModulePath);\n } catch (e) {\n console.error('Failed to load custom function module');\n throw e;\n }\n\n const customJavascriptFunction = customModule.default;\n\n await customJavascriptFunction(ctx, { inputs, outputs, env });\n\n const promises: SpawnPromise<SpawnResult>[] = [];\n for (const output of Object.values(outputs)) {\n if (output.rawValue) {\n assert(output.value, 'output.value is required');\n promises.push(\n spawnAsync('set-output', [output.id, output.value], {\n env,\n stdio: 'pipe',\n })\n );\n }\n }\n for (const envName of Object.keys(env)) {\n const envValue = env[envName];\n if (envValue !== envBefore[envName] && envValue) {\n promises.push(\n spawnAsync('set-env', [envName, envValue], {\n env,\n stdio: 'pipe',\n })\n );\n }\n }\n await Promise.all(promises);\n}\n\nvoid runCustomJsFunctionAsync();\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customFunction.js","sourceRoot":"","sources":["../../src/utils/customFunction.ts"],"names":[],"mappings":";;;;;;AAyBA,0CASC;AAED,8CASC;AAED,4DAuCC;AAtFD,gDAAwB;AAExB,yCAA0C;AAC1C,wDAA0B;AAO1B,+CAA8C;AAE9C,MAAM,WAAW,GAAG,IAAA,yBAAa,GAAE,CAAC;AAEvB,QAAA,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAC;AAW1F,SAAgB,eAAe,CAC7B,MAAkD;IAElD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QAC1C,EAAE;QACF,EAAE,eAAe,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;KACnF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAC/B,MAAwD;IAExD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,EAAE,EAAE,CAAC;QACxD,EAAE;QACF,EAAE,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE;KACnF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAgB,wBAAwB,CAAC,2BAAmC;IAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,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C;QACrE,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\n\nimport { createContext } from 'this-file';\nimport fs from 'fs-extra';\n\nimport { BuildStepFunction } from '../BuildStep.js';\nimport { BuildStepEnv } from '../BuildStepEnv.js';\nimport { SerializedBuildStepOutput } from '../BuildStepOutput.js';\nimport { SerializedBuildStepContext } from '../BuildStepContext.js';\n\nimport { spawnAsync } from './shell/spawn.js';\n\nconst thisFileCtx = createContext();\n\nexport const SCRIPTS_PATH = path.join(thisFileCtx.dirname, '../../dist_commonjs/scripts');\n\ntype SerializedBuildStepInput = { serializedValue: string | undefined };\n\nexport interface SerializedCustomBuildFunctionArguments {\n env: BuildStepEnv;\n inputs: Record<string, SerializedBuildStepInput>;\n outputs: Record<string, SerializedBuildStepOutput>;\n ctx: SerializedBuildStepContext;\n}\n\nexport function serializeInputs(\n inputs: Parameters<BuildStepFunction>[1]['inputs']\n): SerializedCustomBuildFunctionArguments['inputs'] {\n return Object.fromEntries(\n Object.entries(inputs).map(([id, input]) => [\n id,\n { serializedValue: input === undefined ? undefined : JSON.stringify(input.value) },\n ])\n );\n}\n\nexport function deserializeInputs(\n inputs: SerializedCustomBuildFunctionArguments['inputs']\n): Parameters<BuildStepFunction>[1]['inputs'] {\n return Object.fromEntries(\n Object.entries(inputs).map(([id, { serializedValue }]) => [\n id,\n { value: serializedValue === undefined ? undefined : JSON.parse(serializedValue) },\n ])\n );\n}\n\nexport function createCustomFunctionCall(rawCustomFunctionModulePath: string): BuildStepFunction {\n return async (ctx, { env, inputs, outputs }) => {\n let customFunctionModulePath = rawCustomFunctionModulePath;\n if (!(await fs.exists(ctx.global.projectSourceDirectory))) {\n const relative = path.relative(\n path.resolve(ctx.global.projectSourceDirectory),\n customFunctionModulePath\n );\n customFunctionModulePath = path.resolve(\n path.join(ctx.global.projectTargetDirectory, relative)\n );\n }\n const serializedArguments: SerializedCustomBuildFunctionArguments = {\n env,\n inputs: serializeInputs(inputs),\n outputs: Object.fromEntries(\n Object.entries(outputs).map(([id, output]) => [id, output.serialize()])\n ),\n ctx: ctx.serialize(),\n };\n try {\n await spawnAsync(\n 'node',\n [\n path.join(SCRIPTS_PATH, 'runCustomFunction.cjs'),\n customFunctionModulePath,\n JSON.stringify(serializedArguments),\n ],\n {\n logger: ctx.logger,\n cwd: ctx.workingDirectory,\n env,\n stdio: 'pipe',\n }\n );\n } catch {\n throw new Error(`Custom function exited with non-zero exit code.`);\n }\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duplicates.js","sourceRoot":"","sources":["../../../src/utils/expodash/duplicates.ts"],"names":[],"mappings":";;AAAA,gCAWC;AAXD,SAAgB,UAAU,CAAI,KAAU;IACtC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAK,CAAC;IACrC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAK,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,kBAAkB,CAAC,CAAC;AACjC,CAAC","sourcesContent":["export function duplicates<T>(items: T[]): T[] {\n const visitedItemsSet = new Set<T>();\n const duplicatedItemsSet = new Set<T>();\n for (const item of items) {\n if (visitedItemsSet.has(item)) {\n duplicatedItemsSet.add(item);\n } else {\n visitedItemsSet.add(item);\n }\n }\n return [...duplicatedItemsSet];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniq.js","sourceRoot":"","sources":["../../../src/utils/expodash/uniq.ts"],"names":[],"mappings":";;AAAA,oBAGC;AAHD,SAAgB,IAAI,CAAI,KAAU;IAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;AAClB,CAAC","sourcesContent":["export function uniq<T>(items: T[]): T[] {\n const set = new Set(items);\n return [...set];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hashFiles.js","sourceRoot":"","sources":["../../src/utils/hashFiles.ts"],"names":[],"mappings":";;;;;AASA,8BAyBC;AAlCD,mCAAoC;AAEpC,wDAA0B;AAE1B;;;;GAIG;AACH,SAAgB,SAAS,CAAC,SAAmB;IAC3C,MAAM,YAAY,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,IAAI,kBAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAChC,MAAM,WAAW,GAAG,kBAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAC9C,MAAM,QAAQ,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,CAAC;gBACnE,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC7B,QAAQ,GAAG,IAAI,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED,YAAY,CAAC,GAAG,EAAE,CAAC;IACnB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { createHash } from 'crypto';\n\nimport fs from 'fs-extra';\n\n/**\n * Hashes the contents of multiple files and returns a combined SHA256 hash.\n * @param filePaths Array of absolute file paths to hash\n * @returns Combined SHA256 hash of all files, or empty string if no files exist\n */\nexport function hashFiles(filePaths: string[]): string {\n const combinedHash = createHash('sha256');\n let hasFound = false;\n\n for (const filePath of filePaths) {\n try {\n if (fs.pathExistsSync(filePath)) {\n const fileContent = fs.readFileSync(filePath);\n const fileHash = createHash('sha256').update(fileContent).digest();\n combinedHash.write(fileHash);\n hasFound = true;\n }\n } catch (err: any) {\n throw new Error(`Failed to hash file ${filePath}: ${err.message}`);\n }\n }\n\n combinedHash.end();\n const result = combinedHash.digest('hex');\n\n if (!hasFound) {\n return '';\n }\n\n return result;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsepEval.js","sourceRoot":"","sources":["../../src/utils/jsepEval.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,2BAA2B;AAC3B,8DAA8D;AAC9D,4FAA4F;AAC5F,0CAA0C;;;;;AA6L1C,4BAGC;AA9LD,oDAA4B;AAE5B,gDAAwB;AACxB,4DAA6B;AAE7B,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;IAClC,KAAK,EAAE,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;IAClC,IAAI,EAAE,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,sBAAsB;IACxD,IAAI,EAAE,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,sBAAsB;IACxD,GAAG,EAAE,CAAC,CAAM,EAAE,CAAM,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IAC9B,GAAG,EAAE,CAAC,CAAM,EAA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,CAAC;QACJ,CAAC;QACD,KAAK,iBAAiB,CAAC,CAAC,CAAC;YACvB,MAAM,QAAQ,GAAI,IAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAClE,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAChD,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED,SAAgB,QAAQ,CAAC,UAAkB,EAAE,OAAiC;IAC5E,MAAM,IAAI,GAAG,IAAA,cAAI,EAAC,UAAU,CAAC,CAAC;IAC9B,OAAO,sBAAsB,CAAC,IAAI,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["// https://github.com/Sensative/jsep-eval/blob/master/src/jsep-eval.js\n// - migrated to TypeScript\n// - small refactoring (splitting operators into unary/binary)\n// - lack of LogicalExpression we don't need, because our version of JSEP does not expose it\n// - lack of Promise wrapper we don't need\n\nimport assert from 'assert';\n\nimport jsep from 'jsep';\nimport get from 'lodash.get';\n\nconst binaryOperatorFunctions = {\n '===': (a: any, b: any) => a === b,\n '!==': (a: any, b: any) => a !== b,\n '==': (a: any, b: any) => a == b, // eslint-disable-line\n '!=': (a: any, b: any) => a != b, // eslint-disable-line\n '>': (a: any, b: any) => a > b,\n '<': (a: any, b: any) => a < b,\n '>=': (a: any, b: any) => a >= b,\n '<=': (a: any, b: any) => a <= b,\n '+': (a: any, b: any) => a + b,\n '-': (a: any, b: any) => a - b,\n '*': (a: any, b: any) => a * b,\n '/': (a: any, b: any) => a / b,\n '%': (a: any, b: any) => a % b, // remainder\n '**': (a: any, b: any) => a ** b, // exponentiation\n '&': (a: any, b: any) => a & b, // bitwise AND\n '|': (a: any, b: any) => a | b, // bitwise OR\n '^': (a: any, b: any) => a ^ b, // bitwise XOR\n '<<': (a: any, b: any) => a << b, // left shift\n '>>': (a: any, b: any) => a >> b, // sign-propagating right shift\n '>>>': (a: any, b: any) => a >>> b, // zero-fill right shift\n // Let's make a home for the logical operators here as well\n '||': (a: any, b: any) => a || b,\n '&&': (a: any, b: any) => a && b,\n};\ntype BinaryOperator = keyof typeof binaryOperatorFunctions;\n\nconst unaryOperatorFunctions = {\n '!': (a: any) => !a,\n '~': (a: any) => ~a, // bitwise NOT\n '+': (a: any) => +a, // unary plus\n '-': (a: any) => -a, // unary negation\n '++': (a: any) => ++a, // increment\n '--': (a: any) => --a, // decrement\n};\ntype UnaryOperator = keyof typeof unaryOperatorFunctions;\n\nfunction isValid<T extends jsep.ExpressionType>(\n expression: jsep.Expression,\n types: T[]\n): expression is jsep.CoreExpression & { type: T } {\n return types.includes(expression.type as T);\n}\n\nfunction getParameterPath(node: jsep.MemberExpression, context: Record<string, unknown>): string {\n // it's a MEMBER expression\n // EXAMPLES: a[b] (computed)\n // a.b (not computed)\n const computed = node.computed;\n const object = node.object;\n const property = node.property;\n\n // object is either 'IDENTIFIER', 'MEMBER', or 'THIS'\n assert(\n isValid(object, ['MemberExpression', 'Identifier', 'ThisExpression']),\n 'Invalid object type'\n );\n assert(property, 'Member expression property is missing');\n\n let objectPath = '';\n if (object.type === 'ThisExpression') {\n objectPath = '';\n } else if (isValid(object, ['Identifier'])) {\n objectPath = object.name;\n } else {\n objectPath = getParameterPath(object, context);\n }\n\n if (computed) {\n // if computed -> evaluate anew\n const propertyPath = evaluateExpressionNode(property, context);\n return objectPath + '[' + propertyPath + ']';\n } else if (property.type === 'Identifier') {\n return (objectPath ? objectPath + '.' : '') + property.name;\n } else if (property.type === 'CallExpression') {\n const propertyPath = evaluateExpressionNode(property, context);\n return (objectPath ? objectPath + '.' : '') + propertyPath;\n } else if (property.type === 'Literal') {\n return (objectPath ? objectPath + '.' : '') + `${property.value}`;\n } else {\n assert(isValid(property, ['MemberExpression']), 'Invalid object type');\n const propertyPath = getParameterPath(property, context);\n return (objectPath ? objectPath + '.' : '') + propertyPath;\n }\n}\n\nfunction evaluateExpressionNode(node: jsep.Expression, context: Record<string, unknown>): unknown {\n switch (node.type as jsep.ExpressionType) {\n case 'Literal': {\n return (node as jsep.Literal).value;\n }\n case 'ThisExpression': {\n return context;\n }\n case 'Compound': {\n const compoundNode = node as jsep.Compound;\n const expressions = compoundNode.body.map((el) => evaluateExpressionNode(el, context));\n return expressions.pop();\n }\n case 'UnaryExpression': {\n const unaryNode = node as jsep.UnaryExpression;\n if (!(unaryNode.operator in unaryOperatorFunctions)) {\n throw new Error(`Unsupported unary operator: ${unaryNode.operator}`);\n }\n const operatorFn = unaryOperatorFunctions[unaryNode.operator as UnaryOperator];\n const argument = evaluateExpressionNode(unaryNode.argument, context);\n return operatorFn(argument);\n }\n case 'BinaryExpression': {\n const binaryNode = node as jsep.BinaryExpression;\n if (!(binaryNode.operator in binaryOperatorFunctions)) {\n throw new Error(`Unsupported binary operator: ${binaryNode.operator}`);\n }\n const operator = binaryOperatorFunctions[binaryNode.operator as BinaryOperator];\n const left = evaluateExpressionNode(binaryNode.left, context);\n const right = evaluateExpressionNode(binaryNode.right, context);\n return operator(left, right);\n }\n case 'ConditionalExpression': {\n const conditionalNode = node as jsep.ConditionalExpression;\n const test = evaluateExpressionNode(conditionalNode.test, context);\n const consequent = evaluateExpressionNode(conditionalNode.consequent, context);\n const alternate = evaluateExpressionNode(conditionalNode.alternate, context);\n return test ? consequent : alternate;\n }\n case 'CallExpression': {\n const allowedCalleeTypes: jsep.ExpressionType[] = [\n 'MemberExpression',\n 'Identifier',\n 'ThisExpression',\n ];\n const callNode = node as jsep.CallExpression;\n if (!allowedCalleeTypes.includes(callNode.callee.type as jsep.ExpressionType)) {\n throw new Error(\n `Invalid function callee type: ${\n callNode.callee.type\n }. Expected one of [${allowedCalleeTypes.join(', ')}].`\n );\n }\n const callee = evaluateExpressionNode(callNode.callee, context);\n const args = callNode.arguments.map((arg) => evaluateExpressionNode(arg, context));\n assert(typeof callee === 'function', 'Expected a function');\n // eslint-disable-next-line prefer-spread\n return callee.apply(null, args);\n }\n case 'Identifier': {\n const identifier = (node as jsep.Identifier).name;\n if (!(identifier in context)) {\n throw new Error(\n `Invalid identifier \"${identifier}\". Expected one of [${Object.keys(context).join(\n ', '\n )}].`\n );\n }\n return get(context, identifier);\n }\n case 'MemberExpression': {\n const memberNode = node as jsep.MemberExpression;\n return get(\n evaluateExpressionNode(memberNode.object, context),\n getParameterPath(\n {\n type: 'MemberExpression',\n object: { type: 'ThisExpression' },\n property: memberNode.property,\n computed: false,\n } as jsep.MemberExpression,\n context\n )\n );\n }\n case 'ArrayExpression': {\n const elements = (node as jsep.ArrayExpression).elements.map((el) =>\n el ? evaluateExpressionNode(el, context) : null\n );\n return elements;\n }\n default:\n throw new Error(`Unsupported expression type: ${node.type}`);\n }\n}\n\nexport function jsepEval(expression: string, context?: Record<string, unknown>): unknown {\n const tree = jsep(expression);\n return evaluateExpressionNode(tree, context ?? {});\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullthrows.js","sourceRoot":"","sources":["../../src/utils/nullthrows.ts"],"names":[],"mappings":";;AAAA,gCAKC;AALD,SAAgB,UAAU,CAAI,KAA2B,EAAE,OAAgB;IACzE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,SAAS,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,sDAAsD,KAAK,EAAE,CAAC,CAAC;AAChG,CAAC","sourcesContent":["export function nullthrows<T>(value: T | null | undefined, message?: string): NonNullable<T> {\n if (value != null) {\n return value;\n }\n throw new TypeError(message ?? `Expected value not to be null or undefined but got ${value}`);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../src/utils/shell/bin.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,yCAA0C;AAE1C,MAAM,GAAG,GAAG,IAAA,yBAAa,GAAE,CAAC;AAEf,QAAA,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport { createContext } from 'this-file';\n\nconst ctx = createContext();\n\nexport const BIN_PATH = path.join(ctx.dirname, '../../../bin');\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/utils/shell/command.ts"],"names":[],"mappings":";;AAAA,wDAcC;AAdD,SAAgB,sBAAsB,CACpC,KAAa,EACb,MAAe;IAEf,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IACD,OAAO;QACL,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC","sourcesContent":["export function getShellCommandAndArgs(\n shell: string,\n script?: string\n): { command: string; args?: string[] } {\n const splits = shell.split(' ');\n const command = splits[0];\n const args = [...splits.slice(1)];\n if (script) {\n args.push(script);\n }\n return {\n command,\n args,\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../src/utils/shell/spawn.ts"],"names":[],"mappings":";;;;;AA8BA,gCAcC;AA1CD,yCAAiE;AACjE,oEAI2B;AAoB3B,KAAK;AAEL,sDAAsD;AACtD,SAAgB,UAAU,CACxB,OAAe,EACf,IAAc,EACd,aAA2B;IACzB,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;CACnB;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAA,qBAAkB,EAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,IAAI,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAA,wBAAe,EAAC,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { IOType } from 'child_process';\n\nimport { pipeSpawnOutput, bunyan, PipeMode } from '@expo/logger';\nimport spawnAsyncOriginal, {\n SpawnResult,\n SpawnPromise,\n SpawnOptions as SpawnOptionsOriginal,\n} from '@expo/spawn-async';\n\n// We omit 'ignoreStdio' to simplify logic -- only 'stdio' governs stdio.\n// We omit 'stdio' here to add further down in a logger-based union.\ntype SpawnOptions = Omit<SpawnOptionsOriginal, 'stdio' | 'ignoreStdio'> & {\n lineTransformer?: (line: string) => string | null;\n mode?: PipeMode;\n} & (\n | {\n // If logger is passed, we require stdio to be pipe.\n logger: bunyan;\n stdio: 'pipe' | [IOType, 'pipe', 'pipe', ...IOType[]];\n }\n | {\n // If logger is not passed, stdio can be anything.\n // Defaults to inherit.\n logger?: never;\n stdio?: SpawnOptionsOriginal['stdio'];\n }\n );\n// If\n\n// eslint-disable-next-line async-protect/async-suffix\nexport function spawnAsync(\n command: string,\n args: string[],\n allOptions: SpawnOptions = {\n stdio: 'inherit',\n cwd: process.cwd(),\n }\n): SpawnPromise<SpawnResult> {\n const { logger, ...options } = allOptions;\n const promise = spawnAsyncOriginal(command, args, options);\n if (logger && promise.child) {\n pipeSpawnOutput(logger, promise.child, options);\n }\n return promise;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","s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CAAC,CAAC;IACxC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,wCAAwC,CAC/C,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI,CACf,CAAC;AACJ,CAAC;AAOD,SAAgB,eAAe,CAAC,cAAsB;IACpD,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,2CAAmC,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9F,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,eAAe,CAAC,wBAAgC;IAC9D,MAAM,MAAM,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,4BAAgB,CACxB,gKAAgK,wBAAwB,GAAG,CAC5L,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import get from 'lodash.get';\nimport cloneDeep from 'lodash.clonedeep';\n\nimport { BuildStepInputValueTypeName } from '../BuildStepInput.js';\nimport { BuildConfigError, BuildStepRuntimeError } from '../errors.js';\n\nimport { nullthrows } from './nullthrows.js';\n\nexport const BUILD_STEP_INPUT_EXPRESSION_REGEXP = /\\${\\s*(inputs\\.[\\S]+)\\s*}/;\nexport const BUILD_STEP_OUTPUT_EXPRESSION_REGEXP = /\\${\\s*(steps\\.[\\S]+)\\s*}/;\nexport const BUILD_GLOBAL_CONTEXT_EXPRESSION_REGEXP = /\\${\\s*(eas\\.[\\S]+)\\s*}/;\nexport const BUILD_STEP_OR_BUILD_GLOBAL_CONTEXT_REFERENCE_REGEX = /\\${\\s*((steps|eas)\\.[\\S]+)\\s*}/;\n\nexport function interpolateWithInputs(\n templateString: string,\n inputs: Record<string, string>\n): string {\n return interpolate(templateString, BUILD_STEP_INPUT_EXPRESSION_REGEXP, inputs);\n}\n\nexport function interpolateWithOutputs<InterpolableType extends string | object>(\n interpolableValue: InterpolableType,\n fn: (path: string) => string\n): InterpolableType {\n if (typeof interpolableValue === 'string') {\n return interpolateStringWithOutputs(interpolableValue, fn) as InterpolableType;\n } else {\n return interpolateObjectWithOutputs(interpolableValue, fn) as InterpolableType;\n }\n}\n\nexport function interpolateStringWithOutputs(\n templateString: string,\n fn: (path: string) => string\n): string {\n return interpolate(templateString, BUILD_STEP_OUTPUT_EXPRESSION_REGEXP, fn);\n}\n\nexport function interpolateObjectWithOutputs(\n interpolableObject: object,\n fn: (path: string) => string\n): object {\n const interpolableObjectCopy = cloneDeep(interpolableObject);\n Object.keys(interpolableObject).forEach((property) => {\n const propertyValue = interpolableObject[property as keyof typeof interpolableObject];\n if (['string', 'object'].includes(typeof propertyValue)) {\n interpolableObjectCopy[property as keyof typeof interpolableObjectCopy] =\n interpolateWithOutputs(propertyValue, fn);\n }\n });\n return interpolableObjectCopy;\n}\n\nexport function getObjectValueForInterpolation(\n path: string,\n obj: Record<string, unknown>\n): string | number | boolean | null {\n const value = get(obj, path);\n\n if (value === undefined) {\n throw new BuildStepRuntimeError(\n `Object field \"${path}\" does not exist. Ensure you are using the correct field name.`\n );\n }\n\n if (!isAllowedValueTypeForObjectInterpolation(value)) {\n throw new BuildStepRuntimeError(\n `EAS context field \"${path}\" is not of type ${Object.values(BuildStepInputValueTypeName).join(\n ', '\n )}, or undefined. It is of type \"${typeof value}\". We currently only support accessing string or undefined values from the EAS context.`\n );\n }\n\n if (value !== null && typeof value === 'object') {\n return JSON.stringify(value);\n }\n\n return value;\n}\n\nexport function interpolateWithGlobalContext<InterpolableType extends string | object>(\n interpolableValue: InterpolableType,\n fn: (path: string) => string\n): InterpolableType {\n if (typeof interpolableValue === 'string') {\n return interpolateStringWithGlobalContext(interpolableValue, fn) as InterpolableType;\n } else {\n return interpolateObjectWithGlobalContext(interpolableValue, fn) as InterpolableType;\n }\n}\n\nexport function interpolateStringWithGlobalContext(\n templateString: string,\n fn: (path: string) => string\n): string {\n return interpolate(templateString, BUILD_GLOBAL_CONTEXT_EXPRESSION_REGEXP, fn);\n}\n\nexport function interpolateObjectWithGlobalContext(\n templateObject: object,\n fn: (path: string) => string\n): object {\n const templateObjectCopy = cloneDeep(templateObject);\n Object.keys(templateObject).forEach((property) => {\n const propertyValue = templateObject[property as keyof typeof templateObject];\n if (['string', 'object'].includes(typeof propertyValue)) {\n templateObjectCopy[property as keyof typeof templateObjectCopy] =\n interpolateWithGlobalContext(propertyValue, fn);\n }\n });\n return templateObjectCopy;\n}\n\nfunction interpolate(\n templateString: string,\n regex: RegExp,\n varsOrFn: Record<string, string> | ((key: string) => string)\n): string {\n const matched = templateString.match(new RegExp(regex, 'g'));\n if (!matched) {\n return templateString;\n }\n let result = templateString;\n for (const match of matched) {\n const [, path] = nullthrows(match.match(regex));\n const value = typeof varsOrFn === 'function' ? varsOrFn(path) : varsOrFn[path.split('.')[1]];\n result = result.replace(match, value);\n }\n return result;\n}\n\nfunction isAllowedValueTypeForObjectInterpolation(\n value: unknown\n): value is string | number | boolean | object | null {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'object' ||\n value === null\n );\n}\n\ninterface BuildOutputPath {\n stepId: string;\n outputId: string;\n}\n\nexport function findOutputPaths(templateString: string): BuildOutputPath[] {\n const result: BuildOutputPath[] = [];\n const matches = templateString.matchAll(new RegExp(BUILD_STEP_OUTPUT_EXPRESSION_REGEXP, 'g'));\n for (const match of matches) {\n result.push(parseOutputPath(match[1]));\n }\n return result;\n}\n\nexport function parseOutputPath(outputPathWithObjectName: string): BuildOutputPath {\n const splits = outputPathWithObjectName.split('.').slice(1);\n if (splits.length !== 2) {\n throw new BuildConfigError(\n `Step output path must consist of two components joined with a dot, where first is the step ID, and second is the output name, e.g. \"step3.output1\". Passed: \"${outputPathWithObjectName}\"`\n );\n }\n const [stepId, outputId] = splits;\n return { stepId, outputId };\n}\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BuildFunction, BuildFunctionById } from './BuildFunction.js';
|
|
2
|
-
import { BuildFunctionGroup } from './BuildFunctionGroup.js';
|
|
3
|
-
import { BuildStep } from './BuildStep.js';
|
|
4
|
-
import { BuildStepGlobalContext } from './BuildStepContext.js';
|
|
5
|
-
import { BuildWorkflow } from './BuildWorkflow.js';
|
|
6
|
-
export declare abstract class AbstractConfigParser {
|
|
7
|
-
protected readonly ctx: BuildStepGlobalContext;
|
|
8
|
-
protected readonly externalFunctions?: BuildFunction[];
|
|
9
|
-
protected readonly externalFunctionGroups?: BuildFunctionGroup[];
|
|
10
|
-
constructor(ctx: BuildStepGlobalContext, { externalFunctions, externalFunctionGroups, }: {
|
|
11
|
-
externalFunctions?: BuildFunction[];
|
|
12
|
-
externalFunctionGroups?: BuildFunctionGroup[];
|
|
13
|
-
});
|
|
14
|
-
parseAsync(): Promise<BuildWorkflow>;
|
|
15
|
-
protected abstract parseConfigToBuildStepsAndBuildFunctionByIdMappingAsync(): Promise<{
|
|
16
|
-
buildSteps: BuildStep[];
|
|
17
|
-
buildFunctionById: BuildFunctionById;
|
|
18
|
-
}>;
|
|
19
|
-
private validateExternalFunctions;
|
|
20
|
-
private validateExternalFunctionGroups;
|
|
21
|
-
protected getExternalFunctionFullIds(): string[];
|
|
22
|
-
protected getExternalFunctionGroupFullIds(): string[];
|
|
23
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { BuildWorkflow } from './BuildWorkflow.js';
|
|
2
|
-
import { BuildWorkflowValidator } from './BuildWorkflowValidator.js';
|
|
3
|
-
import { BuildConfigError } from './errors.js';
|
|
4
|
-
import { duplicates } from './utils/expodash/duplicates.js';
|
|
5
|
-
import { uniq } from './utils/expodash/uniq.js';
|
|
6
|
-
export class AbstractConfigParser {
|
|
7
|
-
constructor(ctx, { externalFunctions, externalFunctionGroups, }) {
|
|
8
|
-
this.ctx = ctx;
|
|
9
|
-
this.validateExternalFunctions(externalFunctions);
|
|
10
|
-
this.validateExternalFunctionGroups(externalFunctionGroups);
|
|
11
|
-
this.externalFunctions = externalFunctions;
|
|
12
|
-
this.externalFunctionGroups = externalFunctionGroups;
|
|
13
|
-
}
|
|
14
|
-
async parseAsync() {
|
|
15
|
-
const { buildSteps, buildFunctionById } = await this.parseConfigToBuildStepsAndBuildFunctionByIdMappingAsync();
|
|
16
|
-
const workflow = new BuildWorkflow(this.ctx, { buildSteps, buildFunctions: buildFunctionById });
|
|
17
|
-
await new BuildWorkflowValidator(workflow).validateAsync();
|
|
18
|
-
return workflow;
|
|
19
|
-
}
|
|
20
|
-
validateExternalFunctions(externalFunctions) {
|
|
21
|
-
if (externalFunctions === undefined) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const externalFunctionIds = externalFunctions.map((f) => f.getFullId());
|
|
25
|
-
const duplicatedExternalFunctionIds = duplicates(externalFunctionIds);
|
|
26
|
-
if (duplicatedExternalFunctionIds.length === 0) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
throw new BuildConfigError(`Provided external functions with duplicated IDs: ${duplicatedExternalFunctionIds
|
|
30
|
-
.map((id) => `"${id}"`)
|
|
31
|
-
.join(', ')}`);
|
|
32
|
-
}
|
|
33
|
-
validateExternalFunctionGroups(externalFunctionGroups) {
|
|
34
|
-
if (externalFunctionGroups === undefined) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const externalFunctionGroupIds = externalFunctionGroups.map((f) => f.getFullId());
|
|
38
|
-
const duplicatedExternalFunctionGroupIds = duplicates(externalFunctionGroupIds);
|
|
39
|
-
if (duplicatedExternalFunctionGroupIds.length === 0) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
throw new BuildConfigError(`Provided external function groups with duplicated IDs: ${duplicatedExternalFunctionGroupIds
|
|
43
|
-
.map((id) => `"${id}"`)
|
|
44
|
-
.join(', ')}`);
|
|
45
|
-
}
|
|
46
|
-
getExternalFunctionFullIds() {
|
|
47
|
-
if (this.externalFunctions === undefined) {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
const ids = this.externalFunctions.map((f) => f.getFullId());
|
|
51
|
-
return uniq(ids);
|
|
52
|
-
}
|
|
53
|
-
getExternalFunctionGroupFullIds() {
|
|
54
|
-
if (this.externalFunctionGroups === undefined) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
const ids = this.externalFunctionGroups.map((f) => f.getFullId());
|
|
58
|
-
return uniq(ids);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=AbstractConfigParser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractConfigParser.js","sourceRoot":"","sources":["../src/AbstractConfigParser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,MAAM,OAAgB,oBAAoB;IAIxC,YACqB,GAA2B,EAC9C,EACE,iBAAiB,EACjB,sBAAsB,GAIvB;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AM,wBAAwB,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAClF,MAAM,kCAAkC,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAC;QAChF,IAAI,kCAAkC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,OAAO;QACT,CAAC;QACD,MAAM,IAAI,gBAAgB,CACxB,0DAA0D,kCAAkC;aACzF,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC;aACtB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;IAES,0BAA0B;QAClC,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IAES,+BAA+B;QACvC,IAAI,IAAI,CAAC,sBAAsB,KAAK,SAAS,EAAE,CAAC;YAC9C,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;CACF","sourcesContent":["import { BuildFunction, BuildFunctionById } from './BuildFunction.js';\nimport { BuildFunctionGroup } from './BuildFunctionGroup.js';\nimport { BuildStep } from './BuildStep.js';\nimport { BuildStepGlobalContext } from './BuildStepContext.js';\nimport { BuildWorkflow } from './BuildWorkflow.js';\nimport { BuildWorkflowValidator } from './BuildWorkflowValidator.js';\nimport { BuildConfigError } from './errors.js';\nimport { duplicates } from './utils/expodash/duplicates.js';\nimport { uniq } from './utils/expodash/uniq.js';\n\nexport abstract class AbstractConfigParser {\n protected readonly externalFunctions?: BuildFunction[];\n protected readonly externalFunctionGroups?: BuildFunctionGroup[];\n\n constructor(\n protected readonly ctx: BuildStepGlobalContext,\n {\n externalFunctions,\n externalFunctionGroups,\n }: {\n externalFunctions?: BuildFunction[];\n externalFunctionGroups?: BuildFunctionGroup[];\n }\n ) {\n this.validateExternalFunctions(externalFunctions);\n this.validateExternalFunctionGroups(externalFunctionGroups);\n\n this.externalFunctions = externalFunctions;\n this.externalFunctionGroups = externalFunctionGroups;\n }\n\n public async parseAsync(): Promise<BuildWorkflow> {\n const { buildSteps, buildFunctionById } =\n await this.parseConfigToBuildStepsAndBuildFunctionByIdMappingAsync();\n const workflow = new BuildWorkflow(this.ctx, { buildSteps, buildFunctions: buildFunctionById });\n await new BuildWorkflowValidator(workflow).validateAsync();\n return workflow;\n }\n\n protected abstract parseConfigToBuildStepsAndBuildFunctionByIdMappingAsync(): Promise<{\n buildSteps: BuildStep[];\n buildFunctionById: BuildFunctionById;\n }>;\n\n private validateExternalFunctions(externalFunctions?: BuildFunction[]): void {\n if (externalFunctions === undefined) {\n return;\n }\n const externalFunctionIds = externalFunctions.map((f) => f.getFullId());\n const duplicatedExternalFunctionIds = duplicates(externalFunctionIds);\n if (duplicatedExternalFunctionIds.length === 0) {\n return;\n }\n throw new BuildConfigError(\n `Provided external functions with duplicated IDs: ${duplicatedExternalFunctionIds\n .map((id) => `\"${id}\"`)\n .join(', ')}`\n );\n }\n\n private validateExternalFunctionGroups(externalFunctionGroups?: BuildFunctionGroup[]): void {\n if (externalFunctionGroups === undefined) {\n return;\n }\n const externalFunctionGroupIds = externalFunctionGroups.map((f) => f.getFullId());\n const duplicatedExternalFunctionGroupIds = duplicates(externalFunctionGroupIds);\n if (duplicatedExternalFunctionGroupIds.length === 0) {\n return;\n }\n throw new BuildConfigError(\n `Provided external function groups with duplicated IDs: ${duplicatedExternalFunctionGroupIds\n .map((id) => `\"${id}\"`)\n .join(', ')}`\n );\n }\n\n protected getExternalFunctionFullIds(): string[] {\n if (this.externalFunctions === undefined) {\n return [];\n }\n const ids = this.externalFunctions.map((f) => f.getFullId());\n return uniq(ids);\n }\n\n protected getExternalFunctionGroupFullIds(): string[] {\n if (this.externalFunctionGroups === undefined) {\n return [];\n }\n const ids = this.externalFunctionGroups.map((f) => f.getFullId());\n return uniq(ids);\n }\n}\n"]}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import Joi from 'joi';
|
|
2
|
-
import { BuildRuntimePlatform } from './BuildRuntimePlatform.js';
|
|
3
|
-
import { BuildStepInputValueTypeName, BuildStepInputValueType } from './BuildStepInput.js';
|
|
4
|
-
import { BuildStepEnv } from './BuildStepEnv.js';
|
|
5
|
-
export type BuildFunctions = Record<string, BuildFunctionConfig>;
|
|
6
|
-
interface BuildFunctionsConfigFile {
|
|
7
|
-
configFilesToImport?: string[];
|
|
8
|
-
functions?: BuildFunctions;
|
|
9
|
-
}
|
|
10
|
-
export interface BuildConfig extends BuildFunctionsConfigFile {
|
|
11
|
-
build: {
|
|
12
|
-
name?: string;
|
|
13
|
-
steps: BuildStepConfig[];
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export type BuildStepConfig = BuildStepCommandRun | BuildStepBareCommandRun | BuildStepFunctionCall | BuildStepBareFunctionOrFunctionGroupCall;
|
|
17
|
-
export type BuildStepCommandRun = {
|
|
18
|
-
run: BuildFunctionCallConfig & {
|
|
19
|
-
outputs?: BuildStepOutputs;
|
|
20
|
-
command: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export type BuildStepBareCommandRun = {
|
|
24
|
-
run: string;
|
|
25
|
-
};
|
|
26
|
-
export type BuildStepFunctionCall = {
|
|
27
|
-
[functionId: string]: BuildFunctionCallConfig;
|
|
28
|
-
};
|
|
29
|
-
export type BuildStepBareFunctionOrFunctionGroupCall = string;
|
|
30
|
-
export type BuildFunctionCallConfig = {
|
|
31
|
-
id?: string;
|
|
32
|
-
inputs?: BuildStepInputs;
|
|
33
|
-
name?: string;
|
|
34
|
-
workingDirectory?: string;
|
|
35
|
-
shell?: string;
|
|
36
|
-
env?: BuildStepEnv;
|
|
37
|
-
if?: string;
|
|
38
|
-
timeout_minutes?: number;
|
|
39
|
-
__metrics_id?: string;
|
|
40
|
-
};
|
|
41
|
-
export type BuildStepInputs = Record<string, unknown>;
|
|
42
|
-
export type BuildStepOutputs = (string | {
|
|
43
|
-
name: string;
|
|
44
|
-
required?: boolean;
|
|
45
|
-
})[];
|
|
46
|
-
export interface BuildFunctionConfig {
|
|
47
|
-
inputs?: BuildFunctionInputs;
|
|
48
|
-
outputs?: BuildFunctionOutputs;
|
|
49
|
-
name?: string;
|
|
50
|
-
supportedRuntimePlatforms?: BuildRuntimePlatform[];
|
|
51
|
-
shell?: string;
|
|
52
|
-
command?: string;
|
|
53
|
-
path?: string;
|
|
54
|
-
}
|
|
55
|
-
export type BuildFunctionInputs = (string | {
|
|
56
|
-
name: string;
|
|
57
|
-
defaultValue?: BuildStepInputValueType;
|
|
58
|
-
allowedValues?: BuildStepInputValueType[];
|
|
59
|
-
required?: boolean;
|
|
60
|
-
allowedValueType: BuildStepInputValueTypeName;
|
|
61
|
-
})[];
|
|
62
|
-
export type BuildFunctionOutputs = BuildStepOutputs;
|
|
63
|
-
export declare const BuildFunctionsConfigFileSchema: Joi.ObjectSchema<BuildFunctionsConfigFile>;
|
|
64
|
-
export declare const BuildConfigSchema: Joi.ObjectSchema<BuildConfig>;
|
|
65
|
-
interface BuildConfigValidationParams {
|
|
66
|
-
externalFunctionIds?: string[];
|
|
67
|
-
externalFunctionGroupsIds?: string[];
|
|
68
|
-
skipNamespacedFunctionsOrFunctionGroupsCheck?: boolean;
|
|
69
|
-
}
|
|
70
|
-
export declare function readAndValidateBuildConfigFromPathAsync(configPath: string, params?: BuildConfigValidationParams): Promise<BuildConfig>;
|
|
71
|
-
export declare function readAndValidateBuildFunctionsConfigFileAsync(configPath: string): Promise<BuildFunctionsConfigFile>;
|
|
72
|
-
export declare function readRawBuildConfigAsync(configPath: string): Promise<any>;
|
|
73
|
-
export declare function validateConfig<T>(schema: Joi.ObjectSchema<T>, config: object, configFilePath?: string): T;
|
|
74
|
-
export declare function mergeConfigWithImportedFunctions(config: BuildConfig, importedFunctions: BuildFunctions): void;
|
|
75
|
-
export declare function isBuildStepCommandRun(step: BuildStepConfig): step is BuildStepCommandRun;
|
|
76
|
-
export declare function isBuildStepBareCommandRun(step: BuildStepConfig): step is BuildStepBareCommandRun;
|
|
77
|
-
export declare function isBuildStepFunctionCall(step: BuildStepConfig): step is BuildStepFunctionCall;
|
|
78
|
-
export declare function isBuildStepBareFunctionOrFunctionGroupCall(step: BuildStepConfig): step is BuildStepBareFunctionOrFunctionGroupCall;
|
|
79
|
-
export declare function validateAllFunctionsExist(config: BuildConfig, { externalFunctionIds, externalFunctionGroupsIds, skipNamespacedFunctionsOrFunctionGroupsCheck, }: BuildConfigValidationParams): void;
|
|
80
|
-
export {};
|