@dropthis/cli 0.14.0 → 0.16.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.
- package/README.md +4 -5
- package/dist/cli.cjs +36 -8
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/node/README.md +3 -5
- package/node_modules/@dropthis/node/dist/{drops-DephtJf-.d.cts → drops-BtAGkA9A.d.cts} +28 -4
- package/node_modules/@dropthis/node/dist/{drops-DephtJf-.d.ts → drops-BtAGkA9A.d.ts} +28 -4
- package/node_modules/@dropthis/node/dist/edge.cjs +4 -1
- package/node_modules/@dropthis/node/dist/edge.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/edge.d.cts +1 -1
- package/node_modules/@dropthis/node/dist/edge.d.ts +1 -1
- package/node_modules/@dropthis/node/dist/edge.mjs +4 -1
- package/node_modules/@dropthis/node/dist/edge.mjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.cjs +9 -1
- package/node_modules/@dropthis/node/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.d.cts +2 -2
- package/node_modules/@dropthis/node/dist/index.d.ts +2 -2
- package/node_modules/@dropthis/node/dist/index.mjs +8 -1
- package/node_modules/@dropthis/node/dist/index.mjs.map +1 -1
- package/node_modules/@dropthis/node/package.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -269,13 +269,12 @@ Reports CLI version, auth source (`env`, `flag`, `storage`, or `missing`), and c
|
|
|
269
269
|
|
|
270
270
|
## Pricing tiers
|
|
271
271
|
|
|
272
|
-
- **Free
|
|
273
|
-
- **
|
|
274
|
-
- **Pro ($19/mo)** — everything in Personal plus password protection and analytics.
|
|
272
|
+
- **Free** — drops expire after 7 days, 5 MB per drop, 500 MB active storage, dropthis badge.
|
|
273
|
+
- **Pro** — drops never expire, 100 MB per drop, 10 GB storage, no badge, 1 custom domain, password-protected drops. Pro is currently invite-only. Learn more at https://dropthis.app/pricing.
|
|
275
274
|
|
|
276
|
-
|
|
275
|
+
Connecting a custom domain (`dropthis domains connect`) requires the Pro plan (1 hostname). Domains already connected keep working regardless of plan.
|
|
277
276
|
|
|
278
|
-
`dropthis account` shows your active tier and its limits.
|
|
277
|
+
`dropthis account` shows your active tier and its limits.
|
|
279
278
|
|
|
280
279
|
## Agent skills
|
|
281
280
|
|
package/dist/cli.cjs
CHANGED
|
@@ -365,7 +365,9 @@ function formatDateTime(iso) {
|
|
|
365
365
|
function formatBytes(bytes) {
|
|
366
366
|
if (bytes < 1024) return `${bytes} B`;
|
|
367
367
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
368
|
-
|
|
368
|
+
if (bytes < 1024 * 1024 * 1024)
|
|
369
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
370
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
369
371
|
}
|
|
370
372
|
function writeJson(deps, envelope) {
|
|
371
373
|
deps.stdout(`${JSON.stringify(envelope)}
|
|
@@ -481,7 +483,29 @@ async function runAccountGet(_input, deps) {
|
|
|
481
483
|
if (data?.status) pairs.push(["Status", String(data.status)]);
|
|
482
484
|
if (data?.createdAt)
|
|
483
485
|
pairs.push(["Created", String(data.createdAt).split("T")[0]]);
|
|
486
|
+
const usage = data?.usage;
|
|
487
|
+
const limits = data?.limits;
|
|
488
|
+
if (typeof usage?.storageUsedBytes === "number") {
|
|
489
|
+
if (typeof limits?.maxStorageBytes === "number") {
|
|
490
|
+
pairs.push([
|
|
491
|
+
"Storage",
|
|
492
|
+
`${formatBytes(usage.storageUsedBytes)} of ${formatBytes(limits.maxStorageBytes)}`
|
|
493
|
+
]);
|
|
494
|
+
} else {
|
|
495
|
+
pairs.push(["Storage", formatBytes(usage.storageUsedBytes)]);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (typeof usage?.customDomainsUsed === "number" && typeof limits?.maxCustomHostnames === "number") {
|
|
499
|
+
pairs.push([
|
|
500
|
+
"Domains",
|
|
501
|
+
`${usage.customDomainsUsed} of ${limits.maxCustomHostnames}`
|
|
502
|
+
]);
|
|
503
|
+
}
|
|
484
504
|
writeKv(deps, pairs, { ok: true, account: result.data });
|
|
505
|
+
if (typeof data?.upgradeUrl === "string") {
|
|
506
|
+
deps.stderr(`${hint(`Upgrade: ${data.upgradeUrl}`)}
|
|
507
|
+
`);
|
|
508
|
+
}
|
|
485
509
|
return { exitCode: 0 };
|
|
486
510
|
}
|
|
487
511
|
async function runAccountUpdate(input, deps) {
|
|
@@ -880,13 +904,13 @@ async function runDoctor(_input, deps) {
|
|
|
880
904
|
const authSource = credential?.source ?? "missing";
|
|
881
905
|
const storageBackend = stored?.storage ?? "none";
|
|
882
906
|
const pairs = [
|
|
883
|
-
["Version", "0.
|
|
907
|
+
["Version", "0.16.0"],
|
|
884
908
|
["Auth", authSource],
|
|
885
909
|
["Storage", storageBackend]
|
|
886
910
|
];
|
|
887
911
|
writeKv(deps, pairs, {
|
|
888
912
|
ok: true,
|
|
889
|
-
version: "0.
|
|
913
|
+
version: "0.16.0",
|
|
890
914
|
auth: { source: authSource },
|
|
891
915
|
storage: { backend: storageBackend }
|
|
892
916
|
});
|
|
@@ -2567,7 +2591,7 @@ function buildProgram(options = {}) {
|
|
|
2567
2591
|
` ${import_picocolors6.default.cyan("dropthis login")}`,
|
|
2568
2592
|
` ${import_picocolors6.default.cyan("dropthis publish ./dist")}`
|
|
2569
2593
|
].join("\n")
|
|
2570
|
-
).version("0.
|
|
2594
|
+
).version("0.16.0").configureHelp({
|
|
2571
2595
|
subcommandTerm(cmd) {
|
|
2572
2596
|
const args = cmd.registeredArguments.map((a) => {
|
|
2573
2597
|
const name = a.name();
|
|
@@ -2611,7 +2635,7 @@ ${lines.map((l) => ` ${l}`).join("\n")}
|
|
|
2611
2635
|
`Attach JSON key-value pairs, e.g. '{"source":"ci"}'`
|
|
2612
2636
|
).option("--metadata-file <path>", "Read metadata JSON from a file").option("--path <name>", "Set filename when publishing from stdin").option(
|
|
2613
2637
|
"--domain <hostname>",
|
|
2614
|
-
"Serve this drop under a connected custom domain (must be live \u2014 see: dropthis domains list). Path-mode: drop lives at https://domain/{slug}/. Dedicated: drop is at the root (409 if occupied). Omit to use the account's default path domain."
|
|
2638
|
+
"Serve this drop under a connected custom domain (must be live \u2014 see: dropthis domains list), or pass the literal 'shared' to publish to the shared pool even when the account has a default domain. Path-mode: drop lives at https://domain/{slug}/. Dedicated: drop is at the root (409 if occupied). Omit to use the account's default path domain."
|
|
2615
2639
|
).option(
|
|
2616
2640
|
"--slug <vanity-slug>",
|
|
2617
2641
|
"Vanity slug for path-mode custom domains (1\u201363 lowercase letters/digits/hyphens). Auto-suffixed if taken. Only valid with --domain on a path-mode domain."
|
|
@@ -2628,6 +2652,7 @@ ${lines.map((l) => ` ${l}`).join("\n")}
|
|
|
2628
2652
|
"dropthis publish ./dist --title 'Launch page'",
|
|
2629
2653
|
"cat report.md | dropthis publish - --content-type text/markdown --path report.md",
|
|
2630
2654
|
"dropthis publish ./dist --domain reports.example.com --slug launch",
|
|
2655
|
+
"dropthis publish ./report.html --domain shared # bypass the account default domain",
|
|
2631
2656
|
"URL=$(dropthis publish ./dist --url)"
|
|
2632
2657
|
])
|
|
2633
2658
|
).action(async (inputs, commandOptions) => {
|
|
@@ -2922,7 +2947,10 @@ ${lines.map((l) => ` ${l}`).join("\n")}
|
|
|
2922
2947
|
);
|
|
2923
2948
|
domains.command("update <hostname>").description(
|
|
2924
2949
|
"Update a domain \u2014 repoint to a different drop (dedicated mode) or set/clear as account default (path mode). At least one option required."
|
|
2925
|
-
).option("--drop <dropId>", "Repoint to a different drop (dedicated mode)").option("--default", "Set as account default publish domain (path mode)").option(
|
|
2950
|
+
).option("--drop <dropId>", "Repoint to a different drop (dedicated mode)").option("--default", "Set as account default publish domain (path mode)").option(
|
|
2951
|
+
"--no-default",
|
|
2952
|
+
"Clear the account default publish domain (defaultless publishes revert to the shared pool)"
|
|
2953
|
+
).option("--json", "Force JSON output").action(
|
|
2926
2954
|
async (hostname, commandOptions) => {
|
|
2927
2955
|
const deps = await commandDeps(program, options, store, commandOptions);
|
|
2928
2956
|
const result = await runDomainsUpdate(
|
|
@@ -3108,7 +3136,7 @@ ${lines.map((l) => ` ${l}`).join("\n")}
|
|
|
3108
3136
|
);
|
|
3109
3137
|
const result = await runUpgrade(commandOptions, {
|
|
3110
3138
|
...deps,
|
|
3111
|
-
currentVersion: "0.
|
|
3139
|
+
currentVersion: "0.16.0"
|
|
3112
3140
|
});
|
|
3113
3141
|
process.exitCode = result.exitCode;
|
|
3114
3142
|
});
|
|
@@ -3351,7 +3379,7 @@ var showNotice = shouldShowNotice({
|
|
|
3351
3379
|
if (showNotice) {
|
|
3352
3380
|
const notice = noticeFromCache({
|
|
3353
3381
|
cache: updateCache,
|
|
3354
|
-
currentVersion: "0.
|
|
3382
|
+
currentVersion: "0.16.0"
|
|
3355
3383
|
});
|
|
3356
3384
|
if (notice) {
|
|
3357
3385
|
process.stderr.write(`
|