@swell/cli 2.0.1-alpha.16 → 2.0.1-alpha.18

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 (86) hide show
  1. package/dist/app-command.d.ts +1 -1
  2. package/dist/app-command.js +9 -9
  3. package/dist/commands/app/dev.d.ts +16 -0
  4. package/dist/commands/app/dev.js +28 -0
  5. package/dist/commands/app/frontend/deploy.d.ts +15 -0
  6. package/dist/commands/app/frontend/deploy.js +41 -0
  7. package/dist/commands/app/frontend/dev.d.ts +19 -0
  8. package/dist/commands/app/frontend/dev.js +108 -0
  9. package/dist/commands/app/info.js +14 -9
  10. package/dist/commands/app/init.d.ts +12 -0
  11. package/dist/commands/app/init.js +34 -0
  12. package/dist/commands/app/install.d.ts +0 -3
  13. package/dist/commands/app/install.js +12 -21
  14. package/dist/commands/app/pull.d.ts +15 -0
  15. package/dist/commands/app/pull.js +50 -0
  16. package/dist/commands/app/push.d.ts +9 -12
  17. package/dist/commands/app/push.js +57 -131
  18. package/dist/commands/app/release.d.ts +13 -0
  19. package/dist/commands/app/release.js +148 -0
  20. package/dist/commands/app/version.d.ts +5 -4
  21. package/dist/commands/app/version.js +60 -39
  22. package/dist/commands/app/watch.d.ts +2 -4
  23. package/dist/commands/app/watch.js +3 -83
  24. package/dist/commands/create/app.d.ts +35 -11
  25. package/dist/commands/create/app.js +131 -128
  26. package/dist/commands/create/frontend.d.ts +12 -0
  27. package/dist/commands/create/frontend.js +38 -0
  28. package/dist/commands/create/function.d.ts +2 -2
  29. package/dist/commands/create/function.js +2 -2
  30. package/dist/commands/create/notification.d.ts +2 -2
  31. package/dist/commands/create/notification.js +2 -2
  32. package/dist/commands/env.d.ts +12 -0
  33. package/dist/commands/env.js +31 -0
  34. package/dist/commands/login.js +7 -7
  35. package/dist/commands/logs.js +0 -3
  36. package/dist/commands/theme/dev.d.ts +21 -0
  37. package/dist/commands/theme/dev.js +164 -0
  38. package/dist/commands/theme/init.d.ts +9 -0
  39. package/dist/commands/theme/init.js +15 -0
  40. package/dist/commands/theme/pull.d.ts +20 -0
  41. package/dist/commands/theme/pull.js +65 -0
  42. package/dist/commands/theme/push.d.ts +19 -0
  43. package/dist/commands/theme/push.js +89 -0
  44. package/dist/create-app-command.d.ts +20 -0
  45. package/dist/create-app-command.js +253 -0
  46. package/dist/create-collection-command.d.ts +3 -3
  47. package/dist/create-collection-command.js +4 -4
  48. package/dist/{create-command.d.ts → create-config-command.d.ts} +1 -1
  49. package/dist/{create-command.js → create-config-command.js} +3 -5
  50. package/dist/env/local.d.ts +8 -0
  51. package/dist/env/local.js +7 -0
  52. package/dist/env/production.d.ts +8 -0
  53. package/dist/env/production.js +7 -0
  54. package/dist/env/review.d.ts +8 -0
  55. package/dist/env/review.js +7 -0
  56. package/dist/env/staging.d.ts +8 -0
  57. package/dist/env/staging.js +7 -0
  58. package/dist/lib/api.d.ts +1 -0
  59. package/dist/lib/api.js +39 -13
  60. package/dist/lib/app-config.d.ts +12 -5
  61. package/dist/lib/app-config.js +57 -21
  62. package/dist/lib/apps/app-config.d.ts +17 -3
  63. package/dist/lib/apps/app-config.js +194 -66
  64. package/dist/lib/apps/index.d.ts +92 -12
  65. package/dist/lib/apps/index.js +145 -47
  66. package/dist/lib/apps/paths.d.ts +14 -7
  67. package/dist/lib/apps/paths.js +73 -28
  68. package/dist/lib/config.d.ts +9 -2
  69. package/dist/lib/config.js +49 -1
  70. package/dist/lib/constants.d.ts +5 -0
  71. package/dist/lib/constants.js +23 -4
  72. package/dist/lib/create/content.d.ts +1 -1
  73. package/dist/lib/create/index.js +5 -1
  74. package/dist/lib/info.js +2 -2
  75. package/dist/lib/stores.d.ts +5 -3
  76. package/dist/lib/stores.js +7 -5
  77. package/dist/lib/style.d.ts +2 -0
  78. package/dist/lib/style.js +2 -0
  79. package/dist/push-app-command.d.ts +73 -0
  80. package/dist/push-app-command.js +754 -0
  81. package/dist/remote-app-command.d.ts +35 -9
  82. package/dist/remote-app-command.js +417 -159
  83. package/oclif.manifest.json +817 -71
  84. package/package.json +13 -1
  85. package/dist/commands/app/_pull.d.ts +0 -8
  86. package/dist/commands/app/_pull.js +0 -45
