veryfront 0.1.1155 → 0.1.1158

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.
Files changed (68) hide show
  1. package/esm/cli/commands/deploy/command-help.d.ts.map +1 -1
  2. package/esm/cli/commands/deploy/command-help.js +3 -2
  3. package/esm/cli/commands/deploy/command.d.ts +26 -7
  4. package/esm/cli/commands/deploy/command.d.ts.map +1 -1
  5. package/esm/cli/commands/deploy/command.js +287 -14
  6. package/esm/cli/commands/deploy/index.d.ts +1 -1
  7. package/esm/cli/commands/deploy/index.d.ts.map +1 -1
  8. package/esm/cli/commands/deploy/index.js +1 -1
  9. package/esm/cli/commands/init/init-command.d.ts.map +1 -1
  10. package/esm/cli/commands/init/init-command.js +10 -19
  11. package/esm/cli/commands/up/command.d.ts.map +1 -1
  12. package/esm/cli/commands/up/command.js +17 -23
  13. package/esm/cli/mcp/tools/deploy-tool.d.ts +1 -1
  14. package/esm/cli/mcp/tools/deploy-tool.d.ts.map +1 -1
  15. package/esm/cli/shared/config.d.ts +11 -2
  16. package/esm/cli/shared/config.d.ts.map +1 -1
  17. package/esm/cli/shared/config.js +10 -2
  18. package/esm/cli/shared/deployment-provenance.d.ts +1 -1
  19. package/esm/cli/shared/deployment-provenance.d.ts.map +1 -1
  20. package/esm/cli/shared/deployment-provenance.js +5 -5
  21. package/esm/cli/shared/reserve-slug.d.ts.map +1 -1
  22. package/esm/cli/shared/reserve-slug.js +7 -2
  23. package/esm/cli/shared/slug.d.ts +1 -0
  24. package/esm/cli/shared/slug.d.ts.map +1 -1
  25. package/esm/cli/shared/slug.js +10 -0
  26. package/esm/cli/templates/manifest.d.ts +7 -0
  27. package/esm/cli/templates/manifest.js +14 -7
  28. package/esm/deno.js +2 -2
  29. package/esm/src/html/html-injection.d.ts +3 -0
  30. package/esm/src/html/html-injection.d.ts.map +1 -1
  31. package/esm/src/html/html-injection.js +2 -0
  32. package/esm/src/html/hydration-script-builder/dev-client-renderer.d.ts.map +1 -1
  33. package/esm/src/html/hydration-script-builder/dev-client-renderer.js +4 -2
  34. package/esm/src/html/hydration-script-builder/prod-scripts.d.ts.map +1 -1
  35. package/esm/src/html/hydration-script-builder/prod-scripts.js +4 -2
  36. package/esm/src/html/hydration-script-builder/templates/index.d.ts +1 -0
  37. package/esm/src/html/hydration-script-builder/templates/index.d.ts.map +1 -1
  38. package/esm/src/html/hydration-script-builder/templates/index.js +1 -0
  39. package/esm/src/html/hydration-script-builder/templates/navigation-store.d.ts +11 -0
  40. package/esm/src/html/hydration-script-builder/templates/navigation-store.d.ts.map +1 -0
  41. package/esm/src/html/hydration-script-builder/templates/navigation-store.js +53 -0
  42. package/esm/src/html/hydration-script-builder/templates/renderer.d.ts.map +1 -1
  43. package/esm/src/html/hydration-script-builder/templates/renderer.js +5 -1
  44. package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
  45. package/esm/src/html/hydration-script-builder/templates/router.js +13 -5
  46. package/esm/src/release-assets/build-executor.d.ts.map +1 -1
  47. package/esm/src/release-assets/build-executor.js +52 -9
  48. package/esm/src/release-assets/route-path.d.ts.map +1 -1
  49. package/esm/src/release-assets/route-path.js +44 -6
  50. package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
  51. package/esm/src/rendering/orchestrator/html.js +1 -0
  52. package/esm/src/rendering/rsc/client-boot.ts +4 -2
  53. package/esm/src/rendering/rsc/client-module-strategy.d.ts +4 -0
  54. package/esm/src/rendering/rsc/client-module-strategy.d.ts.map +1 -1
  55. package/esm/src/rendering/rsc/client-module-strategy.js +28 -0
  56. package/esm/src/rendering/rsc/hydrate-client.ts +18 -2
  57. package/esm/src/routing/api/module-loader/external-import-rewriter.d.ts +1 -1
  58. package/esm/src/routing/api/module-loader/external-import-rewriter.d.ts.map +1 -1
  59. package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
  60. package/esm/src/routing/api/module-loader/loader.js +4 -1
  61. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  62. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +1 -1
  63. package/esm/src/transforms/import-rewriter/route-adapter.d.ts +1 -1
  64. package/esm/src/transforms/import-rewriter/route-adapter.d.ts.map +1 -1
  65. package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +1 -1
  66. package/esm/src/utils/version-constant.d.ts +1 -1
  67. package/esm/src/utils/version-constant.js +1 -1
  68. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deploy/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,WA6CxB,CAAC"}
