@devvit/cli 0.11.4-next-2024-12-06-75957d720.0 → 0.11.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.
@@ -33,7 +33,7 @@ class CreateApp extends DevvitCommand {
33
33
  }
34
34
  }
35
35
  catch (err) {
36
- this.error(`Something went wrong: ${StringUtil.caughtToString(err, 'message')}`);
36
+ this.error(`Something went wrong: ${StringUtil.caughtToString(err)}`);
37
37
  }
38
38
  }
39
39
  }
@@ -23,7 +23,7 @@ class Icons extends ProjectCommand {
23
23
  this.log('No SVG assets found - add some to your assets directory!');
24
24
  return;
25
25
  }
26
- ux.action.start('Creating icons map');
26
+ ux.action.start('Creating icons map...');
27
27
  const iconsMap = __classPrivateFieldGet(this, _Icons_instances, "m", _Icons_createIconsMap).call(this, svgAssets);
28
28
  await fsp.writeFile(outputFile, iconsMap);
29
29
  ux.action.stop(`Created icons map at ${outputFile}!`);
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/commands/events.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAwB,MAAM,mCAAmC,CAAC;AAwCxF,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,aAAa;;IAC/C,OAAgB,WAAW,EAAE,MAAM,CAA4C;IAC/E,OAAgB,MAAM,EAAE,OAAO,CAAQ;IACvC,OAAgB,IAAI;;MAMlB;IACF,OAAgB,KAAK;;MAKnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqC3B"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/commands/events.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAwB,MAAM,mCAAmC,CAAC;AAwCxF,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,aAAa;;IAC/C,OAAgB,WAAW,EAAE,MAAM,CAA4C;IAC/E,OAAgB,MAAM,EAAE,OAAO,CAAQ;IACvC,OAAgB,IAAI;;MAMlB;IACF,OAAgB,KAAK;;MAKnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmC3B"}
@@ -76,7 +76,7 @@ _Events_instances = new WeakSet(), _Events_onStreamNext = function _Events_onStr
76
76
  this.warn(chalk.yellow(`unknown message: ${JSON.stringify(msg)}`));
77
77
  }
78
78
  }, _Events_onStreamError = function _Events_onStreamError(err) {
79
- this.error(chalk.red(`error while fetching logs: ${StringUtil.caughtToString(err, 'message')}`));
79
+ this.error(chalk.red(`error while fetching logs: ${StringUtil.caughtToString(err)}`));
80
80
  };
81
81
  Events.description = 'Streams event logs for an installation';
82
82
  Events.hidden = true;
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAwB,MAAM,mCAAmC,CAAC;AAIxF,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,aAAa;;IAChD,OAAgB,WAAW,SACgH;IAE3I,OAAgB,QAAQ,WAMtB;IAEF,OAAgB,IAAI;;;MAalB;IAMI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4G3B"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAwB,MAAM,mCAAmC,CAAC;AAIxF,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,aAAa;;IAChD,OAAgB,WAAW,SACgH;IAE3I,OAAgB,QAAQ,WAMtB;IAEF,OAAgB,IAAI;;;MAalB;IAMI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyG3B"}
@@ -43,7 +43,7 @@ class Install extends DevvitCommand {
43
43
  __classPrivateFieldGet(this, _Install_appVersionClient, "f").GetNutritionByNameVersion({ name, version }),
44
44
  ]);
45
45
  if (existingInstallInfo) {
46
- ux.action.stop(`Currently on version ${DevvitVersion.fromProtoAppVersionInfo(existingInstallInfo.appVersion).toString()}`);
46
+ ux.action.stop(`Currently on version ${DevvitVersion.fromProtoAppVersionInfo(existingInstallInfo.appVersion).toString()} ✅`);
47
47
  }
48
48
  this.log(nutritionCategoriesToString(name, nutrition.categories));
49
49
  ux.action.start(`Installing ${name} to r/${subreddit}`);
@@ -52,7 +52,7 @@ class Install extends DevvitCommand {
52
52
  if (existingInstallInfo) {
53
53
  if (existingInstallInfo.appVersion && appVersion.id === existingInstallInfo.appVersion.id) {
54
54
  // exit gracefully if the current app version is already installed
55
- ux.action.stop(`Version ${DevvitVersion.fromProtoAppVersionInfo(existingInstallInfo.appVersion).toString()} has already been installed.`);
55
+ ux.action.stop(`Version ${DevvitVersion.fromProtoAppVersionInfo(existingInstallInfo.appVersion).toString()} has already been installed ✅`);
56
56
  return;
57
57
  }
58
58
  else {
@@ -71,11 +71,10 @@ class Install extends DevvitCommand {
71
71
  upgradeStrategy: 0,
72
72
  });
73
73
  }
74
- ux.action.stop(`Successfully installed version ${DevvitVersion.fromProtoAppVersionInfo(installationInfo.appVersion).toString()}!`);
74
+ ux.action.stop(`Successfully installed version ${DevvitVersion.fromProtoAppVersionInfo(installationInfo.appVersion).toString()} ✅`);
75
75
  }
76
76
  catch (err) {
77
- ux.action.stop('Error');
78
- this.error(`An error occurred while installing your app: ${StringUtil.caughtToString(err, 'message')}`);
77
+ this.error(`An error occurred while installing your app: ${StringUtil.caughtToString(err)}`);
79
78
  }
80
79
  }
81
80
  }
@@ -23,7 +23,7 @@ class ListInstalls extends DevvitCommand {
23
23
  }