@@ -34,6 +34,10 @@ have available for logging in to.
34
34
  try {
35
35
  user = await this.api.get({ adminPath: 'user' });
36
36
  config.setUser(user);
37
+ this.log(`You are already logged in to ${style.storeId(currentStoreId)} as ${style.currentUser(user.username)}. Use --force to login again, or \`swell switch\` to switch stores.`);
38
+ // eslint-disable-next-line no-process-exit, unicorn/no-process-exit
39
+ process.env.NODE_ENV !== 'test' && process.exit(0);
40
+ return;
37
41
  }
38
42
  catch {
39
43
  // noop
@@ -43,11 +47,9 @@ have available for logging in to.
43
47
  this.api.setStoreEnv(storeId);
44
48
  user = await this.api.get({ adminPath: 'user' }, { sessionId });
45
49
  await this.getAndSetStoreConfig({ sessionId, storeId });
46
- await modifyDefaultStore({ currentStoreId, storeId });
50
+ await modifyDefaultStore({ currentStoreId, storeId }, force);
47
51
  config.setUser(user);
48
- this.log(`You are now logged in to ${style.storeId(storeId)} as ${style.currentUser(user.username)}.`);
49
- // eslint-disable-next-line no-process-exit, unicorn/no-process-exit
50
- process.env.NODE_ENV !== 'test' && process.exit(0);
52
+ this.log(`\nYou are now logged in to ${style.storeId(storeId)} as ${style.currentUser(user.username)}.`);
51
53
  }
52
54
  /**
53
55
  * Use the /user/switch API request to either get the session id for the
@@ -59,9 +61,7 @@ have available for logging in to.
59
61
  * @returns void
60
62
  */
