layero 0.1.1 → 0.1.2

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.
@@ -19,6 +19,22 @@ const VALID_TYPES = new Set([
19
19
  "gatsby",
20
20
  "static",
21
21
  ]);
22
+ function dashboardUrl(apiUrl, projectId) {
23
+ // api.layero.ru → app.layero.ru. Falls back to app.layero.ru for any
24
+ // unrecognized api base (incl. localhost) — the user can override via
25
+ // LAYERO_DASHBOARD_URL if they're pointed at a non-standard env.
26
+ const override = process.env.LAYERO_DASHBOARD_URL;
27
+ if (override)
28
+ return `${override.replace(/\/+$/, "")}/projects/${projectId}`;
29
+ try {
30
+ const u = new URL(apiUrl);
31
+ u.hostname = u.hostname.replace(/^api\./, "app.");
32
+ return `${u.origin}/projects/${projectId}`;
33
+ }
34
+ catch {
35
+ return `https://app.layero.ru/projects/${projectId}`;
36
+ }
37
+ }
22
38
  async function prompt(question, fallback) {
23
39
  const rl = readline.createInterface({
24
40
  input: process.stdin,
@@ -83,8 +99,12 @@ export async function deployCmd(opts) {
83
99
  throw new Error(`project "${project.slug}" is a GitHub-source project; ` +
84
100
  "use the dashboard's Deploy button or push to the linked repo.");
85
101
  }
102
+ // Project page on the dashboard. CDN propagation lags by ~30-60s after a
103
+ // fresh deploy, so a link to the project page is more useful as the
104
+ // immediate "where to look next" target than the live site URL.
105
+ const projectUrl = dashboardUrl(cfg.apiUrl, project.id);
86
106
  if (createdNow) {
87
- console.log(chalk.green(`created project ${project.slug} → https://${project.apex_hostname}`));
107
+ console.log(chalk.green(`created project ${project.slug} → ${projectUrl}`));
88
108
  }
89
109
  console.log(chalk.cyan("packing source..."));
90
110
  const pack = await packCwd(cwd, project.slug);
@@ -108,7 +128,8 @@ export async function deployCmd(opts) {
108
128
  process.exitCode = 1;
109
129
  return;
110
130
  }
111
- console.log(chalk.green(`deploy ready → https://${project.apex_hostname}`));
131
+ console.log(chalk.green(`deploy ready → ${projectUrl}`));
132
+ console.log(chalk.dim(` site: https://${project.apex_hostname} (CDN may take ~30-60s to propagate)`));
112
133
  }
113
134
  finally {
114
135
  // Always clean up the local archive.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layero",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Layero CLI — publish a local site with one command.",
5
5
  "license": "MIT",
6
6
  "type": "module",