eas-cli 16.19.3 → 16.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +85 -85
  2. package/build/api.d.ts +1 -0
  3. package/build/api.js +5 -1
  4. package/build/build/android/build.js +1 -3
  5. package/build/build/build.d.ts +3 -3
  6. package/build/build/build.js +11 -4
  7. package/build/build/graphql.d.ts +4 -2
  8. package/build/build/graphql.js +3 -14
  9. package/build/build/ios/build.js +1 -3
  10. package/build/build/metadata.d.ts +1 -2
  11. package/build/build/metadata.js +0 -1
  12. package/build/commandUtils/workflow/validation.d.ts +6 -0
  13. package/build/commandUtils/workflow/validation.js +160 -0
  14. package/build/commands/build/configure.js +2 -19
  15. package/build/commands/env/create.js +0 -1
  16. package/build/commands/project/new.d.ts +33 -0
  17. package/build/commands/project/new.js +349 -0
  18. package/build/commands/project/onboarding.js +1 -1
  19. package/build/commands/update/index.js +1 -5
  20. package/build/commands/workflow/run.js +0 -2
  21. package/build/commands/workflow/validate.d.ts +1 -0
  22. package/build/commands/workflow/validate.js +8 -39
  23. package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
  24. package/build/credentials/ios/appstore/capabilityList.js +18 -8
  25. package/build/graphql/generated.d.ts +0 -6
  26. package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +5 -24
  27. package/build/graphql/mutations/FingerprintMutation.d.ts +2 -3
  28. package/build/log.js +2 -1
  29. package/build/onboarding/installDependencies.d.ts +4 -1
  30. package/build/onboarding/installDependencies.js +13 -5
  31. package/build/project/maybeUploadFingerprintAsync.d.ts +2 -2
  32. package/build/project/maybeUploadFingerprintAsync.js +7 -12
  33. package/build/project/publish.d.ts +5 -5
  34. package/build/project/publish.js +1 -1
  35. package/build/utils/prompts.d.ts +4 -0
  36. package/build/utils/prompts.js +25 -1
  37. package/build/utils/workflowFile.d.ts +1 -3
  38. package/build/utils/workflowFile.js +2 -8
  39. package/oclif.manifest.json +23 -1
  40. package/package.json +6 -6
package/build/api.d.ts CHANGED
@@ -19,4 +19,5 @@ export declare class ApiV2Client {
19
19
  export declare function getExpoApiBaseUrl(): string;
20
20
  export declare function getExpoWebsiteBaseUrl(): string;
21
21
  export declare function getEASUpdateURL(projectId: string, manifestHostOverride: string | null): string;
22
+ export declare function getExpoApiWorkflowSchemaURL(): string;
22
23
  export {};
package/build/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEASUpdateURL = exports.getExpoWebsiteBaseUrl = exports.getExpoApiBaseUrl = exports.ApiV2Client = void 0;
3
+ exports.getExpoApiWorkflowSchemaURL = exports.getEASUpdateURL = exports.getExpoWebsiteBaseUrl = exports.getExpoApiBaseUrl = exports.ApiV2Client = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiV2Error_1 = require("./ApiV2Error");
6
6
  const fetch_1 = tslib_1.__importStar(require("./fetch"));
@@ -105,3 +105,7 @@ function getEASUpdateURL(projectId, manifestHostOverride) {
105
105
  }
106
106
  }
107
107
  exports.getEASUpdateURL = getEASUpdateURL;
108
+ function getExpoApiWorkflowSchemaURL() {
109
+ return getExpoApiBaseUrl() + '/v2/workflows/schema';
110
+ }
111
+ exports.getExpoApiWorkflowSchemaURL = getExpoApiWorkflowSchemaURL;
@@ -18,7 +18,6 @@ const applicationId_1 = require("../../project/android/applicationId");
18
18
  const gradle_1 = require("../../project/android/gradle");
19
19
  const prompts_1 = require("../../prompts");
20
20
  const build_1 = require("../build");
21
- const graphql_2 = require("../graphql");
22
21
  const credentials_1 = require("../utils/credentials");
23
22
  const validate_1 = require("../validate");
