@within-7/jetr 0.7.6 → 0.8.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.js +12 -10
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -504,7 +504,7 @@ program.name("jetr").description(`Deploy static sites instantly
|
|
|
504
504
|
$ jetr ./dist my-blog Deploy and assign a subdomain
|
|
505
505
|
$ jetr ./dist blog.example.com Deploy to a custom domain (shows DNS setup)
|
|
506
506
|
$ jetr index.html Deploy a single file
|
|
507
|
-
$ jetr *.html *.css my-site Deploy multiple files to a named site`).version("0.
|
|
507
|
+
$ jetr *.html *.css my-site Deploy multiple files to a named site`).version("0.8.0");
|
|
508
508
|
program.argument("[paths...]", "directory, file(s), and/or site name to deploy").action(async (paths) => {
|
|
509
509
|
const config = loadConfig();
|
|
510
510
|
if (!config.token) {
|
|
@@ -568,12 +568,9 @@ program.argument("[paths...]", "directory, file(s), and/or site name to deploy")
|
|
|
568
568
|
);
|
|
569
569
|
console.log(` ${chalk2.bold("Size:")} ${formatBytes(result.totalSize)}`);
|
|
570
570
|
if (customHostname) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
console.log(chalk2.yellow(` DNS setup required:`));
|
|
575
|
-
console.log(` ${customHostname} CNAME jetr-serve.lixilei.workers.dev`);
|
|
576
|
-
}
|
|
571
|
+
console.log();
|
|
572
|
+
console.log(chalk2.yellow(` DNS: ensure CNAME record exists`));
|
|
573
|
+
console.log(` ${chalk2.cyan(customHostname)} CNAME ${chalk2.dim("jetr-serve.lixilei.workers.dev")} (Proxied)`);
|
|
577
574
|
}
|
|
578
575
|
console.log();
|
|
579
576
|
if (mode === "directory") {
|
|
@@ -673,8 +670,10 @@ program.command("list").alias("ls").description("List all your deployed sites").
|
|
|
673
670
|
const expire = s.expires_at ? chalk2.dim(
|
|
674
671
|
` expires ${new Date(s.expires_at * 1e3).toLocaleDateString()}`
|
|
675
672
|
) : "";
|
|
673
|
+
const hasDomain = s.custom_domains && s.custom_domains.length > 0;
|
|
674
|
+
const label = hasDomain ? s.custom_domains[0] : s.name;
|
|
676
675
|
console.log(
|
|
677
|
-
` ${chalk2.bold(
|
|
676
|
+
` ${chalk2.bold(label)}${lock}${expire} ${chalk2.dim(formatBytes(s.total_size))} ${chalk2.cyan(s.url)}`
|
|
678
677
|
);
|
|
679
678
|
}
|
|
680
679
|
console.log(chalk2.dim(`
|
|
@@ -684,11 +683,14 @@ program.command("list").alias("ls").description("List all your deployed sites").
|
|
|
684
683
|
process.exit(1);
|
|
685
684
|
}
|
|
686
685
|
});
|
|
687
|
-
program.command("info").description("Show site details: files, tokens, config").argument("<name>", "site name").action(async (name) => {
|
|
686
|
+
program.command("info").description("Show site details: files, tokens, domains, config").argument("<name>", "site name or custom domain").action(async (name) => {
|
|
688
687
|
try {
|
|
689
688
|
const site = await api.getSite(name);
|
|
690
689
|
console.log(`${chalk2.bold(site.name)}`);
|
|
691
690
|
console.log(` URL: ${chalk2.cyan(site.url)}`);
|
|
691
|
+
if (site.custom_domains?.length > 0) {
|
|
692
|
+
console.log(` Domains: ${site.custom_domains.join(", ")}`);
|
|
693
|
+
}
|
|
692
694
|
console.log(
|
|
693
695
|
` Password: ${site.password_protected ? chalk2.yellow("yes") : "no"}`
|
|
694
696
|
);
|
|
@@ -723,7 +725,7 @@ program.command("info").description("Show site details: files, tokens, config").
|
|
|
723
725
|
process.exit(1);
|
|
724
726
|
}
|
|
725
727
|
});
|
|
726
|
-
program.command("delete").alias("rm").description("Permanently delete a site, all its files, and custom domains").argument("<name>", "site name").action(async (name) => {
|
|
728
|
+
program.command("delete").alias("rm").description("Permanently delete a site, all its files, and custom domains").argument("<name>", "site name or custom domain").action(async (name) => {
|
|
727
729
|
const spinner = ora(`Deleting ${name}...`).start();
|
|
728
730
|
try {
|
|
729
731
|
await api.deleteSite(name);
|