layero 0.1.3 → 0.1.4

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.
@@ -2,9 +2,9 @@ import { promises as fs } from "node:fs";
2
2
  import path from "node:path";
3
3
  import readline from "node:readline/promises";
4
4
  import chalk from "chalk";
5
- import { ApiClient, uploadArchive } from "../api.js";
5
+ import { ApiClient, ApiError, uploadArchive } from "../api.js";
6
6
  import { loadConfig } from "../config.js";
7
- import { loadProjectConfig, saveProjectConfig, } from "../project-config.js";
7
+ import { loadProjectConfig, projectConfigPath, saveProjectConfig, } from "../project-config.js";
8
8
  import { packCwd } from "../pack.js";
9
9
  import { streamDeployLogs } from "../logs.js";
10
10
  const VALID_TYPES = new Set([
@@ -60,8 +60,18 @@ async function resolveProject(api, cwd, opts) {
60
60
  }
61
61
  const existing = await loadProjectConfig(cwd);
62
62
  if (existing) {
63
- const project = await api.getProject(existing.project_id);
64
- return { project, createdNow: false };
63
+ try {
64
+ const project = await api.getProject(existing.project_id);
65
+ return { project, createdNow: false };
66
+ }
67
+ catch (err) {
68
+ if (err instanceof ApiError && err.status === 404) {
69
+ throw new Error(`linked project ${existing.project_id} no longer exists or isn't on your account.\n` +
70
+ ` fix: delete ${projectConfigPath(cwd)} and re-run \`layero deploy\` (creates a new project),\n` +
71
+ ` or run \`layero link <id_or_slug>\` to point at an existing one.`);
72
+ }
73
+ throw err;
74
+ }
65
75
  }
66
76
  // No project_id locally — create one.
67
77
  const me = await api.me();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layero",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Layero CLI — publish a local site with one command.",
5
5
  "license": "MIT",
6
6
  "type": "module",