1
+ {"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deploy/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,WA8CxB,CAAC"}
@@ -38,8 +38,9 @@ export const deployHelp = {
38
38
  "veryfront deploy --dry-run",
39
39
  ],
40
40
  notes: [
41
- "Requires VERYFRONT_API_TOKEN env var or veryfront.json config",
42
- "Requires a successful veryfront push for the same project and branch",
41
+ "Requires VERYFRONT_API_TOKEN or an authenticated Veryfront login",
42
+ "Creates or links a project when veryfront.json is not present",
43
+ "Pushes local source before creating the release",
43
44
  "Creates a new release from the specified branch",
44
45
  "Verifies the target environment points to the created deployment before succeeding",
45
46
  ],
@@ -8,6 +8,8 @@
8
8
  */
9
9
  import type { InferSchema } from "../../../src/extensions/schema/index.js";
10
10
  import { type ApiClient } from "../../shared/config.js";
11
+ import { type ProjectTarget } from "../../shared/deployment-provenance.js";
12
+ import type { ReleaseAssetManifestResponse } from "../../../src/release-assets/manifest-schema.js";
11
13
  /**
12
14
  * Schema factory for deploy command arguments
13
15
  */
@@ -20,6 +22,8 @@ export declare const getDeployArgsSchema: () => import("../../../src/internal-ag
20
22
  force: import("../../../src/internal-agents/schema.js").Schema<boolean>;
21
23
  /** Quiet mode - suppress spinner/progress output */
22
24
  quiet: import("../../../src/internal-agents/schema.js").Schema<boolean>;
25
+ /** Internal option used by commands that already pushed source. */
26
+ skipSourcePush: import("../../../src/internal-agents/schema.js").Schema<boolean>;
23
27
  }>>;
