eas-cli 13.2.3 → 13.3.0

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.
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkflowFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs_1 = tslib_1.__importDefault(require("fs"));
6
+ const path_1 = tslib_1.__importDefault(require("path"));
7
+ const url_1 = require("../build/utils/url");
8
+ const WorkflowRevisionMutation_1 = require("../graphql/mutations/WorkflowRevisionMutation");
9
+ const log_1 = tslib_1.__importStar(require("../log"));
10
+ var WorkflowFile;
11
+ (function (WorkflowFile) {
12
+ async function readWorkflowFileContentsAsync({ projectDir, filePath, }) {
13
+ const [yamlFromEasWorkflowsFile, yamlFromFile] = await Promise.allSettled([
14
+ fs_1.default.promises.readFile(path_1.default.join(projectDir, '.eas', 'workflows', filePath), 'utf8'),
15
+ fs_1.default.promises.readFile(path_1.default.join(process.cwd(), filePath), 'utf8'),
16
+ ]);
17
+ // We prioritize .eas/workflows/${file} over ${file}, because
18
+ // in the worst case we'll try to read .eas/workflows/.eas/workflows/test.yml,
19
+ // which is likely not to exist.
20
+ if (yamlFromEasWorkflowsFile.status === 'fulfilled') {
21
+ return {
22
+ yamlConfig: yamlFromEasWorkflowsFile.value,
23
+ filePath: path_1.default.join(projectDir, '.eas', 'workflows', filePath),
24
+ };
25
+ }
26
+ else if (yamlFromFile.status === 'fulfilled') {
27
+ return {
28
+ yamlConfig: yamlFromFile.value,
29
+ filePath: path_1.default.join(process.cwd(), filePath),
30
+ };
31
+ }
32
+ throw yamlFromFile.reason;
33
+ }
34
+ WorkflowFile.readWorkflowFileContentsAsync = readWorkflowFileContentsAsync;
35
+ function maybePrintWorkflowFileValidationErrors({ error, accountName, projectName, }) {
36
+ const validationErrors = error.graphQLErrors.flatMap(e => {
37
+ return WorkflowRevisionMutation_1.WorkflowRevisionMutation.ValidationErrorExtensionZ.safeParse(e.extensions).data ?? [];
38
+ });
39
+ if (validationErrors.length > 0) {
40
+ log_1.default.error('Workflow file is invalid. Issues:');
41
+ for (const validationError of validationErrors) {
42
+ for (const formError of validationError.metadata.formErrors) {
43
+ log_1.default.error(`- ${formError}`);
44
+ }
45
+ for (const [field, fieldErrors] of Object.entries(validationError.metadata.fieldErrors)) {
46
+ log_1.default.error(`- ${field}: ${fieldErrors.join(', ')}`);
47
+ }
48
+ }
49
+ }
50
+ const githubNotFoundError = error.graphQLErrors.find(e => e.extensions.errorCode === 'GITHUB_NOT_FOUND_ERROR');
51
+ if (githubNotFoundError) {
52
+ log_1.default.error(`GitHub repository not found. It is currently required to run workflows.`);
53
+ log_1.default.error(`Please check that the repository exists and that you have access to it. ${(0, log_1.link)((0, url_1.getProjectGitHubSettingsUrl)(accountName, projectName))}`);
54
+ }
55
+ }
56
+ WorkflowFile.maybePrintWorkflowFileValidationErrors = maybePrintWorkflowFileValidationErrors;
57
+ function validateYamlExtension(fileName) {
58
+ const fileExtension = path_1.default.extname(fileName).toLowerCase();
59
+ if (fileExtension !== '.yml' && fileExtension !== '.yaml') {
60
+ throw new Error('File must have a .yml or .yaml extension');
61
+ }
62
+ }
63
+ WorkflowFile.validateYamlExtension = validateYamlExtension;
64
+ })(WorkflowFile || (exports.WorkflowFile = WorkflowFile = {}));
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "13.2.3",
2
+ "version": "13.3.0",
3
3
  "commands": {
4
4
  "analytics": {
5
5
  "id": "analytics",
@@ -3807,6 +3807,33 @@
3807
3807
  "loggedIn": {}
3808
3808
  }
3809
3809
  },
3810
+ "workflow:create": {
3811
+ "id": "workflow:create",
3812
+ "description": "create a new workflow configuration YAML file",
3813
+ "strict": true,
3814
+ "pluginName": "eas-cli",
3815
+ "pluginAlias": "eas-cli",
3816
+ "pluginType": "core",
3817
+ "aliases": [],
3818
+ "flags": {
3819
+ "non-interactive": {
3820
+ "name": "non-interactive",
3821
+ "type": "boolean",
3822
+ "description": "Run the command in non-interactive mode.",
3823
+ "allowNo": false
3824
+ }
3825
+ },
3826
+ "args": {
3827
+ "name": {
3828
+ "name": "name",
3829
+ "description": "Name of the workflow file (must end with .yml or .yaml)",
3830
+ "required": false
3831
+ }
3832
+ },
3833
+ "contextDefinition": {
3834
+ "projectDir": {}
3835
+ }
3836
+ },
3810
3837
  "workflow:run": {
3811
3838
  "id": "workflow:run",
3812
3839
  "description": "Run an EAS workflow",
@@ -3814,8 +3841,6 @@
3814
3841
  "pluginName": "eas-cli",
3815
3842
  "pluginAlias": "eas-cli",
3816
3843
  "pluginType": "core",
3817
- "hidden": true,
3818
- "state": "beta",
3819
3844
  "aliases": [],
3820
3845
  "flags": {
3821
3846
  "non-interactive": {
@@ -3846,15 +3871,27 @@
3846
3871
  "pluginName": "eas-cli",
3847
3872
  "pluginAlias": "eas-cli",
3848
3873
  "pluginType": "core",
3849
- "hidden": true,
3850
3874
  "aliases": [],
3851
- "flags": {},
3875
+ "flags": {
3876
+ "non-interactive": {
3877
+ "name": "non-interactive",
3878
+ "type": "boolean",
3879
+ "description": "Run the command in non-interactive mode.",
3880
+ "allowNo": false
3881
+ }
3882
+ },
3852
3883
  "args": {
3853
3884
  "path": {
3854
3885
  "name": "path",
3855
3886
  "description": "Path to the workflow configuration YAML file (must end with .yml or .yaml)",
3856
3887
  "required": true
3857
3888
  }
3889
+ },
3890
+ "contextDefinition": {
3891
+ "getDynamicPublicProjectConfigAsync": {},
3892
+ "getDynamicPrivateProjectConfigAsync": {},
3893
+ "projectDir": {},
3894
+ "loggedIn": {}
3858
3895
  }
3859
3896
  },
3860
3897
  "build:version:get": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eas-cli",
3
3
  "description": "EAS command line tool",
4
- "version": "13.2.3",
4
+ "version": "13.3.0",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bin": {
7
7
  "eas": "./bin/run"
@@ -182,6 +182,9 @@
182
182
  },
183
183
  "webhook": {
184
184
  "description": "manage webhooks"
185
+ },
186
+ "workflow": {
187
+ "description": "manage workflows"
185
188
  }
186
189
  },
187
190
  "warn-if-update-available": {
@@ -228,5 +231,5 @@
228
231
  "node": "20.11.0",
229
232
  "yarn": "1.22.21"
230
233
  },
231
- "gitHead": "073bdcd575f7e7c383e6f2aa8d877fa98690c060"
234
+ "gitHead": "da727ba17002f203d14cdb624fbb48c08b08fefb"
232
235
  }