pullfrog 0.0.195-beta.4 → 0.0.195-beta.6

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 (2) hide show
  1. package/dist/cli.mjs +13 -68
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -144992,7 +144992,7 @@ var import_semver = __toESM(require_semver2(), 1);
144992
144992
  // package.json
144993
144993
  var package_default = {
144994
144994
  name: "pullfrog",
144995
- version: "0.0.195-beta.4",
144995
+ version: "0.0.195-beta.6",
144996
144996
  type: "module",
144997
144997
  bin: {
144998
144998
  pullfrog: "dist/cli.mjs",
@@ -152742,23 +152742,6 @@ var p = class {
152742
152742
  }
152743
152743
  }
152744
152744
  };
152745
- var Q = class extends p {
152746
- get cursor() {
152747
- return this.value ? 0 : 1;
152748
- }
152749
- get _value() {
152750
- return this.cursor === 0;
152751
- }
152752
- constructor(t2) {
152753
- super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
152754
- this.value = this._value;
152755
- }), this.on("confirm", (e) => {
152756
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
152757
- }), this.on("cursor", () => {
152758
- this.value = !this.value;
152759
- });
152760
- }
152761
- };
152762
152745
  var rt = class extends p {
152763
152746
  _mask = "\u2022";
152764
152747
  get cursor() {
@@ -152904,33 +152887,6 @@ var Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItem
152904
152887
  for (const b of h) for (const x of b) C2.push(x);
152905
152888
  return g && C2.push(l), C2;
152906
152889
  };
152907
- var ot2 = (e) => {
152908
- const i = e.active ?? "Yes", s = e.inactive ?? "No";
152909
- return new Q({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
152910
- const r = e.withGuide ?? u.withGuide, u2 = `${V2(this.state)} `, n = r ? `${t("gray", d2)} ` : "", o = R(e.output, e.message, n, u2), c2 = `${r ? `${t("gray", d2)}
152911
- ` : ""}${o}
152912
- `, a = this.value ? i : s;
152913
- switch (this.state) {
152914
- case "submit": {
152915
- const l = r ? `${t("gray", d2)} ` : "";
152916
- return `${c2}${l}${t("dim", a)}`;
152917
- }
152918
- case "cancel": {
152919
- const l = r ? `${t("gray", d2)} ` : "";
152920
- return `${c2}${l}${t(["strikethrough", "dim"], a)}${r ? `
152921
- ${t("gray", d2)}` : ""}`;
152922
- }
152923
- default: {
152924
- const l = r ? `${t("cyan", d2)} ` : "", $3 = r ? t("cyan", E2) : "";
152925
- return `${c2}${l}${this.value ? `${t("green", z3)} ${i}` : `${t("dim", H2)} ${t("dim", i)}`}${e.vertical ? r ? `
152926
- ${t("cyan", d2)} ` : `
152927
- ` : ` ${t("dim", "/")} `}${this.value ? `${t("dim", H2)} ${t("dim", s)}` : `${t("green", z3)} ${s}`}
152928
- ${$3}
152929
- `;
152930
- }
152931
- }
152932
- } }).prompt();
152933
- };
152934
152890
  var O2 = { message: (e = [], { symbol: i = t("gray", d2), secondarySymbol: s = t("gray", d2), output: r = process.stdout, spacing: u2 = 1, withGuide: n } = {}) => {
152935
152891
  const o = [], c2 = n ?? u.withGuide, a = c2 ? s : "", l = c2 ? `${i} ` : "", $3 = c2 ? `${s} ` : "";
152936
152892
  for (let p2 = 0; p2 < u2; p2++) o.push(a);
@@ -153256,7 +153212,6 @@ async function fetchStatus(ctx) {
153256
153212
  return {
153257
153213
  installed: false,
153258
153214
  appSlug: result.data.appSlug,
153259
- ownerHasInstallation: result.data.ownerHasInstallation === true,
153260
153215
  installationId: typeof result.data.installationId === "number" ? result.data.installationId : null,
153261
153216
  repositorySelection: sel === "all" || sel === "selected" ? sel : null,
153262
153217
  isOrg: result.data.isOrg === true
@@ -153352,29 +153307,16 @@ async function ensureInstallation(ctx) {
153352
153307
  return initial;
153353
153308
  }
153354
153309
  const sessionId = await createSession(ctx);
153355
- if (initial.ownerHasInstallation && initial.installationId) {
153310
+ if (initial.installationId) {
153356
153311
  const repoRef = import_picocolors.default.bold(`${ctx.owner}/${ctx.repo}`);
153357
153312
  const configUrl = installationConfigUrl({
153358
153313
  owner: ctx.owner,
153359
153314
  installationId: initial.installationId,
153360
153315
  isOrg: initial.isOrg
153361
153316
  });
153362
- if (initial.repositorySelection === "selected") {
153363
- activeSpin.stop(`pullfrog is installed on selected repos \u2014 ${repoRef} is not in the list`);
153364
- process.stdout.write(`${import_picocolors.default.gray(d2)} ${link(import_picocolors.default.dim(configUrl), configUrl)}
153365
- `);
153366
- const proceed = await ot2({
153367
- message: "open browser to add it?",
153368
- active: "open",
153369
- inactive: "cancel"
153370
- });
153371
- handleCancel(proceed);
153372
- if (!proceed) bail("canceled.");
153373
- } else {
153374
- activeSpin.stop(`pullfrog is installed on selected repos, but ${repoRef} is not included.`);
153375
- O2.info(`add it via GitHub's installation config page.
153317
+ activeSpin.stop(`pullfrog is installed on selected repos, but ${repoRef} is not included.`);
153318
+ O2.info(`add it under "Repository access" on the installation config page.
153376
153319
  ${import_picocolors.default.dim(configUrl)}`);
153377
- }
153378
153320
  openBrowser(configUrl);
153379
153321
  } else {
153380
153322
  activeSpin.stop("pullfrog app not installed");
@@ -153383,7 +153325,8 @@ async function ensureInstallation(ctx) {
153383
153325
  ${import_picocolors.default.dim(installUrl)}`);
153384
153326
  openBrowser(installUrl);
153385
153327
  }
153386
- const baseMsg = "once you've installed the app, onboarding will proceed automatically";
153328
+ const isRepoAccessUpdate = !!initial.installationId;
153329
+ const baseMsg = isRepoAccessUpdate ? "once you've added the repo, onboarding will proceed automatically" : "once you've installed the app, onboarding will proceed automatically";
153387
153330
  activeSpin.start(baseMsg);
153388
153331
  let activeSessionId = sessionId;
153389
153332
  let pollMs = activeSessionId ? SESSION_POLL_MS : FALLBACK_POLL_MS;
@@ -153397,13 +153340,14 @@ async function ensureInstallation(ctx) {
153397
153340
  activeSpin.message(`${baseMsg} ${import_picocolors.default.dim("(press r to recheck manually)")}`);
153398
153341
  hintShown = true;
153399
153342
  }
153343
+ const doneMsg = isRepoAccessUpdate ? "repo access confirmed" : "pullfrog app installed";
153400
153344
  if (listener.consume()) {
153401
153345
  activeSpin.message("rechecking via GitHub API");
153402
153346
  try {
153403
153347
  const status = await fetchStatus(ctx);
153404
153348
  if (status.installed) {
153405
153349
  if (activeSessionId) cleanupSession({ token: ctx.token, sessionId: activeSessionId });
153406
- activeSpin.stop("pullfrog app installed");
153350
+ activeSpin.stop(doneMsg);
153407
153351
  return status;
153408
153352
  }
153409
153353
  } catch {
@@ -153423,7 +153367,7 @@ async function ensureInstallation(ctx) {
153423
153367
  const status = await fetchStatus(ctx);
153424
153368
  if (status.installed) {
153425
153369
  cleanupSession({ token: ctx.token, sessionId: activeSessionId });
153426
- activeSpin.stop("pullfrog app installed");
153370
+ activeSpin.stop(doneMsg);
153427
153371
  return status;
153428
153372
  }
153429
153373
  }
@@ -153433,7 +153377,7 @@ async function ensureInstallation(ctx) {
153433
153377
  try {
153434
153378
  const status = await fetchStatus(ctx);
153435
153379
  if (status.installed) {
153436
- activeSpin.stop("pullfrog app installed");
153380
+ activeSpin.stop(doneMsg);
153437
153381
  return status;
153438
153382
  }
153439
153383
  } catch {
@@ -153445,7 +153389,8 @@ async function ensureInstallation(ctx) {
153445
153389
  }
153446
153390
  if (activeSessionId) cleanupSession({ token: ctx.token, sessionId: activeSessionId });
153447
153391
  bail(
153448
- `timed out waiting for app installation.
153392
+ isRepoAccessUpdate ? `timed out waiting for repo access.
153393
+ ${import_picocolors.default.dim("add the repo, then re-run:")} npx pullfrog init` : `timed out waiting for app installation.
153449
153394
  ${import_picocolors.default.dim("if your org requires admin approval, ask an admin to approve,")}
153450
153395
  ${import_picocolors.default.dim("then re-run:")} npx pullfrog init`
153451
153396
  );
@@ -153832,7 +153777,7 @@ async function run2() {
153832
153777
  }
153833
153778
 
153834
153779
  // cli.ts
153835
- var VERSION10 = "0.0.195-beta.4";
153780
+ var VERSION10 = "0.0.195-beta.6";
153836
153781
  var bin = basename2(process.argv[1] || "");
153837
153782
  var PROG = bin === "pf" || bin === "pullfrog" ? bin : "pullfrog";
153838
153783
  var rawArgs = process.argv.slice(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pullfrog",
3
- "version": "0.0.195-beta.4",
3
+ "version": "0.0.195-beta.6",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pullfrog": "dist/cli.mjs",