@addorimprove/prompt 0.3.0 → 0.4.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 (2) hide show
  1. package/dist/prompt.js +9 -2
  2. package/package.json +1 -1
package/dist/prompt.js CHANGED
@@ -134,7 +134,7 @@ function describeApiError(e) {
134
134
  import { homedir } from "node:os";
135
135
  import { join } from "node:path";
136
136
  import { mkdirSync, readFileSync, writeFileSync, rmSync, chmodSync, existsSync } from "node:fs";
137
- var DEFAULT_BASE_URL = "https://app.photosharingapp.com";
137
+ var DEFAULT_BASE_URL = "https://addorimprove.com";
138
138
  function configDir() {
139
139
  const xdg = process.env.XDG_CONFIG_HOME;
140
140
  return xdg ? join(xdg, "prompt") : join(homedir(), ".config", "prompt");
@@ -536,7 +536,13 @@ ${doc.latest?.content ?? "(no versions)"}`);
536
536
  return;
537
537
  }
538
538
  const r = await client.setVisibility(id, label, isPublic);
539
- return out(json, r, `${id} ${label} → ${r.isPublic ? "public" : "private"}.`);
539
+ if (json) {
540
+ return out(json, r, "");
541
+ }
542
+ console.log(`${id} ${label} → ${r.isPublic ? "public" : "private"}.`);
543
+ if (r.isPublic && r.publicUrl)
544
+ console.log(`Short link: ${r.publicUrl}`);
545
+ return;
540
546
  }
541
547
  case "help":
542
548
  default:
@@ -562,6 +568,7 @@ Usage: prompt <command> [args] [flags] (or: npx @addorimprove/prompt <command>
562
568
  iterate <id> [--parent label] [-f file] Add a version on the same line
563
569
  branch <id> <parentLabel> [-f file] Fork a new line from a version
564
570
  visibility <id> <label> public|private Publish/unpublish a version
571
+ On --public, prints a /public/{slug} short link.
565
572
  (omit --format to auto-detect mdx/html from content)
566
573
 
567
574
  Global flags: --base-url <url>, --json, -y/--yes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@addorimprove/prompt",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "bin": { "prompt": "dist/prompt.js" },
6
6
  "files": ["dist"],