@expo/steps 1.0.263 → 1.0.271

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.
Files changed (204) hide show
  1. package/{dist_commonjs → dist}/AbstractConfigParser.d.ts +5 -5
  2. package/{dist_commonjs/AbstractConfigParser.cjs → dist/AbstractConfigParser.js} +13 -13
  3. package/dist/AbstractConfigParser.js.map +1 -0
  4. package/{dist_commonjs → dist}/BuildConfig.d.ts +4 -3
  5. package/{dist_commonjs/BuildConfig.cjs → dist/BuildConfig.js} +24 -22
  6. package/dist/BuildConfig.js.map +1 -0
  7. package/{dist_esm → dist}/BuildConfigParser.d.ts +5 -5
  8. package/{dist_commonjs/BuildConfigParser.cjs → dist/BuildConfigParser.js} +33 -32
  9. package/dist/BuildConfigParser.js.map +1 -0
  10. package/{dist_esm → dist}/BuildFunction.d.ts +9 -7
  11. package/{dist_commonjs/BuildFunction.cjs → dist/BuildFunction.js} +9 -7
  12. package/dist/BuildFunction.js.map +1 -0
  13. package/{dist_commonjs → dist}/BuildFunctionGroup.d.ts +4 -4
  14. package/{dist_commonjs/BuildFunctionGroup.cjs → dist/BuildFunctionGroup.js} +4 -4
  15. package/dist/BuildFunctionGroup.js.map +1 -0
  16. package/{dist_esm → dist}/BuildStep.d.ts +8 -6
  17. package/{dist_commonjs/BuildStep.cjs → dist/BuildStep.js} +31 -30
  18. package/dist/BuildStep.js.map +1 -0
  19. package/{dist_commonjs → dist}/BuildStepContext.d.ts +7 -3
  20. package/{dist_commonjs/BuildStepContext.cjs → dist/BuildStepContext.js} +17 -10
  21. package/dist/BuildStepContext.js.map +1 -0
  22. package/{dist_esm → dist}/BuildStepInput.d.ts +1 -1
  23. package/{dist_commonjs/BuildStepInput.cjs → dist/BuildStepInput.js} +12 -12
  24. package/dist/BuildStepInput.js.map +1 -0
  25. package/{dist_commonjs → dist}/BuildStepOutput.d.ts +1 -1
  26. package/{dist_commonjs/BuildStepOutput.cjs → dist/BuildStepOutput.js} +3 -3
  27. package/dist/BuildStepOutput.js.map +1 -0
  28. package/{dist_commonjs → dist}/BuildTemporaryFiles.d.ts +1 -1
  29. package/{dist_commonjs → dist}/BuildTemporaryFiles.js.map +1 -1
  30. package/{dist_commonjs → dist}/BuildWorkflow.d.ts +4 -3
  31. package/{dist_commonjs/BuildWorkflow.cjs → dist/BuildWorkflow.js} +17 -0
  32. package/dist/BuildWorkflow.js.map +1 -0
  33. package/{dist_commonjs → dist}/BuildWorkflowValidator.d.ts +1 -1
  34. package/{dist_commonjs/BuildWorkflowValidator.cjs → dist/BuildWorkflowValidator.js} +19 -19
  35. package/dist/BuildWorkflowValidator.js.map +1 -0
  36. package/dist/StepMetrics.d.ts +10 -0
  37. package/dist/StepMetrics.js +3 -0
  38. package/dist/StepMetrics.js.map +1 -0
  39. package/{dist_commonjs → dist}/StepsConfigParser.d.ts +5 -5
  40. package/{dist_commonjs/StepsConfigParser.cjs → dist/StepsConfigParser.js} +14 -13
  41. package/dist/StepsConfigParser.js.map +1 -0
  42. package/{dist_esm → dist}/cli/cli.d.ts +3 -3
  43. package/{dist_commonjs/cli/cli.cjs → dist/cli/cli.js} +6 -6
  44. package/dist/cli/cli.js.map +1 -0
  45. package/dist/index.d.ts +19 -0
  46. package/{dist_commonjs/index.cjs → dist/index.js} +30 -30
  47. package/dist/index.js.map +1 -0
  48. package/{dist_commonjs/interpolation.cjs → dist/interpolation.js} +3 -3
  49. package/dist/interpolation.js.map +1 -0
  50. package/{dist_commonjs/scripts/runCustomFunction.cjs → dist/scripts/runCustomFunction.js} +9 -9
  51. package/dist/scripts/runCustomFunction.js.map +1 -0
  52. package/{dist_commonjs → dist}/utils/customFunction.d.ts +4 -4
  53. package/{dist_commonjs/utils/customFunction.cjs → dist/utils/customFunction.js} +4 -6
  54. package/dist/utils/customFunction.js.map +1 -0
  55. package/{dist_commonjs/utils/shell/bin.cjs → dist/utils/shell/bin.js} +1 -3
  56. package/dist/utils/shell/bin.js.map +1 -0
  57. package/{dist_commonjs/utils/template.cjs → dist/utils/template.js} +7 -7
  58. package/dist/utils/template.js.map +1 -0
  59. package/package.json +12 -24
  60. package/dist_commonjs/AbstractConfigParser.js.map +0 -1
  61. package/dist_commonjs/BuildConfig.js.map +0 -1
  62. package/dist_commonjs/BuildConfigParser.d.ts +0 -33
  63. package/dist_commonjs/BuildConfigParser.js.map +0 -1
  64. package/dist_commonjs/BuildFunction.d.ts +0 -43
  65. package/dist_commonjs/BuildFunction.js.map +0 -1
  66. package/dist_commonjs/BuildFunctionGroup.js.map +0 -1
  67. package/dist_commonjs/BuildStep.d.ts +0 -98
  68. package/dist_commonjs/BuildStep.js.map +0 -1
  69. package/dist_commonjs/BuildStepContext.js.map +0 -1
  70. package/dist_commonjs/BuildStepInput.d.ts +0 -47
  71. package/dist_commonjs/BuildStepInput.js.map +0 -1
  72. package/dist_commonjs/BuildStepOutput.js.map +0 -1
  73. package/dist_commonjs/BuildWorkflow.js.map +0 -1
  74. package/dist_commonjs/BuildWorkflowValidator.js.map +0 -1
  75. package/dist_commonjs/StepsConfigParser.js.map +0 -1
  76. package/dist_commonjs/cli/cli.d.ts +0 -18
  77. package/dist_commonjs/cli/cli.js.map +0 -1
  78. package/dist_commonjs/index.d.ts +0 -18
  79. package/dist_commonjs/index.js.map +0 -1
  80. package/dist_commonjs/interpolation.js.map +0 -1
  81. package/dist_commonjs/scripts/runCustomFunction.js.map +0 -1
  82. package/dist_commonjs/utils/customFunction.js.map +0 -1
  83. package/dist_commonjs/utils/shell/bin.js.map +0 -1
  84. package/dist_commonjs/utils/template.js.map +0 -1
  85. package/dist_esm/AbstractConfigParser.d.ts +0 -23
  86. package/dist_esm/AbstractConfigParser.js +0 -61
  87. package/dist_esm/AbstractConfigParser.js.map +0 -1
  88. package/dist_esm/BuildConfig.d.ts +0 -79
  89. package/dist_esm/BuildConfig.js +0 -279
  90. package/dist_esm/BuildConfig.js.map +0 -1
  91. package/dist_esm/BuildConfigParser.js +0 -232
  92. package/dist_esm/BuildConfigParser.js.map +0 -1
  93. package/dist_esm/BuildFunction.js +0 -60
  94. package/dist_esm/BuildFunction.js.map +0 -1
  95. package/dist_esm/BuildFunctionGroup.d.ts +0 -23
  96. package/dist_esm/BuildFunctionGroup.js +0 -36
  97. package/dist_esm/BuildFunctionGroup.js.map +0 -1
  98. package/dist_esm/BuildRuntimePlatform.d.ts +0 -4
  99. package/dist_esm/BuildRuntimePlatform.js +0 -6
  100. package/dist_esm/BuildRuntimePlatform.js.map +0 -1
  101. package/dist_esm/BuildStep.js +0 -353
  102. package/dist_esm/BuildStep.js.map +0 -1
  103. package/dist_esm/BuildStepContext.d.ts +0 -82
  104. package/dist_esm/BuildStepContext.js +0 -200
  105. package/dist_esm/BuildStepContext.js.map +0 -1
  106. package/dist_esm/BuildStepEnv.d.ts +0 -1
  107. package/dist_esm/BuildStepEnv.js +0 -2
  108. package/dist_esm/BuildStepEnv.js.map +0 -1
  109. package/dist_esm/BuildStepInput.js +0 -150
  110. package/dist_esm/BuildStepInput.js.map +0 -1
  111. package/dist_esm/BuildStepOutput.d.ts +0 -33
  112. package/dist_esm/BuildStepOutput.js +0 -57
  113. package/dist_esm/BuildStepOutput.js.map +0 -1
  114. package/dist_esm/BuildTemporaryFiles.d.ts +0 -5
  115. package/dist_esm/BuildTemporaryFiles.js +0 -31
  116. package/dist_esm/BuildTemporaryFiles.js.map +0 -1
  117. package/dist_esm/BuildWorkflow.d.ts +0 -13
  118. package/dist_esm/BuildWorkflow.js +0 -38
  119. package/dist_esm/BuildWorkflow.js.map +0 -1
  120. package/dist_esm/BuildWorkflowValidator.d.ts +0 -10
  121. package/dist_esm/BuildWorkflowValidator.js +0 -121
  122. package/dist_esm/BuildWorkflowValidator.js.map +0 -1
  123. package/dist_esm/StepsConfigParser.d.ts +0 -24
  124. package/dist_esm/StepsConfigParser.js +0 -132
  125. package/dist_esm/StepsConfigParser.js.map +0 -1
  126. package/dist_esm/cli/cli.js +0 -61
  127. package/dist_esm/cli/cli.js.map +0 -1
  128. package/dist_esm/errors.d.ts +0 -24
  129. package/dist_esm/errors.js +0 -24
  130. package/dist_esm/errors.js.map +0 -1
  131. package/dist_esm/index.d.ts +0 -18
  132. package/dist_esm/index.js +0 -18
  133. package/dist_esm/index.js.map +0 -1
  134. package/dist_esm/interpolation.d.ts +0 -5
  135. package/dist_esm/interpolation.js +0 -26
  136. package/dist_esm/interpolation.js.map +0 -1
  137. package/dist_esm/scripts/runCustomFunction.d.ts +0 -1
  138. package/dist_esm/scripts/runCustomFunction.js +0 -100
  139. package/dist_esm/scripts/runCustomFunction.js.map +0 -1
  140. package/dist_esm/utils/customFunction.d.ts +0 -18
  141. package/dist_esm/utils/customFunction.js +0 -49
  142. package/dist_esm/utils/customFunction.js.map +0 -1
  143. package/dist_esm/utils/expodash/duplicates.d.ts +0 -1
  144. package/dist_esm/utils/expodash/duplicates.js +0 -14
  145. package/dist_esm/utils/expodash/duplicates.js.map +0 -1
  146. package/dist_esm/utils/expodash/uniq.d.ts +0 -1
  147. package/dist_esm/utils/expodash/uniq.js +0 -5
  148. package/dist_esm/utils/expodash/uniq.js.map +0 -1
  149. package/dist_esm/utils/hashFiles.d.ts +0 -6
  150. package/dist_esm/utils/hashFiles.js +0 -31
  151. package/dist_esm/utils/hashFiles.js.map +0 -1
  152. package/dist_esm/utils/jsepEval.d.ts +0 -1
  153. package/dist_esm/utils/jsepEval.js +0 -169
  154. package/dist_esm/utils/jsepEval.js.map +0 -1
  155. package/dist_esm/utils/nullthrows.d.ts +0 -1
  156. package/dist_esm/utils/nullthrows.js +0 -7
  157. package/dist_esm/utils/nullthrows.js.map +0 -1
  158. package/dist_esm/utils/shell/bin.d.ts +0 -1
  159. package/dist_esm/utils/shell/bin.js +0 -5
  160. package/dist_esm/utils/shell/bin.js.map +0 -1
  161. package/dist_esm/utils/shell/command.d.ts +0 -4
  162. package/dist_esm/utils/shell/command.js +0 -13
  163. package/dist_esm/utils/shell/command.js.map +0 -1
  164. package/dist_esm/utils/shell/spawn.d.ts +0 -15
  165. package/dist_esm/utils/shell/spawn.js +0 -16
  166. package/dist_esm/utils/shell/spawn.js.map +0 -1
  167. package/dist_esm/utils/template.d.ts +0 -19
  168. package/dist_esm/utils/template.js +0 -106
  169. package/dist_esm/utils/template.js.map +0 -1
  170. /package/{dist_commonjs → dist}/BuildRuntimePlatform.d.ts +0 -0
  171. /package/{dist_commonjs/BuildRuntimePlatform.cjs → dist/BuildRuntimePlatform.js} +0 -0
  172. /package/{dist_commonjs → dist}/BuildRuntimePlatform.js.map +0 -0
  173. /package/{dist_commonjs → dist}/BuildStepEnv.d.ts +0 -0
  174. /package/{dist_commonjs/BuildStepEnv.cjs → dist/BuildStepEnv.js} +0 -0
  175. /package/{dist_commonjs → dist}/BuildStepEnv.js.map +0 -0
  176. /package/{dist_commonjs/BuildTemporaryFiles.cjs → dist/BuildTemporaryFiles.js} +0 -0
  177. /package/{dist_commonjs → dist}/errors.d.ts +0 -0
  178. /package/{dist_commonjs/errors.cjs → dist/errors.js} +0 -0
  179. /package/{dist_commonjs → dist}/errors.js.map +0 -0
  180. /package/{dist_commonjs → dist}/interpolation.d.ts +0 -0
  181. /package/{dist_commonjs → dist}/scripts/runCustomFunction.d.ts +0 -0
  182. /package/{dist_commonjs → dist}/utils/expodash/duplicates.d.ts +0 -0
  183. /package/{dist_commonjs/utils/expodash/duplicates.cjs → dist/utils/expodash/duplicates.js} +0 -0
  184. /package/{dist_commonjs → dist}/utils/expodash/duplicates.js.map +0 -0
  185. /package/{dist_commonjs → dist}/utils/expodash/uniq.d.ts +0 -0
  186. /package/{dist_commonjs/utils/expodash/uniq.cjs → dist/utils/expodash/uniq.js} +0 -0
  187. /package/{dist_commonjs → dist}/utils/expodash/uniq.js.map +0 -0
  188. /package/{dist_commonjs → dist}/utils/hashFiles.d.ts +0 -0
  189. /package/{dist_commonjs/utils/hashFiles.cjs → dist/utils/hashFiles.js} +0 -0
  190. /package/{dist_commonjs → dist}/utils/hashFiles.js.map +0 -0
  191. /package/{dist_commonjs → dist}/utils/jsepEval.d.ts +0 -0
  192. /package/{dist_commonjs/utils/jsepEval.cjs → dist/utils/jsepEval.js} +0 -0
  193. /package/{dist_commonjs → dist}/utils/jsepEval.js.map +0 -0
  194. /package/{dist_commonjs → dist}/utils/nullthrows.d.ts +0 -0
  195. /package/{dist_commonjs/utils/nullthrows.cjs → dist/utils/nullthrows.js} +0 -0
  196. /package/{dist_commonjs → dist}/utils/nullthrows.js.map +0 -0
  197. /package/{dist_commonjs → dist}/utils/shell/bin.d.ts +0 -0
  198. /package/{dist_commonjs → dist}/utils/shell/command.d.ts +0 -0
  199. /package/{dist_commonjs/utils/shell/command.cjs → dist/utils/shell/command.js} +0 -0
  200. /package/{dist_commonjs → dist}/utils/shell/command.js.map +0 -0
  201. /package/{dist_commonjs → dist}/utils/shell/spawn.d.ts +0 -0
  202. /package/{dist_commonjs/utils/shell/spawn.cjs → dist/utils/shell/spawn.js} +0 -0
  203. /package/{dist_commonjs → dist}/utils/shell/spawn.js.map +0 -0
  204. /package/{dist_commonjs → dist}/utils/template.d.ts +0 -0
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BuildStepInput = exports.BuildStepInputValueTypeName = void 0;
7
7
  exports.makeBuildStepInputByIdMap = makeBuildStepInputByIdMap;
