@expo/steps 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -1
- package/dist_commonjs/BuildArtifacts.cjs +0 -9
- package/dist_commonjs/BuildArtifacts.d.ts +0 -5
- package/dist_commonjs/BuildArtifacts.js.map +0 -1
- package/dist_commonjs/BuildConfig.cjs +0 -108
- package/dist_commonjs/BuildConfig.d.ts +0 -53
- package/dist_commonjs/BuildConfig.js.map +0 -1
- package/dist_commonjs/BuildConfigParser.cjs +0 -154
- package/dist_commonjs/BuildConfigParser.d.ts +0 -19
- package/dist_commonjs/BuildConfigParser.js.map +0 -1
- package/dist_commonjs/BuildFunction.cjs +0 -40
- package/dist_commonjs/BuildFunction.d.ts +0 -32
- package/dist_commonjs/BuildFunction.js.map +0 -1
- package/dist_commonjs/BuildPlatform.cjs +0 -9
- package/dist_commonjs/BuildPlatform.d.ts +0 -4
- package/dist_commonjs/BuildPlatform.js.map +0 -1
- package/dist_commonjs/BuildStep.cjs +0 -179
- package/dist_commonjs/BuildStep.d.ts +0 -48
- package/dist_commonjs/BuildStep.js.map +0 -1
- package/dist_commonjs/BuildStepContext.cjs +0 -32
- package/dist_commonjs/BuildStepContext.d.ts +0 -13
- package/dist_commonjs/BuildStepContext.js.map +0 -1
- package/dist_commonjs/BuildStepEnv.cjs +0 -3
- package/dist_commonjs/BuildStepEnv.d.ts +0 -1
- package/dist_commonjs/BuildStepEnv.js.map +0 -1
- package/dist_commonjs/BuildStepInput.cjs +0 -36
- package/dist_commonjs/BuildStepInput.d.ts +0 -18
- package/dist_commonjs/BuildStepInput.js.map +0 -1
- package/dist_commonjs/BuildStepOutput.cjs +0 -29
- package/dist_commonjs/BuildStepOutput.d.ts +0 -16
- package/dist_commonjs/BuildStepOutput.js.map +0 -1
- package/dist_commonjs/BuildTemporaryFiles.cjs +0 -100
- package/dist_commonjs/BuildTemporaryFiles.d.ts +0 -8
- package/dist_commonjs/BuildTemporaryFiles.js.map +0 -1
- package/dist_commonjs/BuildWorkflow.cjs +0 -32
- package/dist_commonjs/BuildWorkflow.d.ts +0 -17
- package/dist_commonjs/BuildWorkflow.js.map +0 -1
- package/dist_commonjs/BuildWorkflowValidator.cjs +0 -76
- package/dist_commonjs/BuildWorkflowValidator.d.ts +0 -8
- package/dist_commonjs/BuildWorkflowValidator.js.map +0 -1
- package/dist_commonjs/bin/uploadArtifact.cjs +0 -30
- package/dist_commonjs/bin/uploadArtifact.d.ts +0 -1
- package/dist_commonjs/bin/uploadArtifact.js.map +0 -1
- package/dist_commonjs/cli/cli.cjs +0 -37
- package/dist_commonjs/cli/cli.d.ts +0 -1
- package/dist_commonjs/cli/cli.js.map +0 -1
- package/dist_commonjs/errors/BuildConfigError.cjs +0 -8
- package/dist_commonjs/errors/BuildConfigError.d.ts +0 -3
- package/dist_commonjs/errors/BuildConfigError.js.map +0 -1
- package/dist_commonjs/errors/BuildInternalError.cjs +0 -7
- package/dist_commonjs/errors/BuildInternalError.d.ts +0 -2
- package/dist_commonjs/errors/BuildInternalError.js.map +0 -1
- package/dist_commonjs/errors/BuildStepRuntimeError.cjs +0 -8
- package/dist_commonjs/errors/BuildStepRuntimeError.d.ts +0 -3
- package/dist_commonjs/errors/BuildStepRuntimeError.js.map +0 -1
- package/dist_commonjs/errors/BuildWorkflowError.cjs +0 -13
- package/dist_commonjs/errors/BuildWorkflowError.d.ts +0 -10
- package/dist_commonjs/errors/BuildWorkflowError.js.map +0 -1
- package/dist_commonjs/errors/UserError.cjs +0 -14
- package/dist_commonjs/errors/UserError.d.ts +0 -9
- package/dist_commonjs/errors/UserError.js.map +0 -1
- package/dist_commonjs/index.cjs +0 -10
- package/dist_commonjs/index.d.ts +0 -3
- package/dist_commonjs/index.js.map +0 -1
- package/dist_commonjs/utils/expodash/uniq.cjs +0 -9
- package/dist_commonjs/utils/expodash/uniq.d.ts +0 -1
- package/dist_commonjs/utils/expodash/uniq.js.map +0 -1
- package/dist_commonjs/utils/nullthrows.cjs +0 -11
- package/dist_commonjs/utils/nullthrows.d.ts +0 -1
- package/dist_commonjs/utils/nullthrows.js.map +0 -1
- package/dist_commonjs/utils/shell/bin.cjs +0 -11
- package/dist_commonjs/utils/shell/bin.d.ts +0 -1
- package/dist_commonjs/utils/shell/bin.js.map +0 -1
- package/dist_commonjs/utils/shell/command.cjs +0 -36
- package/dist_commonjs/utils/shell/command.d.ts +0 -6
- package/dist_commonjs/utils/shell/command.js.map +0 -1
- package/dist_commonjs/utils/shell/spawn.cjs +0 -25
- package/dist_commonjs/utils/shell/spawn.d.ts +0 -9
- package/dist_commonjs/utils/shell/spawn.js.map +0 -1
- package/dist_commonjs/utils/template.cjs +0 -47
- package/dist_commonjs/utils/template.d.ts +0 -11
- package/dist_commonjs/utils/template.js.map +0 -1
- package/dist_esm/BuildArtifacts.d.ts +0 -5
- package/dist_esm/BuildArtifacts.js +0 -6
- package/dist_esm/BuildArtifacts.js.map +0 -1
- package/dist_esm/BuildConfig.d.ts +0 -53
- package/dist_esm/BuildConfig.js +0 -97
- package/dist_esm/BuildConfig.js.map +0 -1
- package/dist_esm/BuildConfigParser.d.ts +0 -19
- package/dist_esm/BuildConfigParser.js +0 -147
- package/dist_esm/BuildConfigParser.js.map +0 -1
- package/dist_esm/BuildFunction.d.ts +0 -32
- package/dist_esm/BuildFunction.js +0 -36
- package/dist_esm/BuildFunction.js.map +0 -1
- package/dist_esm/BuildPlatform.d.ts +0 -4
- package/dist_esm/BuildPlatform.js +0 -6
- package/dist_esm/BuildPlatform.js.map +0 -1
- package/dist_esm/BuildStep.d.ts +0 -48
- package/dist_esm/BuildStep.js +0 -172
- package/dist_esm/BuildStep.js.map +0 -1
- package/dist_esm/BuildStepContext.d.ts +0 -13
- package/dist_esm/BuildStepContext.js +0 -25
- package/dist_esm/BuildStepContext.js.map +0 -1
- package/dist_esm/BuildStepEnv.d.ts +0 -1
- package/dist_esm/BuildStepEnv.js +0 -2
- package/dist_esm/BuildStepEnv.js.map +0 -1
- package/dist_esm/BuildStepInput.d.ts +0 -18
- package/dist_esm/BuildStepInput.js +0 -32
- package/dist_esm/BuildStepInput.js.map +0 -1
- package/dist_esm/BuildStepOutput.d.ts +0 -16
- package/dist_esm/BuildStepOutput.js +0 -25
- package/dist_esm/BuildStepOutput.js.map +0 -1
- package/dist_esm/BuildTemporaryFiles.d.ts +0 -8
- package/dist_esm/BuildTemporaryFiles.js +0 -88
- package/dist_esm/BuildTemporaryFiles.js.map +0 -1
- package/dist_esm/BuildWorkflow.d.ts +0 -17
- package/dist_esm/BuildWorkflow.js +0 -28
- package/dist_esm/BuildWorkflow.js.map +0 -1
- package/dist_esm/BuildWorkflowValidator.d.ts +0 -8
- package/dist_esm/BuildWorkflowValidator.js +0 -72
- package/dist_esm/BuildWorkflowValidator.js.map +0 -1
- package/dist_esm/bin/uploadArtifact.d.ts +0 -1
- package/dist_esm/bin/uploadArtifact.js +0 -25
- package/dist_esm/bin/uploadArtifact.js.map +0 -1
- package/dist_esm/cli/cli.d.ts +0 -1
- package/dist_esm/cli/cli.js +0 -32
- package/dist_esm/cli/cli.js.map +0 -1
- package/dist_esm/errors/BuildConfigError.d.ts +0 -3
- package/dist_esm/errors/BuildConfigError.js +0 -4
- package/dist_esm/errors/BuildConfigError.js.map +0 -1
- package/dist_esm/errors/BuildInternalError.d.ts +0 -2
- package/dist_esm/errors/BuildInternalError.js +0 -3
- package/dist_esm/errors/BuildInternalError.js.map +0 -1
- package/dist_esm/errors/BuildStepRuntimeError.d.ts +0 -3
- package/dist_esm/errors/BuildStepRuntimeError.js +0 -4
- package/dist_esm/errors/BuildStepRuntimeError.js.map +0 -1
- package/dist_esm/errors/BuildWorkflowError.d.ts +0 -10
- package/dist_esm/errors/BuildWorkflowError.js +0 -9
- package/dist_esm/errors/BuildWorkflowError.js.map +0 -1
- package/dist_esm/errors/UserError.d.ts +0 -9
- package/dist_esm/errors/UserError.js +0 -10
- package/dist_esm/errors/UserError.js.map +0 -1
- package/dist_esm/index.d.ts +0 -3
- package/dist_esm/index.js +0 -4
- package/dist_esm/index.js.map +0 -1
- package/dist_esm/utils/expodash/uniq.d.ts +0 -1
- package/dist_esm/utils/expodash/uniq.js +0 -5
- package/dist_esm/utils/expodash/uniq.js.map +0 -1
- package/dist_esm/utils/nullthrows.d.ts +0 -1
- package/dist_esm/utils/nullthrows.js +0 -7
- package/dist_esm/utils/nullthrows.js.map +0 -1
- package/dist_esm/utils/shell/bin.d.ts +0 -1
- package/dist_esm/utils/shell/bin.js +0 -5
- package/dist_esm/utils/shell/bin.js.map +0 -1
- package/dist_esm/utils/shell/command.d.ts +0 -6
- package/dist_esm/utils/shell/command.js +0 -28
- package/dist_esm/utils/shell/command.js.map +0 -1
- package/dist_esm/utils/shell/spawn.d.ts +0 -9
- package/dist_esm/utils/shell/spawn.js +0 -18
- package/dist_esm/utils/shell/spawn.js.map +0 -1
- package/dist_esm/utils/template.d.ts +0 -11
- package/dist_esm/utils/template.js +0 -40
- package/dist_esm/utils/template.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildWorkflowValidator.js","sourceRoot":"","sources":["../src/BuildWorkflowValidator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,OAAO,sBAAsB;IACjC,YAA6B,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;IAAG,CAAC;IAEjD,QAAQ;QACb,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,IAAI,MAAM,CAAC,MAAM,K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":["import { BuildStep } from './BuildStep.js';\nimport { BuildWorkflow } from './BuildWorkflow.js';\nimport { BuildConfigError } from './errors/BuildConfigError.js';\nimport { BuildWorkflowError } from './errors/BuildWorkflowError.js';\nimport { findOutputPaths } from './utils/template.js';\n\nexport class BuildWorkflowValidator {\n constructor(private readonly workflow: BuildWorkflow) {}\n\n public validate(): void {\n const errors: BuildConfigError[] = [];\n errors.push(...this.validateUniqueStepIds());\n errors.push(...this.validateInputs());\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 visitedStepIdsSet = new Set<string>();\n const duplicatedStepIdsSet = new Set<string>();\n for (const stepId of stepIds) {\n if (visitedStepIdsSet.has(stepId)) {\n duplicatedStepIdsSet.add(stepId);\n } else {\n visitedStepIdsSet.add(stepId);\n }\n }\n const duplicatedStepIds = [...duplicatedStepIdsSet];\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 stepByStepId: Record<string, BuildStep> = {};\n for (const step of this.workflow.buildSteps) {\n for (const input of step.inputs ?? []) {\n if (input.defaultValue === undefined) {\n continue;\n }\n const paths = findOutputPaths(input.defaultValue);\n for (const { stepId, outputId } of paths) {\n if (!(stepId in stepByStepId)) {\n if (allStepIds.has(stepId)) {\n const error = new BuildConfigError(\n `Input parameter \"${input.id}\" for step \"${step.id}\" uses an expression that references an output parameter from the future step \"${stepId}\".`\n );\n errors.push(error);\n } else {\n const error = new BuildConfigError(\n `Input parameter \"${input.id}\" for step \"${step.id}\" uses an expression that references an output parameter from a non-existent step \"${stepId}\".`\n );\n errors.push(error);\n }\n } else {\n if (!stepByStepId[stepId].hasOutputParameter(outputId)) {\n const error = new BuildConfigError(\n `Input parameter \"${input.id}\" for step \"${step.id}\" uses an expression that references an undefined output parameter \"${outputId}\" from step \"${stepId}\".`\n );\n errors.push(error);\n }\n }\n }\n }\n stepByStepId[step.id] = step;\n }\n\n return errors;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { createLogger } from '@expo/logger';
|
|
4
|
-
import arg from 'arg';
|
|
5
|
-
import { nullthrows } from '../utils/nullthrows.js';
|
|
6
|
-
import { BuildArtifactType } from '../BuildArtifacts.js';
|
|
7
|
-
import { BuildStepContext } from '../BuildStepContext.js';
|
|
8
|
-
import { saveArtifactToTemporaryDirectoryAsync } from '../BuildTemporaryFiles.js';
|
|
9
|
-
const args = arg({
|
|
10
|
-
'--type': String,
|
|
11
|
-
});
|
|
12
|
-
const artifactPathArg = nullthrows((_a = args._) === null || _a === void 0 ? void 0 : _a[0], 'upload-artifact must be run with the artifact path, e.g. "upload-artifact path/to/app.ipa"');
|
|
13
|
-
const artifactPath = path.resolve(process.cwd(), artifactPathArg);
|
|
14
|
-
const logger = createLogger({
|
|
15
|
-
name: 'eas-build',
|
|
16
|
-
level: 'info',
|
|
17
|
-
});
|
|
18
|
-
const ctx = new BuildStepContext(nullthrows(process.env.__EXPO_STEPS_BUILD_ID, 'Set __EXPO_STEPS_BUILD_ID.'), logger, false, nullthrows(process.env.__EXPO_STEPS_WORKING_DIRECTORY, 'Set __EXPO_STEPS_BUILD_ID.'));
|
|
19
|
-
const rawType = args['--type'];
|
|
20
|
-
const type = rawType !== null && rawType !== void 0 ? rawType : BuildArtifactType.APPLICATION_ARCHIVE;
|
|
21
|
-
saveArtifactToTemporaryDirectoryAsync(ctx, type, artifactPath).catch((err) => {
|
|
22
|
-
console.error(`Failed preparing "${artifactPath}" for upload.`, err);
|
|
23
|
-
process.exit(2);
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=uploadArtifact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uploadArtifact.js","sourceRoot":"","sources":["../../src/bin/uploadArtifact.ts"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAElF,MAAM,IAAI,GAAG,GAAG,CAAC;IACf,QAAQ,EAAE,MAAM;CACjB,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,UAAU,CAChC,MAAA,IAAI,CAAC,CAAC,0CAAG,CAAC,CAAC,EACX,4FAA4F,CAC7F,CAAC;AACF,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;AAElE,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,MAAM,GAAG,GAAG,IAAI,gBAAgB,CAC9B,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,4BAA4B,CAAC,EAC3E,MAAM,EACN,KAAK,EACL,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,4BAA4B,CAAC,CACrF,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAkC,CAAC;AAChE,MAAM,IAAI,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,iBAAiB,CAAC,mBAAmB,CAAC;AAE9D,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC3E,OAAO,CAAC,KAAK,CAAC,qBAAqB,YAAY,eAAe,EAAE,GAAG,CAAC,CAAC;IACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport { createLogger } from '@expo/logger';\nimport arg from 'arg';\n\nimport { nullthrows } from '../utils/nullthrows.js';\nimport { BuildArtifactType } from '../BuildArtifacts.js';\nimport { BuildStepContext } from '../BuildStepContext.js';\nimport { saveArtifactToTemporaryDirectoryAsync } from '../BuildTemporaryFiles.js';\n\nconst args = arg({\n '--type': String,\n});\n\nconst artifactPathArg = nullthrows(\n args._?.[0],\n 'upload-artifact must be run with the artifact path, e.g. \"upload-artifact path/to/app.ipa\"'\n);\nconst artifactPath = path.resolve(process.cwd(), artifactPathArg);\n\nconst logger = createLogger({\n name: 'eas-build',\n level: 'info',\n});\n\nconst ctx = new BuildStepContext(\n nullthrows(process.env.__EXPO_STEPS_BUILD_ID, 'Set __EXPO_STEPS_BUILD_ID.'),\n logger,\n false,\n nullthrows(process.env.__EXPO_STEPS_WORKING_DIRECTORY, 'Set __EXPO_STEPS_BUILD_ID.')\n);\n\nconst rawType = args['--type'] as BuildArtifactType | undefined;\nconst type = rawType ?? BuildArtifactType.APPLICATION_ARCHIVE;\n\nsaveArtifactToTemporaryDirectoryAsync(ctx, type, artifactPath).catch((err) => {\n console.error(`Failed preparing \"${artifactPath}\" for upload.`, err);\n process.exit(2);\n});\n"]}
|
package/dist_esm/cli/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist_esm/cli/cli.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import { createLogger } from '@expo/logger';
|
|
3
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
-
import { BuildConfigParser } from '../BuildConfigParser.js';
|
|
5
|
-
import { BuildStepContext } from '../BuildStepContext.js';
|
|
6
|
-
const logger = createLogger({
|
|
7
|
-
name: 'steps-cli',
|
|
8
|
-
level: 'info',
|
|
9
|
-
});
|
|
10
|
-
async function runAsync(configPath, workingDirectory) {
|
|
11
|
-
const fakeBuildId = uuidv4();
|
|
12
|
-
const ctx = new BuildStepContext(fakeBuildId, logger, false, workingDirectory);
|
|
13
|
-
const parser = new BuildConfigParser(ctx, { configPath });
|
|
14
|
-
const workflow = await parser.parseAsync();
|
|
15
|
-
await workflow.executeAsync();
|
|
16
|
-
const artifacts = await workflow.collectArtifactsAsync();
|
|
17
|
-
if (Object.keys(artifacts).length > 0) {
|
|
18
|
-
logger.info({ artifacts }, 'The workflow produced artifacts');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const relativeConfigPath = process.argv[2];
|
|
22
|
-
const relativeWorkingDirectoryPath = process.argv[3];
|
|
23
|
-
if (!relativeConfigPath && !relativeWorkingDirectoryPath) {
|
|
24
|
-
console.error('Usage: yarn cli config.yml path/to/working/directory');
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
const configPath = path.resolve(process.cwd(), relativeConfigPath);
|
|
28
|
-
const workingDirectory = path.resolve(process.cwd(), relativeWorkingDirectoryPath);
|
|
29
|
-
runAsync(configPath, workingDirectory).catch((err) => {
|
|
30
|
-
logger.error({ err }, 'Build failed');
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=cli.js.map
|
package/dist_esm/cli/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,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AO,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC;AACnE,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,4BAA4B,CAAC,CAAC;AAEnF,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnD,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport { createLogger } from '@expo/logger';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BuildConfigParser } from '../BuildConfigParser.js';\nimport { BuildStepContext } from '../BuildStepContext.js';\n\nconst logger = createLogger({\n name: 'steps-cli',\n level: 'info',\n});\n\nasync function runAsync(configPath: string, workingDirectory: string): Promise<void> {\n const fakeBuildId = uuidv4();\n const ctx = new BuildStepContext(fakeBuildId, logger, false, workingDirectory);\n const parser = new BuildConfigParser(ctx, { configPath });\n const workflow = await parser.parseAsync();\n await workflow.executeAsync();\n const artifacts = await workflow.collectArtifactsAsync();\n if (Object.keys(artifacts).length > 0) {\n logger.info({ artifacts }, 'The workflow produced artifacts');\n }\n}\n\nconst relativeConfigPath = process.argv[2];\nconst relativeWorkingDirectoryPath = process.argv[3];\n\nif (!relativeConfigPath && !relativeWorkingDirectoryPath) {\n console.error('Usage: yarn cli config.yml path/to/working/directory');\n process.exit(1);\n}\n\nconst configPath = path.resolve(process.cwd(), relativeConfigPath);\nconst workingDirectory = path.resolve(process.cwd(), relativeWorkingDirectoryPath);\n\nrunAsync(configPath, workingDirectory).catch((err) => {\n logger.error({ err }, 'Build failed');\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildConfigError.js","sourceRoot":"","sources":["../../src/errors/BuildConfigError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,OAAO,gBAAiB,SAAQ,SAAS;CAAG","sourcesContent":["import { UserError } from './UserError.js';\n\nexport class BuildConfigError extends UserError {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildInternalError.js","sourceRoot":"","sources":["../../src/errors/BuildInternalError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;CAAG","sourcesContent":["export class BuildInternalError extends Error {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildStepRuntimeError.js","sourceRoot":"","sources":["../../src/errors/BuildStepRuntimeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;CAAG","sourcesContent":["import { UserError } from './UserError.js';\n\nexport class BuildStepRuntimeError extends UserError {}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BuildConfigError } from './BuildConfigError.js';
|
|
2
|
-
import { UserError } from './UserError.js';
|
|
3
|
-
export declare class BuildWorkflowError extends UserError {
|
|
4
|
-
readonly message: string;
|
|
5
|
-
readonly errors: BuildConfigError[];
|
|
6
|
-
constructor(message: string, errors: BuildConfigError[], extra?: {
|
|
7
|
-
metadata?: object;
|
|
8
|
-
cause?: Error;
|
|
9
|
-
});
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { UserError } from './UserError.js';
|
|
2
|
-
export class BuildWorkflowError extends UserError {
|
|
3
|
-
constructor(message, errors, extra) {
|
|
4
|
-
super(message, extra);
|
|
5
|
-
this.message = message;
|
|
6
|
-
this.errors = errors;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=BuildWorkflowError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildWorkflowError.js","sourceRoot":"","sources":["../../src/errors/BuildWorkflowError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,YAC2B,OAAe,EACxB,MAA0B,EAC1C,KAGC;QAED,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAPG,YAAO,GAAP,OAAO,CAAQ;QACxB,WAAM,GAAN,MAAM,CAAoB;IAO5C,CAAC;CACF","sourcesContent":["import { BuildConfigError } from './BuildConfigError.js';\nimport { UserError } from './UserError.js';\n\nexport class BuildWorkflowError extends UserError {\n constructor(\n public override readonly message: string,\n public readonly errors: BuildConfigError[],\n extra?: {\n metadata?: object;\n cause?: Error;\n }\n ) {\n super(message, extra);\n }\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export class UserError extends Error {
|
|
2
|
-
constructor(message, extra) {
|
|
3
|
-
var _a;
|
|
4
|
-
super(message);
|
|
5
|
-
this.message = message;
|
|
6
|
-
this.metadata = (_a = extra === null || extra === void 0 ? void 0 : extra.cause) !== null && _a !== void 0 ? _a : {};
|
|
7
|
-
this.cause = extra === null || extra === void 0 ? void 0 : extra.cause;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=UserError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserError.js","sourceRoot":"","sources":["../../src/errors/UserError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,SAAU,SAAQ,KAAK;IAI3C,YAC2B,OAAe,EACxC,KAGC;;QAED,KAAK,CAAC,OAAO,CAAC,CAAC;QANU,YAAO,GAAP,OAAO,CAAQ;QAOxC,IAAI,CAAC,QAAQ,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,mCAAI,EAAE,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC;IAC5B,CAAC;CACF","sourcesContent":["export abstract class UserError extends Error {\n public readonly cause?: Error;\n public readonly metadata: object;\n\n constructor(\n public override readonly message: string,\n extra?: {\n metadata?: object;\n cause?: Error;\n }\n ) {\n super(message);\n this.metadata = extra?.cause ?? {};\n this.cause = extra?.cause;\n }\n}\n"]}
|
package/dist_esm/index.d.ts
DELETED
package/dist_esm/index.js
DELETED
package/dist_esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { BuildArtifactType } from './BuildArtifacts.js';\nexport { BuildConfigParser } from './BuildConfigParser.js';\nexport { BuildStepContext } from './BuildStepContext.js';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function uniq<T = any>(items: T[]): T[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniq.js","sourceRoot":"","sources":["../../../src/utils/expodash/uniq.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,IAAI,CAAU,KAAU;IACtC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;AAClB,CAAC","sourcesContent":["export function uniq<T = any>(items: T[]): T[] {\n const set = new Set(items);\n return [...set];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function nullthrows<T>(value: T | null | undefined, message?: string): NonNullable<T>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export function nullthrows(value, message) {
|
|
2
|
-
if (value != null) {
|
|
3
|
-
return value;
|
|
4
|
-
}
|
|
5
|
-
throw new TypeError(message !== null && message !== void 0 ? message : `Expected value not to be null or undefined but got ${value}`);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=nullthrows.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullthrows.js","sourceRoot":"","sources":["../../src/utils/nullthrows.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAI,KAA2B,EAAE,OAAgB;IACzE,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IACD,MAAM,IAAI,SAAS,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,sDAAsD,KAAK,EAAE,CAAC,CAAC;AAChG,CAAC","sourcesContent":["export function nullthrows<T>(value: T | null | undefined, message?: string): NonNullable<T> {\n if (value != null) {\n return value;\n }\n throw new TypeError(message ?? `Expected value not to be null or undefined but got ${value}`);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const BIN_PATH: string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../src/utils/shell/bin.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;AAE5B,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import path from 'path';\n\nimport { createContext } from 'this-file';\n\nconst ctx = createContext();\n\nexport const BIN_PATH = path.join(ctx.dirname, '../../../bin');\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import os from 'os';
|
|
2
|
-
// stolen from https://circleci.com/docs/configuration-reference/
|
|
3
|
-
const DEFAULT_SHELL = '/bin/bash -eo pipefail';
|
|
4
|
-
const SHELL_BY_PLATFORM = {
|
|
5
|
-
darwin: '/bin/bash --login -eo pipefail',
|
|
6
|
-
};
|
|
7
|
-
export function getDefaultShell(platform = os.platform()) {
|
|
8
|
-
const platformSpecificShell = SHELL_BY_PLATFORM[platform];
|
|
9
|
-
if (platformSpecificShell) {
|
|
10
|
-
return platformSpecificShell;
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
return DEFAULT_SHELL;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export function getShellCommandAndArgs(shell, script) {
|
|
17
|
-
const splits = shell.split(' ');
|
|
18
|
-
const command = splits[0];
|
|
19
|
-
const args = [...splits.slice(1)];
|
|
20
|
-
if (script) {
|
|
21
|
-
args.push(script);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
command,
|
|
25
|
-
args,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/utils/shell/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,iEAAiE;AACjE,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAC/C,MAAM,iBAAiB,GAA6C;IAClE,MAAM,EAAE,gCAAgC;CACzC,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,WAA4B,EAAE,CAAC,QAAQ,EAAE;IACvE,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC1D,IAAI,qBAAqB,EAAE;QACzB,OAAO,qBAAqB,CAAC;KAC9B;SAAM;QACL,OAAO,aAAa,CAAC;KACtB;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAa,EACb,MAAe;IAEf,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,MAAM,EAAE;QACV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACnB;IACD,OAAO;QACL,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC","sourcesContent":["import os from 'os';\n\n// stolen from https://circleci.com/docs/configuration-reference/\nconst DEFAULT_SHELL = '/bin/bash -eo pipefail';\nconst SHELL_BY_PLATFORM: Partial<Record<NodeJS.Platform, string>> = {\n darwin: '/bin/bash --login -eo pipefail',\n};\n\nexport function getDefaultShell(platform: NodeJS.Platform = os.platform()): string {\n const platformSpecificShell = SHELL_BY_PLATFORM[platform];\n if (platformSpecificShell) {\n return platformSpecificShell;\n } else {\n return DEFAULT_SHELL;\n }\n}\n\nexport function getShellCommandAndArgs(\n shell: string,\n script?: string\n): { command: string; args?: string[] } {\n const splits = shell.split(' ');\n const command = splits[0];\n const args = [...splits.slice(1)];\n if (script) {\n args.push(script);\n }\n return {\n command,\n args,\n };\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { bunyan, PipeMode } from '@expo/logger';
|
|
2
|
-
import { SpawnResult, SpawnPromise, SpawnOptions as SpawnOptionsOriginal } from '@expo/spawn-async';
|
|
3
|
-
type SpawnOptions = SpawnOptionsOriginal & {
|
|
4
|
-
logger?: bunyan;
|
|
5
|
-
lineTransformer?: (line: string) => string | null;
|
|
6
|
-
mode?: PipeMode;
|
|
7
|
-
};
|
|
8
|
-
export declare function spawnAsync(command: string, args: string[], allOptions?: SpawnOptions): SpawnPromise<SpawnResult>;
|
|
9
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { pipeSpawnOutput } from '@expo/logger';
|
|
2
|
-
import spawnAsyncOriginal from '@expo/spawn-async';
|
|
3
|
-
// eslint-disable-next-line async-protect/async-suffix
|
|
4
|
-
export function spawnAsync(command, args, allOptions = {
|
|
5
|
-
stdio: 'inherit',
|
|
6
|
-
cwd: process.cwd(),
|
|
7
|
-
}) {
|
|
8
|
-
const { logger, ...options } = allOptions;
|
|
9
|
-
if (logger) {
|
|
10
|
-
options.stdio = 'pipe';
|
|
11
|
-
}
|
|
12
|
-
const promise = spawnAsyncOriginal(command, args, options);
|
|
13
|
-
if (logger && promise.child) {
|
|
14
|
-
pipeSpawnOutput(logger, promise.child, options);
|
|
15
|
-
}
|
|
16
|
-
return promise;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=spawn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../src/utils/shell/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AACjE,OAAO,kBAIN,MAAM,mBAAmB,CAAC;AAQ3B,sDAAsD;AACtD,MAAM,UAAU,UAAU,CACxB,OAAe,EACf,IAAc,EACd,aAA2B;IACzB,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;CACnB;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC;IAC1C,IAAI,MAAM,EAAE;QACV,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;KACxB;IACD,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,IAAI,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE;QAC3B,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;KACjD;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { pipeSpawnOutput, bunyan, PipeMode } from '@expo/logger';\nimport spawnAsyncOriginal, {\n SpawnResult,\n SpawnPromise,\n SpawnOptions as SpawnOptionsOriginal,\n} from '@expo/spawn-async';\n\ntype SpawnOptions = SpawnOptionsOriginal & {\n logger?: bunyan;\n lineTransformer?: (line: string) => string | null;\n mode?: PipeMode;\n};\n\n// eslint-disable-next-line async-protect/async-suffix\nexport function spawnAsync(\n command: string,\n args: string[],\n allOptions: SpawnOptions = {\n stdio: 'inherit',\n cwd: process.cwd(),\n }\n): SpawnPromise<SpawnResult> {\n const { logger, ...options } = allOptions;\n if (logger) {\n options.stdio = 'pipe';\n }\n const promise = spawnAsyncOriginal(command, args, options);\n if (logger && promise.child) {\n pipeSpawnOutput(logger, promise.child, options);\n }\n return promise;\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const BUILD_STEP_INPUT_EXPRESSION_REGEXP: RegExp;
|
|
2
|
-
export declare const BUILD_STEP_OUTPUT_EXPRESSION_REGEXP: RegExp;
|
|
3
|
-
export declare function interpolateWithInputs(templateString: string, inputs: Record<string, string>): string;
|
|
4
|
-
export declare function interpolateWithOutputs(templateString: string, fn: (path: string) => string): string;
|
|
5
|
-
interface BuildOutputPath {
|
|
6
|
-
stepId: string;
|
|
7
|
-
outputId: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function findOutputPaths(templateString: string): BuildOutputPath[];
|
|
10
|
-
export declare function parseOutputPath(outputPath: string): BuildOutputPath;
|
|
11
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { BuildConfigError } from '../errors/BuildConfigError.js';
|
|
2
|
-
import { nullthrows } from './nullthrows.js';
|
|
3
|
-
export const BUILD_STEP_INPUT_EXPRESSION_REGEXP = /\${\s*inputs\.([\S]+)\s*}/;
|
|
4
|
-
export const BUILD_STEP_OUTPUT_EXPRESSION_REGEXP = /\${\s*steps\.([\S]+)\s*}/;
|
|
5
|
-
export function interpolateWithInputs(templateString, inputs) {
|
|
6
|
-
return interpolate(templateString, BUILD_STEP_INPUT_EXPRESSION_REGEXP, inputs);
|
|
7
|
-
}
|
|
8
|
-
export function interpolateWithOutputs(templateString, fn) {
|
|
9
|
-
return interpolate(templateString, BUILD_STEP_OUTPUT_EXPRESSION_REGEXP, fn);
|
|
10
|
-
}
|
|
11
|
-
function interpolate(templateString, regex, varsOrFn) {
|
|
12
|
-
const matched = templateString.match(new RegExp(regex, 'g'));
|
|
13
|
-
if (!matched) {
|
|
14
|
-
return templateString;
|
|
15
|
-
}
|
|
16
|
-
let result = templateString;
|
|
17
|
-
for (const match of matched) {
|
|
18
|
-
const [, key] = nullthrows(match.match(regex));
|
|
19
|
-
const value = typeof varsOrFn === 'function' ? varsOrFn(key) : varsOrFn[key];
|
|
20
|
-
result = result.replace(match, value);
|
|
21
|
-
}
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
export function findOutputPaths(templateString) {
|
|
25
|
-
const result = [];
|
|
26
|
-
const matches = templateString.matchAll(new RegExp(BUILD_STEP_OUTPUT_EXPRESSION_REGEXP, 'g'));
|
|
27
|
-
for (const match of matches) {
|
|
28
|
-
result.push(parseOutputPath(match[1]));
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
export function parseOutputPath(outputPath) {
|
|
33
|
-
const splits = outputPath.split('.');
|
|
34
|
-
if (splits.length !== 2) {
|
|
35
|
-
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: "${outputPath}"`);
|
|
36
|
-
}
|
|
37
|
-
const [stepId, outputId] = splits;
|
|
38
|
-
return { stepId, outputId };
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/utils/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,MAAM,kCAAkC,GAAG,2BAA2B,CAAC;AAC9E,MAAM,CAAC,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AAE9E,M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xC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,MAAM,IAAI,gBAAgB,CACxB,gKAAgK,UAAU,GAAG,CAC9K,CAAC;KACH;IACD,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import { BuildConfigError } from '../errors/BuildConfigError.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*}/;\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(\n templateString: string,\n fn: (path: string) => string\n): string {\n return interpolate(templateString, BUILD_STEP_OUTPUT_EXPRESSION_REGEXP, fn);\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 [, key] = nullthrows(match.match(regex));\n const value = typeof varsOrFn === 'function' ? varsOrFn(key) : varsOrFn[key];\n result = result.replace(match, value);\n }\n return result;\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(outputPath: string): BuildOutputPath {\n const splits = outputPath.split('.');\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: \"${outputPath}\"`\n );\n }\n const [stepId, outputId] = splits;\n return { stepId, outputId };\n}\n"]}
|