@swell/cli 2.9.24 → 2.9.25

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.
@@ -82,6 +82,7 @@ export declare abstract class PushAppCommand extends RemoteAppCommand {
82
82
  logDashboardUrl(flags: {
83
83
  [flag: string]: any;
84
84
  }): void;
85
+ logDeployedStorefrontUrl(): Promise<void>;
85
86
  logStorefrontConnected(): void;
86
87
  logStorefrontFrontendUrl(storefront?: any, branchId?: string): void;
87
88
  logReleaseDetailsHint(error: any): void;
@@ -286,6 +286,9 @@ export class PushAppCommand extends RemoteAppCommand {
286
286
  }
287
287
  await this.handleRequestErrors(async () => this.api.post({ adminPath: `/apps/${this.app.id}/frontend-package` }, { body: { package: serialized } }));
288
288
  this.log(`Deployed managed frontend package ${pkg.digest}.`);
289
+ if (log !== false) {
290
+ await this.logDeployedStorefrontUrl();
291
+ }
289
292
  return;
290
293
  }
291
294
  if (this.app.frontend?.hosting === 'managed' &&
@@ -306,10 +309,10 @@ export class PushAppCommand extends RemoteAppCommand {
306
309
  await this.updateFrontendDeployment(currentStore, projectType, deploymentUrl, deploymentHash);
307
310
  }
308
311
  if (log !== false) {
309
- if (this.app.type === 'storefront' && this.storefront) {
310
- this.logStorefrontFrontendUrl(this.storefront);
312
+ if (this.app.type === 'storefront') {
313
+ await this.logDeployedStorefrontUrl();
311
314
  }
312
- else if (this.app.type !== 'storefront') {
315
+ else {
313
316
  // Get updated app with `installed` property
314
317
  this.app = await this.getApp(this.app.id);
315
318
  this.logAppFrontendUrl();
@@ -737,6 +740,21 @@ export class PushAppCommand extends RemoteAppCommand {
737
740
  const currentStore = localConfig.getDefaultStore();
738
741
  this.log(`View the ${style.appConfigValue(this.app.name)} app in your dashboard at ${style.link(this.dashboardUrl(flags, currentStore))}.`);
739
742
  }
743
+ // `swell app push` deploys without choosing a storefront, so fall back to
744
+ // the app's latest one in this environment
745
+ async logDeployedStorefrontUrl() {
746
+ if (this.app.type !== 'storefront') {
747
+ return;
748
+ }
749
+ // The frontend is already deployed, so a failed lookup only skips the link
750
+ const storefront = this.storefront ||
751
+ (await this.api
752
+ .get({ adminPath: `/apps/${this.app.id}/storefront` })
753
+ .catch(() => null));
754
+ if (storefront) {
755
+ this.logStorefrontFrontendUrl(storefront);
756
+ }
757
+ }
740
758
  logStorefrontConnected() {
741
759
  if (!this.storefront) {
742
760
  this.error('Storefront not connected');
@@ -3606,5 +3606,5 @@
3606
3606
  ]
3607
3607
  }
3608
3608
  },
3609
- "version": "2.9.24"
3609
+ "version": "2.9.25"
3610
3610
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swell/cli",
3
- "version": "2.9.24",
3
+ "version": "2.9.25",
4
4
  "type": "module",
5
5
  "description": "Swell's command line interface/utility",
6
6
  "keywords": [