24
28
  export declare const DeployArgsSchema: import("../../../src/internal-agents/schema.js").Schema<import("../../../src/extensions/schema/schema-validator.js").InferShape<{
25
29
  projectDir: import("../../../src/internal-agents/schema.js").Schema<string | undefined>;
@@ -30,11 +34,18 @@ export declare const DeployArgsSchema: import("../../../src/internal-agents/sche
30
34
  force: import("../../../src/internal-agents/schema.js").Schema<boolean>;
31
35
  /** Quiet mode - suppress spinner/progress output */
32
36
  quiet: import("../../../src/internal-agents/schema.js").Schema<boolean>;
37
+ /** Internal option used by commands that already pushed source. */
38
+ skipSourcePush: import("../../../src/internal-agents/schema.js").Schema<boolean>;
33
39
  }>>;
34
40
  /**
35
41
  * Deploy command options (inferred from schema)
36
42
  */
37
- export type DeployOptions = InferSchema<ReturnType<typeof getDeployArgsSchema>>;
43
+ type ParsedDeployOptions = InferSchema<ReturnType<typeof getDeployArgsSchema>>;
44
+ export type DeployOptions = Omit<ParsedDeployOptions, "skipSourcePush"> & {
45
+ skipSourcePush?: boolean;
46
+ assetManifestPollIntervalMs?: number;
47
+ assetManifestTimeoutMs?: number;
48
+ };
38
49
  /**
39
50
  * Parse CLI arguments into validated DeployOptions
40
51
  */
@@ -47,6 +58,8 @@ export declare const parseDeployArgs: (args: import("../../shared/types.js").Par
47
58
  force: import("../../../src/internal-agents/schema.js").Schema<boolean>;
48
59
  /** Quiet mode - suppress spinner/progress output */
49
60
  quiet: import("../../../src/internal-agents/schema.js").Schema<boolean>;
61
+ /** Internal option used by commands that already pushed source. */
62
+ skipSourcePush: import("../../../src/internal-agents/schema.js").Schema<boolean>;
50
63
  }>>;
51
64
  export declare function requiresExplicitDeployConfirmation(force: boolean): boolean;
52
65
  /**
@@ -69,6 +82,7 @@ interface Environment {
69
82
  };
70
83
  projectId?: string;
71
84
  deployment?: EnvironmentDeployment | null;
85
+ domains?: string[];
72
86
  }
73
87
  /**
74
88
  * Release from the API
@@ -109,20 +123,20 @@ export interface DeploymentVerification {
109
123
  releaseId: string;
110
124
  releaseVersion: string;
111
125
  deploymentId: string;
112
- commitSha: string;
126
+ commitSha: string | null;
113
127
  sourceDigest: string;
114
128
  }
115
129
  export interface ReleaseSourceVerification {
116
130
  projectId: string;
117
131
  releaseId: string;
118
132
  releaseVersion: string;
119
- commitSha: string;
133
+ commitSha: string | null;
120
134
  sourceDigest: string;
121
135
  }
122
136
  interface ReleaseSourceExpectation {
123
137
  projectId: string;
124
138
  releaseId: string;
125
- commitSha: string;
139
+ commitSha: string | null;
126
140
  sourceDigest: string;
127
141
  releaseName?: string;
128
142
  }
@@ -133,7 +147,7 @@ interface DeploymentExpectation {
133
147
  environmentName: string;
134
148
  releaseId: string;
135
149
  deploymentId: string;
136
- commitSha: string;
150
+ commitSha: string | null;
137
151
  sourceDigest: string;
138
152
  releaseName?: string;
139
153
  }
@@ -154,7 +168,7 @@ export declare function assertProjectOwnership(resourceType: "Environment" | "Re
154
168
  * Get environment by name (with pagination support)
155
169
  */
156
170
  export declare function getEnvironmentByName(client: ApiClient, projectSlug: string, name: string): Promise<Environment | null>;
157
- export declare function getProject(client: ApiClient, projectReference: string): Promise<import("../../shared/deployment-provenance.js").ProjectTarget>;
171
+ export declare function getProject(client: ApiClient, projectReference: string): Promise<ProjectTarget>;
158
172
  export declare function getRelease(client: ApiClient, projectReference: string, releaseId: string): Promise<Release>;
159
173
  export declare function getDeployment(client: ApiClient, projectReference: string, deploymentId: string): Promise<Deployment>;
160
174
  export declare function getReleaseSourceDigest(client: ApiClient, projectReference: string, releaseId: string): Promise<string>;
@@ -179,9 +193,14 @@ export declare function resolvePushedSource(input: {
179
193
  branch: string;
180
194
  requireClean: boolean;
181
195
  }): Promise<{
182
- commitSha: string;
196
+ commitSha: string | null;
183
197
  sourceDigest: string;
184
198
  }>;
199
+ export declare function waitForReleaseAssetManifest(client: ApiClient, projectSlug: string, releaseId: string, options?: {
200
+ expectedRoutes?: string[];
201
+ pollIntervalMs?: number;
202
+ timeoutMs?: number;
203
+ }): Promise<ReleaseAssetManifestResponse>;
185
204
  /**
186
205
  * Create a release and deploy to an environment
187
206
  */
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deploy/command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,EAAE,KAAK,SAAS,EAA0C,MAAM,wBAAwB,CAAC;AAehG;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;IAQ5B,oDAAoD;;GAGvD,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;IALzB,oDAAoD;;GAKO,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;IAfxB,oDAAoD;;GAuBtD,CAAC;AAEH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE1E;AAED;;GAEG;AACH,UAAU,qBAAqB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,GAAG,IAAI,CAAC;CACV;AAED,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAA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vC;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA6LzE"}
@@ -7,14 +7,20 @@
7
7
  * @module cli/commands/deploy
8
8
  */
9
9
  import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
10
- import { cwd } from "../../../src/platform/index.js";
11
- import { createApiClient, resolveConfigWithAuth } from "../../shared/config.js";
10
+ import { createFileSystem, cwd } from "../../../src/platform/index.js";
11
+ import { join, relative } from "../../../src/platform/compat/path/index.js";
12
+ import { getEnvironmentConfig } from "../../../src/config/index.js";
13
+ import { createApiClient, readConfigFile, resolveConfigWithAuth, resolveConfigWithAuthDetails, writeProjectSlug, } from "../../shared/config.js";
12
14
  import { CommonArgs, createArgParser } from "../../shared/args.js";
13
15
  import { confirmPrompt, logInfo, logSuccess, logWarning } from "../../utils/index.js";
14
16
  import { createNoopSpinner, createSpinner, muted } from "../../ui/index.js";
17
+ import { reserveProjectSlug } from "../../shared/reserve-slug.js";
18
+ import { normalizeProjectSlug } from "../../shared/slug.js";
19
+ import { pushCommand } from "../push/index.js";
15
20
  import { isAutoConfirmEnabled } from "../../shared/interactive.js";
16
21
  import { isJsonMode, streamJsonLine } from "../../shared/json-output.js";
17
22
  import { computeSourceDigest, getProjectTarget, normalizeControlPlane, readPushReceipt, resolveGitSource, validatePushReceipt, } from "../../shared/deployment-provenance.js";
23
+ import { routeForPage } from "../../../src/release-assets/route-path.js";
18
24
  /**
19
25
  * Schema factory for deploy command arguments
20
26
  */
@@ -27,6 +33,8 @@ export const getDeployArgsSchema = defineSchema((v) => v.object({
27
33
  force: v.boolean().default(false),
28
34
  /** Quiet mode - suppress spinner/progress output */
29
35
  quiet: v.boolean().default(false),
36
+ /** Internal option used by commands that already pushed source. */
37
+ skipSourcePush: v.boolean().default(false),
30
38
  }));
31
39
  export const DeployArgsSchema = lazySchema(getDeployArgsSchema);
32
40
  /**
@@ -202,6 +210,9 @@ export async function createDeployment(client, projectSlug, releaseId, environme
202
210
  function wait(ms) {
203
211
  return new Promise((resolve) => setTimeout(resolve, ms));
204
212
  }
213
+ function formatSourceReference(commitSha) {
214
+ return commitSha ? `pushed commit ${commitSha}` : "pushed source digest";
215
+ }
205
216
  export async function verifyReleaseSource(client, projectReference, expected, options = {}) {
206
217
  const release = await getRelease(client, projectReference, expected.releaseId);
207
218
  if (release.id !== expected.releaseId) {
@@ -230,7 +241,7 @@ export async function verifyReleaseSource(client, projectReference, expected, op
230
241
  if (attempt < attempts - 1 && delayMs > 0)
231
242
  await wait(delayMs);
232
243
  }
233
- throw new Error(`Release ${expected.releaseId} source does not match pushed commit ${expected.commitSha}: expected source digest ${expected.sourceDigest}; last observed ${sourceDigest}`);
244
+ throw new Error(`Release ${expected.releaseId} source does not match ${formatSourceReference(expected.commitSha)}: expected source digest ${expected.sourceDigest}; last observed ${sourceDigest}`);
234
245
  }
235
246
  export async function verifyDeployment(client, projectReference, expected, options = {}) {
236
247
  const deployment = await getDeployment(client, projectReference, expected.deploymentId);
@@ -292,19 +303,224 @@ export async function resolvePushedSource(input) {
292
303
  });
293
304
  return { commitSha, sourceDigest: receipt.sourceDigest };
294
305
  }
306
+ function getErrorStatus(error) {
307
+ if (typeof error !== "object" || error === null)
308
+ return undefined;
309
+ const status = error.status;
310
+ return typeof status === "number" ? status : undefined;
311
+ }
312
+ function buildEnvironmentUrl(projectSlug, environment) {
313
+ const domain = environment.domains?.[0];
314
+ if (domain) {
315
+ return domain.startsWith("http://") || domain.startsWith("https://")
316
+ ? domain
317
+ : `https://${domain}`;
318
+ }
319
+ return `https://${projectSlug}.${environment.name}.veryfront.com`;
320
+ }
321
+ async function inferDeployProjectSlug(projectDir) {
322
+ const fs = createFileSystem();
323
+ const packagePath = join(projectDir, "package.json");
324
+ try {
325
+ if (await fs.exists(packagePath)) {
326
+ const pkg = JSON.parse(await fs.readTextFile(packagePath));
327
+ if (pkg.name)
328
+ return normalizeProjectSlug(pkg.name);
329
+ }
330
+ }
331
+ catch {
332
+ // Fall back to the directory name below.
333
+ }
334
+ const dirName = projectDir.split(/[/\\]/).filter(Boolean).pop() ?? "my-app";
335
+ return normalizeProjectSlug(dirName);
336
+ }
337
+ async function ensureProjectLinkedForDeploy(projectDir, env, dryRun, quiet) {
338
+ const details = await resolveConfigWithAuthDetails(projectDir, env);
339
+ const initial = details.config;
340
+ const configFile = await readConfigFile(projectDir);
341
+ const hasPersistedSlug = Boolean(configFile?.projectSlug);
342
+ const isInferredReference = details.projectReferenceSource.kind === "inferred";
343
+ const projectReference = isInferredReference
344
+ ? normalizeProjectSlug(initial.projectSlug || await inferDeployProjectSlug(projectDir))
345
+ : initial.projectSlug;
346
+ const config = { ...initial, projectSlug: projectReference };
347
+ const client = createApiClient(config);
348
+ try {
349
+ const project = await getProject(client, projectReference);
350
+ if (isInferredReference && !hasPersistedSlug && !dryRun) {
351
+ await writeProjectSlug(projectDir, project.slug);
352
+ if (!quiet)
353
+ logInfo(`Linked project ${project.slug}`);
354
+ }
355
+ return {
356
+ config: { ...config, projectSlug: project.slug },
357
+ client,
358
+ project,
359
+ plannedProjectSlug: project.slug,
360
+ };
361
+ }
362
+ catch (error) {
363
+ if (getErrorStatus(error) !== 404) {
364
+ throw new Error(`Could not check project "${projectReference}": ${error instanceof Error ? error.message : String(error)}`);
365
+ }
366
+ }
367
+ if (!isInferredReference) {
368
+ throw new Error(`Project "${projectReference}" was not found. Check the project reference or remove it to let deploy create a project for this directory.`);
369
+ }
370
+ const suggestedSlug = normalizeProjectSlug(projectReference);
371
+ if (dryRun) {
372
+ if (!quiet)
373
+ logInfo(`Would create project ${suggestedSlug}`);
374
+ return {
375
+ config: { ...initial, projectSlug: suggestedSlug },
376
+ client: createApiClient({ ...initial, projectSlug: suggestedSlug }),
377
+ project: null,
378
+ plannedProjectSlug: suggestedSlug,
379
+ };
380
+ }
381
+ const created = await reserveProjectSlug(suggestedSlug, initial.apiToken, env, initial.apiUrl);
382
+ await writeProjectSlug(projectDir, created.slug);
383
+ if (!quiet)
384
+ logInfo(`Created project ${created.slug}`);
385
+ const createdConfig = { ...initial, projectSlug: created.slug };
386
+ const createdClient = createApiClient(createdConfig);
387
+ const project = created.projectId
388
+ ? { id: created.projectId, slug: created.slug }
389
+ : await getProject(createdClient, created.slug);
390
+ return {
391
+ config: createdConfig,
392
+ client: createdClient,
393
+ project,
394
+ plannedProjectSlug: created.slug,
395
+ };
396
+ }
397
+ async function collectProjectPageRoutes(projectDir) {
398
+ const fs = createFileSystem();
399
+ const routes = new Set();
400
+ async function walk(dir) {
401
+ let entries;
402
+ try {
403
+ if (!(await fs.exists(dir)))
404
+ return;
405
+ entries = await fs.readDir(dir);
406
+ }
407
+ catch {
408
+ return;
409
+ }
410
+ for await (const entry of entries) {
411
+ const path = join(dir, entry.name);
412
+ if (entry.isDirectory) {
413
+ await walk(path);
414
+ continue;
415
+ }
416
+ if (!/\.(tsx|ts|jsx|mdx|js)$/.test(entry.name))
417
+ continue;
418
+ const relativePath = relative(projectDir, path).replace(/\\/g, "/");
419
+ if (relativePath === "." || relativePath === ".." || relativePath.startsWith("../")) {
420
+ continue;
421
+ }
422
+ const route = routeForPage(relativePath);
423
+ if (route)
424
+ routes.add(route);
425
+ }
426
+ }
427
+ await Promise.all([
428
+ walk(join(projectDir, "app")),
429
+ walk(join(projectDir, "pages")),
430
+ ]);
431
+ return [...routes].sort();
432
+ }
433
+ function assertReadyManifestCoversPageRoutes(releaseId, result, expectedRoutes) {
434
+ const manifest = result.manifest;
435
+ if (!manifest) {
436
+ throw new Error(`Release assets for ${releaseId} are ready but no manifest body was returned. Check the release asset build and run deploy again.`);
437
+ }
438
+ const moduleCount = Object.keys(manifest.modules).length;
439
+ const missingRoutes = expectedRoutes.filter((route) => {
440
+ const modules = manifest.routes[route]?.modules;
441
+ return !modules || modules.length === 0;
442
+ });
443
+ if (expectedRoutes.length > 0 && (moduleCount === 0 || missingRoutes.length > 0)) {
444
+ throw new Error(`Release assets for ${releaseId} are ready but do not include browser modules for this app. ${missingRoutes.length > 0 ? `Missing routes: ${missingRoutes.join(", ")}. ` : ""}The deployed page would not hydrate; check the release asset build and run deploy again.`);
445
+ }
446
+ }
447
+ export async function waitForReleaseAssetManifest(client, projectSlug, releaseId, options = {}) {
448
+ const pollIntervalMs = Math.max(100, options.pollIntervalMs ?? 2_000);
449
+ const timeoutMs = Math.max(pollIntervalMs, options.timeoutMs ?? 120_000);
450
+ const expectedRoutes = options.expectedRoutes ?? [];
451
+ const deadline = Date.now() + timeoutMs;
452
+ let lastState = "missing";
453
+ for (;;) {
454
+ try {
455
+ const result = await client.get(`/projects/${projectSlug}/releases/${releaseId}/asset-manifest`);
456
+ lastState = result.state;
457
+ if (result.state === "ready") {
458
+ assertReadyManifestCoversPageRoutes(releaseId, result, expectedRoutes);
459
+ return result;
460
+ }
461
+ if (result.state === "failed") {
462
+ throw new Error(`Release asset build failed for release ${releaseId}`);
463
+ }
464
+ }
465
+ catch (error) {
466
+ if (getErrorStatus(error) !== 404)
467
+ throw error;
468
+ }
469
+ const remainingMs = deadline - Date.now();
470
+ if (remainingMs <= 0) {
471
+ const timeoutSeconds = Math.ceil(timeoutMs / 1000);
472
+ throw new Error(`Release assets were not ready within ${timeoutSeconds}s (last state: ${lastState}). Check the release asset build and run deploy again.`);
473
+ }
474
+ await wait(Math.min(pollIntervalMs, remainingMs));
475
+ }
476
+ }
295
477
  /**
296
478
  * Create a release and deploy to an environment
297
479
  */
298
480
  export async function deployCommand(options) {
299
- const { projectDir = cwd(), branch, env, releaseName, dryRun, force, quiet } = options;
481
+ const { projectDir = cwd(), branch, env, releaseName, dryRun, force, quiet, skipSourcePush, assetManifestPollIntervalMs, assetManifestTimeoutMs, } = options;
300
482
  if (isJsonMode()) {
301
483
  return deployCommandJson(options);
302
484
  }
303
485
  let spinner = quiet ? createNoopSpinner() : createSpinner("Resolving configuration...");
304
- const config = await resolveConfigWithAuth(projectDir);
305
- const client = createApiClient(config);
306
- spinner.update("Resolving project...");
307
- const project = await getProject(client, config.projectSlug);
486
+ const environmentConfig = getEnvironmentConfig();
487
+ const setup = await ensureProjectLinkedForDeploy(projectDir, environmentConfig, dryRun, quiet);
488
+ let { config, client, project } = setup;
489
+ const expectedPageRoutes = await collectProjectPageRoutes(projectDir);
490
+ if (dryRun && !project) {
491
+ spinner.stop();
492
+ if (!quiet) {
493
+ logInfo(`Would push source to "${branch}", create release, and deploy to "${env}" for project ${setup.plannedProjectSlug}`);
494
+ }
495
+ return;
496
+ }
497
+ if (!force && !dryRun && !skipSourcePush) {
498
+ spinner.stop();
499
+ const confirmed = await confirmPrompt(`Push source to "${branch}", create release, and deploy to "${env}"?`, true);
500
+ if (!confirmed) {
501
+ console.log(` ${muted("Deploy cancelled.")}`);
502
+ return;
503
+ }
504
+ spinner = quiet ? createNoopSpinner() : createSpinner("Resolving configuration...");
505
+ }
506
+ if (!skipSourcePush) {
507
+ spinner.update(`Pushing source to "${branch}"...`);
508
+ spinner.stop();
509
+ await pushCommand({
510
+ projectDir,
511
+ branch,
512
+ force: true,
513
+ dryRun,
514
+ quiet: true,
515
+ });
516
+ spinner = quiet ? createNoopSpinner() : createSpinner("Resolving configuration...");
517
+ config = await resolveConfigWithAuth(projectDir, environmentConfig);
518
+ client = createApiClient(config);
519
+ }
520
+ if (!project) {
521
+ spinner.update("Resolving project...");
522
+ project = await getProject(client, config.projectSlug);
523
+ }
308
524
  spinner.update(`Looking up environment "${env}"...`);
309
525
  const environment = await getEnvironmentByName(client, project.id, env);
310
526
  if (!environment) {
@@ -339,7 +555,7 @@ export async function deployCommand(options) {
339
555
  finally {
340
556
  spinner.stop();
341
557
  }
342
- if (!force) {
558
+ if (!force && skipSourcePush) {
343
559
  const confirmed = await confirmPrompt(`Create release from "${branch}" and deploy to "${env}"?`, true);
344
560
  if (!confirmed) {
345
561
  console.log(` ${muted("Deploy cancelled.")}`);
@@ -362,6 +578,12 @@ export async function deployCommand(options) {
362
578
  commitSha: source.commitSha,
363
579
  sourceDigest: source.sourceDigest,
364
580
  });
581
+ spinner.update(`Waiting for release assets for ${release.version}...`);
582
+ await waitForReleaseAssetManifest(client, project.slug, release.id, {
583
+ expectedRoutes: expectedPageRoutes,
584
+ pollIntervalMs: assetManifestPollIntervalMs,
585
+ timeoutMs: assetManifestTimeoutMs,
586
+ });
365
587
  spinner.update(`Deploying ${release.version} to ${env}...`);
366
588
  deployment = await createDeployment(client, project.id, release.id, environment.id);
367
589
  spinner.update(`Verifying ${env} deployment...`);
@@ -395,14 +617,18 @@ export async function deployCommand(options) {
395
617
  const routingConvergenceWarning = getDeploymentRoutingConvergenceWarning(deployment);
396
618
  if (routingConvergenceWarning)
397
619
  logWarning(routingConvergenceWarning);
398
- logInfo(` Commit: ${verification.commitSha}`);
620
+ logInfo(` URL: ${buildEnvironmentUrl(verification.projectSlug, environment)}`);
621
+ logInfo(` Protected: ${environment.protected ? "yes" : "no"}`);
622
+ logInfo(verification.commitSha
623
+ ? ` Commit: ${verification.commitSha}`
624
+ : " Commit: unavailable (source digest verified)");
399
625
  logInfo(` Source digest: ${verification.sourceDigest}`);
400
626
  logInfo(` Control plane: ${normalizeControlPlane(config.apiUrl)}`);
401
627
  const { getPostDeployTips } = await import("../../help/tips.js");
402
628
  console.log(getPostDeployTips());
403
629
  }
404
630
  async function deployCommandJson(options) {
405
- const { projectDir = cwd(), branch, env, releaseName, dryRun, force } = options;
631
+ const { projectDir = cwd(), branch, env, releaseName, dryRun, force, skipSourcePush, assetManifestPollIntervalMs, assetManifestTimeoutMs, } = options;
406
632
  try {
407
633
  // JSON mode requires --force or --yes to prevent accidental deploys
408
634
  if (requiresExplicitDeployConfirmation(force)) {
@@ -416,11 +642,49 @@ async function deployCommandJson(options) {
416
642
  return;
417
643
  }
418
644
  streamJsonLine({ type: "step", name: "resolve-config", status: "started" });
419
- const config = await resolveConfigWithAuth(projectDir);
420
- const client = createApiClient(config);
645
+ const environmentConfig = getEnvironmentConfig();
646
+ const setup = await ensureProjectLinkedForDeploy(projectDir, environmentConfig, dryRun, true);
647
+ let { config, client, project } = setup;
648
+ const expectedPageRoutes = await collectProjectPageRoutes(projectDir);
421
649
  streamJsonLine({ type: "step", name: "resolve-config", status: "completed" });
650
+ if (dryRun && !project) {
651
+ streamJsonLine({
652
+ type: "result",
653
+ success: true,
654
+ data: {
655
+ dryRun: true,
656
+ branch,
657
+ projectId: null,
658
+ projectSlug: setup.plannedProjectSlug,
659
+ environment: env,
660
+ environmentId: null,
661
+ controlPlane: normalizeControlPlane(config.apiUrl),
662
+ plannedActions: [
663
+ "create-project",
664
+ ...(skipSourcePush ? [] : ["push-source"]),
665
+ "create-release",
666
+ "deploy",
667
+ ],
668
+ },
669
+ });
670
+ return;
671
+ }
672
+ if (!skipSourcePush) {
673
+ streamJsonLine({ type: "step", name: "push-source", status: "started" });
674
+ await pushCommand({
675
+ projectDir,
676
+ branch,
677
+ force: true,
678
+ dryRun,
679
+ quiet: true,
680
+ });
681
+ config = await resolveConfigWithAuth(projectDir, environmentConfig);
682
+ client = createApiClient(config);
683
+ streamJsonLine({ type: "step", name: "push-source", status: "completed" });
684
+ }
422
685
  streamJsonLine({ type: "step", name: "resolve-target", status: "started" });
423
- const project = await getProject(client, config.projectSlug);
686
+ if (!project)
687
+ project = await getProject(client, config.projectSlug);
424
688
  const environment = await getEnvironmentByName(client, project.id, env);
425
689
  if (!environment) {
426
690
  streamJsonLine({
@@ -477,6 +741,13 @@ async function deployCommandJson(options) {
477
741
  sourceDigest: source.sourceDigest,
478
742
  });
479
743
  streamJsonLine({ type: "step", name: "verify-release-source", status: "completed" });
744
+ streamJsonLine({ type: "step", name: "wait-release-assets", status: "started" });
745
+ await waitForReleaseAssetManifest(client, project.slug, release.id, {
746
+ expectedRoutes: expectedPageRoutes,
747
+ pollIntervalMs: assetManifestPollIntervalMs,
748
+ timeoutMs: assetManifestTimeoutMs,
749
+ });
750
+ streamJsonLine({ type: "step", name: "wait-release-assets", status: "completed" });
480
751
  streamJsonLine({ type: "step", name: "deploy", status: "started" });
481
752
  const deployment = await createDeployment(client, project.id, release.id, environment.id);
482
753
  streamJsonLine({ type: "step", name: "deploy", status: "completed" });
@@ -515,6 +786,8 @@ async function deployCommandJson(options) {
515
786
  environment: env,
516
787
  environmentId: verification.environmentId,
517
788
  deploymentId: verification.deploymentId,
789
+ url: buildEnvironmentUrl(verification.projectSlug, environment),
790
+ protected: environment.protected,
518
791
  routingConvergence: deployment.routing_convergence ?? null,
519
792
  commitSha: verification.commitSha,
520
793
  sourceDigest: verification.sourceDigest,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Deploy command - Create and deploy releases
3
3
  */
4
- export { assertProjectOwnership, createDeployment, createRelease, DeployArgsSchema, deployCommand, getDeployment, getDeploymentRoutingConvergenceWarning, getEnvironmentByName, getProject, getRelease, getReleaseSourceDigest, parseDeployArgs, requiresExplicitDeployConfirmation, resolvePushedSource, verifyDeployment, verifyReleaseSource, } from "./command.js";
4
+ export { assertProjectOwnership, createDeployment, createRelease, DeployArgsSchema, deployCommand, getDeployment, getDeploymentRoutingConvergenceWarning, getEnvironmentByName, getProject, getRelease, getReleaseSourceDigest, parseDeployArgs, requiresExplicitDeployConfirmation, resolvePushedSource, verifyDeployment, verifyReleaseSource, waitForReleaseAssetManifest, } from "./command.js";
5
5
  export type { Deployment, DeploymentRoutingConvergence, DeploymentVerification, DeployOptions, ReleaseSourceVerification, } from "./command.js";
6
6
  export { handleDeployCommand } from "./handler.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deploy/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,sCAAsC,EACtC,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,kCAAkC,EAClC,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,UAAU,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deploy/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,sCAAsC,EACtC,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,kCAAkC,EAClC,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,UAAU,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Deploy command - Create and deploy releases
3
3
  */
4
- export { assertProjectOwnership, createDeployment, createRelease, DeployArgsSchema, deployCommand, getDeployment, getDeploymentRoutingConvergenceWarning, getEnvironmentByName, getProject, getRelease, getReleaseSourceDigest, parseDeployArgs, requiresExplicitDeployConfirmation, resolvePushedSource, verifyDeployment, verifyReleaseSource, } from "./command.js";
4
+ export { assertProjectOwnership, createDeployment, createRelease, DeployArgsSchema, deployCommand, getDeployment, getDeploymentRoutingConvergenceWarning, getEnvironmentByName, getProject, getRelease, getReleaseSourceDigest, parseDeployArgs, requiresExplicitDeployConfirmation, resolvePushedSource, verifyDeployment, verifyReleaseSource, waitForReleaseAssetManifest, } from "./command.js";
5
5
  export { handleDeployCommand } from "./handler.js";
@@ -1 +1 @@
1
- {"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;AAWjC,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,YAAY,CAAC;AA6PzE;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA+arE"}
1
+ {"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;AAWjC,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,YAAY,CAAC;AA6PzE;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6ZrE"}
@@ -458,12 +458,9 @@ export async function initCommand(options) {
458
458
  if (options.deploy) {
459
459
  const { chdir } = await import("../../../src/platform/index.js");
460
460
  const { ensureAuthenticated, readToken } = await import("../../auth/index.js");
461
- const { randomSuffix } = await import("../../shared/slug.js");
462
- const { reserveProjectSlug } = await import("../../shared/reserve-slug.js");
463
- const { writeProjectSlug } = await import("../../shared/config.js");
464
- const { pushCommand } = await import("../push/index.js");
461
+ const { readConfigFile } = await import("../../shared/config.js");
465
462
  const { deployCommand } = await import("../deploy/index.js");
466
- const manualDeployHint = `Run ${brand("veryfront push --branch main")}, then ${brand("veryfront deploy --branch main --env production")} to deploy later.`;
463
+ const manualDeployHint = `Run ${brand("veryfront deploy")} to deploy later.`;
467
464
  const authResult = await ensureAuthenticated();
468
465
  if (!authResult) {
469
466
  log(`\n Authentication required for --deploy. ${manualDeployHint}`);
@@ -474,28 +471,22 @@ export async function initCommand(options) {
474
471
  log(`\n Could not read auth token. ${manualDeployHint}`);
475
472
  }
476
473
  else {
477
- const slug = `${projectName ?? "my-app"}-${randomSuffix()}`;
478
- log(`\n Deploying as ${brand(slug)}...`);
474
+ log(`\n Deploying project...`);
479
475
  try {
480
- const reserveResult = await reserveProjectSlug(slug, token);
481
- deployedSlug = reserveResult.slug;
482
- await writeProjectSlug(projectDir, deployedSlug);
483
476
  chdir(projectDir);
484
- await pushCommand({
485
- projectDir,
486
- branch: "main",
487
- force: true,
488
- dryRun: false,
489
- quiet: true,
490
- });
491
477
  await deployCommand({
478
+ projectDir,
492
479
  branch: "main",
493
480
  env: "production",
494
481
  force: true,
495
482
  dryRun: false,
496
483
  quiet: true,
497
484
  });
498
- log(` ${green("✓")} Deployed to ${brand(`https://${deployedSlug}.production.veryfront.com`)}`);
485
+ const configFile = await readConfigFile(projectDir);
486
+ deployedSlug = configFile?.projectSlug;
487
+ if (deployedSlug) {
488
+ log(` ${green("✓")} Deployed to ${brand(`https://${deployedSlug}.production.veryfront.com`)}`);
489
+ }
499
490
  }
500
491
  catch (error) {
501
492
  const message = error instanceof Error ? error.message : String(error);
@@ -532,7 +523,7 @@ export async function initCommand(options) {
532
523
  successContent.push("", `${green("Live:")} https://${deployedSlug}.production.veryfront.com`);
533
524
  }
534
525
  if (!deployedSlug) {
535
- successContent.push("", `${brand("veryfront push --branch main")} ${dim("→ upload source")}`, `${brand("veryfront deploy --branch main --env production")} ${dim("→ create a release and go live")}`);
526
+ successContent.push("", `${brand("veryfront deploy")} ${dim("→ upload source, create a release, and go live")}`);
536
527
  }
537
528
  if (!quiet) {
538
529
  console.log("");
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/up/command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAO3E,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,8BAA8B,CAAC;AAS5F,eAAO,MAAM,eAAe;;;;GAM3B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;GAA8B,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC;AAExE,eAAO,MAAM,WAAW;;;;GAItB,CAAC;AAyEH,wBAAsB,SAAS,CAC7B,OAAO,GAAE,OAAO,CAAC,SAAS,CAAM,EAChC,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,IAAI,CAAC,CA8Gf"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/up/command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAO3E,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,8BAA8B,CAAC;AAW5F,eAAO,MAAM,eAAe;;;;GAM3B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;GAA8B,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC;AAExE,eAAO,MAAM,WAAW;;;;GAItB,CAAC;AAsDH,wBAAsB,SAAS,CAC7B,OAAO,GAAE,OAAO,CAAC,SAAS,CAAM,EAChC,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,IAAI,CAAC,CAkHf"}