24
24
  async run() {
25
25
  const { args } = await this.parse(ListInstalls);
26
- ux.action.start('Loading installations');
26
+ ux.action.start('loading');
27
27
  const results = await __classPrivateFieldGet(this, _ListInstalls_instances, "m", _ListInstalls_fetchInstalls).call(this, args.subreddit);
28
28
  ux.action.stop();
29
29
  this.log(); // newline
@@ -1,3 +1,4 @@
1
+ import type { AppVersionInfo } from '@devvit/protos/community.js';
1
2
  import type { Bundle } from '@devvit/protos/types/devvit/plugin/buildpack/buildpack_common.js';
2
3
  import type { FlagInput } from '@oclif/core/lib/interfaces/parser.js';
3
4
  import Upload from '../commands/upload.js';
@@ -9,6 +10,7 @@ export default class Playtest extends Upload {
9
10
  static args: {
10
11
  subreddit: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
11
12
  };
13
+ checkVersionBuildStatus(appVersionInfo: AppVersionInfo): Promise<boolean>;
12
14
  run(): Promise<void>;
13
15
  }
14
16
  export declare function modifyBundleVersions(bundles: Bundle[], version: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"playtest.d.ts","sourceRoot":"","sources":["../../src/commands/playtest.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kEAAkE,CAAC;AAW/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAOtE,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAiB3C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM;;IAC1C,OAAgB,WAAW,SACgK;IAE3L,OAAgB,QAAQ,WAItB;IAEF,WAAoB,KAAK,IAAI,SAAS,CAerC;IAED,OAAgB,IAAI;;MAMlB;IA0Da,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA+QpC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAM7E"}
1
+ {"version":3,"file":"playtest.d.ts","sourceRoot":"","sources":["../../src/commands/playtest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,6BAA6B,CAAC;AAOxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kEAAkE,CAAC;AAW/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAOtE,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAiB3C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM;;IAC1C,OAAgB,WAAW,SACgK;IAE3L,OAAgB,QAAQ,WAItB;IAEF,WAAoB,KAAK,IAAI,SAAS,CAerC;IAED,OAAgB,IAAI;;MAMlB;IAiCI,uBAAuB,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBhE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2QpC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAM7E"}
@@ -9,7 +9,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
- var _Playtest_instances, _a, _Playtest_installationsClient, _Playtest_appLogSub, _Playtest_bundler, _Playtest_existingInstallInfo, _Playtest_appInfo, _Playtest_version, _Playtest_lastBundles, _Playtest_lastQueuedBundles, _Playtest_isOnWatchExecuting, _Playtest_server, _Playtest_flags, _Playtest_watchAssets, _Playtest_getExistingInstallInfo, _Playtest_checkVersionBuildStatus, _Playtest_onWatch, _Playtest_onWatchError, _Playtest_onExit;
12
+ var _Playtest_instances, _a, _Playtest_installationsClient, _Playtest_appLogSub, _Playtest_bundler, _Playtest_existingInstallInfo, _Playtest_appInfo, _Playtest_version, _Playtest_lastBundles, _Playtest_lastQueuedBundles, _Playtest_isOnWatchExecuting, _Playtest_server, _Playtest_flags, _Playtest_watchAssets, _Playtest_getExistingInstallInfo, _Playtest_onWatch, _Playtest_onWatchError, _Playtest_onExit;
13
13
  import { BuildStatus, InstallationType, VersionVisibility, } from '@devvit/protos/community.js';
14
14
  import { ASSET_DIRNAME, WEB_VIEW_ASSET_DIRNAME } from '@devvit/shared-types/Assets.js';
15
15
  import { ACTOR_SRC_DIR, ACTOR_SRC_PRIMARY_NAME, MAX_ALLOWED_SUBSCRIBER_COUNT, PRODUCTS_JSON_FILE, } from '@devvit/shared-types/constants.js';
@@ -96,9 +96,9 @@ class Playtest extends Upload {
96
96
  appVersionInfo = await this.createVersion(__classPrivateFieldGet(this, _Playtest_appInfo, "f").app, __classPrivateFieldGet(this, _Playtest_version, "f"), __classPrivateFieldGet(this, _Playtest_lastBundles, "f"), VersionVisibility.PRIVATE);
97
97
  }
98
98
  catch (err) {
99
- ux.action.stop(chalk.red('Error'));
100
99
  if (err instanceof Error) {
101
- this.log(chalk.red(`\n${StringUtil.caughtToString(err, 'message')}\n`)); // Don't log as error so we don't exit the process.
100
+ // Don't log as error so we don't exit the process.
101
+ this.log(chalk.red(`\n${err}\n`));
102
102
  }
103
103
  else {
104
104
  this.error(`An unknown error occurred when creating the app version.\n${err}`);
@@ -107,22 +107,21 @@ class Playtest extends Upload {
107
107
  return;
108
108
  }
109
109
  // 5. confirm new version has finished building:
110
- if (!(await __classPrivateFieldGet(this, _Playtest_instances, "m", _Playtest_checkVersionBuildStatus).call(this, appVersionInfo))) {
110
+ if (!(await this.checkVersionBuildStatus(appVersionInfo))) {
111
111
  this.error('App version did not build successfully.');
112
112
  }
113
113
  // 6. install playtest version to specified subreddit:
114
114
  const appWithVersion = `${__classPrivateFieldGet(this, _Playtest_appInfo, "f").app.slug}@${__classPrivateFieldGet(this, _Playtest_version, "f")}`;
115
115
  const appVersionId = await slugVersionStringToUUID(appWithVersion, this.appClient);
116
116
  const playtestUrl = chalk.bold.green(`${REDDIT_DESKTOP}/r/${subreddit}${__classPrivateFieldGet(this, _Playtest_flags, "f")?.connect ? `?playtest=${__classPrivateFieldGet(this, _Playtest_appInfo, "f").app.slug}` : ''}`);
117
- ux.action.start(`Installing playtest version ${__classPrivateFieldGet(this, _Playtest_version, "f")}`);
117
+ ux.action.start(`Installing playtest version ${__classPrivateFieldGet(this, _Playtest_version, "f")}...`);
118
118
  await __classPrivateFieldGet(this, _Playtest_installationsClient, "f").Upgrade({
119
119
  id: __classPrivateFieldGet(this, _Playtest_existingInstallInfo, "f").installation.id,
120
120
  appVersionId,
121
121
  });
122
- if (!__classPrivateFieldGet(this, _Playtest_flags, "f")?.['no-live-reload']) {
122
+ if (!__classPrivateFieldGet(this, _Playtest_flags, "f")?.['no-live-reload'])
123
123
  __classPrivateFieldGet(this, _Playtest_server, "f")?.send({ appInstalled: {} });
124
- }
125
- ux.action.stop(`Success! Please visit your test subreddit and refresh to see your latest changes:\n✨ ${playtestUrl}\n`);
124
+ ux.action.stop(`✅\nSuccess! Please visit your test subreddit and refresh to see your latest changes:\n✨ ${playtestUrl}\n`);
126
125
  __classPrivateFieldSet(this, _Playtest_isOnWatchExecuting, false, "f");
127
126
  // If there's a queued watch, execute it now.
128
127
  if (__classPrivateFieldGet(this, _Playtest_lastQueuedBundles, "f")) {
@@ -132,7 +131,7 @@ class Playtest extends Upload {
132
131
  }
133
132
  });
134
133
  _Playtest_onWatchError.set(this, (err) => {
135
- this.error(`watch error: ${StringUtil.caughtToString(err, 'message')}`);
134
+ this.error(`watch error: ${StringUtil.caughtToString(err)}`);
136
135
  });
137
136
  }
138
137
  static get flags() {
@@ -150,6 +149,28 @@ class Playtest extends Upload {
150
149
  }),
151
150
  };
152
151
  }
152
+ async checkVersionBuildStatus(appVersionInfo) {
153
+ ux.action.start('App is building remotely...');
154
+ for (let i = 0; i < 20 && appVersionInfo.buildStatus === BuildStatus.BUILDING; i++) {
155
+ // version is still building: wait and try again
156
+ await sleep(2000);
157
+ const info = await this.appVersionClient.Get({ id: appVersionInfo.id });
158
+ if (!info.appVersion) {
159
+ this.error('Something went wrong, no app version available.');
160
+ }
161
+ appVersionInfo = info.appVersion;
162
+ if (i === 10) {
163
+ this.log(`Your app's taking a while to build - sorry for the delay!`);
164
+ }
165
+ }
166
+ if (appVersionInfo.buildStatus === BuildStatus.READY) {
167
+ ux.action.stop(`✅`);
168
+ }
169
+ else {
170
+ this.warn('Something went wrong: the previous version did not build successfully.');
171
+ }
172
+ return appVersionInfo.buildStatus === BuildStatus.READY;
173
+ }
153
174
  async run() {
154
175
  // Despite the name, finally() is only invoked on successful termination.
155
176
  process.on('SIGINT', () => void __classPrivateFieldGet(this, _Playtest_instances, "m", _Playtest_onExit).call(this));
@@ -181,13 +202,13 @@ class Playtest extends Upload {
181
202
  this.error(`That app already exists, and you can't playtest someone else's app!`);
182
203
  }
183
204
  // App doesn't exist - tell the user to run `devvit upload` first
184
- this.error("Your app doesn't exist yet - you'll need to run 'devvit upload' once before you can playtest your app.");
205
+ this.error(`Your app doesn't exist yet - you'll need to run 'devvit upload' once before you can playtest your app.`);
185
206
  }
186
207
  }
187
208
  const subreddit = getSubredditNameWithoutPrefix(args.subreddit);
188
209
  __classPrivateFieldSet(this, _Playtest_appInfo, await getAppBySlug(this.appClient, appName), "f");
189
210
  if (!__classPrivateFieldGet(this, _Playtest_appInfo, "f")) {
190
- this.error("Your app doesn't exist yet - you'll need to run 'devvit upload' before you can playtest your app.");
211
+ this.error(`Your app doesn't exist yet - you'll need to run 'devvit upload' before you can playtest your app.`);
191
212
  }
192
213
  // alert user if they're about to run playtest in a large subreddit
193
214
  const subscriberCount = await fetchSubredditSubscriberCount(subreddit, token);
@@ -213,12 +234,12 @@ class Playtest extends Upload {
213
234
  // before starting playtest session, make sure app has been installed to the test subreddit:
214
235
  const appWithVersion = `${appName}@${__classPrivateFieldGet(this, _Playtest_version, "f")}`;
215
236
  const appVersionId = await slugVersionStringToUUID(appWithVersion, this.appClient);
216
- ux.action.start(`Checking for existing installation`);
237
+ ux.action.start(`Checking for existing installation...`);
217
238
  __classPrivateFieldSet(this, _Playtest_existingInstallInfo, await __classPrivateFieldGet(this, _Playtest_instances, "m", _Playtest_getExistingInstallInfo).call(this, subreddit), "f");
218
239
  if (!__classPrivateFieldGet(this, _Playtest_existingInstallInfo, "f")) {
219
240
  ux.action.stop(`No existing installation.`);
220
241
  const userT2Id = await this.getUserT2Id(token);
221
- ux.action.start(`Installing`);
242
+ ux.action.start(`Installing...`);
222
243
  try {
223
244
  __classPrivateFieldSet(this, _Playtest_existingInstallInfo, await __classPrivateFieldGet(this, _Playtest_installationsClient, "f").Create({
224
245
  appVersionId,
@@ -229,10 +250,8 @@ class Playtest extends Upload {
229
250
  }), "f");
230
251
  }
231
252
  catch (err) {
232
- ux.action.stop('Error');
233
- this.error(`An error occurred while installing your app: ${StringUtil.caughtToString(err, 'message')}`);
253
+ this.error(`An error occurred while installing your app: ${StringUtil.caughtToString(err)}`);
234
254
  }
235
- ux.action.stop();
236
255
  }
237
256
  else {
238
257
  ux.action.stop(`Found!`);
@@ -270,27 +289,6 @@ _a = Playtest, _Playtest_installationsClient = new WeakMap(), _Playtest_appLogSu
270
289
  return fullInstallInfoList.find((install) => {
271
290
  return install.app?.id === __classPrivateFieldGet(this, _Playtest_appInfo, "f")?.app?.id;
272
291
  });
273
- }, _Playtest_checkVersionBuildStatus = async function _Playtest_checkVersionBuildStatus(appVersionInfo) {
274
- ux.action.start('App is building remotely');
275
- for (let i = 0; i < 20 && appVersionInfo.buildStatus === BuildStatus.BUILDING; i++) {
276
- // version is still building: wait and try again
277
- await sleep(2000);
278
- const info = await this.appVersionClient.Get({ id: appVersionInfo.id });
279
- if (!info.appVersion) {
280
- this.error('Something went wrong, no app version available.');
281
- }
282
- appVersionInfo = info.appVersion;
283
- if (i === 10) {
284
- this.log(`Your app's taking a while to build - sorry for the delay!`);
285
- }
286
- }
287
- if (appVersionInfo.buildStatus === BuildStatus.READY) {
288
- ux.action.stop();
289
- }
290
- else {
291
- this.warn('Something went wrong: the previous version did not build successfully.');
292
- }
293
- return appVersionInfo.buildStatus === BuildStatus.READY;
294
292
  }, _Playtest_onExit = async function _Playtest_onExit() {
295
293
  const revertCommand = chalk.blue(`devvit install ${__classPrivateFieldGet(this, _Playtest_existingInstallInfo, "f").installation.location.name} ${__classPrivateFieldGet(this, _Playtest_appInfo, "f").app.slug}@latest`);
296
294
  __classPrivateFieldGet(this, _Playtest_appLogSub, "f")?.unsubscribe();
@@ -1 +1 @@
1
- {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAcpE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,cAAc;;IACjD,OAAgB,WAAW,SAC8H;IAEzJ,OAAgB,QAAQ,WAKtB;IAEF,OAAgB,IAAI;;MAMlB;IAEF,OAAgB,KAAK;;;MAanB;IAMI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA8L3B"}
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAcpE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,cAAc;;IACjD,OAAgB,WAAW,SAC8H;IAEzJ,OAAgB,QAAQ,WAKtB;IAEF,OAAgB,IAAI;;MAMlB;IAEF,OAAgB,KAAK;;;MAanB;IAMI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4L3B"}
@@ -35,9 +35,9 @@ class Publish extends ProjectCommand {
35
35
  const appWithVersion = await this.inferAppNameAndVersion(args.appWithVersion);
36
36
  await this.checkIfUserLoggedIn();
37
37
  await this.checkDeveloperAccount();
38
- ux.action.start(`Finding ${appWithVersion}`);
38
+ ux.action.start(`Finding ${appWithVersion}...`);
39
39
  const { appInfo, appVersion } = await getInfoForSlugString(appWithVersion, __classPrivateFieldGet(this, _Publish_appClient, "f"));
40
- ux.action.stop();
40
+ ux.action.stop(`✅`);
41
41
  const devvitVersion = new DevvitVersion(appVersion.majorVersion, appVersion.minorVersion, appVersion.patchVersion, appVersion.prereleaseVersion);
42
42
  if (!appInfo.app) {
43
43
  this.error('There was an error retrieving the app info.');
@@ -110,14 +110,13 @@ _Publish_appClient = new WeakMap(), _Publish_appVersionClient = new WeakMap(), _
110
110
  validInstallTypes: [InstallationType.SUBREDDIT],
111
111
  pool: 0, // Don't change the pool
112
112
  };
113
- ux.action.start(`Publishing version "${devvitVersion.toString()}" to Reddit`);
113
+ ux.action.start(`Publishing version "${devvitVersion.toString()}" to Reddit...`);
114
114
  try {
115
115
  const appVersionInfo = await __classPrivateFieldGet(this, _Publish_appVersionClient, "f").Update(appVersionUpdateRequest);
116
- ux.action.stop();
116
+ ux.action.stop('✅');
117
117
  return appVersionInfo;
118
118
  }
119
119
  catch (error) {
120
- ux.action.stop('Error');
121
120
  return handleTwirpError(error, (message) => this.error(message));
122
121
  }
123
122
  }, _Publish_promptOpenURL = async function _Publish_promptOpenURL(url) {
@@ -130,20 +129,19 @@ _Publish_appClient = new WeakMap(), _Publish_appVersionClient = new WeakMap(), _
130
129
  this.error(`An error occurred when opening the URL: ${url}`);
131
130
  }
132
131
  }
133
- process.exit(0);
132
+ process.exit();
134
133
  }, _Publish_submitForReview = async function _Publish_submitForReview(appVersionId, devvitVersion, visibility) {
135
- ux.action.start(`Submitting version "${devvitVersion.toString()}" for review`);
134
+ ux.action.start(`Submitting version "${devvitVersion.toString()}" for review...`);
136
135
  try {
137
136
  await __classPrivateFieldGet(this, _Publish_appPRClient, "f").Submit({ appVersionId, visibility });
138
- ux.action.stop();
137
+ ux.action.stop('✅');
139
138
  return;
140
139
  }
141
140
  catch (err) {
142
- ux.action.stop('Error');
143
141
  if (err && typeof err === 'object' && 'code' in err && err.code === 'already_exists') {
144
142
  this.error('This version has already been submitted for review.');
145
143
  }
146
- this.error(StringUtil.caughtToString(err, 'message'));
144
+ this.error(StringUtil.caughtToString(err));
147
145
  }
148
146
  }, _Publish_promptForVisibility = async function _Publish_promptForVisibility() {
149
147
  const res = await inquirer.prompt([
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/settings/list.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,cAAc;;IACzD,OAAgB,WAAW,SACkG;IAG9G,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAuEpC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/settings/list.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,cAAc;;IACzD,OAAgB,WAAW,SACkG;IAG9G,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsEpC"}
@@ -25,7 +25,7 @@ class ListAppSettings extends ProjectCommand {
25
25
  try {
26
26
  const appInfo = await getAppBySlug(__classPrivateFieldGet(this, _ListAppSettings_appService, "f"), appName);
27
27
  if (!appInfo?.app?.id) {
28
- ux.action.stop("Error: Your app doesn't exist yet - you'll need to run 'devvit upload' before you can list settings.");
28
+ ux.action.stop(`❌ Your app doesn't exist yet - you'll need to run 'devvit upload' before you can list settings.`);
29
29
  return;
30
30
  }
31
31
  const response = await __classPrivateFieldGet(this, _ListAppSettings_appSettingsService, "f").GetForm({
@@ -39,18 +39,16 @@ class ListAppSettings extends ProjectCommand {
39
39
  catch (err) {
40
40
  if (err instanceof TwirpError) {
41
41
  if (err.code === TwirpErrorCode.NotFound) {
42
- ux.action.stop(`Please install your app before listing settings.`);
42
+ ux.action.stop(`❌ Please install your app before listing settings.`);
43
43
  return;
44
44
  }
45
45
  else if (err.message.includes('does not provide method')) {
46
- ux.action.stop(`Unable to fetch settings. Please verify Devvit.addSettings was used in your app.`);
46
+ ux.action.stop(`❌ Unable to fetch settings. Please verify Devvit.addSettings was used in your app.`);
47
47
  return;
48
48
  }
49
49
  }
50
- else {
51
- ux.action.stop('Error');
52
- }
53
- this.error(StringUtil.caughtToString(err, 'message'));
50
+ ux.action.stop(`❌`);
51
+ this.error(StringUtil.caughtToString(err));
54
52
  }
55
53
  }
56
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/commands/settings/set.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;;IACxD,OAAgB,WAAW,SACwE;IAInG,OAAgB,IAAI;;MAKlB;IAca,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiDpC"}
1
+ {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/commands/settings/set.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;;IACxD,OAAgB,WAAW,SACwE;IAInG,OAAgB,IAAI;;MAKlB;IAca,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6CpC"}
@@ -29,7 +29,7 @@ class SetAppSettings extends ProjectCommand {
29
29
  try {
30
30
  const appInfo = await getAppBySlug(__classPrivateFieldGet(this, _SetAppSettings_appService, "f"), appName);
31
31
  if (!appInfo?.app?.id) {
32
- ux.action.stop("Error: Your app doesn't exist yet - you'll need to run 'devvit upload' before you can set settings.");
32
+ ux.action.stop(`❌ Your app doesn't exist yet - you'll need to run 'devvit upload' before you can set settings.`);
33
33
  return;
34
34
  }
35
35
  const response = await __classPrivateFieldGet(this, _SetAppSettings_appSettingsService, "f").UpdateSettings({
@@ -47,25 +47,19 @@ class SetAppSettings extends ProjectCommand {
47
47
  if (!response.success) {
48
48
  this.error(`${JSON.stringify(response.errors)}`);
49
49
  }
50
- ux.action.stop(`Successfully added app settings for ${settingsKey}!`);
50
+ ux.action.stop(`✅ Successfully added app settings for ${settingsKey}!`);
51
51
  }
52
52
  catch (err) {
53
53
  if (err instanceof TwirpError) {
54
54
  if (err.code === TwirpErrorCode.NotFound) {
55
55
  const msg = err.message.includes('addSettings')
56
- ? `Error: Unable to lookup the setting key: ${settingsKey}, please verify Devvit.addSettings was used in your app and the setting's scope is set to SettingScope.App.`
57
- : 'Error: Please install your app before listing settings.';
58
- ux.action.stop(msg);
56
+ ? `Unable to lookup the setting key: ${settingsKey}, please verify Devvit.addSettings was used in your app and the setting's scope is set to SettingScope.App.`
57
+ : 'Please install your app before listing settings.';
58
+ ux.action.stop(`❌ ${msg}`);
59
59
  return;
60
60
  }
61
- else {
62
- ux.action.stop('Error');
63
- }
64
- }
65
- else {
66
- ux.action.stop('Error');
67
61
  }
68
- this.error(StringUtil.caughtToString(err, 'message'));
62
+ this.error(StringUtil.caughtToString(err));
69
63
  }
70
64
  }
71
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAwB,MAAM,mCAAmC,CAAC;AAUxF,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;;IAClD,OAAgB,WAAW,SAAmD;IAE9E,OAAgB,QAAQ,WAItB;IAEF,OAAgB,IAAI;;;MAYlB;IAKI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyD3B"}
1
+ {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAwB,MAAM,mCAAmC,CAAC;AAUxF,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;;IAClD,OAAgB,WAAW,SAAmD;IAE9E,OAAgB,QAAQ,WAItB;IAEF,OAAgB,IAAI;;;MAYlB;IAKI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAuD3B"}
@@ -51,19 +51,17 @@ class Uninstall extends DevvitCommand {
51
51
  id = installationToRemove.id;
52
52
  }
53
53
  catch (err) {
54
- ux.action.stop('Error');
55
- this.error(`Error while trying to find installation to remove: ${StringUtil.caughtToString(err, 'message')}`);
54
+ this.error(`Error while trying to find installation to remove: ${StringUtil.caughtToString(err)}`);
56
55
  }
57
- ux.action.stop();
56
+ ux.action.stop(`✅`);
58
57
  ux.action.start(`Uninstalling`);
59
58
  try {
60
59
  await __classPrivateFieldGet(this, _Uninstall_installationsClient, "f").Remove({ id });
61
60
  }
62
61
  catch (err) {
63
- ux.action.stop('Error');
64
- this.error(`ERROR: Unable to uninstall app: ${StringUtil.caughtToString(err, 'message')}`);
62
+ this.error(`ERROR: Unable to uninstall app: ${StringUtil.caughtToString(err)}`);
65
63
  }
66
- ux.action.stop();
64
+ ux.action.stop('✅');
67
65
  }
68
66
  }
69
67
  _Uninstall_installationsClient = new WeakMap(), _Uninstall_appVersionClient = new WeakMap();
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/commands/update/app.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAQvE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAc;IACnD,OAAgB,WAAW,SACsD;IAEjF,OAAgB,QAAQ,WAA2B;cAE1B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAaxC,cAAc,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC3D,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAC3B;AA0DD,MAAM,MAAM,oBAAoB,GAC5B;IACE,OAAO,EAAE,KAAK,CAAC;IACf,aAAa,EAAE,SAAS,CAAC;CAC1B,GACD;IACE,OAAO,EAAE,IAAI,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEN;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CA6F/B"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/commands/update/app.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAQvE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAc;IACnD,OAAgB,WAAW,SACsD;IAEjF,OAAgB,QAAQ,WAA2B;cAE1B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAexC,cAAc,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B3D,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAC3B;AA0DD,MAAM,MAAM,oBAAoB,GAC5B;IACE,OAAO,EAAE,KAAK,CAAC;IACf,aAAa,EAAE,SAAS,CAAC;CAC1B,GACD;IACE,OAAO,EAAE,IAAI,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEN;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CA6F/B"}
@@ -18,7 +18,9 @@ class UpdateApp extends ProjectCommand {
18
18
  const devvitVersion = semver.parse(cliPackageJSON.version);
19
19
  const result = await matchDevvitPackageVersions(this.projectRoot, devvitVersion, true);
20
20
  if (!result.success) {
21
- process.exit(1);
21
+ this.exit(1);
22
+ // `this.exit` never returns, but it's typed as `void` not `never`, so we need to return for type safety
23
+ return;
22
24
  }
23
25
  await this.doUpdatesSince(result.oldestVersion);
24
26
  }
@@ -32,12 +34,11 @@ class UpdateApp extends ProjectCommand {
32
34
  this.log('Performing update actions:');
33
35
  isFirstAction = false;
34
36
  }
35
- ux.action.start(`Attempting to ${action.description}`);
37
+ ux.action.start(`Attempting to ${action.description}...`);
36
38
  await action.run(this);
37
- ux.action.stop();
39
+ ux.action.stop('done!');
38
40
  }
39
41
  catch (err) {
40
- ux.action.stop('Error');
41
42
  isSuccess = false;
42
43
  this.warn(`An error occurred while attempting to ${action.description}:`);
43
44
  this.warn(err);
@@ -1 +1 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/commands/upload.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,OAAO,EACZ,cAAc,EAEd,WAAW,EAIX,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kEAAkE,CAAC;AAmB/F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AActE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAa5D,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,cAAc;;IAChD,OAAgB,WAAW,SAA+M;IAE1O,OAAgB,KAAK,EAAE,SAAS,CAgD9B;IAEF,QAAQ,CAAC,SAAS,kDAAqB;IACvC,QAAQ,CAAC,gBAAgB,yDAA4B;IAe/C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA4JpB,YAAY,CAChB,aAAa,EAAE,YAAY,EAC3B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,WAAW,CAAC;IAqGjB,cAAc,CAClB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,aAAa,CAAC;IAuBnB,aAAa,CACjB,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,aAAa,EACzB,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,cAAc,CAAC;IA8NX,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CAuM1D"}
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/commands/upload.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,OAAO,EACZ,cAAc,EAEd,WAAW,EAIX,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kEAAkE,CAAC;AAmB/F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AActE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAa5D,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,cAAc;;IAChD,OAAgB,WAAW,SAA+M;IAE1O,OAAgB,KAAK,EAAE,SAAS,CAgD9B;IAEF,QAAQ,CAAC,SAAS,kDAAqB;IACvC,QAAQ,CAAC,gBAAgB,yDAA4B;IAe/C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA4JpB,YAAY,CAChB,aAAa,EAAE,YAAY,EAC3B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,WAAW,CAAC;IA8FjB,cAAc,CAClB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,aAAa,CAAC;IAuBnB,aAAa,CACjB,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,aAAa,EACzB,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,cAAc,CAAC;IA4NX,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CA0M1D"}
@@ -79,7 +79,7 @@ class Upload extends ProjectCommand {
79
79
  appInfo = await getAppBySlug(this.appClient, appName);
80
80
  }
81
81
  catch (e) {
82
- this.error(StringUtil.caughtToString(e, 'message'));
82
+ this.error(StringUtil.caughtToString(e));
83
83
  }
84
84
  if (!flags.justDoIt) {
85
85
  // If we're not just doing it, check and make sure there's a chance our
@@ -107,9 +107,9 @@ class Upload extends ProjectCommand {
107
107
  if (shouldCreateNewApp || !appInfo) {
108
108
  // If we're creating a new app, or if we couldn't find the app
109
109
  // bundle the app now, to ensure it builds before we potentially create an app
110
- ux.action.start('Verifying app builds');
110
+ ux.action.start('Verifying app builds...');
111
111
  await __classPrivateFieldGet(this, _Upload_instances, "m", _Upload_bundleActors).call(this, username, projectConfig.version, !flags.disableTypecheck);
112
- ux.action.stop();
112
+ ux.action.stop('✅');
113
113
  didVerificationBuild = true;
114
114
  appInfo = await this.createNewApp(projectConfig, flags.copyPaste, flags.justDoIt);
115
115
  }
@@ -124,9 +124,9 @@ class Upload extends ProjectCommand {
124
124
  // Now, create a new version, probably prompting for the new version number
125
125
  const version = await this.getNextVersion(appInfo, flags.bump, !flags.justDoIt);
126
126
  __classPrivateFieldGet(this, _Upload_event, "f").devplatform.app_version_number = version.toString();
127
- ux.action.start(didVerificationBuild ? 'Rebuilding for first upload' : 'Building');
127
+ ux.action.start(didVerificationBuild ? 'Rebuilding for first upload...' : 'Building...');
128
128
  const bundles = await __classPrivateFieldGet(this, _Upload_instances, "m", _Upload_bundleActors).call(this, username, version.toString(), !flags.disableTypecheck);
129
- ux.action.stop();
129
+ ux.action.stop('✅');
130
130
  try {
131
131
  await this.createVersion(appInfo.app, version, bundles, VersionVisibility.PRIVATE);
132
132
  }
@@ -140,7 +140,7 @@ class Upload extends ProjectCommand {
140
140
  }
141
141
  this.log(`\n✨ Visit ${chalk.cyan.bold(`${DEVVIT_PORTAL_URL}/apps/${appInfo.app?.slug}`)} to view your app!`);
142
142
  await __classPrivateFieldGet(this, _Upload_instances, "m", _Upload_sendEventIfNotSent).call(this);
143
- process.exit(0);
143
+ process.exit();
144
144
  }
145
145
  async createNewApp(projectConfig, copyPaste, justDoIt) {
146
146
  projectConfig.name = await __classPrivateFieldGet(this, _Upload_instances, "m", _Upload_promptNameUntilNotTaken).call(this, sluggable(projectConfig.name) ? makeSlug(projectConfig.name) : undefined);
@@ -185,7 +185,7 @@ class Upload extends ProjectCommand {
185
185
  __classPrivateFieldGet(this, _Upload_event, "f").devplatform.cli_upload_is_nsfw = isNsfw;
186
186
  __classPrivateFieldGet(this, _Upload_event, "f").devplatform.app_name = projectConfig.name;
187
187
  try {
188
- ux.action.start('Creating app');
188
+ ux.action.start('Creating app...');
189
189
  // let's eliminate the "slug" field and just update the "name" directly
190
190
  const newApp = await this.appClient.Create(appCreationRequest);
191
191
  await updateDevvitConfig(this.projectRoot, this.configFile, {
@@ -200,17 +200,11 @@ class Upload extends ProjectCommand {
200
200
  };
201
201
  }
202
202
  catch (err) {
203
- ux.action.stop('Error');
204
- if (err instanceof TwirpError) {
205
- if (err.code === TwirpErrorCode.AlreadyExists) {
206
- this.error(`An app account with the name "${projectConfig.name}" already exists. Please change the "name" field of devvit.yaml and try again.`);
207
- }
208
- else {
209
- this.error(StringUtil.caughtToString(err, 'message'));
210
- }
203
+ if (err instanceof TwirpError && err.code === TwirpErrorCode.AlreadyExists) {
204
+ this.error(`An app account with the name "${projectConfig.name}" already exists. Please change the "name" field of devvit.yaml and try again.`);
211
205
  }
212
206
  else {
213
- this.error('Your app could not be uploaded because we encountered an issue creating your app account. This may happen because of a network issue on our end. Please try again.');
207
+ this.error(StringUtil.caughtToString(err));
214
208
  }
215
209
  }
216
210
  }
@@ -265,7 +259,7 @@ class Upload extends ProjectCommand {
265
259
  }
266
260
  }
267
261
  }
268
- ux.action.start(`Uploading new version "${appVersion.toString()}" to Reddit`);
262
+ ux.action.start(`Uploading new version "${appVersion.toString()}" to Reddit...`);
269
263
  try {
270
264
  // Actually create the app version
271
265
  const appVersionInfo = await this.appVersionClient.Create({
@@ -279,11 +273,10 @@ class Upload extends ProjectCommand {
279
273
  prereleaseVersion: appVersion.prerelease,
280
274
  actorBundles: bundles,
281
275
  });
282
- ux.action.stop();
276
+ ux.action.stop(`✅`);
283
277
  return appVersionInfo;
284
278
  }
285
279
  catch (error) {
286
- ux.action.stop('Error');
287
280
  return handleTwirpError(error, (message) => this.error(message));
288
281
  }
289
282
  }
@@ -364,7 +357,7 @@ _Upload_event = new WeakMap(), _Upload_eventSent = new WeakMap(), _Upload_verbos
364
357
  return await bundler.bundle(this.projectRoot, actorSpec);
365
358
  }
366
359
  catch (err) {
367
- this.error(StringUtil.caughtToString(err, 'message'));
360
+ this.error(StringUtil.caughtToString(err));
368
361
  }
369
362
  }, _Upload_getLatestPublishedVersion = function _Upload_getLatestPublishedVersion(versions) {
370
363
  const versionsSorted = versions
@@ -464,7 +457,7 @@ async function _Upload_syncAssets() {
464
457
  this.error(`Asset ${asset.filePath} is too large - images can't be more than ${prettyPrintSize(MAX_ASSET_NON_GIF_SIZE)}.`);
465
458
  }
466
459
  }
467
- ux.action.start(`Checking for new assets to upload`);
460
+ ux.action.start(`Checking for new assets to upload...`);
468
461
  const assetMap = await __classPrivateFieldGet(this, _Upload_instances, "m", _Upload_uploadNewAssets).call(this, assets);
469
462
  ux.action.stop(`Found ${assets.length} new asset${assets.length === 1 ? '' : 's'}.`);
470
463
  return assetMap;
@@ -473,7 +466,7 @@ async function _Upload_syncAssets() {
473
466
  if (assets.length === 0) {
474
467
  return {};
475
468
  }
476
- ux.action.start(`Checking for new WebView assets to upload`);
469
+ ux.action.start(`Checking for new WebView assets to upload...`);
477
470
  const assetMap = await __classPrivateFieldGet(this, _Upload_instances, "m", _Upload_uploadNewAssets).call(this, assets, true);
478
471
  ux.action.stop(`Found ${assets.length} new WebView asset${assets.length === 1 ? '' : 's'}.`);
479
472
  // only return the html files for the WebView assets
@@ -519,7 +512,7 @@ async function _Upload_syncAssets() {
519
512
  return assetMap;
520
513
  }
521
514
  // Upload everything, giving back pairs of the assets & their upload response
522
- ux.action.start(`Uploading new ${webViewMsg}assets, ${newAssets.length} remaining`);
515
+ ux.action.start(`Uploading new ${webViewMsg}assets, ${newAssets.length} remaining...`);
523
516
  let uploadResults = [];
524
517
  try {
525
518
  // Do this in batches - we don't want to upload everything at once and
@@ -542,13 +535,12 @@ async function _Upload_syncAssets() {
542
535
  ];
543
536
  }))),
544
537
  ];
545
- ux.action.start(`Uploading new ${webViewMsg}assets, ${newAssets.length} remaining`);
538
+ ux.action.start(`Uploading new ${webViewMsg}assets, ${newAssets.length} remaining...`);
546
539
  }
547
540
  }
548
541
  catch (err) {
549
542
  const error = err;
550
543
  const msg = `Failed to upload ${webViewMsg}assets. (${error.message})`;
551
- ux.action.stop(msg);
552
544
  if (webViewAsset) {
553
545
  // don't fail on WebView uploads in case we just don't have the feature enabled
554
546
  ux.action.stop(msg);
@@ -1 +1 @@
1
- {"version":3,"file":"check-update.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/init/check-update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUrC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,CAuCtB,CAAC;AAYF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzE;AAGD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ5E;AAID,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"check-update.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/init/check-update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUrC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,CAsCtB,CAAC;AAYF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzE;AAGD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ5E;AAID,eAAe,IAAI,CAAC"}
@@ -16,12 +16,11 @@ const hook = async function (options) {
16
16
  }
17
17
  let latest;
18
18
  try {
19
- ux.action.start('Checking for updates');
19
+ ux.action.start('Checking for updates...');
20
20
  latest = await fetchLatestPublishedVersion();
21
- ux.action.stop();
21
+ ux.action.stop('✅');
22
22
  }
23
23
  catch {
24
- ux.action.stop('Error');
25
24
  this.warn('There was an error checking for devvit updates. The command will proceed, but you may be using an outdated version.');
26
25
  // don't want to block the user if they are offline
27
26
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"app-log-observer.d.ts","sourceRoot":"","sources":["../../../src/util/app-logs/app-log-observer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQtD,KAAK,OAAO,GAAG;IAAE,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAClF,KAAK,oBAAoB,GAAG,YAAY,GAAG;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,qBAAa,cAAe,YAAW,QAAQ,CAAC,gBAAgB,CAAC;;gBAMnD,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,OAAO;IAKzD,QAAQ,IAAI,IAAI;IAUhB,IAAI,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI;IAejC,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;CA8C1B"}
1
+ {"version":3,"file":"app-log-observer.d.ts","sourceRoot":"","sources":["../../../src/util/app-logs/app-log-observer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQtD,KAAK,OAAO,GAAG;IAAE,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAClF,KAAK,oBAAoB,GAAG,YAAY,GAAG;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,qBAAa,cAAe,YAAW,QAAQ,CAAC,gBAAgB,CAAC;;gBAMnD,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,OAAO;IAKzD,QAAQ,IAAI,IAAI;IAUhB,IAAI,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI;IAejC,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;CA4C1B"}
@@ -57,7 +57,7 @@ export class AppLogObserver {
57
57
  }
58
58
  }
59
59
  error(err) {
60
- __classPrivateFieldGet(this, _AppLogObserver_logger, "f").error(chalk.red(`error while fetching logs: ${StringUtil.caughtToString(err, 'message')}`));
60
+ __classPrivateFieldGet(this, _AppLogObserver_logger, "f").error(chalk.red(`error while fetching logs: ${StringUtil.caughtToString(err)}`));
61
61
  }
62
62
  }
63
63
  _AppLogObserver_config = new WeakMap(), _AppLogObserver_logger = new WeakMap(), _AppLogObserver_instances = new WeakSet(), _AppLogObserver_logError = function _AppLogObserver_logError(error) {
@@ -150,7 +150,7 @@ Last error: ${StringUtil.caughtToString(error, 'message')}`);
150
150
  retries++;
151
151
  }
152
152
  }
153
- throw new Error(`${JSON.stringify(prop)} failed after ${MAX_RETRIES} attempts.
153
+ throw new Error(`${target} failed after ${MAX_RETRIES} attempts.
154
154
  First error: ${StringUtil.caughtToString(firstError, 'message')}
155
155
  Last error: ${StringUtil.caughtToString(lastError, 'message')}`);
156
156
  };
@@ -27,7 +27,7 @@ export async function fetchUserT2Id(token) {
27
27
  return Result.Err(`Failed to fetch user id as string. Got: ${fetchUserRes.value}`);
28
28
  }
29
29
  if (userId === '') {
30
- return Result.Err(`Failed to fetch user id - got an empty string somehow.`);
30
+ return Result.Err(`Failed to fetch user id - got an empty string somehow...`);
31
31
  }
32
32
  if (!userId.startsWith('t2_')) {
33
33
  userId = 't2_' + userId;
@@ -14,6 +14,6 @@ export async function getAppBySlug(appClient, slug) {
14
14
  return undefined;
15
15
  }
16
16
  }
17
- throw StringUtil.caughtToString(err, 'message');
17
+ throw StringUtil.caughtToString(err);
18
18
  }
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/cli",
3
- "version": "0.11.4-next-2024-12-06-75957d720.0",
3
+ "version": "0.11.4",
4
4
  "description": "Reddit's Dev Platform CLI Tool",
5
5
  "license": "BSD-3-Clause",
6
6
  "author": "@reddit/dev-platform",
@@ -42,11 +42,11 @@
42
42
  },
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
- "@devvit/build-pack": "0.11.4-next-2024-12-06-75957d720.0",
45
+ "@devvit/build-pack": "0.11.4",
46
46
  "@devvit/play": "0.0.43",
47
- "@devvit/protos": "0.11.4-next-2024-12-06-75957d720.0",
48
- "@devvit/public-api": "0.11.4-next-2024-12-06-75957d720.0",
49
- "@devvit/shared-types": "0.11.4-next-2024-12-06-75957d720.0",
47
+ "@devvit/protos": "0.11.4",
48
+ "@devvit/public-api": "0.11.4",
49
+ "@devvit/shared-types": "0.11.4",
50
50
  "@improbable-eng/grpc-web": "0.15.0",
51
51
  "@improbable-eng/grpc-web-node-http-transport": "0.15.0",
52
52
  "@oclif/core": "2.9.4",
@@ -78,8 +78,8 @@
78
78
  "ws": "8.18.0"
79
79
  },
80
80
  "devDependencies": {
81
- "@devvit/repo-tools": "0.11.4-next-2024-12-06-75957d720.0",
82
- "@devvit/tsconfig": "0.11.4-next-2024-12-06-75957d720.0",
81
+ "@devvit/repo-tools": "0.11.4",
82
+ "@devvit/tsconfig": "0.11.4",
83
83
  "@types/file-type": "10.9.1",
84
84
  "@types/inquirer": "9.0.3",
85
85
  "@types/js-yaml": "4.0.5",
@@ -120,5 +120,5 @@
120
120
  ]
121
121
  }
122
122
  },
123
- "gitHead": "97be0453bdd93eb23a7d9b115a87cf5a9f26eb4c"
123
+ "gitHead": "4e4f06374e9c54e277e08d75bc4b159952dc3e97"
124
124
  }