layero 0.11.8 → 0.11.9
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/agent.js +2 -2
- package/dist/commands/deploy.js +15 -1
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -342,8 +342,8 @@ function renderHuman(event) {
|
|
|
342
342
|
process.stdout.write(`✓ Проект ${event.slug} удалён (очистка ресурсов идёт в фоне)\n`);
|
|
343
343
|
break;
|
|
344
344
|
case "claimable":
|
|
345
|
-
process.stdout.write(`→ Временный
|
|
346
|
-
process.stdout.write(`
|
|
345
|
+
process.stdout.write(`→ Временный сайт ${event.slug}: ${event.preview_url ?? event.url}\n`);
|
|
346
|
+
process.stdout.write(` Живёт до ${event.expires_at} (час). Забрать в аккаунт: ${event.claim_url}\n`);
|
|
347
347
|
break;
|
|
348
348
|
case "claim_status":
|
|
349
349
|
process.stdout.write(`Код ${event.code}: ${event.status}${event.claimed ? " (забран)" : ""}` +
|
package/dist/commands/deploy.js
CHANGED
|
@@ -209,6 +209,13 @@ async function assertSandboxServesFiles(cwd, opts, existing, detectFolder) {
|
|
|
209
209
|
return;
|
|
210
210
|
throw new LayeroError("claim_static_only", `деплой без аккаунта (--claim) выкладывает только статику и SPA, а эта папка — серверное приложение (${kind})`, "sign in and deploy from the account: `npx layero@latest login`, then run the same deploy without --claim");
|
|
211
211
|
}
|
|
212
|
+
/** Обёртка временного сайта по его адресу: `<панель>/preview/<метка>`.
|
|
213
|
+
* Считается здесь для повторной выкатки — платформа отдаёт поле только при
|
|
214
|
+
* создании песочницы. */
|
|
215
|
+
function sandboxPreviewUrl(siteUrl) {
|
|
216
|
+
const label = new URL(siteUrl).hostname.split(".")[0];
|
|
217
|
+
return `https://app.layero.ru/preview/${label}`;
|
|
218
|
+
}
|
|
212
219
|
/**
|
|
213
220
|
* 🚨 ДЕТЕКТ — ОДИН НА ВЫКАТКУ. Гейт core «входов анализа не становится
|
|
214
221
|
* больше» считает запуски детекта в этом файле: каждый лишний — ещё один
|
|
@@ -597,6 +604,9 @@ export async function deployCmd(opts) {
|
|
|
597
604
|
cliCfg = r.cfg;
|
|
598
605
|
claimable = {
|
|
599
606
|
claim_url: r.created.claim_url,
|
|
607
|
+
// Обёртка панели — ссылка «для людей»: голый адрес песочницы браузеру
|
|
608
|
+
// отвечает переходом на неё. Старая платформа поля не отдаёт.
|
|
609
|
+
preview_url: r.created.preview_url ?? null,
|
|
600
610
|
expires_at: r.created.expires_at,
|
|
601
611
|
project_id: r.created.project_id,
|
|
602
612
|
slug: r.created.slug,
|
|
@@ -931,13 +941,16 @@ export async function deployCmd(opts) {
|
|
|
931
941
|
emit({ event: "preview_evicted", evicted });
|
|
932
942
|
}
|
|
933
943
|
// Claimable: ссылка «забрать» — ДО `ready`, потому что после `ready`
|
|
934
|
-
// агент не читает, а без этой ссылки сайт исчезнет через
|
|
944
|
+
// агент не читает, а без этой ссылки сайт исчезнет через час.
|
|
945
|
+
// `preview_url` — обёртка панели: пока сайт временный, человеку
|
|
946
|
+
// открывается только она; `url` остаётся для проверок и агентов.
|
|
935
947
|
if (claimable) {
|
|
936
948
|
emit({
|
|
937
949
|
event: "claimable",
|
|
938
950
|
project_id: claimable.project_id,
|
|
939
951
|
slug: claimable.slug,
|
|
940
952
|
url: liveUrl,
|
|
953
|
+
preview_url: claimable.preview_url ?? sandboxPreviewUrl(liveUrl),
|
|
941
954
|
claim_url: claimable.claim_url,
|
|
942
955
|
expires_at: claimable.expires_at,
|
|
943
956
|
});
|
|
@@ -948,6 +961,7 @@ export async function deployCmd(opts) {
|
|
|
948
961
|
project_id: project.id,
|
|
949
962
|
slug: project.slug,
|
|
950
963
|
url: liveUrl,
|
|
964
|
+
preview_url: sandboxPreviewUrl(liveUrl),
|
|
951
965
|
claim_url: reusedClaim.claim_url,
|
|
952
966
|
expires_at: reusedClaim.expires_at,
|
|
953
967
|
});
|
package/package.json
CHANGED