24
23
  async function createAndroidContextAsync(ctx) {
@@ -78,8 +77,7 @@ async function prepareAndroidBuildAsync(ctx) {
78
77
  prepareJobAsync: async (ctx, jobData) => {
79
78
  return await (0, prepareJob_1.prepareJobAsync)(ctx, jobData);
80
79
  },
81
- sendBuildRequestAsync: async (appId, job, metadata, buildParams) => {
82
- const graphqlMetadata = (0, graphql_2.transformMetadata)(metadata);
80
+ sendBuildRequestAsync: async (appId, job, graphqlMetadata, buildParams) => {
83
81
  const graphqlJob = (0, graphql_1.transformJob)(job);
84
82
  return await BuildMutation_1.BuildMutation.createAndroidBuildAsync(ctx.graphqlClient, {
85
83
  appId,
@@ -1,8 +1,8 @@
1
- import { ArchiveSource, BuildJob, Metadata, Platform } from '@expo/eas-build-job';
1
+ import { ArchiveSource, BuildJob, Platform } from '@expo/eas-build-job';
2
2
  import { CredentialsSource } from '@expo/eas-json';
3
3
  import { BuildContext } from './context';
4
4
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
5
- import { BuildFragment, BuildParamsInput } from '../graphql/generated';
5
+ import { BuildFragment, BuildMetadataInput, BuildParamsInput } from '../graphql/generated';
6
6
  import { BuildResult } from '../graphql/mutations/BuildMutation';
7
7
  export interface CredentialsResult<Credentials> {
8
8
  source: CredentialsSource.LOCAL | CredentialsSource.REMOTE;
@@ -17,7 +17,7 @@ interface Builder<TPlatform extends Platform, Credentials, TJob extends BuildJob
17
17
  ensureCredentialsAsync(ctx: BuildContext<TPlatform>): Promise<CredentialsResult<Credentials> | undefined>;
18
18
  syncProjectConfigurationAsync(ctx: BuildContext<TPlatform>): Promise<void>;
19
19
  prepareJobAsync(ctx: BuildContext<TPlatform>, jobData: JobData<Credentials>): Promise<BuildJob>;
20
- sendBuildRequestAsync(appId: string, job: TJob, metadata: Metadata, buildParams: BuildParamsInput): Promise<BuildResult>;
20
+ sendBuildRequestAsync(appId: string, job: TJob, metadata: BuildMetadataInput, buildParams: BuildParamsInput): Promise<BuildResult>;
21
21
  }
22
22
  export type BuildRequestSender = () => Promise<BuildFragment | undefined>;
23
23
  export declare function prepareBuildRequestForPlatformAsync<TPlatform extends Platform, Credentials, TJob extends BuildJob>(builder: Builder<TPlatform, Credentials, TJob>): Promise<BuildRequestSender>;
@@ -98,14 +98,21 @@ async function prepareBuildRequestForPlatformAsync(builder) {
98
98
  else if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.INTERNAL) {
99
99
  await BuildMutation_1.BuildMutation.updateBuildMetadataAsync(ctx.graphqlClient, {
100
100
  buildId: (0, nullthrows_1.default)(process.env.EAS_BUILD_ID),
101
- metadata: (0, graphql_1.transformMetadata)(metadata),
101
+ metadata: (0, graphql_1.transformMetadata)({
102
+ metadata,
103
+ fingerprintSource: runtimeAndFingerprintMetadata.fingerprintSource ?? undefined,
104
+ }),
102
105
  });
103
106
  (0, json_1.printJsonOnlyOutput)({ job, metadata });
104
107
  return undefined;
105
108
  }
106
109
  else if (!ctx.localBuildOptions.localBuildMode) {
107
110
  try {
108
- return await sendBuildRequestAsync(builder, job, metadata, buildParams);
111
+ const graphqlMetadata = (0, graphql_1.transformMetadata)({
112
+ metadata,
113
+ fingerprintSource: runtimeAndFingerprintMetadata.fingerprintSource ?? undefined,
114
+ });
115
+ return await sendBuildRequestAsync(builder, job, graphqlMetadata, buildParams);
109
116
  }
110
117
  catch (error) {
111
118
  handleBuildRequestError(error, job.platform);
@@ -221,13 +228,13 @@ async function uploadMetadataFileAsync(projectTarball, ctx) {
221
228
  }
222
229
  }
223
230
  }
224
- async function sendBuildRequestAsync(builder, job, metadata, buildParams) {
231
+ async function sendBuildRequestAsync(builder, job, graphqlMetadata, buildParams) {
225
232
  const { ctx } = builder;
226
233
  return await (0, common_1.withAnalyticsAsync)(ctx.analytics, async () => {
227
234
  if (log_1.default.isDebug) {
228
235
  log_1.default.log(`Starting ${platform_1.requestedPlatformDisplayNames[job.platform]} build`);
229
236
  }
230
- const { build, deprecationInfo } = await builder.sendBuildRequestAsync(ctx.projectId, job, metadata, buildParams);
237
+ const { build, deprecationInfo } = await builder.sendBuildRequestAsync(ctx.projectId, job, graphqlMetadata, buildParams);
231
238
  (0, printBuildInfo_1.printDeprecationWarnings)(deprecationInfo);
232
239
  return build;
233
240
  }, {
@@ -2,8 +2,10 @@ import { ArchiveSource, BuildMode, BuildTrigger, Metadata, Workflow } from '@exp
2
2
  import { LoggerLevel } from '@expo/logger';
3
3
  import { BuildIosEnterpriseProvisioning, BuildMetadataInput, BuildWorkflow, FingerprintSourceInput, BuildMode as GraphQLBuildMode, BuildTrigger as GraphQLBuildTrigger, ProjectArchiveSourceInput, WorkerLoggerLevel } from '../graphql/generated';
4
4
  export declare function transformProjectArchive(archiveSource: ArchiveSource): ProjectArchiveSourceInput;
5
- export declare function transformMetadata(metadata: Metadata): BuildMetadataInput;
6
- export declare function transformFingerprintSource(fingerprintSource: NonNullable<Metadata['fingerprintSource']>): FingerprintSourceInput | null;
5
+ export declare function transformMetadata({ metadata, fingerprintSource, }: {
6
+ metadata: Metadata;
7
+ fingerprintSource: FingerprintSourceInput | undefined;
8
+ }): BuildMetadataInput;
7
9
  export declare function transformWorkflow(workflow: Workflow): BuildWorkflow;
8
10
  export declare function transformIosEnterpriseProvisioning(enterpriseProvisioning: Metadata['iosEnterpriseProvisioning']): BuildIosEnterpriseProvisioning;
9
11
  export declare function transformBuildMode(buildMode: BuildMode): GraphQLBuildMode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loggerLevelToGraphQLWorkerLoggerLevel = exports.transformBuildTrigger = exports.transformBuildMode = exports.transformIosEnterpriseProvisioning = exports.transformWorkflow = exports.transformFingerprintSource = exports.transformMetadata = exports.transformProjectArchive = void 0;
3
+ exports.loggerLevelToGraphQLWorkerLoggerLevel = exports.transformBuildTrigger = exports.transformBuildMode = exports.transformIosEnterpriseProvisioning = exports.transformWorkflow = exports.transformMetadata = exports.transformProjectArchive = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const logger_1 = require("@expo/logger");
@@ -25,10 +25,10 @@ function transformProjectArchive(archiveSource) {
25
25
  }
26
26
  }
27
27
  exports.transformProjectArchive = transformProjectArchive;
28
- function transformMetadata(metadata) {
28
+ function transformMetadata({ metadata, fingerprintSource, }) {
29
29
  return {
30
30
  ...metadata,
31
- fingerprintSource: metadata.fingerprintSource && transformFingerprintSource(metadata.fingerprintSource),
31
+ fingerprintSource,
32
32
  credentialsSource: metadata.credentialsSource && transformCredentialsSource(metadata.credentialsSource),
33
33
  distribution: metadata.distribution && transformDistribution(metadata.distribution),
34
34
  workflow: metadata.workflow && transformWorkflow(metadata.workflow),
@@ -37,17 +37,6 @@ function transformMetadata(metadata) {
37
37
  };
38
38
  }
39
39
  exports.transformMetadata = transformMetadata;
40
- function transformFingerprintSource(fingerprintSource) {
41
- if (fingerprintSource.type !== eas_build_job_1.FingerprintSourceType.GCS) {
42
- return null;
43
- }
44
- return {
45
- type: generated_1.FingerprintSourceType.Gcs,
46
- bucketKey: fingerprintSource.bucketKey,
47
- isDebugFingerprint: fingerprintSource.isDebugFingerprint,
48
- };
49
- }
50
- exports.transformFingerprintSource = transformFingerprintSource;
51
40
  function transformCredentialsSource(credentialsSource) {
52
41
  if (credentialsSource === 'local') {
53
42
  return generated_1.BuildCredentialsSource.Local;
@@ -14,7 +14,6 @@ const exemptEncryption_1 = require("../../project/ios/exemptEncryption");
14
14
  const scheme_1 = require("../../project/ios/scheme");
15
15
  const target_1 = require("../../project/ios/target");
16
16
  const build_1 = require("../build");
17
- const graphql_2 = require("../graphql");
18
17
  const validate_1 = require("../validate");
19
18
  async function createIosContextAsync(ctx) {
20
19
  const { buildProfile, env } = ctx;
@@ -82,8 +81,7 @@ async function prepareIosBuildAsync(ctx) {
82
81
  buildScheme: ctx.ios.xcodeBuildContext.buildScheme,
83
82
  });
84
83
  },
85
- sendBuildRequestAsync: async (appId, job, metadata, buildParams) => {
86
- const graphqlMetadata = (0, graphql_2.transformMetadata)(metadata);
84
+ sendBuildRequestAsync: async (appId, job, graphqlMetadata, buildParams) => {
87
85
  const graphqlJob = (0, graphql_1.transformJob)(job);
88
86
  return await BuildMutation_1.BuildMutation.createIosBuildAsync(ctx.graphqlClient, {
89
87
  appId,
@@ -1,9 +1,8 @@
1
- import { FingerprintSource, Metadata, Platform } from '@expo/eas-build-job';
1
+ import { Metadata, Platform } from '@expo/eas-build-job';
2
2
  import { BuildContext } from './context';
3
3
  export declare function collectMetadataAsync<T extends Platform>(ctx: BuildContext<T>, runtimeAndFingerprintMetadata: {
4
4
  runtimeVersion?: string | undefined;
5
5
  fingerprintHash?: string | undefined;
6
- fingerprintSource?: FingerprintSource | undefined;
7
6
  }): Promise<Metadata>;
8
7
  export declare function getReactNativeVersionAsync(projectDir: string): Promise<string | undefined>;
9
8
  export declare function truncateGitCommitMessage(msg: string | undefined, maxLength?: number): string | undefined;
@@ -26,7 +26,6 @@ async function collectMetadataAsync(ctx, runtimeAndFingerprintMetadata) {
26
26
  sdkVersion: ctx.exp.sdkVersion,
27
27
  runtimeVersion: runtimeAndFingerprintMetadata?.runtimeVersion,
28
28
  fingerprintHash: runtimeAndFingerprintMetadata?.fingerprintHash,
29
- fingerprintSource: runtimeAndFingerprintMetadata?.fingerprintSource,
30
29
  reactNativeVersion: await getReactNativeVersionAsync(ctx.projectDir),
31
30
  ...channelObject,
32
31
  distribution,
@@ -0,0 +1,6 @@
1
+ import { ExpoGraphqlClient } from '../context/contextUtils/createGraphqlClient';
2
+ export declare function validateWorkflowFileAsync(workflowFileContents: {
3
+ yamlConfig: string;
4
+ filePath: string;
5
+ }, projectDir: string, graphqlClient: ExpoGraphqlClient, projectId: string): Promise<void>;
6
+ export declare function logWorkflowValidationErrors(error: unknown): void;
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logWorkflowValidationErrors = exports.validateWorkflowFileAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_json_1 = require("@expo/eas-json");
6
+ const errors_1 = require("@expo/eas-json/build/errors");
7
+ const core_1 = require("@urql/core");
8
+ const fs_1 = require("fs");
9
+ const path_1 = tslib_1.__importDefault(require("path"));
10
+ const YAML = tslib_1.__importStar(require("yaml"));
11
+ const api_1 = require("../../api");
12
+ const WorkflowRevisionMutation_1 = require("../../graphql/mutations/WorkflowRevisionMutation");
13
+ const log_1 = tslib_1.__importDefault(require("../../log"));
14
+ const ajv_1 = require("../../metadata/utils/ajv");
15
+ const workflowFile_1 = require("../../utils/workflowFile");
16
+ const jobTypesWithBuildProfile = new Set(['build', 'repack']);
17
+ const buildProfileIsInterpolated = (profileName) => {
18
+ return profileName.includes('${{') && profileName.includes('}}');
19
+ };
20
+ async function validateWorkflowFileAsync(workflowFileContents, projectDir, graphqlClient, projectId) {
21
+ const parsedYaml = parsedYamlFromWorkflowContents(workflowFileContents);
22
+ log_1.default.debug(`Parsed workflow: ${JSON.stringify(parsedYaml, null, 2)}`);
23
+ // Check if the parsed result is empty or null
24
+ log_1.default.debug(`Validating workflow is not empty...`);
25
+ validateWorkflowIsNotEmpty(parsedYaml);
26
+ const workflowSchema = await fetchWorkflowSchemaAsync();
27
+ // Check that all job types are valid
28
+ log_1.default.debug(`Validating workflow job types...`);
29
+ validateWorkflowJobTypes(parsedYaml, workflowSchema);
30
+ // Check for build jobs that do not match any EAS build profiles
31
+ log_1.default.debug(`Validating workflow build jobs...`);
32
+ await validateWorkflowBuildJobsAsync(parsedYaml, projectDir);
33
+ // Check that result passes validation against workflow schema
34
+ log_1.default.debug(`Validating workflow structure...`);
35
+ validateWorkflowStructure(parsedYaml, workflowSchema);
36
+ // Check for other errors using the server-side validation
37
+ log_1.default.debug(`Validating workflow on server...`);
38
+ await validateWorkflowOnServerAsync(graphqlClient, projectId, workflowFileContents);
39
+ }
40
+ exports.validateWorkflowFileAsync = validateWorkflowFileAsync;
41
+ function logWorkflowValidationErrors(error) {
42
+ if (error instanceof errors_1.MissingEasJsonError) {
43
+ throw new Error('Workflows require a valid eas.json. Please run "eas build:configure" to create it.');
44
+ }
45
+ else if (error instanceof errors_1.InvalidEasJsonError) {
46
+ throw new Error('Workflows require a valid eas.json. Please fix the errors in your eas.json and try again.\n\n' +
47
+ error.message);
48
+ }
49
+ else if (error instanceof YAML.YAMLParseError) {
50
+ log_1.default.error(`YAML syntax error: ${error.message}`);
51
+ }
52
+ else if (error instanceof core_1.CombinedError) {
53
+ workflowFile_1.WorkflowFile.maybePrintWorkflowFileValidationErrors({
54
+ error,
55
+ });
56
+ throw error;
57
+ }
58
+ else if (error instanceof Error) {
59
+ log_1.default.error(`Error: ${error.message}`);
60
+ }
61
+ else {
62
+ log_1.default.error(`Unexpected error: ${String(error)}`);
63
+ }
64
+ }
65
+ exports.logWorkflowValidationErrors = logWorkflowValidationErrors;
66
+ function validateWorkflowIsNotEmpty(parsedYaml) {
67
+ if (parsedYaml === null ||
68
+ parsedYaml === undefined ||
69
+ (typeof parsedYaml === 'object' && Object.keys(parsedYaml).length === 0)) {
70
+ throw new Error('YAML file is empty or contains only comments.');
71
+ }
72
+ }
73
+ async function validateWorkflowOnServerAsync(graphqlClient, projectId, workflowFileContents) {
74
+ await WorkflowRevisionMutation_1.WorkflowRevisionMutation.validateWorkflowYamlConfigAsync(graphqlClient, {
75
+ appId: projectId,
76
+ yamlConfig: workflowFileContents.yamlConfig,
77
+ });
78
+ }
79
+ async function validateWorkflowBuildJobsAsync(parsedYaml, projectDir) {
80
+ const jobs = jobsFromWorkflow(parsedYaml);
81
+ const buildJobs = jobs.filter(job => jobTypesWithBuildProfile.has(job.value.type));
82
+ if (buildJobs.length === 0) {
83
+ return;
84
+ }
85
+ const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
86
+ const buildProfileNames = new Set(easJsonAccessor && (await eas_json_1.EasJsonUtils.getBuildProfileNamesAsync(easJsonAccessor)));
87
+ const invalidBuildJobs = buildJobs.filter(job => !buildProfileNames.has(job.value.params.profile) &&
88
+ // If a profile name is interpolated, we can't check if it's valid until the workflow actually runs
89
+ !buildProfileIsInterpolated(job.value.params.profile));
90
+ if (invalidBuildJobs.length > 0) {
91
+ const invalidBuildProfiles = new Set(invalidBuildJobs.map(job => job.value.params.profile));
92
+ throw new Error(`The build jobs in this workflow refer to the following build profiles that are not present in your eas.json file: ${[
93
+ ...invalidBuildProfiles,
94
+ ].join(', ')}`);
95
+ }
96
+ }
97
+ function validateWorkflowJobTypes(parsedYaml, workflowJsonSchema) {
98
+ const jobs = jobsFromWorkflow(parsedYaml);
99
+ const jobTypes = jobTypesFromWorkflowSchema(workflowJsonSchema);
100
+ const invalidJobs = jobs.filter(job => job.value.type && !jobTypes.includes(job.value.type));
101
+ if (invalidJobs.length > 0) {
102
+ throw new Error(`The following jobs have invalid types: ${invalidJobs
103
+ .map(job => job.key)
104
+ .join(', ')}. Valid types are: ${jobTypes.join(', ')}`);
105
+ }
106
+ }
107
+ function validateWorkflowStructure(parsedYaml, workflowJsonSchema) {
108
+ delete workflowJsonSchema['$schema'];
109
+ const ajv = (0, ajv_1.createValidator)();
110
+ const validate = ajv.compile(workflowJsonSchema);
111
+ const result = validate(parsedYaml);
112
+ if (!result) {
113
+ log_1.default.debug(JSON.stringify({
114
+ errors: validate.errors,
115
+ }, null, 2));
116
+ const readableErrors = (0, ajv_1.getReadableErrors)(validate.errors ?? []);
117
+ const processedErrors = new Set();
118
+ for (const err of readableErrors) {
119
+ if (err.message) {
120
+ processedErrors.add(err.message);
121
+ }
122
+ }
123
+ throw new Error([...processedErrors].join('\n'));
124
+ }
125
+ }
126
+ function parsedYamlFromWorkflowContents(workflowFileContents) {
127
+ const parsedYaml = YAML.parse(workflowFileContents.yamlConfig);
128
+ return parsedYaml;
129
+ }
130
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
131
+ async function fetchWorkflowSchemaAsync() {
132
+ // EXPO_TESTING_WORKFLOW_SCHEMA_PATH is used only for testing against a different schema
133
+ if (process.env.EXPO_TESTING_WORKFLOW_SCHEMA_PATH) {
134
+ const schemaPath = path_1.default.resolve(process.env.EXPO_TESTING_WORKFLOW_SCHEMA_PATH);
135
+ log_1.default.debug(`Loading workflow schema from ${schemaPath}`);
136
+ const jsonString = await fs_1.promises.readFile(schemaPath, 'utf-8');
137
+ const jsonFromFile = JSON.parse(jsonString);
138
+ return jsonFromFile.data;
139
+ }
140
+ // Otherwise, we fetch from <ApiBaseUrl>/v2/workflows/schema
141
+ const schemaUrl = (0, api_1.getExpoApiWorkflowSchemaURL)();
142
+ log_1.default.debug(`Fetching workflow schema from ${schemaUrl}`);
143
+ const response = await fetch(schemaUrl);
144
+ if (!response.ok) {
145
+ throw new Error(`Unable to fetch EAS Workflow schema, received status: ${response.status}`);
146
+ }
147
+ const jsonResponse = (await response.json());
148
+ return jsonResponse.data;
149
+ }
150
+ function jobsFromWorkflow(parsedYaml) {
151
+ return Object.entries(parsedYaml?.jobs).flatMap(([key, value]) => {
152
+ return {
153
+ key,
154
+ value,
155
+ };
156
+ });
157
+ }
158
+ function jobTypesFromWorkflowSchema(workflowJsonSchema) {
159
+ return workflowJsonSchema?.properties?.jobs?.additionalProperties?.anyOf.map((props) => props.properties.type.const);
160
+ }
@@ -12,10 +12,10 @@ const log_1 = tslib_1.__importStar(require("../../log"));
12
12
  const platform_1 = require("../../platform");
13
13
  const projectUtils_1 = require("../../project/projectUtils");
14
14
  const workflow_1 = require("../../project/workflow");
15
- const prompts_1 = require("../../prompts");
16
15
  const UpdatesModule_1 = require("../../update/android/UpdatesModule");
17
16
  const configure_2 = require("../../update/configure");
18
17
  const UpdatesModule_2 = require("../../update/ios/UpdatesModule");
18
+ const prompts_1 = require("../../utils/prompts");
19
19
  class BuildConfigure extends EasCommand_1.default {
20
20
  static description = 'configure the project to support EAS Build';
21
21
  static flags = {
@@ -93,24 +93,7 @@ class BuildConfigure extends EasCommand_1.default {
93
93
  exports.default = BuildConfigure;
94
94
  async function promptForPlatformAsync() {
95
95
  log_1.default.addNewLineIfNone();
96
- const { platform } = await (0, prompts_1.promptAsync)({
97
- type: 'select',
96
+ return await (0, prompts_1.promptPlatformAsync)({
98
97
  message: 'Which platforms would you like to configure for EAS Build?',
99
- name: 'platform',
100
- choices: [
101
- {
102
- title: 'All',
103
- value: platform_1.RequestedPlatform.All,
104
- },
105
- {
106
- title: 'iOS',
107
- value: platform_1.RequestedPlatform.Ios,
108
- },
109
- {
110
- title: 'Android',
111
- value: platform_1.RequestedPlatform.Android,
112
- },
113
- ],
114
98
  });
115
- return platform;
116
99
  }
@@ -130,7 +130,6 @@ class EnvCreate extends EasCommand_1.default {
130
130
  value,
131
131
  visibility,
132
132
  environments,
133
- isGlobal: true, // TODO: every account-wide variable is global for now so it's not user facing
134
133
  type: type ?? generated_1.EnvironmentSecretType.String,
135
134
  }, ownerAccount.id);
136
135
  if (!variable) {
@@ -0,0 +1,33 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
3
+ import { AppFragment } from '../../graphql/generated';
4
+ import { PackageManager } from '../../onboarding/installDependencies';
5
+ import { Choice } from '../../prompts';
6
+ import { Actor } from '../../user/User';
7
+ export declare function promptForTargetDirectoryAsync(targetProjectDirFromArgs?: string): Promise<string>;
8
+ export declare function cloneTemplateAsync(targetProjectDir: string): Promise<string>;
9
+ export declare function installProjectDependenciesAsync(projectDir: string): Promise<PackageManager>;
10
+ export declare function getAccountChoices(actor: Actor, namesWithSufficientPermissions: Set<string>): Choice[];
11
+ export declare function createProjectAsync(graphqlClient: ExpoGraphqlClient, actor: Actor, projectDir: string): Promise<string>;
12
+ export declare function stripInvalidCharactersForBundleIdentifier(string: string): string;
13
+ export declare function generateConfigFilesAsync(projectDir: string, app: AppFragment): Promise<void>;
14
+ export declare function generateAppConfigAsync(projectDir: string, app: AppFragment): Promise<void>;
15
+ export declare function generateEasConfigAsync(projectDir: string): Promise<void>;
16
+ export declare function updatePackageJsonAsync(projectDir: string): Promise<void>;
17
+ export declare function copyProjectTemplatesAsync(projectDir: string): Promise<void>;
18
+ export declare function mergeReadmeAsync(projectDir: string): Promise<void>;
19
+ export declare function initializeGitRepositoryAsync(projectDir: string): Promise<void>;
20
+ export declare const formatScriptCommand: (script: string, packageManager: PackageManager) => string;
21
+ export default class New extends EasCommand {
22
+ static aliases: string[];
23
+ static description: string;
24
+ static flags: {};
25
+ static hidden: boolean;
26
+ static args: {
27
+ name: string;
28
+ }[];
29
+ static contextDefinition: {
30
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
31
+ };
32
+ runAsync(): Promise<void>;
33
+ }