layero 0.11.8 → 0.11.10

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 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(`→ Временный проект ${event.slug}: ${event.url}\n`);
346
- process.stdout.write(` Сайт живёт до ${event.expires_at} (час). Забрать в аккаунт: ${event.claim_url}\n`);
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 ? " (забран)" : ""}` +
@@ -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
- // агент не читает, а без этой ссылки сайт исчезнет через 72 часа.
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/dist/detect.js CHANGED
@@ -122,8 +122,8 @@ const JS_COMMENT_RE = /\/\/[^\n]*|\/\*[\s\S]*?\*\//gm;
122
122
  function hasDep(pkg, name) {
123
123
  return Boolean(pkg && ((pkg.dependencies ?? {})[name] ?? (pkg.devDependencies ?? {})[name]));
124
124
  }
125
- /** Mirror of the builder's static-host pre-flight warning for the two
126
- * frameworks that build a server by default (Nuxt, SvelteKit). */
125
+ /** Mirror of the builder's pre-flight warning for the two frameworks whose
126
+ * default build may not run on Layero as is (Nuxt, SvelteKit). */
127
127
  function ssrWarning(snap, framework) {
128
128
  const pkg = snap.packageJson;
129
129
  if (framework === "nuxt") {
@@ -150,10 +150,21 @@ function ssrWarning(snap, framework) {
150
150
  return undefined;
151
151
  const allDeps = { ...(pkg?.dependencies ?? {}), ...(pkg?.devDependencies ?? {}) };
152
152
  const serverAdapter = Object.keys(allDeps).find((d) => d.startsWith("@sveltejs/adapter-") && d !== "@sveltejs/adapter-static");
153
+ // adapter-node is a server Layero runs in a container — nothing to warn
154
+ // about. Until 29.09.2026 this said "Layero hosts static sites only",
155
+ // which stopped being true when containers arrived (T-20260929-7).
156
+ if (serverAdapter === "@sveltejs/adapter-node")
157
+ return undefined;
158
+ const choose = "Pick one yourself: @sveltejs/adapter-static builds a static site, " +
159
+ "@sveltejs/adapter-node builds a server that Layero runs in a container.";
160
+ if (serverAdapter === "@sveltejs/adapter-auto") {
161
+ return ("SvelteKit uses @sveltejs/adapter-auto: it picks an adapter for platforms it knows, " +
162
+ `Layero is not one of them, so the build will produce nothing. ${choose}`);
163
+ }
153
164
  if (serverAdapter) {
154
- return `SvelteKit использует ${serverAdapter} (серверный адаптер). Layero хостит только статику — поставьте @sveltejs/adapter-static.`;
165
+ return `SvelteKit uses ${serverAdapter}, an adapter for another platform; its output will not run on Layero. ${choose}`;
155
166
  }
156
- return "SvelteKit без явного адаптера — поставьте @sveltejs/adapter-static для статического хостинга.";
167
+ return `SvelteKit has no adapter, so the build has nothing to output. ${choose}`;
157
168
  }
158
169
  return undefined;
159
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layero",
3
- "version": "0.11.8",
3
+ "version": "0.11.10",
4
4
  "description": "Layero CLI — deploy a directory or a repo to hosting with build servers in Russia. JSON events and exit codes for AI agents and CI.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -57,7 +57,7 @@
57
57
  "chalk": "^5.3.0",
58
58
  "commander": "^12.1.0",
59
59
  "ignore": "^5.3.2",
60
- "layero-detection": "^0.1.11",
60
+ "layero-detection": "^0.1.12",
61
61
  "open": "^10.1.0",
62
62
  "tar": "^7.4.3"
63
63
  },