61
63
  async getAndSetStoreConfig({ sessionId, storeId, }) {
62
- const switchResponse = await this.api.post({ adminPath: '/user/switch' },
63
- // eslint-disable-next-line camelcase
64
- { body: { client_id: storeId }, sessionId });
64
+ const switchResponse = await this.api.post({ adminPath: '/user/switch' }, { body: { client_id: storeId }, sessionId });
65
65
  // ensure we have the attribute names as we expect before saving
66
66
  switchResponse.sessionId = switchResponse.session_id;
67
67
  switchResponse.storeId = switchResponse.client_id;
@@ -51,12 +51,10 @@ function buildLogRequestBody(flags) {
51
51
  }
52
52
  const { after, before, env, startPolling } = flags;
53
53
  if (env) {
54
- // eslint-disable-next-line camelcase
55
54
  andConditions.push({ environment_id: env });
56
55
  }
57
56
  else {
58
57
  // Default to test env
59
- // eslint-disable-next-line camelcase
60
58
  andConditions.push({ environment_id: 'test' });
61
59
  }
62
60
  // if we are polling, we want to get logs after the last date we received
@@ -191,7 +189,6 @@ export default class Logs extends SwellCommand {
191
189
  }
192
190
  async getLogs(flags) {
193
191
  const body = buildLogRequestBody(flags);
194
- this.debug('getLogs body', body);
195
192
  const response = await this.api.post({ adminPath: `/data/$get/:logs` }, { body });
196
193
  return response?.results?.reverse() || [];
197
194
  }
@@ -0,0 +1,21 @@
1
+ import { PushAppCommand } from '../../push-app-command.js';
2
+ export default class AppThemeDev extends PushAppCommand {
3
+ static examples: string[];
4
+ static flags: {
5
+ bundle: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
6
+ local: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
7
+ 'no-push': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
+ 'storefront-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
+ 'storefront-select': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
+ };
11
+ static orientation: {
12
+ env: string;
13
+ };
14
+ static summary: string;
15
+ appType: string;
16
+ logAppLocalUrl(storeId: string, sessionId: string): void;
17
+ run(): Promise<void>;
18
+ private findAndInstallDependencies;
19
+ private findAndTryScriptCommands;
20
+ private startThemeDevServer;
21
+ }
@@ -0,0 +1,164 @@
1
+ import { Flags } from '@oclif/core';
2
+ import BrowserSync from 'browser-sync';
3
+ import { findUp } from 'find-up';
4
+ import getPort, { portNumbers } from 'get-port';
5
+ import { execSync, spawn } from 'node:child_process';
6
+ import fs from 'node:fs';
7
+ import ora from 'ora';
8
+ import { default as localConfig } from '../../lib/config.js';
9
+ import style from '../../lib/style.js';
10
+ import { PushAppCommand } from '../../push-app-command.js';
11
+ const FALLBACK_PORT = 3000;
12
+ export default class AppThemeDev extends PushAppCommand {
13
+ static examples = [
14
+ 'swell theme dev',
15
+ 'swell theme dev --local',
16
+ 'swell theme dev --bundle',
17
+ 'swell theme dev --storefront-select',
18
+ 'swell theme dev --storefront-id <id>',
19
+ ];
20
+ static flags = {
21
+ bundle: Flags.boolean({
22
+ description: 'bundle assets',
23
+ }),
24
+ local: Flags.boolean({
25
+ description: 'connect to a running local storefront app dev server',
26
+ }),
27
+ 'no-push': Flags.boolean({
28
+ description: 'skip pushing theme files initially',
29
+ }),
30
+ 'storefront-id': Flags.string({
31
+ description: 'identify a storefront to preview and push theme files to',
32
+ }),
33
+ 'storefront-select': Flags.boolean({
34
+ default: false,
35
+ description: 'prompt to select a storefront to preview and push theme files to',
36
+ }),
37
+ };
38
+ static orientation = {
39
+ env: 'test',
40
+ };
41
+ static summary = `Run a theme in dev mode from your local machine.`;
42
+ appType = 'theme';
43
+ logAppLocalUrl(storeId, sessionId) {
44
+ this.log(`View it at ${style.link(this.localFrontendUrl(storeId, sessionId))}\n`);
45
+ }
46
+ async run() {
47
+ const { flags } = await this.parse(AppThemeDev);
48
+ const { local } = flags;
49
+ const noPush = flags['no-push'];
50
+ if (!(await this.ensureAppExists(undefined, false))) {
51
+ return;
52
+ }
53
+ if (!noPush) {
54
+ await this.pushAppConfigs();
55
+ }
56
+ await this.getStorefrontToPush(flags);
57
+ this.logStorefrontConnected();
58
+ this.saveCurrentStorefront();
59
+ await this.startThemeDevServer(local);
60
+ }
61
+ async findAndInstallDependencies() {
62
+ const spinner = ora('Locating package.json...').start();
63
+ try {
64
+ const packageJsonLockPath = await findUp('package-lock.json', {
65
+ type: 'file',
66
+ });
67
+ if (packageJsonLockPath) {
68
+ spinner.succeed('package-lock.json found. Skipping npm install.');
69
+ return null;
70
+ }
71
+ const packageJsonPath = await findUp('package.json', { type: 'file' });
72
+ if (!packageJsonPath) {
73
+ spinner.info('package.json not found. Skipping bundle process.');
74
+ return null;
75
+ }
76
+ spinner.succeed(`Found package.json at ${packageJsonPath}`);
77
+ spinner.start('Installing dependencies...');
78
+ execSync('npm install', { stdio: 'inherit' });
79
+ spinner.succeed('Dependencies installed');
80
+ return packageJsonPath;
81
+ }
82
+ catch {
83
+ spinner.fail('Error locating package.json. Skipping bundle process.');
84
+ return null;
85
+ }
86
+ }
87
+ async findAndTryScriptCommands() {
88
+ try {
89
+ const data = await fs.promises.readFile('package.json', 'utf8');
90
+ const packageJson = JSON.parse(data);
91
+ if (!packageJson.scripts) {
92
+ console.error('No scripts found in package.json. Try adding scripts to your package file.');
93
+ return;
94
+ }
95
+ const preferredScripts = ['dev', 'watch'];
96
+ const scriptName = preferredScripts.find((script) => packageJson.scripts[script]);
97
+ if (!scriptName) {
98
+ console.warn('Neither "dev" nor "watch" scripts found in package.json');
99
+ return;
100
+ }
101
+ const childProcess = spawn('npm', ['run', scriptName], {
102
+ env: { ...process.env, BROWSERSLIST_IGNORE_OLD_DATA: 'true' },
103
+ shell: true,
104
+ stdio: 'pipe',
105
+ });
106
+ childProcess.stdout.on('data', (data) => {
107
+ const lines = data.toString().split(/\r?\n/);
108
+ for (const line of lines) {
109
+ const trimmedLine = line.trim();
110
+ if (trimmedLine) {
111
+ console.log(`${style.success('📦')} ${trimmedLine}`);
112
+ }
113
+ }
114
+ });
115
+ childProcess.on('exit', (code) => {
116
+ if (code === 0) {
117
+ console.log(`${scriptName} completed successfully.`);
118
+ }
119
+ else {
120
+ console.error(`${scriptName} exited with code ${code}.`);
121
+ }
122
+ });
123
+ }
124
+ catch (error) {
125
+ console.error('Error processing package.json:', error);
126
+ }
127
+ }
128
+ async startThemeDevServer(local) {
129
+ const currentStore = localConfig.getDefaultStore();
130
+ const sessionId = localConfig.getSessionId(currentStore);
131
+ const spinner = ora();
132
+ const bundle = process.argv.includes('--bundle');
133
+ if (bundle) {
134
+ await this.findAndInstallDependencies();
135
+ await this.findAndTryScriptCommands();
136
+ }
137
+ // Find an open port starting at 3000
138
+ const freePort = (await getPort({ port: portNumbers(3000, 3100) })) || FALLBACK_PORT;
139
+ spinner.start(`Starting theme dev server on port ${freePort}...`);
140
+ const storefrontUrl = local
141
+ ? this.localFrontendUrl(currentStore, sessionId)
142
+ : this.storefrontFrontendUrl(currentStore, this.storefront, undefined, true);
143
+ const bs = BrowserSync.create();
144
+ bs.init({
145
+ logLevel: 'silent',
146
+ notify: false,
147
+ open: false,
148
+ proxy: {
149
+ proxyReq: [
150
+ (proxyReq) => {
151
+ proxyReq.setHeader('swell-request-id', `${currentStore}_${Date.now()}`);
152
+ },
153
+ ],
154
+ target: storefrontUrl,
155
+ },
156
+ ui: false,
157
+ });
158
+ await this.watchForChanges({
159
+ onChange: () => bs.reload(),
160
+ });
161
+ spinner.stop();
162
+ this.log(`Watching for changes. View your theme at ${style.link(`http://localhost:${freePort}`)}\n`);
163
+ }
164
+ }
@@ -0,0 +1,9 @@
1
+ import InitApp from '../app/init.js';
2
+ export default class InitTheme extends InitApp {
3
+ static description: string;
4
+ static examples: {
5
+ command: string;
6
+ description: string;
7
+ }[];
8
+ appType: string;
9
+ }
@@ -0,0 +1,15 @@
1
+ import InitApp from '../app/init.js';
2
+ export default class InitTheme extends InitApp {
3
+ static description = 'Initialize theme swell.json in the current directory.';
4
+ static examples = [
5
+ {
6
+ command: 'swell theme init',
7
+ description: 'Initialize theme following command prompts.',
8
+ },
9
+ {
10
+ command: 'swell theme init -y',
11
+ description: 'Initialize theme and accept all default values.',
12
+ },
13
+ ];
14
+ appType = 'theme';
15
+ }
@@ -0,0 +1,20 @@
1
+ import AppPull from '../app/pull.js';
2
+ export default class AppThemePull extends AppPull {
3
+ static args: {
4
+ appId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
5
+ targetPath: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static delayOrientation: boolean;
8
+ static description: string;
9
+ static examples: string[];
10
+ static flags: {
11
+ force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
12
+ 'storefront-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
+ 'storefront-select': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
14
+ 'sync-app': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
15
+ };
16
+ static orientation: {};
17
+ static summary: string;
18
+ appType: string;
19
+ run(): Promise<void>;
20
+ }
@@ -0,0 +1,65 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { ThemeConfigPaths } from '../../lib/apps/index.js';
3
+ import style from '../../lib/style.js';
4
+ import AppPull from '../app/pull.js';
5
+ export default class AppThemePull extends AppPull {
6
+ static args = {
7
+ appId: Args.string({
8
+ default: '',
9
+ description: 'theme app id to pull',
10
+ }),
11
+ targetPath: Args.string({
12
+ default: '',
13
+ description: 'path to download theme files into',
14
+ }),
15
+ };
16
+ static delayOrientation = true;
17
+ static description = `Pull all theme files, a specific file, or a specific configuration
18
+ type from a theme in your store's test environment to your local machine.
19
+
20
+ If APPID is not specified, you will be prompted with a list of themes to choose from.
21
+
22
+ Theme file directories:
23
+ ${Object.values(ThemeConfigPaths)
24
+ .map((dir) => style.path(`${dir}/`))
25
+ .join('\n')}`;
26
+ static examples = [
27
+ 'swell theme pull',
28
+ 'swell theme pull mytheme',
29
+ 'swell theme pull mytheme mytheme-folder',
30
+ 'swell theme pull --force',
31
+ 'swell theme pull --storefront-select',
32
+ 'swell theme pull --storefront-id <id>',
33
+ ];
34
+ static flags = {
35
+ force: Flags.boolean({
36
+ default: false,
37
+ description: 'force pull all theme files',
38
+ }),
39
+ 'storefront-id': Flags.string({
40
+ description: 'identify a storefront to pull theme files from',
41
+ }),
42
+ 'storefront-select': Flags.boolean({
43
+ default: false,
44
+ description: 'prompt to select a storefront to pull theme files to',
45
+ }),
46
+ 'sync-app': Flags.boolean({
47
+ default: false,
48
+ description: 'pull app files in addition to theme files to',
49
+ }),
50
+ };
51
+ static orientation = {};
52
+ static summary = 'Pull theme files from Swell to your local machine.';
53
+ appType = 'theme';
54
+ async run() {
55
+ const { args, flags } = await this.parse(AppThemePull);
56
+ const { force } = flags;
57
+ this.themeSyncApp = flags['sync-app'];
58
+ await this.ensureLoggedIn();
59
+ await this.getStorefrontToPull(args, flags);
60
+ await this.logOrientation();
61
+ const { pulled, removed } = await this.pullAppConfigs(force);
62
+ this.logPulledChanges(pulled, removed);
63
+ this.saveCurrentStorefront();
64
+ }
65
+ }
@@ -0,0 +1,19 @@
1
+ import AppPush from '../app/push.js';
2
+ export default class AppThemePush extends AppPush {
3
+ static args: {
4
+ file: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
5
+ };
6
+ static delayOrientation: boolean;
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
11
+ 'storefront-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
+ 'storefront-select': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
+ 'sync-app': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
14
+ };
15
+ static orientation: {};
16
+ static summary: string;
17
+ appType: string;
18
+ run(): Promise<void>;
19
+ }
@@ -0,0 +1,89 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { ThemeConfigPaths, filePathExists, isPathDirectory, } from '../../lib/apps/index.js';
3
+ import style from '../../lib/style.js';
4
+ import AppPush from '../app/push.js';
5
+ export default class AppThemePush extends AppPush {
6
+ static args = {
7
+ file: Args.string({
8
+ char: 'f',
9
+ description: 'relative path to a configuration file or directory to push',
10
+ }),
11
+ };
12
+ static delayOrientation = true;
13
+ static description = `Push all theme files, a specific file, or a specific configuration
14
+ type to an theme in your store's test environment.
15
+
16
+ If the theme does not exist, it will be created and its global ID saved to a .swellrc file.
17
+
18
+ - If no file is specified, all configuration files will be pushed to the store.
19
+ This includes the theme icon (assets/icon.png) and swell.json.
20
+ - If a file is specified, only that file will be pushed to the store.
21
+ - If a directory is specified, only files in that directory will be pushed.
22
+
23
+ Theme file directories:
24
+ ${Object.values(ThemeConfigPaths)
25
+ .map((dir) => style.path(`${dir}/`))
26
+ .join('\n')}`;
27
+ static examples = [
28
+ 'swell theme push',
29
+ 'swell theme push assets',
30
+ 'swell theme push theme/sections',
31
+ 'swell theme push --sync-app',
32
+ 'swell theme push --force',
33
+ 'swell theme push --storefront-select',
34
+ 'swell theme push --storefront-id <id>',
35
+ ];
36
+ static flags = {
37
+ force: Flags.boolean({
38
+ default: false,
39
+ description: 'force push all files',
40
+ }),
41
+ 'storefront-id': Flags.string({
42
+ description: 'identify a storefront to push theme files to',
43
+ }),
44
+ 'storefront-select': Flags.boolean({
45
+ default: false,
46
+ description: 'prompt to select a storefront to push theme files to',
47
+ }),
48
+ 'sync-app': Flags.boolean({
49
+ default: false,
50
+ description: 'push app files in addition to theme files',
51
+ }),
52
+ };
53
+ static orientation = {};
54
+ static summary = 'Push local files to your Swell theme.';
55
+ appType = 'theme';
56
+ async run() {
57
+ const { args, flags } = await this.parse(AppThemePush);
58
+ const { file } = args;
59
+ const { force } = flags;
60
+ this.themeSyncApp = flags['sync-app'];
61
+ if (!(await this.ensureAppExists(file, this.themeSyncApp))) {
62
+ return;
63
+ }
64
+ if (!this.themeSyncApp && this.appCreated) {
65
+ this.themeSyncApp = true;
66
+ }
67
+ await this.getStorefrontToPush(flags);
68
+ await this.logOrientation();
69
+ if (file) {
70
+ const { filePath, relativePath } = this.resolvePushPaths(file);
71
+ // Push individual files if not referring to the whole app path
72
+ if (filePath !== this.appPath) {
73
+ if (!filePathExists(filePath)) {
74
+ this.error(`Path ${style.path(file)} does not exist.`);
75
+ }
76
+ // Targeting a directory
77
+ await (isPathDirectory(filePath)
78
+ ? this.pushFilePath(relativePath, force)
79
+ : this.pushFile(relativePath));
80
+ this.log();
81
+ this.logStorefrontFrontendUrl(this.storefront);
82
+ return;
83
+ }
84
+ }
85
+ await this.pushAppConfigs(force);
86
+ this.logStorefrontFrontendUrl(this.storefront);
87
+ this.saveCurrentStorefront();
88
+ }
89
+ }
@@ -0,0 +1,20 @@
1
+ import { SwellCommand } from './swell-command.js';
2
+ export declare abstract class CreateAppCommand extends SwellCommand {
3
+ static baseFlags: {
4
+ frontend: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
5
+ 'storefront-app': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ yes: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
7
+ };
8
+ private devApi;
9
+ constructor(argv: string[], config: any);
10
+ createAppConfigFolders(swellConfig: any): Promise<void>;
11
+ createFrontendApp(swellConfig: any, flags: any, directCreate?: boolean, kind?: string): Promise<boolean>;
12
+ createStorefrontApp(swellConfig: any, flags: any, directCreate?: boolean): Promise<boolean>;
13
+ createThemeApp(config: any, flags: any, installedStorefrontApp: any): Promise<boolean>;
14
+ doesPackageManagerExist(packageManager: string): Promise<boolean>;
15
+ execWithStdio(cwd: string, command: string, onOutput?: (string: string) => any | false): Promise<void>;
16
+ findPackageManager(pkg?: string): Promise<string | undefined>;
17
+ getInstalledStorefrontApps(): Promise<any[] | boolean>;
18
+ setupPackage(name: string, config: any, pkg: string): Promise<void>;
19
+ tryPackageSetup(name: string, config: any, pkg: string): Promise<void>;
20
+ }