@swell/cli 2.0.12 → 2.0.13
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/commands/app/dev.d.ts +1 -1
- package/dist/commands/app/dev.js +1 -1
- package/dist/commands/app/push.d.ts +1 -1
- package/dist/commands/app/push.js +1 -1
- package/dist/commands/create/app.d.ts +1 -1
- package/dist/commands/create/app.js +1 -1
- package/dist/commands/theme/dev.d.ts +1 -1
- package/dist/commands/theme/dev.js +1 -1
- package/dist/commands/theme/init.d.ts +1 -1
- package/dist/commands/theme/init.js +1 -1
- package/dist/commands/theme/pull.d.ts +2 -1
- package/dist/commands/theme/pull.js +2 -1
- package/dist/commands/theme/push.d.ts +1 -1
- package/dist/commands/theme/push.js +1 -1
- package/dist/push-app-command.js +2 -2
- package/dist/remote-app-command.d.ts +1 -1
- package/dist/remote-app-command.js +8 -2
- package/oclif.manifest.json +3 -2
- package/package.json +1 -1
|
@@ -7,10 +7,10 @@ export default class AppDev extends PushAppCommand {
|
|
|
7
7
|
'no-push': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
8
|
port: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
9
|
};
|
|
10
|
+
static summary: string;
|
|
10
11
|
static delayOrientation: boolean;
|
|
11
12
|
static orientation: {
|
|
12
13
|
env: string;
|
|
13
14
|
};
|
|
14
|
-
static summary: string;
|
|
15
15
|
run(): Promise<void>;
|
|
16
16
|
}
|
package/dist/commands/app/dev.js
CHANGED
|
@@ -17,11 +17,11 @@ export default class AppDev extends PushAppCommand {
|
|
|
17
17
|
description: 'for storefront apps, prompt to select a storefront to preview',
|
|
18
18
|
}),
|
|
19
19
|
};
|
|
20
|
+
static summary = `Run an app in dev mode from your local machine.`;
|
|
20
21
|
static delayOrientation = true;
|
|
21
22
|
static orientation = {
|
|
22
23
|
env: 'test',
|
|
23
24
|
};
|
|
24
|
-
static summary = `Run an app in dev mode from your local machine.`;
|
|
25
25
|
async run() {
|
|
26
26
|
await this.config.runCommand('app:frontend:dev', this.argv);
|
|
27
27
|
}
|
|
@@ -6,11 +6,11 @@ export default class AppPush extends PushAppCommand {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: any;
|
|
9
|
+
static summary: string;
|
|
9
10
|
static delayOrientation: boolean;
|
|
10
11
|
static orientation: {
|
|
11
12
|
env: string;
|
|
12
13
|
};
|
|
13
|
-
static summary: string;
|
|
14
14
|
resolvePushPaths(file: string): {
|
|
15
15
|
filePath: string;
|
|
16
16
|
relativePath: string;
|
|
@@ -38,11 +38,11 @@ ${Object.values(ConfigPaths)
|
|
|
38
38
|
description: 'skip deploying app frontend',
|
|
39
39
|
}),
|
|
40
40
|
};
|
|
41
|
+
static summary = 'Push local files to your Swell app.';
|
|
41
42
|
static delayOrientation = true;
|
|
42
43
|
static orientation = {
|
|
43
44
|
env: 'test',
|
|
44
45
|
};
|
|
45
|
-
static summary = 'Push local files to your Swell app.';
|
|
46
46
|
resolvePushPaths(file) {
|
|
47
47
|
// Join the appPath and file to get the absolute filePath
|
|
48
48
|
const filePath = path.resolve(process.cwd(), file);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CreateAppCommand } from '../../create-app-command.js';
|
|
2
2
|
export default class CreateApp extends CreateAppCommand {
|
|
3
|
+
appType: string;
|
|
3
4
|
static args: {
|
|
4
5
|
id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
5
6
|
};
|
|
@@ -9,7 +10,6 @@ export default class CreateApp extends CreateAppCommand {
|
|
|
9
10
|
description: string;
|
|
10
11
|
}[];
|
|
11
12
|
static flags: any;
|
|
12
|
-
appType: string;
|
|
13
13
|
createSwellConfig({ allowOverwrite, inputId, inputStorefrontApp, inputType, inputYes, nestedPath, }: {
|
|
14
14
|
allowOverwrite?: boolean;
|
|
15
15
|
inputId: string;
|
|
@@ -7,6 +7,7 @@ import { newConfig, swellConfigFileExists } from '../../lib/app-config.js';
|
|
|
7
7
|
import { toAppId, toAppName } from '../../lib/create/index.js';
|
|
8
8
|
import style from '../../lib/style.js';
|
|
9
9
|
export default class CreateApp extends CreateAppCommand {
|
|
10
|
+
appType = '';
|
|
10
11
|
static args = {
|
|
11
12
|
id: Args.string({
|
|
12
13
|
default: '',
|
|
@@ -45,7 +46,6 @@ export default class CreateApp extends CreateAppCommand {
|
|
|
45
46
|
options: ['admin', 'integration', 'storefront', 'theme'],
|
|
46
47
|
}),
|
|
47
48
|
};
|
|
48
|
-
appType = '';
|
|
49
49
|
async createSwellConfig({ allowOverwrite = true, inputId, inputStorefrontApp, inputType, inputYes, nestedPath = true, }) {
|
|
50
50
|
let confirmYes = inputYes;
|
|
51
51
|
const type = inputType ||
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PushAppCommand } from '../../push-app-command.js';
|
|
2
2
|
export default class AppThemeDev extends PushAppCommand {
|
|
3
|
+
appType: string;
|
|
3
4
|
static examples: string[];
|
|
4
5
|
static flags: {
|
|
5
6
|
bundle: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
@@ -11,7 +12,6 @@ export default class AppThemeDev extends PushAppCommand {
|
|
|
11
12
|
env: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
13
|
};
|
|
13
14
|
static summary: string;
|
|
14
|
-
appType: string;
|
|
15
15
|
logAppLocalUrl(storeId: string, sessionId: string): void;
|
|
16
16
|
run(): Promise<void>;
|
|
17
17
|
private findAndInstallDependencies;
|
|
@@ -10,6 +10,7 @@ import style from '../../lib/style.js';
|
|
|
10
10
|
import { PushAppCommand } from '../../push-app-command.js';
|
|
11
11
|
const FALLBACK_PORT = 3000;
|
|
12
12
|
export default class AppThemeDev extends PushAppCommand {
|
|
13
|
+
appType = 'theme';
|
|
13
14
|
static examples = [
|
|
14
15
|
'swell theme dev',
|
|
15
16
|
'swell theme dev --local',
|
|
@@ -44,7 +45,6 @@ export default class AppThemeDev extends PushAppCommand {
|
|
|
44
45
|
}),
|
|
45
46
|
};
|
|
46
47
|
static summary = `Run a theme in dev mode from your local machine.`;
|
|
47
|
-
appType = 'theme';
|
|
48
48
|
logAppLocalUrl(storeId, sessionId) {
|
|
49
49
|
this.log(`View it at ${style.link(this.localFrontendUrl(storeId, sessionId))}\n`);
|
|
50
50
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import InitApp from '../app/init.js';
|
|
2
2
|
export default class InitTheme extends InitApp {
|
|
3
|
+
appType = 'theme';
|
|
3
4
|
static description = 'Initialize theme swell.json in the current directory.';
|
|
4
5
|
static examples = [
|
|
5
6
|
{
|
|
@@ -11,5 +12,4 @@ export default class InitTheme extends InitApp {
|
|
|
11
12
|
description: 'Initialize theme and accept all default values.',
|
|
12
13
|
},
|
|
13
14
|
];
|
|
14
|
-
appType = 'theme';
|
|
15
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import AppPull from '../app/pull.js';
|
|
2
2
|
export default class AppThemePull extends AppPull {
|
|
3
|
+
appType: string;
|
|
3
4
|
static args: {
|
|
4
5
|
appId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
5
6
|
targetPath: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
@@ -14,6 +15,6 @@ export default class AppThemePull extends AppPull {
|
|
|
14
15
|
'sync-app': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
15
16
|
};
|
|
16
17
|
static summary: string;
|
|
17
|
-
|
|
18
|
+
static delayOrientation: boolean;
|
|
18
19
|
run(): Promise<void>;
|
|
19
20
|
}
|
|
@@ -3,6 +3,7 @@ import { ThemeConfigPaths } from '../../lib/apps/index.js';
|
|
|
3
3
|
import style from '../../lib/style.js';
|
|
4
4
|
import AppPull from '../app/pull.js';
|
|
5
5
|
export default class AppThemePull extends AppPull {
|
|
6
|
+
appType = 'theme';
|
|
6
7
|
static args = {
|
|
7
8
|
appId: Args.string({
|
|
8
9
|
default: '',
|
|
@@ -52,7 +53,7 @@ ${Object.values(ThemeConfigPaths)
|
|
|
52
53
|
}),
|
|
53
54
|
};
|
|
54
55
|
static summary = 'Pull theme files from Swell to your local machine.';
|
|
55
|
-
|
|
56
|
+
static delayOrientation = true;
|
|
56
57
|
async run() {
|
|
57
58
|
const { args, flags } = await this.parse(AppThemePull);
|
|
58
59
|
const { force } = flags;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import AppPush from '../app/push.js';
|
|
2
2
|
export default class AppThemePush extends AppPush {
|
|
3
|
+
appType: string;
|
|
3
4
|
static args: {
|
|
4
5
|
file: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
|
|
5
6
|
};
|
|
@@ -13,6 +14,5 @@ export default class AppThemePush extends AppPush {
|
|
|
13
14
|
'sync-app': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
14
15
|
};
|
|
15
16
|
static summary: string;
|
|
16
|
-
appType: string;
|
|
17
17
|
run(): Promise<void>;
|
|
18
18
|
}
|
|
@@ -4,6 +4,7 @@ import { default as localConfig } from '../../lib/config.js';
|
|
|
4
4
|
import style from '../../lib/style.js';
|
|
5
5
|
import AppPush from '../app/push.js';
|
|
6
6
|
export default class AppThemePush extends AppPush {
|
|
7
|
+
appType = 'theme';
|
|
7
8
|
static args = {
|
|
8
9
|
file: Args.string({
|
|
9
10
|
char: 'f',
|
|
@@ -55,7 +56,6 @@ ${Object.values(ThemeConfigPaths)
|
|
|
55
56
|
}),
|
|
56
57
|
};
|
|
57
58
|
static summary = 'Push local files to your Swell theme.';
|
|
58
|
-
appType = 'theme';
|
|
59
59
|
async run() {
|
|
60
60
|
const { args, flags } = await this.parse(AppThemePush);
|
|
61
61
|
const { file } = args;
|
package/dist/push-app-command.js
CHANGED
|
@@ -653,8 +653,8 @@ export class PushAppCommand extends RemoteAppCommand {
|
|
|
653
653
|
isPathDirectory(path.resolve(process.cwd(), resolvedAppId))) {
|
|
654
654
|
resolvedPath = resolvedAppId;
|
|
655
655
|
}
|
|
656
|
-
// Reset app
|
|
657
|
-
if (resolvedPath && this.appPath ===
|
|
656
|
+
// Reset app path if appId is provided
|
|
657
|
+
if (resolvedPath && this.appPath === process.cwd()) {
|
|
658
658
|
this.appPath = path.resolve(process.cwd(), resolvedPath);
|
|
659
659
|
}
|
|
660
660
|
return this.appPath;
|
|
@@ -5,11 +5,11 @@ import { App, AppConfig, AppVersion } from './lib/apps/index.js';
|
|
|
5
5
|
* configurations.
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class RemoteAppCommand extends AppCommand {
|
|
8
|
+
appType: string;
|
|
8
9
|
static delayOrientation: boolean;
|
|
9
10
|
static orientation: AppCommandOrientation;
|
|
10
11
|
app: App;
|
|
11
12
|
appCreated: boolean;
|
|
12
|
-
appType: string;
|
|
13
13
|
storefront?: any;
|
|
14
14
|
storefrontLocalUrl?: string;
|
|
15
15
|
themeSyncApp?: boolean;
|
|
@@ -15,6 +15,7 @@ import style from './lib/style.js';
|
|
|
15
15
|
* configurations.
|
|
16
16
|
*/
|
|
17
17
|
export class RemoteAppCommand extends AppCommand {
|
|
18
|
+
appType = 'any';
|
|
18
19
|
// allows child commands to set orientation
|
|
19
20
|
static delayOrientation = false;
|
|
20
21
|
// most of the times this will be the target environment
|
|
@@ -23,7 +24,6 @@ export class RemoteAppCommand extends AppCommand {
|
|
|
23
24
|
app = {};
|
|
24
25
|
// Indicates the app was created during the command execution
|
|
25
26
|
appCreated = false;
|
|
26
|
-
appType = 'any';
|
|
27
27
|
// API instance of the target storefront, if applicable
|
|
28
28
|
storefront = null;
|
|
29
29
|
// Indicates we are syncing with a local app frontend via proxy
|
|
@@ -631,7 +631,13 @@ export class RemoteAppCommand extends AppCommand {
|
|
|
631
631
|
const orientationOutput = [];
|
|
632
632
|
const currentStore = localConfig.getDefaultStore();
|
|
633
633
|
const { env, store } = flags;
|
|
634
|
-
|
|
634
|
+
if (this.app.name) {
|
|
635
|
+
// Show theme version if not syncing app
|
|
636
|
+
const version = !this.themeSyncApp && this.app.type === 'theme' && this.storefront?.theme_version
|
|
637
|
+
? this.storefront?.theme_version
|
|
638
|
+
: this.app.version;
|
|
639
|
+
orientationOutput.push(`[${this.app.type === 'theme' ? 'theme' : 'app'}] ${style.appName(this.app.name)}${version ? ` v${version}` : ''}`);
|
|
640
|
+
}
|
|
635
641
|
if (store) {
|
|
636
642
|
orientationOutput.push(`[store] ${style.storeId(store)}`);
|
|
637
643
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1691,7 +1691,8 @@
|
|
|
1691
1691
|
"commands",
|
|
1692
1692
|
"theme",
|
|
1693
1693
|
"pull.js"
|
|
1694
|
-
]
|
|
1694
|
+
],
|
|
1695
|
+
"delayOrientation": true
|
|
1695
1696
|
},
|
|
1696
1697
|
"theme:push": {
|
|
1697
1698
|
"aliases": [],
|
|
@@ -1890,5 +1891,5 @@
|
|
|
1890
1891
|
]
|
|
1891
1892
|
}
|
|
1892
1893
|
},
|
|
1893
|
-
"version": "2.0.
|
|
1894
|
+
"version": "2.0.13"
|
|
1894
1895
|
}
|