@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
@@ -1,106 +0,0 @@
1
- import get from 'lodash.get';
2
- import cloneDeep from 'lodash.clonedeep';
3
- import { BuildStepInputValueTypeName } from '../BuildStepInput.js';
4
- import { BuildConfigError, BuildStepRuntimeError } from '../errors.js';
5
- import { nullthrows } from './nullthrows.js';
6
- export const BUILD_STEP_INPUT_EXPRESSION_REGEXP = /\${\s*(inputs\.[\S]+)\s*}/;
7
- export const BUILD_STEP_OUTPUT_EXPRESSION_REGEXP = /\${\s*(steps\.[\S]+)\s*}/;
8
- export const BUILD_GLOBAL_CONTEXT_EXPRESSION_REGEXP = /\${\s*(eas\.[\S]+)\s*}/;
9
- export const BUILD_STEP_OR_BUILD_GLOBAL_CONTEXT_REFERENCE_REGEX = /\${\s*((steps|eas)\.[\S]+)\s*}/;
10
- export function interpolateWithInputs(templateString, inputs) {
11
- return interpolate(templateString, BUILD_STEP_INPUT_EXPRESSION_REGEXP, inputs);
12
- }
13
- export function interpolateWithOutputs(interpolableValue, fn) {
14
- if (typeof interpolableValue === 'string') {
15
- return interpolateStringWithOutputs(interpolableValue, fn);
16
- }
17
- else {
18
- return interpolateObjectWithOutputs(interpolableValue, fn);
19
- }
20
- }
21
- export function interpolateStringWithOutputs(templateString, fn) {
22
- return interpolate(templateString, BUILD_STEP_OUTPUT_EXPRESSION_REGEXP, fn);
23
- }
24
- export function interpolateObjectWithOutputs(interpolableObject, fn) {
25
- const interpolableObjectCopy = cloneDeep(interpolableObject);
26
- Object.keys(interpolableObject).forEach((property) => {
27
- const propertyValue = interpolableObject[property];
28
- if (['string', 'object'].includes(typeof propertyValue)) {
29
- interpolableObjectCopy[property] =
30
- interpolateWithOutputs(propertyValue, fn);
31
- }
32
- });
33
- return interpolableObjectCopy;
34
- }
35
- export function getObjectValueForInterpolation(path, obj) {
36
- const value = get(obj, path);
37
- if (value === undefined) {
38
- throw new BuildStepRuntimeError(`Object field "${path}" does not exist. Ensure you are using the correct field name.`);
39
- }
40
- if (!isAllowedValueTypeForObjectInterpolation(value)) {
41
- throw new BuildStepRuntimeError(`EAS context field "${path}" is not of type ${Object.values(BuildStepInputValueTypeName).join(', ')}, or undefined. It is of type "${typeof value}". We currently only support accessing string or undefined values from the EAS context.`);
42
- }
43
- if (value !== null && typeof value === 'object') {
44
- return JSON.stringify(value);
45
- }
46
- return value;
47
- }
48
- export function interpolateWithGlobalContext(interpolableValue, fn) {
49
- if (typeof interpolableValue === 'string') {
50
- return interpolateStringWithGlobalContext(interpolableValue, fn);
51
- }
52
- else {
53
- return interpolateObjectWithGlobalContext(interpolableValue, fn);
54
- }
55
- }
56
- export function interpolateStringWithGlobalContext(templateString, fn) {
57
- return interpolate(templateString, BUILD_GLOBAL_CONTEXT_EXPRESSION_REGEXP, fn);
58
- }
59
- export function interpolateObjectWithGlobalContext(templateObject, fn) {
60
- const templateObjectCopy = cloneDeep(templateObject);
61
- Object.keys(templateObject).forEach((property) => {
62
- const propertyValue = templateObject[property];
63
- if (['string', 'object'].includes(typeof propertyValue)) {
64
- templateObjectCopy[property] =
65
- interpolateWithGlobalContext(propertyValue, fn);
66
- }
67
- });
68
- return templateObjectCopy;
69
- }
70
- function interpolate(templateString, regex, varsOrFn) {
71
- const matched = templateString.match(new RegExp(regex, 'g'));
72
- if (!matched) {
73
- return templateString;
74
- }
75
- let result = templateString;
76
- for (const match of matched) {
77
- const [, path] = nullthrows(match.match(regex));
78
- const value = typeof varsOrFn === 'function' ? varsOrFn(path) : varsOrFn[path.split('.')[1]];
79
- result = result.replace(match, value);
80
- }
81
- return result;
82
- }
83
- function isAllowedValueTypeForObjectInterpolation(value) {
84
- return (typeof value === 'string' ||
85
- typeof value === 'number' ||
86
- typeof value === 'boolean' ||
87
- typeof value === 'object' ||
88
- value === null);
89
- }
90
- export function findOutputPaths(templateString) {
91
- const result = [];
92
- const matches = templateString.matchAll(new RegExp(BUILD_STEP_OUTPUT_EXPRESSION_REGEXP, 'g'));
93
- for (const match of matches) {
94
- result.push(parseOutputPath(match[1]));
95
- }
96
- return result;
97
- }
98
- export function parseOutputPath(outputPathWithObjectName) {
99
- const splits = outputPathWithObjectName.split('.').slice(1);
100
- if (splits.length !== 2) {
101
- throw new BuildConfigError(`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}"`);
102
- }
103
- const [stepId, outputId] = splits;
104
- return { stepId, outputId };
105
- }
106
- //# sourceMappingURL=template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/utils/template.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM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OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI,CACf,CAAC;AACJ,CAAC;AAOD,MAAM,UAAU,eAAe,CAAC,cAAsB;IACpD,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,mCAAmC,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,MAAM,UAAU,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,gBAAgB,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"]}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes