@swell/cli 2.0.20 → 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.
Files changed (94) hide show
  1. package/dist/commands/api/delete.d.ts +15 -0
  2. package/dist/commands/api/delete.js +26 -0
  3. package/dist/commands/api/get.d.ts +15 -0
  4. package/dist/commands/api/get.js +31 -0
  5. package/dist/commands/api/index.d.ts +7 -0
  6. package/dist/commands/api/index.js +16 -0
  7. package/dist/commands/api/post.d.ts +16 -0
  8. package/dist/commands/api/post.js +33 -0
  9. package/dist/commands/api/put.d.ts +16 -0
  10. package/dist/commands/api/put.js +33 -0
  11. package/dist/commands/app/dev.d.ts +18 -4
  12. package/dist/commands/app/dev.js +383 -5
  13. package/dist/commands/app/frontend/dev.d.ts +6 -5
  14. package/dist/commands/app/frontend/dev.js +127 -58
  15. package/dist/commands/app/install.js +3 -3
  16. package/dist/commands/app/pull.d.ts +1 -1
  17. package/dist/commands/app/pull.js +6 -6
  18. package/dist/commands/app/push.d.ts +3 -3
  19. package/dist/commands/app/push.js +8 -6
  20. package/dist/commands/app/release.d.ts +1 -1
  21. package/dist/commands/app/release.js +1 -1
  22. package/dist/commands/app/version.d.ts +1 -1
  23. package/dist/commands/app/version.js +5 -3
  24. package/dist/commands/create/app.d.ts +10 -2
  25. package/dist/commands/create/app.js +226 -57
  26. package/dist/commands/create/content.d.ts +4 -0
  27. package/dist/commands/create/content.js +83 -15
  28. package/dist/commands/create/function.js +27 -5
  29. package/dist/commands/create/model.d.ts +4 -0
  30. package/dist/commands/create/model.js +120 -25
  31. package/dist/commands/inspect/content.d.ts +25 -0
  32. package/dist/commands/inspect/content.js +159 -0
  33. package/dist/commands/inspect/index.d.ts +7 -0
  34. package/dist/commands/inspect/index.js +16 -0
  35. package/dist/commands/inspect/models.d.ts +27 -0
  36. package/dist/commands/inspect/models.js +197 -0
  37. package/dist/commands/schema.d.ts +27 -0
  38. package/dist/commands/schema.js +231 -0
  39. package/dist/commands/theme/dev.d.ts +1 -1
  40. package/dist/commands/theme/dev.js +2 -2
  41. package/dist/commands/theme/init.d.ts +1 -1
  42. package/dist/commands/theme/init.js +1 -1
  43. package/dist/commands/theme/pull.d.ts +2 -2
  44. package/dist/commands/theme/pull.js +2 -2
  45. package/dist/commands/theme/push.d.ts +1 -1
  46. package/dist/commands/theme/push.js +1 -1
  47. package/dist/create-app-command.d.ts +14 -0
  48. package/dist/create-app-command.js +198 -15
  49. package/dist/create-collection-command.js +4 -1
  50. package/dist/create-config-command.js +4 -0
  51. package/dist/env/local.d.ts +2 -0
  52. package/dist/env/local.js +2 -0
  53. package/dist/env/production.d.ts +2 -0
  54. package/dist/env/production.js +2 -0
  55. package/dist/env/review.d.ts +2 -0
  56. package/dist/env/review.js +2 -0
  57. package/dist/env/staging.d.ts +2 -0
  58. package/dist/env/staging.js +2 -0
  59. package/dist/lib/api.d.ts +16 -5
  60. package/dist/lib/api.js +67 -25
  61. package/dist/lib/app-config.js +1 -0
  62. package/dist/lib/apps/app-config.d.ts +49 -0
  63. package/dist/lib/apps/app-config.js +21 -14
  64. package/dist/lib/apps/index.d.ts +5 -4
  65. package/dist/lib/apps/index.js +109 -21
  66. package/dist/lib/bundle.js +2 -1
  67. package/dist/lib/config.d.ts +1 -1
  68. package/dist/lib/constants.d.ts +2 -4
  69. package/dist/lib/constants.js +6 -4
  70. package/dist/lib/create/content.d.ts +5 -1
  71. package/dist/lib/create/content.js +8 -1
  72. package/dist/lib/create/function.d.ts +2 -1
  73. package/dist/lib/create/function.js +7 -3
  74. package/dist/lib/create/model.d.ts +1 -0
  75. package/dist/lib/create/schemas.d.ts +6 -0
  76. package/dist/lib/create/schemas.js +6 -0
  77. package/dist/lib/proxy.d.ts +1 -0
  78. package/dist/lib/proxy.js +29 -1
  79. package/dist/lib/sessions.js +4 -3
  80. package/dist/lib/style.js +0 -1
  81. package/dist/lib/swell-function-wrapper.d.ts +23 -4
  82. package/dist/lib/swell-function-wrapper.js +11 -4
  83. package/dist/lib/theme-sync.d.ts +6 -6
  84. package/dist/lib/theme-sync.js +49 -39
  85. package/dist/push-app-command.d.ts +12 -8
  86. package/dist/push-app-command.js +108 -29
  87. package/dist/remote-app-command.d.ts +1 -1
  88. package/dist/remote-app-command.js +4 -2
  89. package/dist/swell-api-command.d.ts +13 -0
  90. package/dist/swell-api-command.js +75 -0
  91. package/dist/swell-command.d.ts +1 -1
  92. package/dist/swell-command.js +9 -9
  93. package/package.json +10 -1
  94. package/oclif.manifest.json +0 -1895
@@ -1,12 +1,14 @@
1
- import { FrontendProjectType } from '../../../lib/apps/index.js';
2
1
  import { PushAppCommand } from '../../../push-app-command.js';
3
2
  export default class AppFrontendDev extends PushAppCommand {
4
3
  static examples: string[];
5
4
  static flags: {
6
- 'no-push': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
7
- port: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
5
+ 'proxy-port': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
6
  'storefront-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
7
  'storefront-select': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
+ 'app-dev': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
+ 'no-push': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
+ port: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
+ 'frontend-port': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
12
  };
11
13
  static orientation: {
12
14
  env: string;
@@ -14,6 +16,5 @@ export default class AppFrontendDev extends PushAppCommand {
14
16
  static summary: string;
15
17
  logAppLocalUrl(storeId: string, sessionId: string): void;
16
18
  run(): Promise<void>;
17
- startDevServer(projectType: FrontendProjectType, port?: number): Promise<void>;
18
- updateLocalProxy(proxyUrl: string, spinner: any, storefrontId?: string): Promise<void>;
19
+ private execFrontendProject;
19
20
  }
@@ -1,26 +1,21 @@
1
1
  import { Flags } from '@oclif/core';
2
- import getPort, { portNumbers } from 'get-port';
3
- import ngrok from 'ngrok';
4
- import ora from 'ora';
5
2
  import { default as localConfig } from '../../../lib/config.js';
6
3
  import style from '../../../lib/style.js';
7
4
  import { PushAppCommand } from '../../../push-app-command.js';
8
- const FALLBACK_PORT = 3000;
5
+ import AppDev from '../dev.js';
9
6
  export default class AppFrontendDev extends PushAppCommand {
10
7
  static examples = [
11
8
  'swell app frontend dev',
12
9
  'swell app frontend dev --no-push',
13
- 'swell app frontend dev --port 3000',
10
+ 'swell app frontend dev --proxy-port 3000',
14
11
  'swell app frontend dev --storefront-select',
15
12
  'swell app frontend dev --storefront-id <id>',
16
13
  ];
17
14
  static flags = {
18
- 'no-push': Flags.boolean({
19
- description: 'skip pushing app files initially',
20
- }),
21
- port: Flags.integer({
22
- char: 'p',
23
- description: 'override the default port to run the app locally',
15
+ ...AppDev.flags,
16
+ 'proxy-port': Flags.integer({
17
+ description: 'specify the port for an existing frontend proxy',
18
+ default: 3001,
24
19
  }),
25
20
  'storefront-id': Flags.string({
26
21
  description: 'identify a storefront to preview with and push theme files to',
@@ -29,6 +24,10 @@ export default class AppFrontendDev extends PushAppCommand {
29
24
  default: false,
30
25
  description: 'prompt to select a storefront to preview with',
31
26
  }),
27
+ 'app-dev': Flags.boolean({
28
+ description: 'indicates frontend app is running in app dev mode',
29
+ default: true,
30
+ }),
32
31
  };
33
32
  static orientation = {
34
33
  env: 'test',
@@ -42,12 +41,12 @@ export default class AppFrontendDev extends PushAppCommand {
42
41
  }
43
42
  async run() {
44
43
  const { flags } = await this.parse(AppFrontendDev);
45
- const { port } = flags;
44
+ const { port, 'proxy-port': proxyPort, 'app-dev': isAppDev } = flags;
46
45
  const noPush = flags['no-push'];
47
46
  if (!(await this.ensureAppExists(undefined, false))) {
48
47
  return;
49
48
  }
50
- if (!noPush) {
49
+ if (!noPush && !isAppDev) {
51
50
  await this.pushAppConfigs();
52
51
  }
53
52
  if (this.app.type === 'storefront') {
@@ -55,54 +54,124 @@ export default class AppFrontendDev extends PushAppCommand {
55
54
  this.logStorefrontConnected();
56
55
  }
57
56
  this.saveCurrentStorefront();
58
- const projectType = this.getFrontendProjectType();
59
- await this.startDevServer(projectType, port);
57
+ if (!isAppDev) {
58
+ this.log(`Starting app dev server...\n`);
59
+ }
60
+ const serverPort = await this.startProxyServer(proxyPort || port);
61
+ await this.execFrontendProject(serverPort, isAppDev);
60
62
  }
61
- async startDevServer(projectType, port) {
63
+ async execFrontendProject(serverPort, isAppDev) {
64
+ const projectType = this.getFrontendProjectType(!isAppDev);
65
+ if (!projectType) {
66
+ return;
67
+ }
62
68
  const currentStore = localConfig.getDefaultStore();
63
- const spinner = ora();
64
- // Find an open port starting at 3000
65
- const freePort = port ||
66
- (await getPort({ port: portNumbers(3000, 3100) })) ||
67
- FALLBACK_PORT;
68
- this.log(`Starting ${projectType.name} dev server...\n`);
69
- // Start ngrok proxy
70
- const proxyUrl = await ngrok.connect({
71
- addr: freePort,
72
- region: 'us', // TODO: make it configurable
73
- });
74
- await this.updateLocalProxy(proxyUrl, spinner, this.storefront?.id);
75
- return this.exec(projectType.devCommand.replace('${PORT}', String(freePort)), (string) => {
76
- // Hide useless astro warning about image optimization
77
- if (string.includes('The current configuration does not support image optimization')) {
78
- return false;
79
- }
80
- // Hide useless astro warning about .dev.vars
81
- if (string.includes('There is no `.dev.vars` file')) {
82
- return false;
83
- }
84
- // Hide astro localhost URL/network as it can confuse the user
85
- if (string.includes('┃ Local') || string.includes('┃ Network')) {
86
- return false;
87
- }
88
- // Started, show app url (TODO for nextjs)
89
- if (string.includes('watching for file changes')) {
90
- spinner.succeed(`Started ${projectType.name} dev server on port ${freePort}.\n`);
91
- const sessionId = localConfig.getSessionId(currentStore);
92
- setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
93
- this.watchForChanges();
69
+ let serverReadyDetected = false;
70
+ await this.execFrontend(projectType.devCommand.replace('${PORT}', String(serverPort)), (string) => {
71
+ // Framework-specific output handling and ready detection
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))) {
87
+ serverReadyDetected = true;
88
+ this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
89
+ const sessionId = localConfig.getSessionId(currentStore);
90
+ setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
91
+ if (!isAppDev) {
92
+ this.watchForChanges();
93
+ }
94
+ }
95
+ break;
96
+ }
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;
101
+ }
102
+ // 3. READY DETECTION: Detect server ready, show our message
103
+ if (!serverReadyDetected &&
104
+ /watching for file changes/i.test(string)) {
105
+ serverReadyDetected = true;
106
+ this.log(`Started ${projectType.name} dev server on port ${serverPort}.\n`);
107
+ const sessionId = localConfig.getSessionId(currentStore);
108
+ setTimeout(() => this.logAppLocalUrl(currentStore, sessionId), 100);
109
+ if (!isAppDev) {
110
+ this.watchForChanges();
111
+ }
112
+ }
113
+ break;
114
+ }
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;
123
+ }
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;
137
+ }
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;
154
+ }
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
+ }
170
+ }
171
+ break;
172
+ }
173
+ // No default
94
174
  }
95
175
  });
96
176
  }
