eoas 1.0.39 → 2.0.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.
@@ -17,7 +17,7 @@ class GenerateCerts extends core_1.Command {
17
17
  message: 'In which directory would you like to store your code signing certificate (used by your expo app)?',
18
18
  name: 'certificateOutputDir',
19
19
  type: 'text',
20
- initial: './certs',
20
+ initial: './keysStore',
21
21
  validate: v => {
22
22
  try {
23
23
  // eslint-disable-next-line
@@ -30,10 +30,10 @@ class GenerateCerts extends core_1.Command {
30
30
  },
31
31
  });
32
32
  const { keyOutputDir } = await (0, prompts_1.promptAsync)({
33
- message: 'In which directory would you like to store your key pair (used by your OTA Server) ?. ⚠️ Those certss are sensitive and should be kept private.',
33
+ message: 'In which directory would you like to store your key pair (used by your OTA Server) ?. ⚠️ Those keysStore are sensitive and should be kept private.',
34
34
  name: 'keyOutputDir',
35
35
  type: 'text',
36
- initial: './certs',
36
+ initial: './keysStore',
37
37
  validate: v => {
38
38
  try {
39
39
  // eslint-disable-next-line
@@ -49,19 +49,19 @@ class Init extends core_1.Command {
49
49
  }
50
50
  }
51
51
  const confirmed = await (0, prompts_1.confirmAsync)({
52
- message: 'Do you have already generated your certificates for code signing?',
52
+ message: 'Do you have already generated your certificates and keysStore for code signing?',
53
53
  name: 'certificates',
54
54
  type: 'confirm',
55
55
  });
56
56
  if (!confirmed) {
57
- log_1.default.fail('You need to generate your certificates first by using npx eoas generate-certs');
57
+ log_1.default.fail('You need to generate your certificates first by using npx eoas generate-keysStore');
58
58
  return;
59
59
  }
60
60
  const { codeSigningCertificatePath } = await (0, prompts_1.promptAsync)({
61
- message: 'Enter the path to your code signing certificate (ex: ./certs/certificate.pem)',
61
+ message: 'Enter the path to your code signing certificate (ex: ./keysStore/certificate.pem)',
62
62
  name: 'codeSigningCertificatePath',
63
63
  type: 'text',
64
- initial: './certs/certificate.pem',
64
+ initial: './keysStore/certificate.pem',
65
65
  validate: v => {
66
66
  try {
67
67
  const fullPath = path_1.default.resolve(projectDir, v);
@@ -61,17 +61,17 @@ class Publish extends core_1.Command {
61
61
  const credentials = (0, auth_1.retrieveExpoCredentials)();
62
62
  if (!credentials.token && !credentials.sessionSecret) {
63
63
  log_1.default.error('You are not logged to eas, please run `eas login`');
64
- process.exit(1);
64
+ return;
65
65
  }
66
66
  const { flags } = await this.parse(Publish);
67
67
  const { platform, nonInteractive, branch, channel } = this.sanitizeFlags(flags);
68
68
  if (!branch) {
69
69
  log_1.default.error('Branch name is required');
70
- process.exit(1);
70
+ return;
71
71
  }
72
72
  if (!channel) {
73
73
  log_1.default.error('Channel name is required');
74
- process.exit(1);
74
+ return;
75
75
  }
76
76
  await this.vcsClient.ensureRepoExistsAsync();
77
77
  await (0, repo_1.ensureRepoIsCleanAsync)(this.vcsClient, nonInteractive);
@@ -79,7 +79,7 @@ class Publish extends core_1.Command {
79
79
  const hasExpo = (0, package_1.isExpoInstalled)(projectDir);
80
80
  if (!hasExpo) {
81
81
  log_1.default.error('Expo is not installed in this project. Please install Expo first.');
82
- process.exit(1);
82
+ return;
83
83
  }
84
84
  const privateConfig = await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir, {
85
85
  env: {
@@ -89,7 +89,7 @@ class Publish extends core_1.Command {
89
89
  const updateUrl = (0, expoConfig_1.getExpoConfigUpdateUrl)(privateConfig);
90
90
  if (!updateUrl) {
91
91
  log_1.default.error("Update url is not setup in your config. Please run 'eoas init' to setup the update url");
92
- process.exit(1);
92
+ return;
93
93
  }
94
94
  let baseUrl;
95
95
  try {
@@ -98,7 +98,7 @@ class Publish extends core_1.Command {
98
98
  }
99
99
  catch (e) {
100
100
  log_1.default.error('Invalid URL', e);
101
- process.exit(1);
101
+ return;
102
102
  }
103
103
  if (!nonInteractive) {
104
104
  const confirmed = await (0, prompts_1.confirmAsync)({
@@ -108,10 +108,9 @@ class Publish extends core_1.Command {
108
108
  });
109
109
  if (!confirmed) {
110
110
  log_1.default.error('Please run `eoas init` to setup the correct update url');
111
- process.exit(1);
112
111
  }
113
112
  }
114
- const runtimeSpinner = (0, ora_1.ora)('🔄 Resolving runtime version...').start();
113
+ const runtimeSpinner = (0, ora_1.ora)('Resolving runtime version').start();
115
114
  const runtimeVersions = [
116
115
  ...(!platform || platform === expoConfig_1.RequestedPlatform.All || platform === expoConfig_1.RequestedPlatform.Ios
117
116
  ? [
@@ -143,10 +142,10 @@ class Publish extends core_1.Command {
143
142
  if (!runtimeVersions.length) {
144
143
  runtimeSpinner.fail('Could not resolve runtime versions for the requested platforms');
145
144
  log_1.default.error('Could not resolve runtime versions for the requested platforms');
146
- process.exit(1);
145
+ return;
147
146
  }
148
- runtimeSpinner.succeed('Runtime versions resolved');
149
- const exportSpinner = (0, ora_1.ora)('📦 Exporting project files...').start();
147
+ runtimeSpinner.succeed('Runtime versions resolved');
148
+ const exportSpinner = (0, ora_1.ora)("Exporting project's static files").start();
150
149
  try {
151
150
  await (0, spawn_async_1.default)('rm', ['-rf', 'dist'], { cwd: projectDir });
152
151
  const { stdout } = await (0, spawn_async_1.default)('npx', ['expo', 'export', '--output-dir', 'dist'], {
@@ -156,30 +155,28 @@ class Publish extends core_1.Command {
156
155
  EXPO_NO_DOTENV: '1',
157
156
  },
158
157
  });
159
- exportSpinner.succeed('🚀 Project exported successfully');
158
+ exportSpinner.succeed('Project exported successfully');
160
159
  log_1.default.withInfo(stdout);
161
160
  }
162
161
  catch {
163
- exportSpinner.fail('Failed to export the project');
164
- process.exit(1);
162
+ exportSpinner.fail('Failed to export the project');
165
163
  }
166
164
  const publicConfig = await (0, expoConfig_1.getPublicExpoConfigAsync)(projectDir, {
167
165
  skipSDKVersionRequirement: true,
168
166
  });
169
167
  if (!publicConfig) {
170
168
  log_1.default.error('Could not find Expo config in this project. Please make sure you have an Expo config.');
171
- process.exit(1);
169
+ return;
172
170
  }
173
171
  // eslint-disable-next-line
174
172
  fs_extra_1.default.writeJsonSync(path_1.default.join(projectDir, 'dist', 'expoConfig.json'), publicConfig, {
175
173
  spaces: 2,
176
174
  });
177
175
  log_1.default.withInfo('expoConfig.json file created in dist directory');
178
- const uploadFilesSpinner = (0, ora_1.ora)('📤 Uploading files...').start();
176
+ const uploadFilesSpinner = (0, ora_1.ora)('Uploading files to the server').start();
179
177
  const files = (0, assets_1.computeFilesRequests)(projectDir, platform || expoConfig_1.RequestedPlatform.All);
180
178
  if (!files.length) {
181
179
  uploadFilesSpinner.fail('No files to upload');
182
- process.exit(1);
183
180
  }
184
181
  try {
185
182
  const uploadUrls = await Promise.all(runtimeVersions.map(runtimeVersion => {
@@ -237,22 +234,16 @@ class Publish extends core_1.Command {
237
234
  body: buffer,
238
235
  });
239
236
  if (!response.ok) {
240
- log_1.default.error(' File upload failed', await response.text());
241
- process.exit(1);
237
+ log_1.default.error('Failed to upload file', await response.text());
238
+ throw new Error('Failed to upload file');
242
239
  }
243
240
  file.close();
244
241
  }));
245
- uploadFilesSpinner.succeed('Files uploaded successfully');
242
+ uploadFilesSpinner.succeed('Files uploaded successfully');
246
243
  }
247
244
  catch {
248
- uploadFilesSpinner.fail('Failed to upload static files');
249
- process.exit(1);
245
+ uploadFilesSpinner.fail('Failed to upload static files');
250
246
  }
251
- console.log(`\n✅ Your update has been successfully pushed to ${updateUrl}`);
252
- console.log(`🔗 Channel: \`${channel}\``);
253
- console.log(`🌿 Branch: \`${branch}\``);
254
- console.log(`⏳ Deployed at: \`${new Date().toUTCString()}\`\n`);
255
- console.log('🔥 Your users will receive the latest update automatically!');
256
247
  }
257
248
  }
258
249
  exports.default = Publish;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoas",
3
- "version": "1.0.39",
3
+ "version": "2.0.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.json",