@dropthis/cli 0.18.0 → 0.19.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/dist/cli.cjs +18 -10
- package/dist/cli.cjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -916,13 +916,13 @@ async function runDoctor(_input, deps) {
|
|
|
916
916
|
const authSource = credential?.source ?? "missing";
|
|
917
917
|
const storageBackend = stored?.storage ?? "none";
|
|
918
918
|
const pairs = [
|
|
919
|
-
["Version", "0.
|
|
919
|
+
["Version", "0.19.0"],
|
|
920
920
|
["Auth", authSource],
|
|
921
921
|
["Storage", storageBackend]
|
|
922
922
|
];
|
|
923
923
|
writeKv(deps, pairs, {
|
|
924
924
|
ok: true,
|
|
925
|
-
version: "0.
|
|
925
|
+
version: "0.19.0",
|
|
926
926
|
auth: { source: authSource },
|
|
927
927
|
storage: { backend: storageBackend }
|
|
928
928
|
});
|
|
@@ -1656,6 +1656,7 @@ function formatDryRunManifest(prepared, extra) {
|
|
|
1656
1656
|
|
|
1657
1657
|
// src/options.ts
|
|
1658
1658
|
var import_promises = require("fs/promises");
|
|
1659
|
+
var import_node = require("@dropthis/node");
|
|
1659
1660
|
async function parseDropOptions(raw) {
|
|
1660
1661
|
if (raw.metadata && raw.metadataFile) {
|
|
1661
1662
|
throw new Error("Use either --metadata or --metadata-file, not both.");
|
|
@@ -1666,6 +1667,9 @@ async function parseDropOptions(raw) {
|
|
|
1666
1667
|
if (raw.noindex && raw.index) {
|
|
1667
1668
|
throw new Error("Use either --noindex or --index, not both.");
|
|
1668
1669
|
}
|
|
1670
|
+
if (raw.shared && raw.domain) {
|
|
1671
|
+
throw new Error("Use either --shared or --domain <hostname>, not both.");
|
|
1672
|
+
}
|
|
1669
1673
|
if (raw.visibility && raw.visibility !== "public" && raw.visibility !== "unlisted") {
|
|
1670
1674
|
throw new Error(
|
|
1671
1675
|
`Invalid visibility "${raw.visibility}". Use "public" or "unlisted".`
|
|
@@ -1696,7 +1700,7 @@ async function parseDropOptions(raw) {
|
|
|
1696
1700
|
...raw.contentType ? { contentType: raw.contentType } : {},
|
|
1697
1701
|
...raw.path ? { path: raw.path } : {},
|
|
1698
1702
|
...raw.idempotencyKey ? { idempotencyKey: raw.idempotencyKey } : {},
|
|
1699
|
-
...raw.domain ? { domain: raw.domain } : {},
|
|
1703
|
+
...raw.shared ? { domain: import_node.SHARED_POOL } : raw.domain ? { domain: raw.domain } : {},
|
|
1700
1704
|
...raw.slug ? { slug: raw.slug } : {}
|
|
1701
1705
|
};
|
|
1702
1706
|
}
|
|
@@ -2437,7 +2441,7 @@ async function runWhoami(_input, deps) {
|
|
|
2437
2441
|
}
|
|
2438
2442
|
|
|
2439
2443
|
// src/context.ts
|
|
2440
|
-
var
|
|
2444
|
+
var import_node2 = require("@dropthis/node");
|
|
2441
2445
|
function createContext(input) {
|
|
2442
2446
|
const env = input.env ?? process.env;
|
|
2443
2447
|
const global = input.global ?? {};
|
|
@@ -2454,7 +2458,7 @@ function createContext(input) {
|
|
|
2454
2458
|
stderr: input.stderr ?? ((value) => process.stderr.write(value)),
|
|
2455
2459
|
createClient(apiKey) {
|
|
2456
2460
|
const baseUrl = global.apiUrl ?? env.DROPTHIS_API_URL;
|
|
2457
|
-
return new
|
|
2461
|
+
return new import_node2.Dropthis({
|
|
2458
2462
|
...apiKey ? { apiKey } : {},
|
|
2459
2463
|
...baseUrl ? { baseUrl } : {}
|
|
2460
2464
|
});
|
|
@@ -2644,7 +2648,7 @@ function buildProgram(options = {}) {
|
|
|
2644
2648
|
` ${import_picocolors6.default.cyan("dropthis login")}`,
|
|
2645
2649
|
` ${import_picocolors6.default.cyan("dropthis publish ./dist")}`
|
|
2646
2650
|
].join("\n")
|
|
2647
|
-
).version("0.
|
|
2651
|
+
).version("0.19.0").configureHelp({
|
|
2648
2652
|
subcommandTerm(cmd) {
|
|
2649
2653
|
const args = cmd.registeredArguments.map((a) => {
|
|
2650
2654
|
const name = a.name();
|
|
@@ -2688,7 +2692,10 @@ ${lines.map((l) => ` ${l}`).join("\n")}
|
|
|
2688
2692
|
`Attach JSON key-value pairs, e.g. '{"source":"ci"}'`
|
|
2689
2693
|
).option("--metadata-file <path>", "Read metadata JSON from a file").option("--path <name>", "Set filename when publishing from stdin").option(
|
|
2690
2694
|
"--domain <hostname>",
|
|
2691
|
-
"Serve this drop under a connected custom domain (must be live \u2014 see: dropthis domains list)
|
|
2695
|
+
"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. To publish to the shared pool instead, use --shared."
|
|
2696
|
+
).option(
|
|
2697
|
+
"--shared",
|
|
2698
|
+
"Deliberately publish to the shared dropthis pool, bypassing your default custom domain (an off-domain publish). Cannot combine with --domain."
|
|
2692
2699
|
).option(
|
|
2693
2700
|
"--slug <vanity-slug>",
|
|
2694
2701
|
"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."
|
|
@@ -2705,7 +2712,7 @@ ${lines.map((l) => ` ${l}`).join("\n")}
|
|
|
2705
2712
|
"dropthis publish ./dist --title 'Launch page'",
|
|
2706
2713
|
"cat report.md | dropthis publish - --content-type text/markdown --path report.md",
|
|
2707
2714
|
"dropthis publish ./dist --domain reports.example.com --slug launch",
|
|
2708
|
-
"dropthis publish ./report.html --
|
|
2715
|
+
"dropthis publish ./report.html --shared # bypass your default domain \u2192 shared pool",
|
|
2709
2716
|
"URL=$(dropthis publish ./dist --url)"
|
|
2710
2717
|
])
|
|
2711
2718
|
).addHelpText(
|
|
@@ -3214,7 +3221,7 @@ ${import_picocolors6.default.bold("Canonical vs raw URLs:")}`,
|
|
|
3214
3221
|
);
|
|
3215
3222
|
const result = await runUpgrade(commandOptions, {
|
|
3216
3223
|
...deps,
|
|
3217
|
-
currentVersion: "0.
|
|
3224
|
+
currentVersion: "0.19.0"
|
|
3218
3225
|
});
|
|
3219
3226
|
process.exitCode = result.exitCode;
|
|
3220
3227
|
});
|
|
@@ -3322,6 +3329,7 @@ function toDropOptions(options) {
|
|
|
3322
3329
|
...options.path ? { path: options.path } : {},
|
|
3323
3330
|
...options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {},
|
|
3324
3331
|
...options.domain ? { domain: options.domain } : {},
|
|
3332
|
+
...options.shared ? { shared: true } : {},
|
|
3325
3333
|
...options.slug ? { slug: options.slug } : {},
|
|
3326
3334
|
...options.json !== void 0 ? { json: options.json } : {},
|
|
3327
3335
|
...options.quiet !== void 0 ? { quiet: options.quiet } : {},
|
|
@@ -3457,7 +3465,7 @@ var showNotice = shouldShowNotice({
|
|
|
3457
3465
|
if (showNotice) {
|
|
3458
3466
|
const notice = noticeFromCache({
|
|
3459
3467
|
cache: updateCache,
|
|
3460
|
-
currentVersion: "0.
|
|
3468
|
+
currentVersion: "0.19.0"
|
|
3461
3469
|
});
|
|
3462
3470
|
if (notice) {
|
|
3463
3471
|
process.stderr.write(`
|