97
- async updateLocalProxy(proxyUrl, spinner, storefrontId) {
98
- const storefront = this.app.type === 'storefront' &&
99
- (await this.getAppStorefront({ storefront_id: storefrontId }));
100
- await this.handleRequestErrors(async () => this.api.put({ adminPath: `/client/apps/${this.app.id}/local-proxy` }, {
101
- body: {
102
- proxy_url: proxyUrl,
103
- storefront_id: storefront?.id || null,
104
- storefront_slug: storefront?.slug || null,
105
- },
106
- }), () => spinner.fail('Error starting local proxy'));
107
- }
108
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 (error) {
132
+ catch {
133
133
  // noop
134
134
  }
135
135
  const existingSourcedApps = sourceAppId
@@ -13,6 +13,6 @@ export default class AppPull extends PushAppCommand {
13
13
  env: string;
14
14
  };
15
15
  static summary: string;
16
- run(): Promise<void>;
17
16
  logPulledChanges(pulled: string[], removed: string[]): void;
17
+ run(): Promise<void>;
18
18
  }
@@ -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
- resolvePushPaths(file: string): {
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
- resolvePushPaths(file) {
47
- // Join the appPath and file to get the absolute filePath
48
- const filePath = path.resolve(process.cwd(), file);
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 && semver.gt(localVersion, remoteVersion)) {
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.lt(version, localVersion)) {
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
- createSwellConfig({ allowOverwrite, inputId, inputStorefrontApp, inputType, inputYes, nestedPath, }: {
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;