u1s1-cli 1.1.0 → 1.2.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/deploy.js +7 -4
- package/package.json +1 -1
package/dist/deploy.js
CHANGED
|
@@ -4,8 +4,8 @@ import { createInterface } from "node:readline/promises";
|
|
|
4
4
|
import { VERSION, u1s1Dir } from "./config.js";
|
|
5
5
|
import { authorizedFetch } from "./device-auth.js";
|
|
6
6
|
/**
|
|
7
|
-
* u1s1 deploy
|
|
8
|
-
*
|
|
7
|
+
* u1s1 deploy publishes a static site to <project>.<account-code>.u1s1.app.
|
|
8
|
+
* Detect the site root, ask for a project slug, and remember it in ~/.u1s1/deploys.json.
|
|
9
9
|
* → 并发上传 → 网关原子切换生效,输出可分享的网址。
|
|
10
10
|
*/
|
|
11
11
|
const deploysFile = join(u1s1Dir, "deploys.json");
|
|
@@ -168,7 +168,7 @@ async function promptSiteName(def) {
|
|
|
168
168
|
return def;
|
|
169
169
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
170
170
|
try {
|
|
171
|
-
const answer = (await rl.question(`
|
|
171
|
+
const answer = (await rl.question(` 项目名(回车用 ${def},只需在你的账号内唯一):`)).trim().toLowerCase();
|
|
172
172
|
return answer || def;
|
|
173
173
|
}
|
|
174
174
|
finally {
|
|
@@ -269,11 +269,14 @@ export async function deployCommand(cfg, args) {
|
|
|
269
269
|
deploy_id: start.deploy_id,
|
|
270
270
|
visibility,
|
|
271
271
|
});
|
|
272
|
-
rememberSite(dir, start.site);
|
|
272
|
+
rememberSite(dir, start.slug || name || start.site);
|
|
273
273
|
console.log(` ✅ 部署完成,${fin.file_count} 个文件已上线`);
|
|
274
274
|
console.log("");
|
|
275
275
|
console.log(` ${fin.visibility === "private" ? "🔒" : "🌐"} ${fin.url}`);
|
|
276
276
|
console.log("");
|
|
277
|
+
if ((fin.hostname || start.hostname || "").split(".").length > 3) {
|
|
278
|
+
console.log(" 新 hostname 的 HTTPS 证书会由 Total TLS 自动签发,首次访问可能需要等待几分钟。");
|
|
279
|
+
}
|
|
277
280
|
if (fin.visibility === "private") {
|
|
278
281
|
console.log(" 私密站点仅你可见,请从 https://u1s1.io/dashboard#sec-sites 打开。");
|
|
279
282
|
}
|