8
8
  const assert_1 = __importDefault(require("assert"));
9
- const errors_js_1 = require("./errors.cjs");
10
- const template_js_1 = require("./utils/template.cjs");
11
- const interpolation_js_1 = require("./interpolation.cjs");
9
+ const errors_1 = require("./errors");
10
+ const template_1 = require("./utils/template");
11
+ const interpolation_1 = require("./interpolation");
12
12
  var BuildStepInputValueTypeName;
13
13
  (function (BuildStepInputValueTypeName) {
14
14
  BuildStepInputValueTypeName["STRING"] = "string";
@@ -33,9 +33,9 @@ class BuildStepInput {
33
33
  var _a;
34
34
  const rawValue = (_a = this._value) !== null && _a !== void 0 ? _a : this.defaultValue;
35
35
  if (this.required && rawValue === undefined) {
36
- throw new errors_js_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" is required but it was not set.`);
36
+ throw new errors_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" is required but it was not set.`);
37
37
  }
38
- const interpolatedValue = (0, interpolation_js_1.interpolateJobContext)({
38
+ const interpolatedValue = (0, interpolation_1.interpolateJobContext)({
39
39
  target: rawValue,
40
40
  context: interpolationContext,
41
41
  });
@@ -47,7 +47,7 @@ class BuildStepInput {
47
47
  if (valueDoesNotRequireInterpolation) {
48
48
  if (typeof interpolatedValue !== this.allowedValueTypeName &&
49
49
  interpolatedValue !== undefined) {
50
- throw new errors_js_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`);
50
+ throw new errors_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`);
51
51
  }
52
52
  returnValue = interpolatedValue;
53
53
  }
@@ -56,7 +56,7 @@ class BuildStepInput {
56
56
  // so this will never be true.
57
57
  (0, assert_1.default)(interpolatedValue !== undefined);
58
58
  const valueInterpolatedWithGlobalContext = this.ctx.interpolate(interpolatedValue);
59
- const valueInterpolatedWithOutputsAndGlobalContext = (0, template_js_1.interpolateWithOutputs)(valueInterpolatedWithGlobalContext, (path) => { var _a; return (_a = this.ctx.getStepOutputValue(path)) !== null && _a !== void 0 ? _a : ''; });
59
+ const valueInterpolatedWithOutputsAndGlobalContext = (0, template_1.interpolateWithOutputs)(valueInterpolatedWithGlobalContext, (path) => { var _a; return (_a = this.ctx.getStepOutputValue(path)) !== null && _a !== void 0 ? _a : ''; });
60
60
  returnValue = this.parseInputValueToAllowedType(valueInterpolatedWithOutputsAndGlobalContext);
61
61
  }
62
62
  return returnValue;
@@ -67,7 +67,7 @@ class BuildStepInput {
67
67
  }
68
68
  set(value) {
69
69
  if (this.required && value === undefined) {
70
- throw new errors_js_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" is required.`);
70
+ throw new errors_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" is required.`);
71
71
  }
72
72
  this._value = value;
73
73
  return this;
@@ -82,7 +82,7 @@ class BuildStepInput {
82
82
  }
83
83
  isRawValueStepOrContextReference() {
84
84
  return (typeof this.rawValue === 'string' &&
85
- (!!template_js_1.BUILD_STEP_OR_BUILD_GLOBAL_CONTEXT_REFERENCE_REGEX.exec(this.rawValue) ||
85
+ (!!template_1.BUILD_STEP_OR_BUILD_GLOBAL_CONTEXT_REFERENCE_REGEX.exec(this.rawValue) ||
86
86
  // If value is an interpolation reference we're going to render whatever it evaluates to.
87
87
  // See `interpolateJobContext`.
88
88
  (this.rawValue.startsWith('${{') && this.rawValue.endsWith('}}'))));
@@ -119,7 +119,7 @@ class BuildStepInput {
119
119
  parseInputValueToNumber(value) {
120
120
  const numberValue = Number(value);
121
121
  if (Number.isNaN(numberValue)) {
122
- throw new errors_js_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`);
122
+ throw new errors_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`);
123
123
  }
124
124
  return numberValue;
125
125
  }
@@ -131,7 +131,7 @@ class BuildStepInput {
131
131
  return false;
132
132
  }
133
133
  else {
134
- throw new errors_js_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`);
134
+ throw new errors_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`);
135
135
  }
136
136
  }
137
137
  parseInputValueToObject(value) {
@@ -139,7 +139,7 @@ class BuildStepInput {
139
139
  return JSON.parse(value);
140
140
  }
141
141
  catch (e) {
142
- throw new errors_js_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`, {
142
+ throw new errors_1.BuildStepRuntimeError(`Input parameter "${this.id}" for step "${this.stepDisplayName}" must be of type "${this.allowedValueTypeName}".`, {
143
143
  cause: e,
144
144
  });
145
145
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildStepInput.js","sourceRoot":"","sources":["../src/BuildStepInput.ts"],"names":[],"mappings":";;;;;;AAwOA,8DAQC;AAhPD,oDAA4B;AAK5B,qCAAiD;AACjD,+CAG0B;AAC1B,mDAAwD;AAExD,IAAY,2BAKX;AALD,WAAY,2BAA2B;IACrC,gDAAiB,CAAA;IACjB,kDAAmB,CAAA;IACnB,gDAAiB,CAAA;IACjB,4CAAa,CAAA;AACf,CAAC,EALW,2BAA2B,2CAA3B,2BAA2B,QAKtC;AAkCD,MAAa,cAAc;IAalB,MAAM,CAAC,cAAc,CAAC,MAAoC;QAC/D,OAAO,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,YACmB,GAA2B,EAC5C,EACE,EAAE,EACF,eAAe,EACf,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,oBAAoB,GACO;QARZ,QAAG,GAAH,GAAG,CAAwB;QAU5C,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAEM,QAAQ,CAAC,EACd,oBAAoB,GAGrB;;QACC,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,CAAC,YAAY,CAAC;QAClD,IAAI,IAAI,CAA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IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,8BAAqB,CAC7B,oBAAoB,IAAI,CAAC,EAAE,eAAe,IAAI,CAAC,eAAe,sBAAsB,IAAI,CAAC,oBAAoB,IAAI,CAClH,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,uBAAuB,CAAC,KAAgC;QAC9D,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAqB,CAC7B,oBAAoB,IAAI,CAAC,EAAE,eAAe,IAAI,CAAC,eAAe,sBAAsB,IAAI,CAAC,oBAAoB,IAAI,EACjH;gBACE,KAAK,EAAE,CAAC;aACT,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAnLD,wCAmLC;AAED,SAAgB,yBAAyB,CAAC,MAAyB;IACjE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAClC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;QACtB,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAwB,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import assert from 'assert';\n\nimport { JobInterpolationContext } from '@expo/eas-build-job';\n\nimport { BuildStepGlobalContext } from './BuildStepContext';\nimport { BuildStepRuntimeError } from './errors';\nimport {\n BUILD_STEP_OR_BUILD_GLOBAL_CONTEXT_REFERENCE_REGEX,\n interpolateWithOutputs,\n} from './utils/template';\nimport { interpolateJobContext } from './interpolation';\n\nexport enum BuildStepInputValueTypeName {\n STRING = 'string',\n BOOLEAN = 'boolean',\n NUMBER = 'number',\n JSON = 'json',\n}\n\nexport type BuildStepInputValueType<\n T extends BuildStepInputValueTypeName = BuildStepInputValueTypeName,\n> = T extends BuildStepInputValueTypeName.STRING\n ? string\n : T extends BuildStepInputValueTypeName.BOOLEAN\n ? boolean\n : T extends BuildStepInputValueTypeName.NUMBER\n ? number\n : Record<string, unknown>;\n\nexport type BuildStepInputById = Record<string, BuildStepInput>;\nexport type BuildStepInputProvider = (\n ctx: BuildStepGlobalContext,\n stepId: string\n) => BuildStepInput;\n\ninterface BuildStepInputProviderParams<\n T extends BuildStepInputValueTypeName = BuildStepInputValueTypeName,\n R extends boolean = boolean,\n> {\n id: string;\n allowedValues?: unknown[];\n defaultValue?: unknown;\n required: R;\n allowedValueTypeName: T;\n}\n\ninterface BuildStepInputParams<T extends BuildStepInputValueTypeName, R extends boolean>\n extends BuildStepInputProviderParams<T, R> {\n stepDisplayName: string;\n}\n\nexport class BuildStepInput<\n T extends BuildStepInputValueTypeName = BuildStepInputValueTypeName,\n R extends boolean = boolean,\n> {\n public readonly id: string;\n public readonly stepDisplayName: string;\n public readonly defaultValue?: unknown;\n public readonly allowedValues?: unknown[];\n public readonly allowedValueTypeName: T;\n public readonly required: R;\n\n private _value?: unknown;\n\n public static createProvider(params: BuildStepInputProviderParams): BuildStepInputProvider {\n return (ctx, stepDisplayName) => new BuildStepInput(ctx, { ...params, stepDisplayName });\n }\n\n constructor(\n private readonly ctx: BuildStepGlobalContext,\n {\n id,\n stepDisplayName,\n allowedValues,\n defaultValue,\n required,\n allowedValueTypeName,\n }: BuildStepInputParams<T, R>\n ) {\n this.id = id;\n this.stepDisplayName = stepDisplayName;\n this.allowedValues = allowedValues;\n this.defaultValue = defaultValue;\n this.required = required;\n this.allowedValueTypeName = allowedValueTypeName;\n }\n\n public getValue({\n interpolationContext,\n }: {\n interpolationContext: JobInterpolationContext;\n }): R extends true ? BuildStepInputValueType<T> : BuildStepInputValueType<T> | undefined {\n const rawValue = this._value ?? this.defaultValue;\n if (this.required && rawValue === undefined) {\n throw new BuildStepRuntimeError(\n `Input parameter \"${this.id}\" for step \"${this.stepDisplayName}\" is required but it was not set.`\n );\n }\n\n const interpolatedValue = interpolateJobContext({\n target: rawValue,\n context: interpolationContext,\n });\n\n const valueDoesNotRequireInterpolation =\n interpolatedValue === undefined ||\n interpolatedValue === null ||\n typeof interpolatedValue === 'boolean' ||\n typeof interpolatedValue === 'number';\n let returnValue;\n if (valueDoesNotRequireInterpolation) {\n if (\n typeof interpolatedValue !== this.allowedValueTypeName &&\n interpolatedValue !== undefined\n ) {\n throw new BuildStepRuntimeError(\n `Input parameter \"${this.id}\" for step \"${this.stepDisplayName}\" must be of type \"${this.allowedValueTypeName}\".`\n );\n }\n returnValue = interpolatedValue as BuildStepInputValueType<T>;\n } else {\n // `valueDoesNotRequireInterpolation` checks that `rawValue` is not undefined\n // so this will never be true.\n assert(interpolatedValue !== undefined);\n const valueInterpolatedWithGlobalContext = this.ctx.interpolate(interpolatedValue);\n const valueInterpolatedWithOutputsAndGlobalContext = interpolateWithOutputs(\n valueInterpolatedWithGlobalContext,\n (path) => this.ctx.getStepOutputValue(path) ?? ''\n );\n returnValue = this.parseInputValueToAllowedType(valueInterpolatedWithOutputsAndGlobalContext);\n }\n return returnValue;\n }\n\n public get rawValue(): unknown {\n return this._value ?? this.defaultValue;\n }\n\n public set(value: unknown): BuildStepInput {\n if (this.required && value === undefined) {\n throw new BuildStepRuntimeError(\n `Input parameter \"${this.id}\" for step \"${this.stepDisplayName}\" is required.`\n );\n }\n\n this._value = value;\n return this;\n }\n\n public isRawValueOneOfAllowedValues(): boolean {\n const value = this._value ?? this.defaultValue;\n if (this.allowedValues === undefined || value === undefined) {\n return true;\n }\n return this.allowedValues.includes(value);\n }\n\n public isRawValueStepOrContextReference(): boolean {\n return (\n typeof this.rawValue === 'string' &&\n (!!BUILD_STEP_OR_BUILD_GLOBAL_CONTEXT_REFERENCE_REGEX.exec(this.rawValue) ||\n // If value is an interpolation reference we're going to render whatever it evaluates to.\n // See `interpolateJobContext`.\n (this.rawValue.startsWith('${{') && this.rawValue.endsWith('}}')))\n );\n }\n\n private parseInputValueToAllowedType(\n value: string | object | boolean | number\n ): BuildStepInputValueType<T> {\n if (typeof value === 'object') {\n return value as BuildStepInputValueType<T>;\n }\n if (this.allowedValueTypeName === BuildStepInputValueTypeName.STRING) {\n return this.parseInputValueToString(value) as BuildStepInputValueType<T>;\n } else if (this.allowedValueTypeName === BuildStepInputValueTypeName.NUMBER) {\n return this.parseInputValueToNumber(value) as BuildStepInputValueType<T>;\n } else if (this.allowedValueTypeName === BuildStepInputValueTypeName.BOOLEAN) {\n return this.parseInputValueToBoolean(value) as BuildStepInputValueType<T>;\n } else {\n return this.parseInputValueToObject(value) as BuildStepInputValueType<T>;\n }\n }\n\n private parseInputValueToString(value: string | boolean | number): string {\n let parsedValue = value;\n try {\n parsedValue = JSON.parse(`\"${value}\"`);\n } catch (err) {\n if (!(err instanceof SyntaxError)) {\n throw err;\n }\n }\n return parsedValue as string;\n }\n\n private parseInputValueToNumber(value: string | boolean | number): number {\n const numberValue = Number(value);\n if (Number.isNaN(numberValue)) {\n throw new BuildStepRuntimeError(\n `Input parameter \"${this.id}\" for step \"${this.stepDisplayName}\" must be of type \"${this.allowedValueTypeName}\".`\n );\n }\n return numberValue;\n }\n\n private parseInputValueToBoolean(value: string | boolean | number): boolean {\n if (value === 'true' || value === true) {\n return true;\n } else if (value === 'false' || value === false) {\n return false;\n } else {\n throw new BuildStepRuntimeError(\n `Input parameter \"${this.id}\" for step \"${this.stepDisplayName}\" must be of type \"${this.allowedValueTypeName}\".`\n );\n }\n }\n\n private parseInputValueToObject(value: string | boolean | number): Record<string, any> {\n try {\n return JSON.parse(value as string);\n } catch (e: any) {\n throw new BuildStepRuntimeError(\n `Input parameter \"${this.id}\" for step \"${this.stepDisplayName}\" must be of type \"${this.allowedValueTypeName}\".`,\n {\n cause: e,\n }\n );\n }\n }\n}\n\nexport function makeBuildStepInputByIdMap(inputs?: BuildStepInput[]): BuildStepInputById {\n if (inputs === undefined) {\n return {};\n }\n return inputs.reduce((acc, input) => {\n acc[input.id] = input;\n return acc;\n }, {} as BuildStepInputById);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BuildStepGlobalContext } from './BuildStepContext.js';
1
+ import { BuildStepGlobalContext } from './BuildStepContext';
2
2
  export type BuildStepOutputById = Record<string, BuildStepOutput>;
3
3
  export type BuildStepOutputProvider = (ctx: BuildStepGlobalContext, stepDisplayName: string) => BuildStepOutput;
4
4
  interface BuildStepOutputProviderParams<R extends boolean = boolean> {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BuildStepOutput = void 0;
4
4
  exports.makeBuildStepOutputByIdMap = makeBuildStepOutputByIdMap;
5
- const errors_js_1 = require("./errors.cjs");
5
+ const errors_1 = require("./errors");
6
6
  class BuildStepOutput {
7
7
  static createProvider(params) {
8
8
  return (ctx, stepDisplayName) => new BuildStepOutput(ctx, { ...params, stepDisplayName });
@@ -20,13 +20,13 @@ class BuildStepOutput {
20
20
  }
21
21
  get value() {
22
22
  if (this.required && this._value === undefined) {
23
- throw new errors_js_1.BuildStepRuntimeError(`Output parameter "${this.id}" for step "${this.stepDisplayName}" is required but it was not set.`);
23
+ throw new errors_1.BuildStepRuntimeError(`Output parameter "${this.id}" for step "${this.stepDisplayName}" is required but it was not set.`);
24
24
  }
25
25
  return this._value;
26
26
  }
27
27
  set(value) {
28
28
  if (this.required && value === undefined) {
29
- throw new errors_js_1.BuildStepRuntimeError(`Output parameter "${this.id}" for step "${this.stepDisplayName}" is required.`);
29
+ throw new errors_1.BuildStepRuntimeError(`Output parameter "${this.id}" for step "${this.stepDisplayName}" is required.`);
30
30
  }
31
31
  this._value = value;
32
32
  return this;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildStepOutput.js","sourceRoot":"","sources":["../src/BuildStepOutput.ts"],"names":[],"mappings":";;;AA8FA,gEAQC;AArGD,qCAAiD;AA6BjD,MA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ACnB,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAqC;QAC7D,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,SAAS,EAAE;YAClD,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,eAAe,EAAE,UAAU,CAAC,eAAe;YAC3C,QAAQ,EAAE,UAAU,CAAC,QAAQ;SAC9B,CAAC,CAAC;QACH,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AA9DD,0CA8DC;AAED,SAAgB,0BAA0B,CAAC,OAA2B;IACpE,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACpC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QACxB,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAyB,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import { BuildStepGlobalContext } from './BuildStepContext';\nimport { BuildStepRuntimeError } from './errors';\n\nexport type BuildStepOutputById = Record<string, BuildStepOutput>;\nexport type BuildStepOutputProvider = (\n ctx: BuildStepGlobalContext,\n stepDisplayName: string\n) => BuildStepOutput;\n\ninterface BuildStepOutputProviderParams<R extends boolean = boolean> {\n id: string;\n required: R;\n}\n\ninterface BuildStepOutputParams<R extends boolean = boolean>\n extends BuildStepOutputProviderParams<R> {\n stepDisplayName: string;\n}\n\ntype BuildStepOutputValueType<R extends boolean = boolean> = R extends true\n ? string\n : string | undefined;\n\nexport interface SerializedBuildStepOutput<R extends boolean = boolean> {\n id: string;\n stepDisplayName: string;\n required: R;\n value?: string;\n}\n\nexport class BuildStepOutput<R extends boolean = boolean> {\n public readonly id: string;\n public readonly stepDisplayName: string;\n public readonly required: R;\n\n private _value?: string;\n\n public static createProvider(params: BuildStepOutputProviderParams): BuildStepOutputProvider {\n return (ctx, stepDisplayName) => new BuildStepOutput(ctx, { ...params, stepDisplayName });\n }\n\n constructor(\n // @ts-expect-error ctx is not used in this class but let's keep it here for consistency\n private readonly ctx: BuildStepGlobalContext | undefined,\n { id, stepDisplayName, required }: BuildStepOutputParams<R>\n ) {\n this.id = id;\n this.stepDisplayName = stepDisplayName;\n this.required = required;\n }\n\n public get rawValue(): string | undefined {\n return this._value;\n }\n\n public get value(): BuildStepOutputValueType<R> {\n if (this.required && this._value === undefined) {\n throw new BuildStepRuntimeError(\n `Output parameter \"${this.id}\" for step \"${this.stepDisplayName}\" is required but it was not set.`\n );\n }\n return this._value as BuildStepOutputValueType<R>;\n }\n\n public set(value: BuildStepOutputValueType<R>): BuildStepOutput {\n if (this.required && value === undefined) {\n throw new BuildStepRuntimeError(\n `Output parameter \"${this.id}\" for step \"${this.stepDisplayName}\" is required.`\n );\n }\n this._value = value;\n return this;\n }\n\n public serialize(): SerializedBuildStepOutput {\n return {\n id: this.id,\n stepDisplayName: this.stepDisplayName,\n required: this.required,\n value: this._value,\n };\n }\n\n public static deserialize(serialized: SerializedBuildStepOutput): BuildStepOutput {\n const deserialized = new BuildStepOutput(undefined, {\n id: serialized.id,\n stepDisplayName: serialized.stepDisplayName,\n required: serialized.required,\n });\n deserialized._value = serialized.value;\n return deserialized;\n }\n}\n\nexport function makeBuildStepOutputByIdMap(outputs?: BuildStepOutput[]): BuildStepOutputById {\n if (outputs === undefined) {\n return {};\n }\n return outputs.reduce((acc, output) => {\n acc[output.id] = output;\n return acc;\n }, {} as BuildStepOutputById);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BuildStepGlobalContext } from './BuildStepContext.js';
1
+ import { BuildStepGlobalContext } from './BuildStepContext';
2
2
  export declare function saveScriptToTemporaryFileAsync(ctx: BuildStepGlobalContext, stepId: string, scriptContents: string): Promise<string>;
3
3
  export declare function cleanUpStepTemporaryDirectoriesAsync(ctx: BuildStepGlobalContext, stepId: string): Promise<void>;
4
4
  export declare function getTemporaryOutputsDirPath(ctx: BuildStepGlobalContext, stepId: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"BuildTemporaryFiles.js","sourceRoot":"","sources":["../src/BuildTemporaryFiles.ts"],"names":[],"mappings":";;;;;AAOA,wEAUC;AAED,oFAUC;AAUD,gEAEC;AAED,0DAEC;AA7CD,gDAAwB;AACxB,2DAA6B;AAE7B,+BAAoC;AAI7B,KAAK,UAAU,8BAA8B,CAClD,GAA2B,EAC3B,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,CAAC,UAAU,EAAE,GAAG,IAAA,SAAM,GAAE,KAAK,CAAC,CAAC;IACpE,MAAM,kBAAE,CAAC,SAAS,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;IACxD,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAEM,KAAK,UAAU,oCAAoC,CACxD,GAA2B,EAC3B,MAAc;IAEd,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IACD,MAAM,sBAAsB,GAAG,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACpE,MAAM,kBAAE,CAAC,EAAE,CAAC,sBAAsB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACtE,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,sBAAsB,EAAE,EAAE,kCAAkC,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,uBAAuB,CAAC,GAA2B,EAAE,MAAc;IAC1E,OAAO,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,0BAA0B,CAAC,GAA2B,EAAE,MAAc;IAC7E,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,0BAA0B,CAAC,GAA2B,EAAE,MAAc;IACpF,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,uBAAuB,CAAC,GAA2B,EAAE,MAAc;IACjF,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import path from 'path';\nimport fs from 'fs/promises';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BuildStepGlobalContext } from './BuildStepContext.js';\n\nexport async function saveScriptToTemporaryFileAsync(\n ctx: BuildStepGlobalContext,\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 cleanUpStepTemporaryDirectoriesAsync(\n ctx: BuildStepGlobalContext,\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.baseLogger.debug({ stepTemporaryDirectory }, 'Removed step temporary directory');\n}\n\nfunction getTemporaryStepDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(ctx.stepsInternalBuildDirectory, 'steps', stepId);\n}\n\nfunction getTemporaryScriptsDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'scripts');\n}\n\nexport function getTemporaryOutputsDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'outputs');\n}\n\nexport function getTemporaryEnvsDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'envs');\n}\n"]}
1
+ {"version":3,"file":"BuildTemporaryFiles.js","sourceRoot":"","sources":["../src/BuildTemporaryFiles.ts"],"names":[],"mappings":";;;;;AAOA,wEAUC;AAED,oFAUC;AAUD,gEAEC;AAED,0DAEC;AA7CD,gDAAwB;AACxB,2DAA6B;AAE7B,+BAAoC;AAI7B,KAAK,UAAU,8BAA8B,CAClD,GAA2B,EAC3B,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,CAAC,UAAU,EAAE,GAAG,IAAA,SAAM,GAAE,KAAK,CAAC,CAAC;IACpE,MAAM,kBAAE,CAAC,SAAS,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;IACxD,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAEM,KAAK,UAAU,oCAAoC,CACxD,GAA2B,EAC3B,MAAc;IAEd,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IACD,MAAM,sBAAsB,GAAG,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACpE,MAAM,kBAAE,CAAC,EAAE,CAAC,sBAAsB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACtE,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,sBAAsB,EAAE,EAAE,kCAAkC,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,uBAAuB,CAAC,GAA2B,EAAE,MAAc;IAC1E,OAAO,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,0BAA0B,CAAC,GAA2B,EAAE,MAAc;IAC7E,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,0BAA0B,CAAC,GAA2B,EAAE,MAAc;IACpF,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,uBAAuB,CAAC,GAA2B,EAAE,MAAc;IACjF,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import path from 'path';\nimport fs from 'fs/promises';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BuildStepGlobalContext } from './BuildStepContext';\n\nexport async function saveScriptToTemporaryFileAsync(\n ctx: BuildStepGlobalContext,\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 cleanUpStepTemporaryDirectoriesAsync(\n ctx: BuildStepGlobalContext,\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.baseLogger.debug({ stepTemporaryDirectory }, 'Removed step temporary directory');\n}\n\nfunction getTemporaryStepDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(ctx.stepsInternalBuildDirectory, 'steps', stepId);\n}\n\nfunction getTemporaryScriptsDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'scripts');\n}\n\nexport function getTemporaryOutputsDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'outputs');\n}\n\nexport function getTemporaryEnvsDirPath(ctx: BuildStepGlobalContext, stepId: string): string {\n return path.join(getTemporaryStepDirPath(ctx, stepId), 'envs');\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { BuildFunctionById } from './BuildFunction.js';
2
- import { BuildStep } from './BuildStep.js';
3
- import { BuildStepGlobalContext } from './BuildStepContext.js';
1
+ import { BuildFunctionById } from './BuildFunction';
2
+ import { BuildStep } from './BuildStep';
3
+ import { BuildStepGlobalContext } from './BuildStepContext';
4
4
  export declare class BuildWorkflow {
5
5
  private readonly ctx;
6
6
  readonly buildSteps: BuildStep[];
@@ -10,4 +10,5 @@ export declare class BuildWorkflow {
10
10
  buildFunctions: BuildFunctionById;
11
11
  });
12
12
  executeAsync(): Promise<void>;
13
+ private collectStepMetrics;
13
14
  }
@@ -21,13 +21,20 @@ class BuildWorkflow {
21
21
  this.ctx.markAsFailed();
22
22
  }
23
23
  if (shouldExecuteStep) {
24
+ const startTime = performance.now();
25
+ let stepResult;
24
26
  try {
25
27
  await step.executeAsync();
28
+ stepResult = 'success';
26
29
  }
27
30
  catch (err) {
31
+ stepResult = 'failed';
28
32
  maybeError = maybeError !== null && maybeError !== void 0 ? maybeError : err;
29
33
  this.ctx.markAsFailed();
30
34
  }
35
+ finally {
36
+ this.collectStepMetrics(step, stepResult, performance.now() - startTime);
37
+ }
31
38
  }
32
39
  else {
33
40
  step.skip();
@@ -37,6 +44,16 @@ class BuildWorkflow {
37
44
  throw maybeError;
38
45
  }
39
46
  }
47
+ collectStepMetrics(step, result, durationMs) {
48
+ if (!step.__metricsId) {
49
+ return;
50
+ }
51
+ this.ctx.addStepMetric({
52
+ metricsId: step.__metricsId,
53
+ result,
54
+ durationMs,
55
+ });
56
+ }
40
57
  }
41
58
  exports.BuildWorkflow = BuildWorkflow;
42
59
  //# sourceMappingURL=BuildWorkflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildWorkflow.js","sourceRoot":"","sources":["../src/BuildWorkflow.ts"],"names":[],"mappings":";;;AAKA,MAAa,aAAa;IAIxB,YACmB,GAA2B,EAC5C,EAAE,UAAU,EAAE,cAAc,EAAkE;QAD7E,QAAG,GAAH,GAAG,CAAwB;QAG5C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,YAAY;QACvB,IAAI,UAAU,GAAiB,IAAI,CAAC;QACpC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACnC,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,IAAI,CAAC;gBACH,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC/C,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC/B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CACnB,wDAAwD,IAAI,CAAC,WAAW,iCAAiC,IAAI,CAAC,WAAW,4JAA4J,CACtR,CAAC;gBACF,UAAU,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,GAAG,CAAC;gBAC/B,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YAC1B,CAAC;YAED,IAAI,iBAAiB,EAAE,CAAC;gBACtB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;gBACpC,IAAI,UAA4B,CAAC;gBACjC,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;oBAC1B,UAAU,GAAG,SAAS,CAAC;gBACzB,CAAC;gBAAC,OAAO,GAAQ,EAAE,CAAC;oBAClB,UAAU,GAAG,QAAQ,CAAC;oBACtB,UAAU,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,GAAG,CAAC;oBAC/B,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;gBAC1B,CAAC;wBAAS,CAAC;oBACT,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAW,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC;gBAC5E,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,CAAC;QACH,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,UAAU,CAAC;QACnB,CAAC;IACH,CAAC;IAEO,kBAAkB,CAAC,IAAe,EAAE,MAAwB,EAAE,UAAkB;QACtF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC;YACrB,SAAS,EAAE,IAAI,CAAC,WAAW;YAC3B,MAAM;YACN,UAAU;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA9DD,sCA8DC","sourcesContent":["import { BuildFunctionById } from './BuildFunction';\nimport { BuildStep } from './BuildStep';\nimport { BuildStepGlobalContext } from './BuildStepContext';\nimport { StepMetricResult } from './StepMetrics';\n\nexport class BuildWorkflow {\n public readonly buildSteps: BuildStep[];\n public readonly buildFunctions: BuildFunctionById;\n\n constructor(\n private readonly ctx: BuildStepGlobalContext,\n { buildSteps, buildFunctions }: { buildSteps: BuildStep[]; buildFunctions: BuildFunctionById }\n ) {\n this.buildSteps = buildSteps;\n this.buildFunctions = buildFunctions;\n }\n\n public async executeAsync(): Promise<void> {\n let maybeError: Error | null = null;\n for (const step of this.buildSteps) {\n let shouldExecuteStep = false;\n\n try {\n shouldExecuteStep = step.shouldExecuteStep();\n } catch (err: any) {\n step.ctx.logger.error({ err });\n step.ctx.logger.error(\n `Runner failed to evaluate if it should execute step \"${step.displayName}\", using step's if condition \"${step.ifCondition}\". This can be caused by trying to access non-existing object property. If you think this is a bug report it here: https://github.com/expo/eas-cli/issues.`\n );\n maybeError = maybeError ?? err;\n this.ctx.markAsFailed();\n }\n\n if (shouldExecuteStep) {\n const startTime = performance.now();\n let stepResult: StepMetricResult;\n try {\n await step.executeAsync();\n stepResult = 'success';\n } catch (err: any) {\n stepResult = 'failed';\n maybeError = maybeError ?? err;\n this.ctx.markAsFailed();\n } finally {\n this.collectStepMetrics(step, stepResult!, performance.now() - startTime);\n }\n } else {\n step.skip();\n }\n }\n\n if (maybeError) {\n throw maybeError;\n }\n }\n\n private collectStepMetrics(step: BuildStep, result: StepMetricResult, durationMs: number): void {\n if (!step.__metricsId) {\n return;\n }\n\n this.ctx.addStepMetric({\n metricsId: step.__metricsId,\n result,\n durationMs,\n });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BuildWorkflow } from './BuildWorkflow.js';
1
+ import { BuildWorkflow } from './BuildWorkflow';
2
2
  export declare class BuildWorkflowValidator {
3
3
  private readonly workflow;
4
4
  constructor(workflow: BuildWorkflow);
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BuildWorkflowValidator = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const fs_extra_1 = __importDefault(require("fs-extra"));
9
- const BuildStepInput_js_1 = require("./BuildStepInput.cjs");
10
- const errors_js_1 = require("./errors.cjs");
11
- const duplicates_js_1 = require("./utils/expodash/duplicates.cjs");
12
- const nullthrows_js_1 = require("./utils/nullthrows.cjs");
13
- const template_js_1 = require("./utils/template.cjs");
9
+ const BuildStepInput_1 = require("./BuildStepInput");
10
+ const errors_1 = require("./errors");
11
+ const duplicates_1 = require("./utils/expodash/duplicates");
12
+ const nullthrows_1 = require("./utils/nullthrows");
13
+ const template_1 = require("./utils/template");
14
14
  class BuildWorkflowValidator {
15
15
  constructor(workflow) {
16
16
  this.workflow = workflow;
@@ -22,17 +22,17 @@ class BuildWorkflowValidator {
22
22
  errors.push(...this.validateAllowedPlatforms());
23
23
  errors.push(...(await this.validateCustomFunctionModulesAsync()));
24
24
  if (errors.length !== 0) {
25
- throw new errors_js_1.BuildWorkflowError('Build workflow is invalid.', errors);
25
+ throw new errors_1.BuildWorkflowError('Build workflow is invalid.', errors);
26
26
  }
27
27
  }
28
28
  validateUniqueStepIds() {
29
29
  const stepIds = this.workflow.buildSteps.map(({ id }) => id);
30
- const duplicatedStepIds = (0, duplicates_js_1.duplicates)(stepIds);
30
+ const duplicatedStepIds = (0, duplicates_1.duplicates)(stepIds);
31
31
  if (duplicatedStepIds.length === 0) {
32
32
  return [];
33
33
  }
34
34
  else {
35
- const error = new errors_js_1.BuildConfigError(`Duplicated step IDs: ${duplicatedStepIds.map((i) => `"${i}"`).join(', ')}`);
35
+ const error = new errors_1.BuildConfigError(`Duplicated step IDs: ${duplicatedStepIds.map((i) => `"${i}"`).join(', ')}`);
36
36
  return [error];
37
37
  }
38
38
  }
@@ -44,16 +44,16 @@ class BuildWorkflowValidator {
44
44
  for (const currentStep of this.workflow.buildSteps) {
45
45
  for (const currentStepInput of (_a = currentStep.inputs) !== null && _a !== void 0 ? _a : []) {
46
46
  if (currentStepInput.required && currentStepInput.rawValue === undefined) {
47
- const error = new errors_js_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" is required but it was not set.`);
47
+ const error = new errors_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" is required but it was not set.`);
48
48
  errors.push(error);
49
49
  }
50
50
  const currentType = typeof currentStepInput.rawValue === 'object'
51
- ? BuildStepInput_js_1.BuildStepInputValueTypeName.JSON
51
+ ? BuildStepInput_1.BuildStepInputValueTypeName.JSON
52
52
  : typeof currentStepInput.rawValue;
53
53
  if (currentStepInput.rawValue !== undefined &&
54
54
  !currentStepInput.isRawValueStepOrContextReference() &&
55
55
  currentType !== currentStepInput.allowedValueTypeName) {
56
- const error = new errors_js_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" is set to "${typeof currentStepInput.rawValue === 'object'
56
+ const error = new errors_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" is set to "${typeof currentStepInput.rawValue === 'object'
57
57
  ? JSON.stringify(currentStepInput.rawValue)
58
58
  : currentStepInput.rawValue}" which is not of type "${currentStepInput.allowedValueTypeName}" or is not step or context reference.`);
59
59
  errors.push(error);
@@ -62,28 +62,28 @@ class BuildWorkflowValidator {
62
62
  continue;
63
63
  }
64
64
  if (!currentStepInput.isRawValueOneOfAllowedValues()) {
65
- const error = new errors_js_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" is set to "${currentStepInput.rawValue}" which is not one of the allowed values: ${(0, nullthrows_js_1.nullthrows)(currentStepInput.allowedValues)
65
+ const error = new errors_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" is set to "${currentStepInput.rawValue}" which is not one of the allowed values: ${(0, nullthrows_1.nullthrows)(currentStepInput.allowedValues)
66
66
  .map((i) => `"${i}"`)
67
67
  .join(', ')}.`);
68
68
  errors.push(error);
69
69
  }
70
70
  const paths = typeof currentStepInput.defaultValue === 'string'
71
- ? (0, template_js_1.findOutputPaths)(currentStepInput.defaultValue)
71
+ ? (0, template_1.findOutputPaths)(currentStepInput.defaultValue)
72
72
  : [];
73
73
  for (const { stepId: referencedStepId, outputId: referencedStepOutputId } of paths) {
74
74
  if (!(referencedStepId in visitedStepByStepId)) {
75
75
  if (allStepIds.has(referencedStepId)) {
76
- const error = new errors_js_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" uses an expression that references an output parameter from the future step "${referencedStepId}".`);
76
+ const error = new errors_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" uses an expression that references an output parameter from the future step "${referencedStepId}".`);
77
77
  errors.push(error);
78
78
  }
79
79
  else {
80
- const error = new errors_js_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" uses an expression that references an output parameter from a non-existent step "${referencedStepId}".`);
80
+ const error = new errors_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" uses an expression that references an output parameter from a non-existent step "${referencedStepId}".`);
81
81
  errors.push(error);
82
82
  }
83
83
  }
84
84
  else {
85
85
  if (!visitedStepByStepId[referencedStepId].hasOutputParameter(referencedStepOutputId)) {
86
- const error = new errors_js_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" uses an expression that references an undefined output parameter "${referencedStepOutputId}" from step "${referencedStepId}".`);
86
+ const error = new errors_1.BuildConfigError(`Input parameter "${currentStepInput.id}" for step "${currentStep.displayName}" uses an expression that references an undefined output parameter "${referencedStepOutputId}" from step "${referencedStepId}".`);
87
87
  errors.push(error);
88
88
  }
89
89
  }
@@ -97,7 +97,7 @@ class BuildWorkflowValidator {
97
97
  const errors = [];
98
98
  for (const step of this.workflow.buildSteps) {
99
99
  if (!step.canBeRunOnRuntimePlatform()) {
100
- const error = new errors_js_1.BuildConfigError(`Step "${step.displayName}" is not allowed on platform "${step.ctx.global.runtimePlatform}". Allowed platforms for this step are: ${(0, nullthrows_js_1.nullthrows)(step.supportedRuntimePlatforms, `step.supportedRuntimePlatforms can't be falsy if canBeRunOnRuntimePlatform() is false`)
100
+ const error = new errors_1.BuildConfigError(`Step "${step.displayName}" is not allowed on platform "${step.ctx.global.runtimePlatform}". Allowed platforms for this step are: ${(0, nullthrows_1.nullthrows)(step.supportedRuntimePlatforms, `step.supportedRuntimePlatforms can't be falsy if canBeRunOnRuntimePlatform() is false`)
101
101
  .map((p) => `"${p}"`)
102
102
  .join(', ')}.`);
103
103
  errors.push(error);
@@ -112,12 +112,12 @@ class BuildWorkflowValidator {
112
112
  continue;
113
113
  }
114
114
  if (!(await fs_extra_1.default.exists(buildFunction.customFunctionModulePath))) {
115
- const error = new errors_js_1.BuildConfigError(`Custom function module path "${buildFunction.customFunctionModulePath}" for function "${buildFunction.id}" does not exist.`);
115
+ const error = new errors_1.BuildConfigError(`Custom function module path "${buildFunction.customFunctionModulePath}" for function "${buildFunction.id}" does not exist.`);
116
116
  errors.push(error);
117
117
  continue;
118
118
  }
119
119
  if (!(await fs_extra_1.default.exists(path_1.default.join(buildFunction.customFunctionModulePath, 'package.json')))) {
120
- const error = new errors_js_1.BuildConfigError(`Custom function module path "${buildFunction.customFunctionModulePath}" for function "${buildFunction.id}" does not contain a package.json file.`);
120
+ const error = new errors_1.BuildConfigError(`Custom function module path "${buildFunction.customFunctionModulePath}" for function "${buildFunction.id}" does not contain a package.json file.`);
121
121
  errors.push(error);
122
122
  }
123
123
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildWorkflowValidator.js","sourceRoot":"","sources":["../src/BuildWorkflowValidator.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAG1B,qDAA+D;AAE/D,qCAAgE;AAChE,4DAAyD;AACzD,mDAAgD;AAChD,+CAAmD;AAEnD,MAAa,sBAAsB;IACjC,YAA6B,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;IAAG,CAAC;IAEjD,KAAK,CAAC,aAAa;QACxB,MAAM,MAAM,GAAuB,EAAE,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAC7C,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC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gCAAgC,aAAa,CAAC,wBAAwB,mBAAmB,aAAa,CAAC,EAAE,mBAAmB,CAC7H,CAAC;gBACF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACnB,SAAS;YACX,CAAC;YAED,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,cAAI,CAAC,IAAI,CAAC,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1F,MAAM,KAAK,GAAG,IAAI,yBAAgB,CAChC,gCAAgC,aAAa,CAAC,wBAAwB,mBAAmB,aAAa,CAAC,EAAE,yCAAyC,CACnJ,CAAC;gBACF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5JD,wDA4JC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { BuildStep } from './BuildStep';\nimport { BuildStepInputValueTypeName } from './BuildStepInput';\nimport { BuildWorkflow } from './BuildWorkflow';\nimport { BuildConfigError, BuildWorkflowError } from './errors';\nimport { duplicates } from './utils/expodash/duplicates';\nimport { nullthrows } from './utils/nullthrows';\nimport { findOutputPaths } from './utils/template';\n\nexport class BuildWorkflowValidator {\n constructor(private readonly workflow: BuildWorkflow) {}\n\n public async validateAsync(): Promise<void> {\n const errors: BuildConfigError[] = [];\n errors.push(...this.validateUniqueStepIds());\n errors.push(...this.validateInputs());\n errors.push(...this.validateAllowedPlatforms());\n errors.push(...(await this.validateCustomFunctionModulesAsync()));\n if (errors.length !== 0) {\n throw new BuildWorkflowError('Build workflow is invalid.', errors);\n }\n }\n\n private validateUniqueStepIds(): BuildConfigError[] {\n const stepIds = this.workflow.buildSteps.map(({ id }) => id);\n const duplicatedStepIds = duplicates(stepIds);\n if (duplicatedStepIds.length === 0) {\n return [];\n } else {\n const error = new BuildConfigError(\n `Duplicated step IDs: ${duplicatedStepIds.map((i) => `\"${i}\"`).join(', ')}`\n );\n return [error];\n }\n }\n\n private validateInputs(): BuildConfigError[] {\n const errors: BuildConfigError[] = [];\n\n const allStepIds = new Set(this.workflow.buildSteps.map((s) => s.id));\n const visitedStepByStepId: Record<string, BuildStep> = {};\n for (const currentStep of this.workflow.buildSteps) {\n for (const currentStepInput of currentStep.inputs ?? []) {\n if (currentStepInput.required && currentStepInput.rawValue === undefined) {\n const error = new BuildConfigError(\n `Input parameter \"${currentStepInput.id}\" for step \"${currentStep.displayName}\" is required but it was not set.`\n );\n errors.push(error);\n }\n\n const currentType =\n typeof currentStepInput.rawValue === 'object'\n ? BuildStepInputValueTypeName.JSON\n : typeof currentStepInput.rawValue;\n if (\n currentStepInput.rawValue !== undefined &&\n !currentStepInput.isRawValueStepOrContextReference() &&\n currentType !== currentStepInput.allowedValueTypeName\n ) {\n const error = new BuildConfigError(\n `Input parameter \"${currentStepInput.id}\" for step \"${\n currentStep.displayName\n }\" is set to \"${\n typeof currentStepInput.rawValue === 'object'\n ? JSON.stringify(currentStepInput.rawValue)\n : currentStepInput.rawValue\n }\" which is not of type \"${\n currentStepInput.allowedValueTypeName\n }\" or is not step or context reference.`\n );\n errors.push(error);\n }\n\n if (currentStepInput.defaultValue === undefined) {\n continue;\n }\n if (!currentStepInput.isRawValueOneOfAllowedValues()) {\n const error = new BuildConfigError(\n `Input parameter \"${currentStepInput.id}\" for step \"${\n currentStep.displayName\n }\" is set to \"${currentStepInput.rawValue}\" which is not one of the allowed values: ${nullthrows(\n currentStepInput.allowedValues\n )\n .map((i) => `\"${i}\"`)\n .join(', ')}.`\n );\n errors.push(error);\n }\n const paths =\n typeof currentStepInput.defaultValue === 'string'\n ? findOutputPaths(currentStepInput.defaultValue)\n : [];\n for (const { stepId: referencedStepId, outputId: referencedStepOutputId } of paths) {\n if (!(referencedStepId in visitedStepByStepId)) {\n if (allStepIds.has(referencedStepId)) {\n const error = new BuildConfigError(\n `Input parameter \"${currentStepInput.id}\" for step \"${currentStep.displayName}\" uses an expression that references an output parameter from the future step \"${referencedStepId}\".`\n );\n errors.push(error);\n } else {\n const error = new BuildConfigError(\n `Input parameter \"${currentStepInput.id}\" for step \"${currentStep.displayName}\" uses an expression that references an output parameter from a non-existent step \"${referencedStepId}\".`\n );\n errors.push(error);\n }\n } else {\n if (!visitedStepByStepId[referencedStepId].hasOutputParameter(referencedStepOutputId)) {\n const error = new BuildConfigError(\n `Input parameter \"${currentStepInput.id}\" for step \"${currentStep.displayName}\" uses an expression that references an undefined output parameter \"${referencedStepOutputId}\" from step \"${referencedStepId}\".`\n );\n errors.push(error);\n }\n }\n }\n }\n visitedStepByStepId[currentStep.id] = currentStep;\n }\n\n return errors;\n }\n\n private validateAllowedPlatforms(): BuildConfigError[] {\n const errors: BuildConfigError[] = [];\n for (const step of this.workflow.buildSteps) {\n if (!step.canBeRunOnRuntimePlatform()) {\n const error = new BuildConfigError(\n `Step \"${step.displayName}\" is not allowed on platform \"${\n step.ctx.global.runtimePlatform\n }\". Allowed platforms for this step are: ${nullthrows(\n step.supportedRuntimePlatforms,\n `step.supportedRuntimePlatforms can't be falsy if canBeRunOnRuntimePlatform() is false`\n )\n .map((p) => `\"${p}\"`)\n .join(', ')}.`\n );\n errors.push(error);\n }\n }\n return errors;\n }\n\n private async validateCustomFunctionModulesAsync(): Promise<BuildConfigError[]> {\n const errors: BuildConfigError[] = [];\n for (const buildFunction of Object.values(this.workflow.buildFunctions)) {\n if (!buildFunction.customFunctionModulePath) {\n continue;\n }\n\n if (!(await fs.exists(buildFunction.customFunctionModulePath))) {\n const error = new BuildConfigError(\n `Custom function module path \"${buildFunction.customFunctionModulePath}\" for function \"${buildFunction.id}\" does not exist.`\n );\n errors.push(error);\n continue;\n }\n\n if (!(await fs.exists(path.join(buildFunction.customFunctionModulePath, 'package.json')))) {\n const error = new BuildConfigError(\n `Custom function module path \"${buildFunction.customFunctionModulePath}\" for function \"${buildFunction.id}\" does not contain a package.json file.`\n );\n errors.push(error);\n }\n }\n return errors;\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ export type StepMetricResult = 'success' | 'failed';
2
+ export type StepMetricInput = {
3
+ metricsId: string;
4
+ result: StepMetricResult;
5
+ durationMs: number;
6
+ };
7
+ export type StepMetric = StepMetricInput & {
8
+ platform: 'darwin' | 'linux';
9
+ };
10
+ export type StepMetricsCollection = StepMetric[];
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=StepMetrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepMetrics.js","sourceRoot":"","sources":["../src/StepMetrics.ts"],"names":[],"mappings":"","sourcesContent":["export type StepMetricResult = 'success' | 'failed';\n\nexport type StepMetricInput = {\n metricsId: string;\n result: StepMetricResult;\n durationMs: number;\n};\n\nexport type StepMetric = StepMetricInput & {\n platform: 'darwin' | 'linux';\n};\n\nexport type StepMetricsCollection = StepMetric[];\n"]}
@@ -1,9 +1,9 @@
1
1
  import { Step } from '@expo/eas-build-job';
2
- import { BuildFunction, BuildFunctionById } from './BuildFunction.js';
3
- import { BuildFunctionGroup } from './BuildFunctionGroup.js';
4
- import { BuildStepGlobalContext } from './BuildStepContext.js';
5
- import { BuildStep } from './BuildStep.js';
6
- import { AbstractConfigParser } from './AbstractConfigParser.js';
2
+ import { BuildFunction, BuildFunctionById } from './BuildFunction';
3
+ import { BuildFunctionGroup } from './BuildFunctionGroup';
4
+ import { BuildStepGlobalContext } from './BuildStepContext';
5
+ import { BuildStep } from './BuildStep';
6
+ import { AbstractConfigParser } from './AbstractConfigParser';
7
7
  export declare class StepsConfigParser extends AbstractConfigParser {
8
8
  private readonly steps;
9
9
  constructor(ctx: BuildStepGlobalContext, { steps, externalFunctions, externalFunctionGroups, }: {
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.StepsConfigParser = void 0;
7
7
  const node_assert_1 = __importDefault(require("node:assert"));
8
8
  const eas_build_job_1 = require("@expo/eas-build-job");
9
- const BuildFunctionGroup_js_1 = require("./BuildFunctionGroup.cjs");
10
- const BuildStep_js_1 = require("./BuildStep.cjs");
11
- const AbstractConfigParser_js_1 = require("./AbstractConfigParser.cjs");
12
- const errors_js_1 = require("./errors.cjs");
13
- const BuildStepOutput_js_1 = require("./BuildStepOutput.cjs");
14
- class StepsConfigParser extends AbstractConfigParser_js_1.AbstractConfigParser {
9
+ const BuildFunctionGroup_1 = require("./BuildFunctionGroup");
10
+ const BuildStep_1 = require("./BuildStep");
11
+ const AbstractConfigParser_1 = require("./AbstractConfigParser");
12
+ const errors_1 = require("./errors");
13
+ const BuildStepOutput_1 = require("./BuildStepOutput");
14
+ class StepsConfigParser extends AbstractConfigParser_1.AbstractConfigParser {
15
15
  constructor(ctx, { steps, externalFunctions, externalFunctionGroups, }) {
16
16
  super(ctx, {
17
17
  externalFunctions,
@@ -27,7 +27,7 @@ class StepsConfigParser extends AbstractConfigParser_js_1.AbstractConfigParser {
27
27
  externalFunctionGroupIds: this.getExternalFunctionGroupFullIds(),
28
28
  });
29
29
  const buildFunctionById = this.createBuildFunctionByIdMappingForExternalFunctions();
30
- const buildFunctionGroupById = (0, BuildFunctionGroup_js_1.createBuildFunctionGroupByIdMapping)((_a = this.externalFunctionGroups) !== null && _a !== void 0 ? _a : []);
30
+ const buildFunctionGroupById = (0, BuildFunctionGroup_1.createBuildFunctionGroupByIdMapping)((_a = this.externalFunctionGroups) !== null && _a !== void 0 ? _a : []);
31
31
  const buildSteps = [];
32
32
  for (const stepConfig of validatedSteps) {
33
33
  buildSteps.push(...this.createBuildStepsFromStepConfig(stepConfig, {
@@ -62,14 +62,14 @@ class StepsConfigParser extends AbstractConfigParser_js_1.AbstractConfigParser {
62
62
  });
63
63
  }
64
64
  else {
65
- throw new errors_js_1.BuildConfigError('Invalid job step configuration detected. Step must be shell or function step');
65
+ throw new errors_1.BuildConfigError('Invalid job step configuration detected. Step must be shell or function step');
66
66
  }
67
67
  }
68
68
  createBuildStepFromShellStepConfig(step) {
69
- const id = BuildStep_js_1.BuildStep.getNewId(step.id);
70
- const displayName = BuildStep_js_1.BuildStep.getDisplayName({ id, name: step.name, command: step.run });
69
+ const id = BuildStep_1.BuildStep.getNewId(step.id);
70
+ const displayName = BuildStep_1.BuildStep.getDisplayName({ id, name: step.name, command: step.run });
71
71
  const outputs = step.outputs && this.createBuildStepOutputsFromDefinition(step.outputs, displayName);
72
- return new BuildStep_js_1.BuildStep(this.ctx, {
72
+ return new BuildStep_1.BuildStep(this.ctx, {
73
73
  id,
74
74
  outputs,
75
75
  name: step.name,
@@ -79,6 +79,7 @@ class StepsConfigParser extends AbstractConfigParser_js_1.AbstractConfigParser {
79
79
  command: step.run,
80
80
  env: step.env,
81
81
  ifCondition: step.if,
82
+ __metricsId: step.__metrics_id,
82
83
  });
83
84
  }
84
85
  createBuildStepsFromFunctionStepConfig(step, { buildFunctionById, buildFunctionGroupById, }) {
@@ -107,7 +108,7 @@ class StepsConfigParser extends AbstractConfigParser_js_1.AbstractConfigParser {
107
108
  createBuildStepOutputsFromDefinition(stepOutputs, stepDisplayName) {
108
109
  return stepOutputs.map((entry) => {
109
110
  var _a;
110
- return new BuildStepOutput_js_1.BuildStepOutput(this.ctx, {
111
+ return new BuildStepOutput_1.BuildStepOutput(this.ctx, {
111
112
  id: entry.name,
112
113
  stepDisplayName,
113
114
  required: (_a = entry.required) !== null && _a !== void 0 ? _a : true,
@@ -129,7 +130,7 @@ class StepsConfigParser extends AbstractConfigParser_js_1.AbstractConfigParser {
129
130
  !externalFunctionGroupsIdsSet.has(calledFunctionOrFunctionGroup));
130
131
  });
131
132
  if (nonExistentFunctionsOrFunctionGroups.length > 0) {
132
- throw new errors_js_1.BuildConfigError(`Calling non-existent functions: ${nonExistentFunctionsOrFunctionGroups
133
+ throw new errors_1.BuildConfigError(`Calling non-existent functions: ${nonExistentFunctionsOrFunctionGroups
133
134
  .map((f) => `"${f}"`)
134
135
  .join(', ')}.`);
135
136
  }
@@ -0,0 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ellStep,\n ShellStep,\n Step,\n validateSteps,\n} from '@expo/eas-build-job';\n\nimport { BuildFunction, BuildFunctionById } from './BuildFunction';\nimport {\n BuildFunctionGroup,\n BuildFunctionGroupById,\n createBuildFunctionGroupByIdMapping,\n} from './BuildFunctionGroup';\nimport { BuildStepGlobalContext } from './BuildStepContext';\nimport { BuildStep } from './BuildStep';\nimport { AbstractConfigParser } from './AbstractConfigParser';\nimport { BuildConfigError } from './errors';\nimport { BuildStepOutput } from './BuildStepOutput';\n\nexport class StepsConfigParser extends AbstractConfigParser {\n private readonly steps: Step[];\n\n constructor(\n ctx: BuildStepGlobalContext,\n {\n steps,\n externalFunctions,\n externalFunctionGroups,\n }: {\n steps: Step[];\n externalFunctions?: BuildFunction[];\n externalFunctionGroups?: BuildFunctionGroup[];\n }\n ) {\n super(ctx, {\n externalFunctions,\n externalFunctionGroups,\n });\n\n this.steps = steps;\n }\n\n protected async parseConfigToBuildStepsAndBuildFunctionByIdMappingAsync(): Promise<{\n buildSteps: BuildStep[];\n buildFunctionById: BuildFunctionById;\n }> {\n const validatedSteps = validateSteps(this.steps);\n StepsConfigParser.validateAllFunctionsExist(validatedSteps, {\n externalFunctionIds: this.getExternalFunctionFullIds(),\n externalFunctionGroupIds: this.getExternalFunctionGroupFullIds(),\n });\n\n const buildFunctionById = this.createBuildFunctionByIdMappingForExternalFunctions();\n const buildFunctionGroupById = createBuildFunctionGroupByIdMapping(\n this.externalFunctionGroups ?? []\n );\n\n const buildSteps: BuildStep[] = [];\n for (const stepConfig of validatedSteps) {\n buildSteps.push(\n ...this.createBuildStepsFromStepConfig(stepConfig, {\n buildFunctionById,\n buildFunctionGroupById,\n })\n );\n }\n\n return {\n buildSteps,\n buildFunctionById,\n };\n }\n\n private createBuildFunctionByIdMappingForExternalFunctions(): BuildFunctionById {\n const result: BuildFunctionById = {};\n\n if (this.externalFunctions === undefined) {\n return result;\n }\n\n for (const buildFunction of this.externalFunctions) {\n const fullId = buildFunction.getFullId();\n result[fullId] = buildFunction;\n }\n return result;\n }\n\n private createBuildStepsFromStepConfig(\n stepConfig: Step,\n {\n buildFunctionById,\n buildFunctionGroupById,\n }: {\n buildFunctionById: BuildFunctionById;\n buildFunctionGroupById: BuildFunctionGroupById;\n }\n ): BuildStep[] {\n if (isStepShellStep(stepConfig)) {\n return [this.createBuildStepFromShellStepConfig(stepConfig)];\n } else if (isStepFunctionStep(stepConfig)) {\n return this.createBuildStepsFromFunctionStepConfig(stepConfig, {\n buildFunctionById,\n buildFunctionGroupById,\n });\n } else {\n throw new BuildConfigError(\n 'Invalid job step configuration detected. Step must be shell or function step'\n );\n }\n }\n\n private createBuildStepFromShellStepConfig(step: ShellStep): BuildStep {\n const id = BuildStep.getNewId(step.id);\n const displayName = BuildStep.getDisplayName({ id, name: step.name, command: step.run });\n const outputs =\n step.outputs && this.createBuildStepOutputsFromDefinition(step.outputs, displayName);\n return new BuildStep(this.ctx, {\n id,\n outputs,\n name: step.name,\n displayName,\n workingDirectory: step.working_directory,\n shell: step.shell,\n command: step.run,\n env: step.env,\n ifCondition: step.if,\n __metricsId: step.__metrics_id,\n });\n }\n\n private createBuildStepsFromFunctionStepConfig(\n step: FunctionStep,\n {\n buildFunctionById,\n buildFunctionGroupById,\n }: {\n buildFunctionById: BuildFunctionById;\n buildFunctionGroupById: BuildFunctionGroupById;\n }\n ): BuildStep[] {\n const functionId = step.uses;\n const maybeFunctionGroup = buildFunctionGroupById[functionId];\n if (maybeFunctionGroup) {\n // TODO: allow to set id, name, working_directory, shell, env and if for function groups\n return maybeFunctionGroup.createBuildStepsFromFunctionGroupCall(this.ctx, {\n callInputs: step.with,\n });\n }\n\n const buildFunction = buildFunctionById[functionId];\n assert(buildFunction, 'function ID must be ID of function or function group');\n\n return [\n buildFunction.createBuildStepFromFunctionCall(this.ctx, {\n id: step.id,\n name: step.name,\n callInputs: step.with,\n workingDirectory: step.working_directory,\n shell: step.shell,\n env: step.env,\n ifCondition: step.if,\n }),\n ];\n }\n\n private createBuildStepOutputsFromDefinition(\n stepOutputs: Required<ShellStep>['outputs'],\n stepDisplayName: string\n ): BuildStepOutput[] {\n return stepOutputs.map(\n (entry) =>\n new BuildStepOutput(this.ctx, {\n id: entry.name,\n stepDisplayName,\n required: entry.required ?? true,\n })\n );\n }\n\n private static validateAllFunctionsExist(\n steps: Step[],\n {\n externalFunctionIds,\n externalFunctionGroupIds,\n }: {\n externalFunctionIds: string[];\n externalFunctionGroupIds: string[];\n }\n ): void {\n const calledFunctionsOrFunctionGroupsSet = new Set<string>();\n for (const step of steps) {\n if (step.uses) {\n calledFunctionsOrFunctionGroupsSet.add(step.uses);\n }\n }\n const calledFunctionsOrFunctionGroup = Array.from(calledFunctionsOrFunctionGroupsSet);\n const externalFunctionIdsSet = new Set(externalFunctionIds);\n const externalFunctionGroupsIdsSet = new Set(externalFunctionGroupIds);\n const nonExistentFunctionsOrFunctionGroups = calledFunctionsOrFunctionGroup.filter(\n (calledFunctionOrFunctionGroup) => {\n return (\n !externalFunctionIdsSet.has(calledFunctionOrFunctionGroup) &&\n !externalFunctionGroupsIdsSet.has(calledFunctionOrFunctionGroup)\n );\n }\n );\n if (nonExistentFunctionsOrFunctionGroups.length > 0) {\n throw new BuildConfigError(\n `Calling non-existent functions: ${nonExistentFunctionsOrFunctionGroups\n .map((f) => `\"${f}\"`)\n .join(', ')}.`\n );\n }\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { StaticJobInterpolationContext } from '@expo/eas-build-job';
2
2
  import { bunyan } from '@expo/logger';
3
- import { ExternalBuildContextProvider } from '../BuildStepContext.js';
4
- import { BuildRuntimePlatform } from '../BuildRuntimePlatform.js';
5
- import { BuildStepEnv } from '../BuildStepEnv.js';
3
+ import { ExternalBuildContextProvider } from '../BuildStepContext';
4
+ import { BuildRuntimePlatform } from '../BuildRuntimePlatform';
5
+ import { BuildStepEnv } from '../BuildStepEnv';
6
6
  export declare class CliContextProvider implements ExternalBuildContextProvider {
7
7
  readonly logger: bunyan;
8
8
  readonly runtimePlatform: BuildRuntimePlatform;
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.CliContextProvider = void 0;
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const logger_1 = require("@expo/logger");
10
- const BuildConfigParser_js_1 = require("../BuildConfigParser.cjs");
11
- const BuildStepContext_js_1 = require("../BuildStepContext.cjs");
12
- const errors_js_1 = require("../errors.cjs");
10
+ const BuildConfigParser_1 = require("../BuildConfigParser");
11
+ const BuildStepContext_1 = require("../BuildStepContext");
12
+ const errors_1 = require("../errors");
13
13
  const logger = (0, logger_1.createLogger)({
14
14
  name: 'steps-cli',
15
15
  level: 'info',
@@ -40,8 +40,8 @@ class CliContextProvider {
40
40
  }
41
41
  exports.CliContextProvider = CliContextProvider;
42
42
  async function runAsync(configPath, relativeProjectDirectory, runtimePlatform) {
43
- const ctx = new BuildStepContext_js_1.BuildStepGlobalContext(new CliContextProvider(logger, runtimePlatform, relativeProjectDirectory, relativeProjectDirectory, relativeProjectDirectory, relativeProjectDirectory), false);
44
- const parser = new BuildConfigParser_js_1.BuildConfigParser(ctx, {
43
+ const ctx = new BuildStepContext_1.BuildStepGlobalContext(new CliContextProvider(logger, runtimePlatform, relativeProjectDirectory, relativeProjectDirectory, relativeProjectDirectory, relativeProjectDirectory), false);
44
+ const parser = new BuildConfigParser_1.BuildConfigParser(ctx, {
45
45
  configPath,
46
46
  });
47
47
  const workflow = await parser.parseAsync();
@@ -58,7 +58,7 @@ const configPath = path_1.default.resolve(process.cwd(), relativeConfigPath);
58
58
  const workingDirectory = path_1.default.resolve(process.cwd(), relativeProjectDirectoryPath);
59
59
  runAsync(configPath, workingDirectory, platform).catch((err) => {
60
60
  logger.error({ err }, 'Build failed');
61
- if (err instanceof errors_js_1.BuildWorkflowError) {
61
+ if (err instanceof errors_1.BuildWorkflowError) {
62
62
  logger.error('Failed to parse the custom build config file.');
63
63
  for (const detailedErr of err.errors) {
64
64
  logger.error({ err: detailedErr });