@swell/cli 2.9.3 → 2.9.4
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/dist/push-app-command.d.ts +1 -0
- package/dist/push-app-command.js +10 -14
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -66,6 +66,7 @@ export declare abstract class PushAppCommand extends RemoteAppCommand {
|
|
|
66
66
|
env?: string;
|
|
67
67
|
'storefront-id'?: string;
|
|
68
68
|
'storefront-select'?: boolean;
|
|
69
|
+
yes?: boolean;
|
|
69
70
|
}, defaultStorefront?: any): Promise<void>;
|
|
70
71
|
handleWatchFileChange(configFile: string, configType: ConfigType, event: WatchFileEvent): Promise<void>;
|
|
71
72
|
logAppFrontendUrl(): void;
|
package/dist/push-app-command.js
CHANGED
|
@@ -386,14 +386,9 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
386
386
|
const query = Object.entries(params || {})
|
|
387
387
|
.map(([key, value]) => `${key}=${value}`)
|
|
388
388
|
.join('&');
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}));
|
|
393
|
-
}
|
|
394
|
-
catch {
|
|
395
|
-
// noop
|
|
396
|
-
}
|
|
389
|
+
return this.handleRequestErrors(async () => this.api.get({
|
|
390
|
+
adminPath: `/apps/${this.app.id}/storefront?${query}`,
|
|
391
|
+
}));
|
|
397
392
|
}
|
|
398
393
|
async getAppToPull(args, shouldChoose = true) {
|
|
399
394
|
const { appId, targetPath } = args;
|
|
@@ -402,9 +397,9 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
402
397
|
await this.api.setStoreEnv(currentStore, klass.orientation?.env);
|
|
403
398
|
this.resolveAppPath(appId, targetPath);
|
|
404
399
|
if (isPathDirectory(this.appPath)) {
|
|
405
|
-
this.swellConfig = swellConfig(this.appPath);
|
|
406
|
-
const localAppId = this.swellConfig.get('id');
|
|
407
|
-
const localAppType = this.swellConfig.get('type');
|
|
400
|
+
this.swellConfig = await swellConfig(this.appPath);
|
|
401
|
+
const localAppId = String(this.swellConfig.get('id'));
|
|
402
|
+
const localAppType = String(this.swellConfig.get('type'));
|
|
408
403
|
if (localAppId) {
|
|
409
404
|
if (appId && appId !== localAppId) {
|
|
410
405
|
this.error(`${localAppType === 'theme' ? 'A theme' : 'An app'} already exists in this path with a different ID: ${style.appConfigValue(localAppId)}`);
|
|
@@ -418,7 +413,7 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
418
413
|
? await this.chooseAppToPull()
|
|
419
414
|
: undefined;
|
|
420
415
|
if (shouldChoose) {
|
|
421
|
-
this.swellConfig = swellConfig(this.appPath);
|
|
416
|
+
this.swellConfig = await swellConfig(this.appPath);
|
|
422
417
|
}
|
|
423
418
|
return app;
|
|
424
419
|
}
|
|
@@ -528,7 +523,7 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
528
523
|
: this.storefront.app_id;
|
|
529
524
|
this.app = await this.getApp(appId);
|
|
530
525
|
}
|
|
531
|
-
this.swellConfig = swellConfig(this.appPath);
|
|
526
|
+
this.swellConfig = await swellConfig(this.appPath);
|
|
532
527
|
return this.storefront;
|
|
533
528
|
}
|
|
534
529
|
async getStorefrontToPush(flags = {}) {
|
|
@@ -600,6 +595,7 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
600
595
|
async setStorefrontEnv(flags, defaultStorefront) {
|
|
601
596
|
const currentStore = localConfig.getDefaultStore();
|
|
602
597
|
const targetStorefront = flags['storefront-id'];
|
|
598
|
+
const nonInteractive = flags.yes || false;
|
|
603
599
|
if (defaultStorefront &&
|
|
604
600
|
!targetStorefront &&
|
|
605
601
|
!flags['storefront-id'] &&
|
|
@@ -615,7 +611,7 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
615
611
|
else {
|
|
616
612
|
const hasTestEnv = await this.api.isTestEnvEnabled();
|
|
617
613
|
if (hasTestEnv) {
|
|
618
|
-
const env = await selectEnvironmentId();
|
|
614
|
+
const env = nonInteractive ? 'test' : await selectEnvironmentId();
|
|
619
615
|
await this.api.setStoreEnv(currentStore, env);
|
|
620
616
|
}
|
|
621
617
|
}
|
package/oclif.manifest.json
CHANGED