@swell/cli 2.1.0 → 2.2.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.
- package/dist/commands/api/delete.d.ts +15 -0
- package/dist/commands/api/delete.js +26 -0
- package/dist/commands/api/get.d.ts +15 -0
- package/dist/commands/api/get.js +31 -0
- package/dist/commands/api/index.d.ts +7 -0
- package/dist/commands/api/index.js +16 -0
- package/dist/commands/api/post.d.ts +16 -0
- package/dist/commands/api/post.js +33 -0
- package/dist/commands/api/put.d.ts +16 -0
- package/dist/commands/api/put.js +33 -0
- package/dist/commands/app/dev.d.ts +9 -9
- package/dist/commands/app/dev.js +158 -136
- package/dist/commands/app/frontend/dev.d.ts +1 -1
- package/dist/commands/app/frontend/dev.js +84 -78
- package/dist/commands/app/install.js +3 -3
- package/dist/commands/app/pull.d.ts +1 -1
- package/dist/commands/app/pull.js +6 -6
- package/dist/commands/app/push.d.ts +3 -3
- package/dist/commands/app/push.js +8 -6
- package/dist/commands/app/release.d.ts +1 -1
- package/dist/commands/app/release.js +1 -1
- package/dist/commands/app/version.d.ts +1 -1
- package/dist/commands/app/version.js +5 -3
- package/dist/commands/create/app.d.ts +10 -2
- package/dist/commands/create/app.js +226 -57
- package/dist/commands/create/content.d.ts +4 -0
- package/dist/commands/create/content.js +83 -15
- package/dist/commands/create/function.js +27 -5
- package/dist/commands/create/model.d.ts +4 -0
- package/dist/commands/create/model.js +120 -25
- package/dist/commands/inspect/content.d.ts +25 -0
- package/dist/commands/inspect/content.js +159 -0
- package/dist/commands/inspect/index.d.ts +7 -0
- package/dist/commands/inspect/index.js +16 -0
- package/dist/commands/inspect/models.d.ts +27 -0
- package/dist/commands/inspect/models.js +197 -0
- package/dist/commands/schema.d.ts +27 -0
- package/dist/commands/schema.js +231 -0
- package/dist/commands/theme/dev.d.ts +1 -1
- package/dist/commands/theme/dev.js +2 -2
- 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 -2
- package/dist/commands/theme/pull.js +2 -2
- package/dist/commands/theme/push.d.ts +1 -1
- package/dist/commands/theme/push.js +1 -1
- package/dist/create-app-command.d.ts +12 -2
- package/dist/create-app-command.js +103 -80
- package/dist/create-collection-command.js +4 -1
- package/dist/create-config-command.js +4 -0
- package/dist/env/local.d.ts +1 -0
- package/dist/env/local.js +1 -0
- package/dist/env/production.d.ts +1 -0
- package/dist/env/production.js +1 -0
- package/dist/env/review.d.ts +1 -0
- package/dist/env/review.js +1 -0
- package/dist/env/staging.d.ts +1 -0
- package/dist/env/staging.js +1 -0
- package/dist/lib/api.d.ts +16 -5
- package/dist/lib/api.js +67 -25
- package/dist/lib/app-config.js +1 -0
- package/dist/lib/apps/index.d.ts +2 -0
- package/dist/lib/apps/index.js +20 -15
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/constants.d.ts +1 -0
- package/dist/lib/constants.js +1 -0
- package/dist/lib/create/content.d.ts +5 -1
- package/dist/lib/create/content.js +8 -1
- package/dist/lib/create/function.d.ts +2 -1
- package/dist/lib/create/function.js +7 -3
- package/dist/lib/create/model.d.ts +1 -0
- package/dist/lib/create/schemas.d.ts +6 -0
- package/dist/lib/create/schemas.js +6 -0
- package/dist/lib/sessions.js +4 -3
- package/dist/lib/style.js +0 -1
- package/dist/lib/theme-sync.d.ts +6 -6
- package/dist/lib/theme-sync.js +49 -39
- package/dist/push-app-command.d.ts +7 -7
- package/dist/push-app-command.js +38 -36
- package/dist/remote-app-command.d.ts +1 -1
- package/dist/remote-app-command.js +4 -2
- package/dist/swell-api-command.d.ts +13 -0
- package/dist/swell-api-command.js +75 -0
- package/dist/swell-command.d.ts +1 -1
- package/dist/swell-command.js +9 -9
- package/package.json +8 -1
- package/oclif.manifest.json +0 -1936
|
@@ -14,7 +14,7 @@ export default class AppFrontendDev extends PushAppCommand {
|
|
|
14
14
|
env: string;
|
|
15
15
|
};
|
|
16
16
|
static summary: string;
|
|
17
|
+
logAppLocalUrl(storeId: string, sessionId: string): void;
|
|
17
18
|
run(): Promise<void>;
|
|
18
19
|
private execFrontendProject;
|
|
19
|
-
logAppLocalUrl(storeId: string, sessionId: string): void;
|
|
20
20
|
}
|
|
@@ -33,6 +33,12 @@ export default class AppFrontendDev extends PushAppCommand {
|
|
|
33
33
|
env: 'test',
|
|
34
34
|
};
|
|
35
35
|
static summary = `Run a frontend app in dev mode from your local machine.`;
|
|
36
|
+
logAppLocalUrl(storeId, sessionId) {
|
|
37
|
+
const frontendAppRoute = this.app.type === 'storefront' && this.app.storefront?.external
|
|
38
|
+
? `/${this.app.private_id}`
|
|
39
|
+
: '';
|
|
40
|
+
this.log(`View it at ${style.link(`${this.localFrontendUrl(storeId, sessionId)}${frontendAppRoute}`)}\n`);
|
|
41
|
+
}
|
|
36
42
|
async run() {
|
|
37
43
|
const { flags } = await this.parse(AppFrontendDev);
|
|
38
44
|
const { port, 'proxy-port': proxyPort, 'app-dev': isAppDev } = flags;
|
|
@@ -63,21 +69,21 @@ export default class AppFrontendDev extends PushAppCommand {
|
|
|
63
69
|
let serverReadyDetected = false;
|
|
64
70
|
await this.execFrontend(projectType.devCommand.replace('${PORT}', String(serverPort)), (string) => {
|
|
65
71
|
// Framework-specific output handling and ready detection
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
/✓
|
|
72
|
+
switch (projectType.slug) {
|
|
73
|
+
case 'nextjs': {
|
|
74
|
+
// 1. NOISE FILTER: Hide unwanted output
|
|
75
|
+
if (string.includes('Using vars defined in .dev.vars')) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
// 2. URL FILTER: Hide localhost/network URLs (confusing - users should use Swell tunnel)
|
|
79
|
+
if (/- local:\s+http:\/\//i.test(string) ||
|
|
80
|
+
/- network:\s+http:\/\//i.test(string) ||
|
|
81
|
+
/ready on http:\/\/localhost/i.test(string)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
// 3. READY DETECTION: Detect server ready, show our message
|
|
85
|
+
if (!serverReadyDetected &&
|
|
86
|
+
(/✓ ready in \d+/.test(string) || /✓ starting/.test(string))) {
|
|
81
87
|
serverReadyDetected = true;
|
|
82
88
|
this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
|
|
83
89
|
const sessionId = localConfig.getSessionId(currentStore);
|
|
@@ -86,38 +92,16 @@ export default class AppFrontendDev extends PushAppCommand {
|
|
|
86
92
|
this.watchForChanges();
|
|
87
93
|
}
|
|
88
94
|
}
|
|
95
|
+
break;
|
|
89
96
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
string.includes('┃ Network')) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
// 3. READY DETECTION: Detect server ready, show our message
|
|
98
|
-
if (!serverReadyDetected && /watching for file changes/i.test(string)) {
|
|
99
|
-
serverReadyDetected = true;
|
|
100
|
-
this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
|
|
101
|
-
const sessionId = localConfig.getSessionId(currentStore);
|
|
102
|
-
setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
|
|
103
|
-
if (!isAppDev) {
|
|
104
|
-
this.watchForChanges();
|
|
97
|
+
case 'astro': {
|
|
98
|
+
// 2. URL FILTER: Hide localhost/network URLs (confusing - users should use Swell tunnel)
|
|
99
|
+
if (string.includes('┃ Local') || string.includes('┃ Network')) {
|
|
100
|
+
return false;
|
|
105
101
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// 1. NOISE FILTER: Hide unwanted output
|
|
110
|
-
if (string.includes('press h + enter to show help')) {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
// 2. URL FILTER: Hide localhost/network URLs (confusing - users should use Swell tunnel)
|
|
114
|
-
if (/➜\s+Local:\s+http:\/\//i.test(string)) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
// 3. READY DETECTION: Detect server ready, show our message
|
|
118
|
-
if (!serverReadyDetected) {
|
|
119
|
-
if (/Application bundle generation complete/i.test(string) ||
|
|
120
|
-
/Watch mode enabled/i.test(string)) {
|
|
102
|
+
// 3. READY DETECTION: Detect server ready, show our message
|
|
103
|
+
if (!serverReadyDetected &&
|
|
104
|
+
/watching for file changes/i.test(string)) {
|
|
121
105
|
serverReadyDetected = true;
|
|
122
106
|
this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
|
|
123
107
|
const sessionId = localConfig.getSessionId(currentStore);
|
|
@@ -126,46 +110,68 @@ export default class AppFrontendDev extends PushAppCommand {
|
|
|
126
110
|
this.watchForChanges();
|
|
127
111
|
}
|
|
128
112
|
}
|
|
113
|
+
break;
|
|
129
114
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const sessionId = localConfig.getSessionId(currentStore);
|
|
139
|
-
setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
|
|
140
|
-
if (!isAppDev) {
|
|
141
|
-
this.watchForChanges();
|
|
115
|
+
case 'angular': {
|
|
116
|
+
// 1. NOISE FILTER: Hide unwanted output
|
|
117
|
+
if (string.includes('press h + enter to show help')) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
// 2. URL FILTER: Hide localhost/network URLs (confusing - users should use Swell tunnel)
|
|
121
|
+
if (/➜\s+local:\s+http:\/\//i.test(string)) {
|
|
122
|
+
return false;
|
|
142
123
|
}
|
|
143
|
-
|
|
124
|
+
// 3. READY DETECTION: Detect server ready, show our message
|
|
125
|
+
if (!serverReadyDetected &&
|
|
126
|
+
(/application bundle generation complete/.test(string) ||
|
|
127
|
+
/watch mode enabled/.test(string))) {
|
|
128
|
+
serverReadyDetected = true;
|
|
129
|
+
this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
|
|
130
|
+
const sessionId = localConfig.getSessionId(currentStore);
|
|
131
|
+
setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
|
|
132
|
+
if (!isAppDev) {
|
|
133
|
+
this.watchForChanges();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
144
137
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
138
|
+
case 'hono': {
|
|
139
|
+
// 2. URL FILTER: Hide localhost URLs (confusing - users should use Swell tunnel)
|
|
140
|
+
// Note: For Hono, the ready signal IS the URL line, so we handle both in section 3
|
|
141
|
+
// 3. READY DETECTION: Detect server ready, show our message, hide the URL
|
|
142
|
+
if (!serverReadyDetected &&
|
|
143
|
+
/ready on http:\/\/localhost:\d+/i.test(string)) {
|
|
144
|
+
serverReadyDetected = true;
|
|
145
|
+
this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
|
|
146
|
+
const sessionId = localConfig.getSessionId(currentStore);
|
|
147
|
+
setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
|
|
148
|
+
if (!isAppDev) {
|
|
149
|
+
this.watchForChanges();
|
|
150
|
+
}
|
|
151
|
+
return false; // Hide the "Ready on localhost" line
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
151
154
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
case 'nuxt': {
|
|
156
|
+
// 2. URL FILTER: Hide localhost/network URLs (confusing - users should use Swell tunnel)
|
|
157
|
+
if (/➜ local:\s+http:\/\//i.test(string) ||
|
|
158
|
+
/➜ network:/i.test(string)) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
// 3. READY DETECTION: Detect server ready, show our message
|
|
162
|
+
if (!serverReadyDetected && /nuxt \d+\.\d+\.\d+/i.test(string)) {
|
|
163
|
+
serverReadyDetected = true;
|
|
164
|
+
this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
|
|
165
|
+
const sessionId = localConfig.getSessionId(currentStore);
|
|
166
|
+
setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
|
|
167
|
+
if (!isAppDev) {
|
|
168
|
+
this.watchForChanges();
|
|
169
|
+
}
|
|
160
170
|
}
|
|
171
|
+
break;
|
|
161
172
|
}
|
|
173
|
+
// No default
|
|
162
174
|
}
|
|
163
175
|
});
|
|
164
176
|
}
|
|
165
|
-
logAppLocalUrl(storeId, sessionId) {
|
|
166
|
-
const frontendAppRoute = this.app.type === 'storefront' && this.app.storefront?.external
|
|
167
|
-
? `/${this.app.private_id}`
|
|
168
|
-
: '';
|
|
169
|
-
this.log(`View it at ${style.link(`${this.localFrontendUrl(storeId, sessionId)}${frontendAppRoute}`)}\n`);
|
|
170
|
-
}
|
|
171
177
|
}
|
|
@@ -2,8 +2,8 @@ import { confirm } from '@inquirer/prompts';
|
|
|
2
2
|
import { Flags } from '@oclif/core';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import * as semver from 'semver';
|
|
5
|
-
import config from '../../lib/config.js';
|
|
6
5
|
import { readRcFile } from '../../lib/app-config.js';
|
|
6
|
+
import config from '../../lib/config.js';
|
|
7
7
|
import { selectEnvironmentId, selectLoggedInStoreId, } from '../../lib/stores.js';
|
|
8
8
|
import style from '../../lib/style.js';
|
|
9
9
|
import { RemoteAppCommand } from '../../remote-app-command.js';
|
|
@@ -48,7 +48,7 @@ Without a store specified, install the app in the Live environment of the curren
|
|
|
48
48
|
if (versions.length === 0) {
|
|
49
49
|
this.error(`${version ? `Version ${version} not found` : 'No versions found'} for ${style.appConfigValue(this.app.name)} app. ${version
|
|
50
50
|
? ''
|
|
51
|
-
: `Create a version with the ${style.command('swell version')} command first.`}`);
|
|
51
|
+
: `Create a version with the ${style.command('swell app version')} command first.`}`);
|
|
52
52
|
}
|
|
53
53
|
const versionToInstall = version
|
|
54
54
|
? versions.find((ver) => ver.version === version)?.version
|
|
@@ -129,7 +129,7 @@ Without a store specified, install the app in the Live environment of the curren
|
|
|
129
129
|
const sourceApp = await readRcFile(this.swellRcPath());
|
|
130
130
|
sourceAppId = sourceApp?.id;
|
|
131
131
|
}
|
|
132
|
-
catch
|
|
132
|
+
catch {
|
|
133
133
|
// noop
|
|
134
134
|
}
|
|
135
135
|
const existingSourcedApps = sourceAppId
|
|
@@ -36,6 +36,12 @@ ${Object.values(ConfigPaths)
|
|
|
36
36
|
env: 'test',
|
|
37
37
|
};
|
|
38
38
|
static summary = 'Pull app files from Swell to your local machine.';
|
|
39
|
+
logPulledChanges(pulled, removed) {
|
|
40
|
+
const typeLabel = this.appType === 'theme' ? 'theme' : 'app';
|
|
41
|
+
const changeCount = pulled.length + removed.length;
|
|
42
|
+
const pluralFiles = changeCount === 1 ? 'file' : 'files';
|
|
43
|
+
this.log(`Pulled ${changeCount} ${pluralFiles} from ${style.appConfigValue(this.app.name)} ${typeLabel} in ${style.path(path.resolve(this.appPath))}.`);
|
|
44
|
+
}
|
|
39
45
|
async run() {
|
|
40
46
|
const { args, flags } = await this.parse(AppPull);
|
|
41
47
|
const { force } = flags;
|
|
@@ -44,10 +50,4 @@ ${Object.values(ConfigPaths)
|
|
|
44
50
|
const { pulled, removed } = await this.pullAppConfigs(force);
|
|
45
51
|
this.logPulledChanges(pulled, removed);
|
|
46
52
|
}
|
|
47
|
-
logPulledChanges(pulled, removed) {
|
|
48
|
-
const typeLabel = this.appType === 'theme' ? 'theme' : 'app';
|
|
49
|
-
const changeCount = pulled.length + removed.length;
|
|
50
|
-
const pluralFiles = changeCount === 1 ? 'file' : 'files';
|
|
51
|
-
this.log(`Pulled ${changeCount} ${pluralFiles} from ${style.appConfigValue(this.app.name)} ${typeLabel} in ${style.path(path.resolve(this.appPath))}.`);
|
|
52
|
-
}
|
|
53
53
|
}
|
|
@@ -3,15 +3,15 @@ export default class AppPush extends PushAppCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
file: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
+
static delayOrientation: boolean;
|
|
6
7
|
static description: string;
|
|
7
8
|
static examples: string[];
|
|
8
9
|
static flags: any;
|
|
9
|
-
static summary: string;
|
|
10
|
-
static delayOrientation: boolean;
|
|
11
10
|
static orientation: {
|
|
12
11
|
env: string;
|
|
13
12
|
};
|
|
14
|
-
|
|
13
|
+
static summary: string;
|
|
14
|
+
resolvePushPaths(file: string, appPathFlag?: string): {
|
|
15
15
|
filePath: string;
|
|
16
16
|
relativePath: string;
|
|
17
17
|
};
|
|
@@ -10,6 +10,7 @@ export default class AppPush extends PushAppCommand {
|
|
|
10
10
|
description: 'relative path to a configuration file or directory to push',
|
|
11
11
|
}),
|
|
12
12
|
};
|
|
13
|
+
static delayOrientation = true;
|
|
13
14
|
static description = `Push all app files, a specific file, or a specific configuration
|
|
14
15
|
type to an app in your store's test environment.
|
|
15
16
|
|
|
@@ -38,14 +39,15 @@ ${Object.values(ConfigPaths)
|
|
|
38
39
|
description: 'skip deploying app frontend',
|
|
39
40
|
}),
|
|
40
41
|
};
|
|
41
|
-
static summary = 'Push local files to your Swell app.';
|
|
42
|
-
static delayOrientation = true;
|
|
43
42
|
static orientation = {
|
|
44
43
|
env: 'test',
|
|
45
44
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
static summary = 'Push local files to your Swell app.';
|
|
46
|
+
resolvePushPaths(file, appPathFlag) {
|
|
47
|
+
// If --app-path was explicitly provided, resolve FILE relative to appPath
|
|
48
|
+
// Otherwise, resolve relative to cwd for better UX (tab completion)
|
|
49
|
+
const baseDir = appPathFlag ? this.appPath : process.cwd();
|
|
50
|
+
const filePath = path.resolve(baseDir, file);
|
|
49
51
|
// Check if filePath is outside of appPath
|
|
50
52
|
const relativePath = path.relative(this.appPath, filePath);
|
|
51
53
|
if (relativePath.startsWith('..') || path.isAbsolute(relativePath)) {
|
|
@@ -71,7 +73,7 @@ ${Object.values(ConfigPaths)
|
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
75
|
if (file) {
|
|
74
|
-
const { filePath, relativePath } = this.resolvePushPaths(file);
|
|
76
|
+
const { filePath, relativePath } = this.resolvePushPaths(file, flags['app-path']);
|
|
75
77
|
// Push individual files if not referring to the whole app path
|
|
76
78
|
if (filePath !== this.appPath) {
|
|
77
79
|
if (!filePathExists(filePath)) {
|
|
@@ -6,10 +6,10 @@ export default class AppRelease extends PushAppCommand {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: any;
|
|
9
|
-
static summary: string;
|
|
10
9
|
static orientation: {
|
|
11
10
|
env: string;
|
|
12
11
|
};
|
|
12
|
+
static summary: string;
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
validateReleaseDetails(): void;
|
|
15
15
|
private validateCreateVersion;
|
|
@@ -56,10 +56,10 @@ The app must be connected to a partner account with access to publish.`;
|
|
|
56
56
|
description: 'skip confirmation prompt',
|
|
57
57
|
}),
|
|
58
58
|
};
|
|
59
|
-
static summary = 'Release a new version of your an app for publishing to the App Store.';
|
|
60
59
|
static orientation = {
|
|
61
60
|
env: 'test',
|
|
62
61
|
};
|
|
62
|
+
static summary = 'Release a new version of your an app for publishing to the App Store.';
|
|
63
63
|
async run() {
|
|
64
64
|
const { args, flags } = await this.parse(AppRelease);
|
|
65
65
|
const { amend, message, 'not-supported': notSupported, 'release-notes': releaseNotesFile, yes, } = flags;
|
|
@@ -11,10 +11,10 @@ export default class AppVersion extends PushAppCommand {
|
|
|
11
11
|
'no-git-tag': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
12
|
yes: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
13
13
|
};
|
|
14
|
-
static summary: string;
|
|
15
14
|
static orientation: {
|
|
16
15
|
env: string;
|
|
17
16
|
};
|
|
17
|
+
static summary: string;
|
|
18
18
|
run(): Promise<void>;
|
|
19
19
|
private createRemoteVersion;
|
|
20
20
|
private gitCommit;
|
|
@@ -67,10 +67,10 @@ behavior by using the --no-git-tag option.`;
|
|
|
67
67
|
description: 'skip confirmation prompt',
|
|
68
68
|
}),
|
|
69
69
|
};
|
|
70
|
-
static summary = 'Increment the version of your Swell app.';
|
|
71
70
|
static orientation = {
|
|
72
71
|
env: 'test',
|
|
73
72
|
};
|
|
73
|
+
static summary = 'Increment the version of your Swell app.';
|
|
74
74
|
async run() {
|
|
75
75
|
const { args, flags } = await this.parse(AppVersion);
|
|
76
76
|
const { amend, 'no-git-tag': noGitTag, yes } = flags;
|
|
@@ -96,7 +96,9 @@ behavior by using the --no-git-tag option.`;
|
|
|
96
96
|
const latestVersion = await this.getVersion();
|
|
97
97
|
const remoteVersion = latestVersion?.version;
|
|
98
98
|
// Suggest the next version if not provided
|
|
99
|
-
if (!nextVersion &&
|
|
99
|
+
if (!nextVersion &&
|
|
100
|
+
remoteVersion &&
|
|
101
|
+
semver.gt(localVersion, remoteVersion)) {
|
|
100
102
|
nextVersion = localVersion;
|
|
101
103
|
}
|
|
102
104
|
// If the user didn't specify a version, show the latest one
|
|
@@ -187,7 +189,7 @@ behavior by using the --no-git-tag option.`;
|
|
|
187
189
|
// increment the version
|
|
188
190
|
version = semver.inc(localVersion, version);
|
|
189
191
|
}
|
|
190
|
-
if (semver.
|
|
192
|
+
if (semver.lte(version, localVersion)) {
|
|
191
193
|
this.error(`Version ${version} must be greater than the current version ${localVersion}.`);
|
|
192
194
|
}
|
|
193
195
|
return version;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CreateAppCommand } from '../../create-app-command.js';
|
|
2
2
|
export default class CreateApp extends CreateAppCommand {
|
|
3
|
-
appType: string;
|
|
4
3
|
static args: {
|
|
5
4
|
id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
6
5
|
};
|
|
@@ -10,11 +9,18 @@ export default class CreateApp extends CreateAppCommand {
|
|
|
10
9
|
description: string;
|
|
11
10
|
}[];
|
|
12
11
|
static flags: any;
|
|
13
|
-
|
|
12
|
+
appType: string;
|
|
13
|
+
createSwellConfig({ allowOverwrite, inputId, inputStorefrontApp, inputType, inputName, inputVersion, inputDescription, inputFrontend, inputIntegrationType, inputIntegrationId, inputYes, nestedPath, }: {
|
|
14
14
|
allowOverwrite?: boolean;
|
|
15
|
+
inputDescription?: string;
|
|
16
|
+
inputFrontend?: string;
|
|
15
17
|
inputId?: string;
|
|
18
|
+
inputIntegrationId?: string;
|
|
19
|
+
inputIntegrationType?: string;
|
|
20
|
+
inputName?: string;
|
|
16
21
|
inputStorefrontApp?: string;
|
|
17
22
|
inputType?: string;
|
|
23
|
+
inputVersion?: string;
|
|
18
24
|
inputYes?: boolean;
|
|
19
25
|
nestedPath?: boolean;
|
|
20
26
|
}): Promise<{
|
|
@@ -22,6 +28,7 @@ export default class CreateApp extends CreateAppCommand {
|
|
|
22
28
|
config: any;
|
|
23
29
|
installedStorefrontApp: any;
|
|
24
30
|
swellConfigJson: {
|
|
31
|
+
extensions?: any[] | undefined;
|
|
25
32
|
theme: {
|
|
26
33
|
storefront: {
|
|
27
34
|
app: string;
|
|
@@ -33,6 +40,7 @@ export default class CreateApp extends CreateAppCommand {
|
|
|
33
40
|
type: string;
|
|
34
41
|
version: string;
|
|
35
42
|
} | {
|
|
43
|
+
extensions?: any[] | undefined;
|
|
36
44
|
permissions: never[];
|
|
37
45
|
description: string;
|
|
38
46
|
id: string;
|