@dropthis/cli 0.9.0 → 0.9.2

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.
package/README.md CHANGED
@@ -137,12 +137,9 @@ dropthis drops update drop_abc123 --title "New title"
137
137
 
138
138
  # Optimistic concurrency
139
139
  dropthis drops update drop_abc123 ./dist-v2 --if-revision 1
140
-
141
- # Change vanity slug
142
- dropthis drops update drop_abc123 --slug new-slug
143
140
  ```
144
141
 
145
- `drops update` supports all publish flags plus `--slug` and `--if-revision`.
142
+ `drops update` supports all publish flags plus `--if-revision`.
146
143
 
147
144
  ## Commands
148
145
 
package/dist/cli.cjs CHANGED
@@ -769,13 +769,13 @@ async function runDoctor(_input, deps) {
769
769
  const authSource = credential?.source ?? "missing";
770
770
  const storageBackend = stored?.storage ?? "none";
771
771
  const pairs = [
772
- ["Version", "0.9.0"],
772
+ ["Version", "0.9.2"],
773
773
  ["Auth", authSource],
774
774
  ["Storage", storageBackend]
775
775
  ];
776
776
  writeKv(deps, pairs, {
777
777
  ok: true,
778
- version: "0.9.0",
778
+ version: "0.9.2",
779
779
  auth: { source: authSource },
780
780
  storage: { backend: storageBackend }
781
781
  });
@@ -1108,7 +1108,6 @@ async function parseDropOptions(raw) {
1108
1108
  "--metadata-file"
1109
1109
  ) : void 0;
1110
1110
  return {
1111
- ...raw.slug ? { slug: raw.slug } : {},
1112
1111
  ...raw.title ? { title: raw.title } : {},
1113
1112
  ...raw.visibility ? { visibility: raw.visibility } : {},
1114
1113
  ...raw.password ? { password: raw.password } : {},
@@ -1277,7 +1276,7 @@ async function handlePublishDryRun(input, raw, deps, client) {
1277
1276
 
1278
1277
  // src/commands/update-content.ts
1279
1278
  var NO_CONTENT_MESSAGE = "update-content requires content. Provide a file, folder, URL, or text to ship a new deployment.";
1280
- var NO_CONTENT_NEXT_ACTION = "Pass an input, e.g. dropthis update-content <dropId> ./dist. To change title, visibility, password, slug, expiry, or metadata, use dropthis update-settings <dropId> instead.";
1279
+ var NO_CONTENT_NEXT_ACTION = "Pass an input, e.g. dropthis update-content <dropId> ./dist. To change title, visibility, password, expiry, or metadata, use dropthis update-settings <dropId> instead.";
1281
1280
  function contentOptions(options) {
1282
1281
  const out = {};
1283
1282
  if (options.entry !== void 0) out.entry = options.entry;
@@ -1386,7 +1385,7 @@ function assertDropId(target) {
1386
1385
  // src/commands/update-settings.ts
1387
1386
  var prompts4 = __toESM(require("@clack/prompts"), 1);
1388
1387
  var NO_SETTINGS_MESSAGE = "Nothing to update. Provide at least one settings option.";
1389
- var NO_SETTINGS_NEXT_ACTION = "Run dropthis update-settings --help, or retry with one of: --title, --slug, --visibility, --password, --no-password, --noindex, --index, --expires-at, --metadata, or --metadata-file. To replace the content at the URL instead, use dropthis update-content <dropId> ./dist.";
1388
+ var NO_SETTINGS_NEXT_ACTION = "Run dropthis update-settings --help, or retry with one of: --title, --visibility, --password, --no-password, --noindex, --index, --expires-at, --metadata, or --metadata-file. To replace the content at the URL instead, use dropthis update-content <dropId> ./dist.";
1390
1389
  async function runUpdateSettings(dropId, raw, deps) {
1391
1390
  try {
1392
1391
  await requireCredential({
@@ -1462,7 +1461,6 @@ async function promptForSettings(target, prompt) {
1462
1461
  required: true,
1463
1462
  options: [
1464
1463
  { value: "title", label: "Title", hint: "--title" },
1465
- { value: "slug", label: "Slug", hint: "--slug" },
1466
1464
  { value: "visibility", label: "Visibility", hint: "--visibility" },
1467
1465
  {
1468
1466
  value: "password",
@@ -1492,14 +1490,6 @@ async function promptForSettings(target, prompt) {
1492
1490
  if (prompt.isCancel(value)) return cancel2(prompt);
1493
1491
  options.title = value.trim();
1494
1492
  }
1495
- if (selected.has("slug")) {
1496
- const value = await prompt.text({
1497
- message: "Slug",
1498
- validate: requireNonEmpty("Enter a slug.")
1499
- });
1500
- if (prompt.isCancel(value)) return cancel2(prompt);
1501
- options.slug = value.trim();
1502
- }
1503
1493
  if (selected.has("visibility")) {
1504
1494
  const value = await prompt.select({
1505
1495
  message: "Visibility",
@@ -1603,7 +1593,6 @@ async function handleDryRun2(dropId, raw, deps) {
1603
1593
  assertDropId2(dropId);
1604
1594
  const options = await parseDropOptions(raw);
1605
1595
  const fields = {};
1606
- if (options.slug) fields.slug = options.slug;
1607
1596
  if (options.title) fields.title = options.title;
1608
1597
  if (options.visibility) fields.visibility = options.visibility;
1609
1598
  if (options.password !== void 0) fields.password = options.password;
@@ -1833,7 +1822,7 @@ function buildProgram(options = {}) {
1833
1822
  ` ${import_picocolors4.default.cyan("dropthis login")}`,
1834
1823
  ` ${import_picocolors4.default.cyan("dropthis publish ./dist")}`
1835
1824
  ].join("\n")
1836
- ).version("0.9.0").configureHelp({
1825
+ ).version("0.9.2").configureHelp({
1837
1826
  subcommandTerm(cmd) {
1838
1827
  const args = cmd.registeredArguments.map((a) => {
1839
1828
  const name = a.name();
@@ -1853,7 +1842,7 @@ function buildProgram(options = {}) {
1853
1842
  program.option("-q, --quiet", "Suppress status output and imply JSON");
1854
1843
  program.option("--no-interactive", "Disable interactive prompts");
1855
1844
  program.command("publish [input...]", { isDefault: true }).description(
1856
- "Publish files, folders, URLs, strings, or stdin.\nMultiple files are bundled into one drop.\nUse - to read stdin explicitly, or pipe without args."
1845
+ "Publish content to a permanent public URL (also: share, post, put online, make public, get a link).\nFiles, folders, URLs, strings, or stdin; multiple files bundle into one drop. Use - for stdin, or pipe without args.\nCreates a NEW drop each run \u2014 to change one you already published, use update-content (the files) or update-settings (title/visibility/password/expiry/metadata) with its drop_\u2026 id, not publish again."
1857
1846
  ).option("--title <title>", "Drop title").option("--visibility <v>", "public or unlisted (default: public)").option("--password <password>", "Require password to view").option("--noindex", "Prevent search-engine indexing").option("--expires-at <datetime>", "Auto-delete after this ISO 8601 date").option(
1858
1847
  "--content-type <mime>",
1859
1848
  "Override MIME type (auto-detected from extension)"
@@ -1906,7 +1895,7 @@ function buildProgram(options = {}) {
1906
1895
  process.exitCode = result.exitCode;
1907
1896
  });
1908
1897
  program.command("update-content <dropId> [input...]").description(
1909
- "Replace a drop's content, same URL (pass the full drop_\u2026 id, not the slug).\nShips a new deployment. Settings stay unchanged \u2014 use update-settings for title, visibility, password, slug, expiry, or metadata."
1898
+ "Replace a drop's content, same URL (pass the full drop_\u2026 id, not the slug).\nShips a new deployment. Settings stay unchanged \u2014 use update-settings for title, visibility, password, expiry, or metadata."
1910
1899
  ).option(
1911
1900
  "--entry <path>",
1912
1901
  "Entry file for multi-file bundles (default: index.html)"
@@ -1961,8 +1950,8 @@ function buildProgram(options = {}) {
1961
1950
  }
1962
1951
  );
1963
1952
  program.command("update-settings <dropId>").description(
1964
- "Change a drop's title, visibility, password, vanity slug, expiry, or metadata (pass the full drop_\u2026 id, not the slug).\nContent stays unchanged \u2014 use update-content to replace the files at the URL."
1965
- ).option("--slug <slug>", "Change the vanity slug").option("--title <title>", "Change title").option("--visibility <v>", "Set to public or unlisted").option("--password <password>", "Require password to view").option("--no-password", "Remove password protection").option("--noindex", "Prevent search-engine indexing").option("--index", "Allow search-engine indexing").option("--expires-at <datetime>", "Auto-delete after this ISO 8601 date").option(
1953
+ "Change a drop's title, visibility, password, expiry, or metadata (pass the full drop_\u2026 id, not the slug).\nContent stays unchanged \u2014 use update-content to replace the files at the URL."
1954
+ ).option("--title <title>", "Change title").option("--visibility <v>", "Set to public or unlisted").option("--password <password>", "Require password to view").option("--no-password", "Remove password protection").option("--noindex", "Prevent search-engine indexing").option("--index", "Allow search-engine indexing").option("--expires-at <datetime>", "Auto-delete after this ISO 8601 date").option(
1966
1955
  "--metadata <json>",
1967
1956
  `Attach JSON key-value pairs, e.g. '{"source":"ci"}'`
1968
1957
  ).option("--metadata-file <path>", "Read metadata JSON from a file").option(
@@ -2268,7 +2257,6 @@ function globalOptions(program, commandOptions) {
2268
2257
  }
2269
2258
  function toDropOptions(options) {
2270
2259
  return {
2271
- ...options.slug ? { slug: options.slug } : {},
2272
2260
  ...options.title ? { title: options.title } : {},
2273
2261
  ...options.visibility ? { visibility: options.visibility } : {},
2274
2262
  ...typeof options.password === "string" ? { password: options.password } : {},