@hype-stack/cli 1.0.0 → 1.0.1

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 (53) hide show
  1. package/dist/{cli-DtlLnANf.js → cli-C8n6X5xr.js} +3753 -1599
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/commands/deploy.d.ts +26 -0
  4. package/dist/commands/deploy.d.ts.map +1 -0
  5. package/dist/config/bin.js +7 -7
  6. package/dist/deploy/assets.d.ts +73 -0
  7. package/dist/deploy/assets.d.ts.map +1 -0
  8. package/dist/deploy/assign.d.ts +58 -0
  9. package/dist/deploy/assign.d.ts.map +1 -0
  10. package/dist/deploy/build.d.ts +29 -0
  11. package/dist/deploy/build.d.ts.map +1 -0
  12. package/dist/deploy/catalog.d.ts +60 -0
  13. package/dist/deploy/catalog.d.ts.map +1 -0
  14. package/dist/deploy/config.d.ts +94 -0
  15. package/dist/deploy/config.d.ts.map +1 -0
  16. package/dist/deploy/detect.d.ts +36 -0
  17. package/dist/deploy/detect.d.ts.map +1 -0
  18. package/dist/deploy/dry-run.d.ts +14 -0
  19. package/dist/deploy/dry-run.d.ts.map +1 -0
  20. package/dist/deploy/env-plan.d.ts +67 -0
  21. package/dist/deploy/env-plan.d.ts.map +1 -0
  22. package/dist/deploy/migrations.d.ts +11 -0
  23. package/dist/deploy/migrations.d.ts.map +1 -0
  24. package/dist/deploy/orchestrate.d.ts +31 -0
  25. package/dist/deploy/orchestrate.d.ts.map +1 -0
  26. package/dist/deploy/plan.d.ts +23 -0
  27. package/dist/deploy/plan.d.ts.map +1 -0
  28. package/dist/deploy/project-env.d.ts +17 -0
  29. package/dist/deploy/project-env.d.ts.map +1 -0
  30. package/dist/deploy/providers/fly.d.ts +56 -0
  31. package/dist/deploy/providers/fly.d.ts.map +1 -0
  32. package/dist/deploy/providers/index.d.ts +9 -0
  33. package/dist/deploy/providers/index.d.ts.map +1 -0
  34. package/dist/deploy/providers/railway.d.ts +29 -0
  35. package/dist/deploy/providers/railway.d.ts.map +1 -0
  36. package/dist/deploy/providers/types.d.ts +92 -0
  37. package/dist/deploy/providers/types.d.ts.map +1 -0
  38. package/dist/deploy/report.d.ts +13 -0
  39. package/dist/deploy/report.d.ts.map +1 -0
  40. package/dist/deploy/runner.d.ts +81 -0
  41. package/dist/deploy/runner.d.ts.map +1 -0
  42. package/dist/deploy/types.d.ts +208 -0
  43. package/dist/deploy/types.d.ts.map +1 -0
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -2
  47. package/dist/types/types.d.ts +7 -0
  48. package/dist/types/types.d.ts.map +1 -1
  49. package/dist/utils/exec.d.ts +8 -0
  50. package/dist/utils/exec.d.ts.map +1 -1
  51. package/dist/utils/json.d.ts +11 -0
  52. package/dist/utils/json.d.ts.map +1 -0
  53. package/package.json +1 -1
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmDpC,wBAAgB,aAAa,IAAI,OAAO,CAoJvC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0EpC,wBAAgB,aAAa,IAAI,OAAO,CAuLvC"}
@@ -0,0 +1,26 @@
1
+ import { resolveAssignment } from '../deploy/assign.js';
2
+ import { DeployOptions, DeployTarget, ManagedService } from '../deploy/types.js';
3
+ /**
4
+ * Deploy the whole stack: the two frontends, the backend, and the Postgres,
5
+ * Valkey, and object storage they run on.
6
+ *
7
+ * Every provider assignment is saved to the `deploy` block of `stack.json` on
8
+ * the way out, so the second run is `hype-stack deploy` with no flags and lands
9
+ * on exactly the same infrastructure.
10
+ */
11
+ export declare function deployCommand(options?: DeployOptions): Promise<void>;
12
+ export interface PromptGapsInput {
13
+ assignment: ReturnType<typeof resolveAssignment>;
14
+ availableTargets: DeployTarget[];
15
+ requestedTargets: DeployTarget[];
16
+ }
17
+ /**
18
+ * What the flags and the saved config left open, which is exactly what has to
19
+ * be asked about. Services only count when a backend is part of the run: a
20
+ * frontend-only deploy has nothing that would talk to a database.
21
+ */
22
+ export declare function pendingAssignments(input: PromptGapsInput): {
23
+ targets: DeployTarget[];
24
+ services: ManagedService[];
25
+ };
26
+ //# sourceMappingURL=deploy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,iBAAiB,EAAqC,MAAM,qBAAqB,CAAC;AA4BzG,OAAO,KAAK,EAEV,aAAa,EAEb,YAAY,EACZ,cAAc,EAGf,MAAM,oBAAoB,CAAC;AAM5B;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmJ9E;AA2BD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IACjD,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,gBAAgB,EAAE,YAAY,EAAE,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG;IAC1D,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B,CAUA"}
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import { l as e, n as t, t as n, u as r } from "../cli-DtlLnANf.js";
2
+ import { d as e, n as t, t as n, u as r } from "../cli-C8n6X5xr.js";
3
3
  import { z as i } from "zod";
4
4
  import * as a from "@sentry/node";
5
5
  //#region src/core/sentry.ts
6
6
  var o = 2e3;
7
- function s({ command: e, dsn: t }) {
8
- if (!t) return !1;
7
+ function s({ command: t, dsn: n }) {
8
+ if (!n) return !1;
9
9
  try {
10
10
  return a.init({
11
- dsn: t,
12
- release: `@hype-stack/cli@${r}`,
11
+ dsn: n,
12
+ release: `@hype-stack/cli@${e}`,
13
13
  sendDefaultPii: !1,
14
14
  initialScope: { tags: {
15
- command: e,
15
+ command: t,
16
16
  node: process.version,
17
17
  platform: process.platform
18
18
  } }
@@ -51,7 +51,7 @@ var l = i.object({
51
51
  "onboard",
52
52
  "template"
53
53
  ], f = process.argv[2], p = f && d.includes(f) ? f : "root";
54
- f === "mcp" && process.argv[3] !== "install" && (e("mcp"), t());
54
+ f === "mcp" && process.argv[3] !== "install" && (r("mcp"), t());
55
55
  var m = s({
56
56
  command: p,
57
57
  dsn: process.env.CLI_SENTRY_DSN
@@ -0,0 +1,73 @@
1
+ import { PlannedTarget } from './types.js';
2
+ /** Where generated deploy files land, relative to the project root. */
3
+ export declare const DEPLOY_ASSETS_DIR = ".hype-stack/deploy";
4
+ /**
5
+ * Port the generated static image listens on. Fixed rather than read from
6
+ * `$PORT` so the nginx config needs no templating, which keeps `try_files
7
+ * $uri` from being eaten by the base image's envsubst step. Both providers are
8
+ * told this number explicitly.
9
+ */
10
+ export declare const STATIC_PORT = 8080;
11
+ export declare function assetsDir(projectRoot: string): string;
12
+ export interface FlyTomlInput {
13
+ app: string;
14
+ region?: string;
15
+ internalPort: number;
16
+ /** Static targets run one always-on machine; a suspended SPA host is pointless latency. */
17
+ minMachines?: number;
18
+ /**
19
+ * Command to run in a temporary machine built from the new image, before any
20
+ * traffic moves to it. This is where migrations belong: Fly aborts the whole
21
+ * deploy if it exits non-zero, so a release never goes out against a database
22
+ * it cannot run on.
23
+ */
24
+ releaseCommand?: string;
25
+ }
26
+ export declare function renderFlyToml(input: FlyTomlInput): string;
27
+ export interface WriteFlyTomlInput {
28
+ projectRoot: string;
29
+ target: PlannedTarget;
30
+ internalPort: number;
31
+ releaseCommand?: string;
32
+ }
33
+ export declare function writeFlyToml(input: WriteFlyTomlInput): Promise<string>;
34
+ /**
35
+ * nginx config for a single-page app: every unknown path falls back to
36
+ * `index.html` so client-side routing survives a hard refresh.
37
+ */
38
+ export declare function renderStaticNginxConf(port: number): string;
39
+ export interface StaticDockerfileInput {
40
+ /** Build output directory, relative to the project root. */
41
+ contentDir: string;
42
+ /** nginx config path, relative to the project root. */
43
+ configPath: string;
44
+ port: number;
45
+ }
46
+ /**
47
+ * Image for a prebuilt SPA. The bundle is built on the machine running the
48
+ * deploy (so the `VITE_*` values are the resolved production ones) and this
49
+ * image only has to serve it, which keeps the remote build to a single COPY.
50
+ */
51
+ export declare function renderStaticDockerfile(input: StaticDockerfileInput): string;
52
+ export interface StaticImageAssets {
53
+ /** Dockerfile path relative to the project root. */
54
+ dockerfile: string;
55
+ /** nginx config path relative to the project root. */
56
+ nginxConf: string;
57
+ port: number;
58
+ }
59
+ /**
60
+ * Write the Dockerfile and nginx config that turn a built SPA into a container,
61
+ * for the providers that host containers rather than static assets.
62
+ */
63
+ export declare function writeStaticImageAssets(projectRoot: string, target: PlannedTarget, contentDir: string): Promise<StaticImageAssets>;
64
+ /**
65
+ * Locate the Dockerfile a container target builds from, relative to the project
66
+ * root. Returns null when the app ships none, which is what turns into the
67
+ * "add a Dockerfile" error instead of a confusing remote build failure.
68
+ */
69
+ export declare function findTargetDockerfile(projectRoot: string, target: PlannedTarget): Promise<string | null>;
70
+ export declare function toPosixRelative(from: string, to: string): string;
71
+ /** Keep generated deploy files out of git; they are reproducible from `stack.json`. */
72
+ export declare function ensureAssetsGitignored(projectRoot: string): Promise<void>;
73
+ //# sourceMappingURL=assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/deploy/assets.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErD;AAUD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAsBzD;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAGD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoB1D;AAED,MAAM,WAAW,qBAAqB;IACpC,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAa3E;AAED,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAI7G;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,uFAAuF;AACvF,wBAAsB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAc/E"}
@@ -0,0 +1,58 @@
1
+ import { ServeModes } from './detect.js';
2
+ import { DeployConfig, DeployResource, DeployTarget, ManagedService, ProviderId } from './types.js';
3
+ export type AssignmentIssueCode = "unassigned" | "missing-target" | "unsupported-serve-mode";
4
+ export interface AssignmentIssue {
5
+ resource: DeployResource;
6
+ provider?: ProviderId;
7
+ code: AssignmentIssueCode;
8
+ message: string;
9
+ /** How to get past it, phrased as something the user can paste. */
10
+ fix?: string;
11
+ }
12
+ export interface Assignment {
13
+ targets: Partial<Record<DeployTarget, ProviderId>>;
14
+ services: Partial<Record<ManagedService, ProviderId>>;
15
+ }
16
+ export interface ResolveAssignmentInput {
17
+ config: DeployConfig;
18
+ /** Provider for anything without a more specific assignment. Beats the saved `defaultProvider`. */
19
+ defaultProvider?: ProviderId;
20
+ /** Per-resource `--backend fly` style overrides. Beat everything else. */
21
+ overrides?: Partial<Record<DeployResource, ProviderId>>;
22
+ /** Targets that actually exist in the project, from `stack.json` -> `apps`. */
23
+ availableTargets: DeployTarget[];
24
+ /** Restrict this run to a subset of targets. Empty or omitted means all available. */
25
+ only?: DeployTarget[];
26
+ }
27
+ /**
28
+ * Work out which provider owns each target and service.
29
+ *
30
+ * Precedence, highest first: an explicit `--<resource> <provider>` override, the
31
+ * saved `stack.json` entry, the `--provider` default for this run, then the
32
+ * saved `defaultProvider`. Anything still unresolved comes back absent, and
33
+ * {@link validateAssignment} turns that into an `unassigned` issue rather than
34
+ * guessing a provider that would bill the user.
35
+ */
36
+ export declare function resolveAssignment(input: ResolveAssignmentInput): Assignment;
37
+ /**
38
+ * Narrow the targets to deploy: the intersection of what the project has and
39
+ * what `--only` asked for, in catalog order so the summary is always stable.
40
+ */
41
+ export declare function selectTargets(availableTargets: DeployTarget[], only?: DeployTarget[]): DeployTarget[];
42
+ export interface ValidateAssignmentInput {
43
+ assignment: Assignment;
44
+ availableTargets: DeployTarget[];
45
+ /** Targets the user explicitly asked for, so a typo is reported rather than ignored. */
46
+ requestedTargets?: DeployTarget[];
47
+ /** Serve mode per app, from detection. A null entry means it cannot ship at all. */
48
+ serveModes?: ServeModes;
49
+ }
50
+ /**
51
+ * Check every assignment against the provider capability matrix. Returns the
52
+ * full list of problems rather than the first one, so a bad plan is fixed in a
53
+ * single pass instead of one error per run.
54
+ */
55
+ export declare function validateAssignment(input: ValidateAssignmentInput): AssignmentIssue[];
56
+ /** Format issues into one block for a note/error, newest-friendly for a terminal. */
57
+ export declare function formatIssues(issues: AssignmentIssue[]): string;
58
+ //# sourceMappingURL=assign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assign.d.ts","sourceRoot":"","sources":["../../src/deploy/assign.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEzG,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,gBAAgB,GAAG,wBAAwB,CAAC;AAE7F,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IACnD,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,YAAY,CAAC;IACrB,mGAAmG;IACnG,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;IACxD,+EAA+E;IAC/E,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,sFAAsF;IACtF,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,UAAU,CAkB3E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,YAAY,EAAE,EAAE,IAAI,CAAC,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAIrG;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,YAAY,EAAE,CAAC;IAClC,oFAAoF;IACpF,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,eAAe,EAAE,CAsDpF;AAaD,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAO9D"}
@@ -0,0 +1,29 @@
1
+ import { ProviderContext } from './providers/types.js';
2
+ import { PlannedTarget } from './types.js';
3
+ /**
4
+ * Pick the package script that produces the deployable artifact. Returns null
5
+ * when the app declares none, which the caller turns into an actionable error
6
+ * rather than deploying an empty directory.
7
+ */
8
+ export declare function resolveBuildScript(root: string): Promise<string | null>;
9
+ export interface BuildResult {
10
+ /** Script that ran, or null when the target needed no local build. */
11
+ script: string | null;
12
+ /** Build output directory relative to the project root, for static targets. */
13
+ outputDir?: string;
14
+ }
15
+ export interface BuildTargetInput {
16
+ target: PlannedTarget;
17
+ /** Env for the build, which is where `VITE_*` values get baked into the bundle. */
18
+ env: Record<string, string>;
19
+ secrets: string[];
20
+ }
21
+ /**
22
+ * Build a static target locally.
23
+ *
24
+ * Vite inlines `VITE_*` at build time, so the bundle has to be produced with the
25
+ * production API origin already resolved. Building here (rather than on the
26
+ * provider) is also what lets a static host receive a plain folder of files.
27
+ */
28
+ export declare function buildStaticTarget(ctx: ProviderContext, input: BuildTargetInput): Promise<BuildResult>;
29
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/deploy/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAchD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAI7E;AAED,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAgC3G"}
@@ -0,0 +1,60 @@
1
+ import { DeployResource, DeployTarget, ManagedService, ProviderId, ProviderSpec, ServiceSpec, TargetSpec } from './types.js';
2
+ /**
3
+ * Deploy settings live in the `deploy` block of `stack.json` rather than a file
4
+ * of their own. A project without `stack.json` is not a Hype Stack project, so
5
+ * there is nothing to deploy and nowhere sensible to record what was created.
6
+ */
7
+ export declare const DEPLOY_CONFIG_FILE = "stack.json";
8
+ /** Key inside `stack.json` that holds everything below. */
9
+ export declare const DEPLOY_CONFIG_KEY = "deploy";
10
+ /**
11
+ * Dotted path to a deploy setting, for error messages that tell the user
12
+ * exactly what to edit, e.g. `deploy.services.bucket.external`.
13
+ */
14
+ export declare function settingPath(...segments: string[]): string;
15
+ /**
16
+ * Schema version written into the `deploy` block. Tracked separately from
17
+ * `stack.json`'s own version so the two can evolve without forcing each other.
18
+ */
19
+ export declare const DEPLOY_CONFIG_VERSION = 1;
20
+ /** Environment name used when neither the flag nor the saved config picks one. */
21
+ export declare const DEFAULT_ENVIRONMENT = "production";
22
+ export declare const DEPLOY_TARGETS: DeployTarget[];
23
+ export declare const MANAGED_SERVICES: ManagedService[];
24
+ /**
25
+ * Providers the CLI will drive.
26
+ *
27
+ * The bar for being here is deploying the whole stack unattended: all three
28
+ * apps as containers, plus Postgres, Valkey, and an S3-compatible bucket, from
29
+ * one command with no dashboard visits in the middle. Static hosts do not
30
+ * qualify, however good they are at the static half. Cloudflare and Netlify
31
+ * cannot run the backend at all and have no managed Postgres, which would leave
32
+ * the user assembling the rest by hand.
33
+ */
34
+ export declare const PROVIDER_IDS: ProviderId[];
35
+ export declare const TARGET_SPECS: Record<DeployTarget, TargetSpec>;
36
+ export declare const SERVICE_SPECS: Record<ManagedService, ServiceSpec>;
37
+ export declare const PROVIDER_SPECS: Record<ProviderId, ProviderSpec>;
38
+ export declare function isDeployTarget(value: string): value is DeployTarget;
39
+ export declare function isManagedService(value: string): value is ManagedService;
40
+ export declare function isProviderId(value: string): value is ProviderId;
41
+ export declare function isDeployResource(value: string): value is DeployResource;
42
+ /** Human label for a target or service, for prompts and the summary. */
43
+ export declare function resourceLabel(resource: DeployResource): string;
44
+ export declare function providerLabel(provider: ProviderId): string;
45
+ /**
46
+ * Providers that can host `resource`.
47
+ *
48
+ * Every one of them can host all three apps and run all three services, which
49
+ * is the entry requirement, so this is the full list. It stays a function
50
+ * because the picker and the error messages read better asking the question
51
+ * than asserting the answer.
52
+ */
53
+ export declare function providersForResource(_resource: DeployResource): ProviderId[];
54
+ /**
55
+ * Default remote resource name. Provider namespaces are global-ish (Fly app
56
+ * names are unique per organization, Railway service names per project), so the
57
+ * project name is always the prefix to keep two projects from colliding.
58
+ */
59
+ export declare function defaultResourceName(projectName: string, resource: DeployResource): string;
60
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/deploy/catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,eAAoB,CAAC;AAEpD,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,YAAY,EAAqC,CAAC;AAE/E,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAAqC,CAAC;AAEnF;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,EAAuB,CAAC;AAE7D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,CAgCzD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,WAAW,CAgB7D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,YAAY,CAe3D,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAEnE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAEvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAEvE;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAG9D;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAE1D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,cAAc,GAAG,UAAU,EAAE,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,CAEzF"}
@@ -0,0 +1,94 @@
1
+ import { z } from 'zod';
2
+ import { DeployConfig } from './types.js';
3
+ export declare const deployConfigSchema: z.ZodObject<{
4
+ version: z.ZodNumber;
5
+ projectName: z.ZodString;
6
+ environment: z.ZodString;
7
+ defaultProvider: z.ZodOptional<z.ZodEnum<{
8
+ railway: "railway";
9
+ fly: "fly";
10
+ }>>;
11
+ targets: z.ZodDefault<z.ZodObject<{
12
+ backend: z.ZodOptional<z.ZodObject<{
13
+ provider: z.ZodEnum<{
14
+ railway: "railway";
15
+ fly: "fly";
16
+ }>;
17
+ app: z.ZodOptional<z.ZodString>;
18
+ region: z.ZodOptional<z.ZodString>;
19
+ url: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>>;
21
+ frontend: z.ZodOptional<z.ZodObject<{
22
+ provider: z.ZodEnum<{
23
+ railway: "railway";
24
+ fly: "fly";
25
+ }>;
26
+ app: z.ZodOptional<z.ZodString>;
27
+ region: z.ZodOptional<z.ZodString>;
28
+ url: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>>;
30
+ admin: z.ZodOptional<z.ZodObject<{
31
+ provider: z.ZodEnum<{
32
+ railway: "railway";
33
+ fly: "fly";
34
+ }>;
35
+ app: z.ZodOptional<z.ZodString>;
36
+ region: z.ZodOptional<z.ZodString>;
37
+ url: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strip>>;
39
+ }, z.core.$strip>>;
40
+ services: z.ZodDefault<z.ZodObject<{
41
+ postgres: z.ZodOptional<z.ZodObject<{
42
+ provider: z.ZodEnum<{
43
+ railway: "railway";
44
+ fly: "fly";
45
+ }>;
46
+ name: z.ZodOptional<z.ZodString>;
47
+ region: z.ZodOptional<z.ZodString>;
48
+ external: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
+ }, z.core.$strip>>;
50
+ valkey: z.ZodOptional<z.ZodObject<{
51
+ provider: z.ZodEnum<{
52
+ railway: "railway";
53
+ fly: "fly";
54
+ }>;
55
+ name: z.ZodOptional<z.ZodString>;
56
+ region: z.ZodOptional<z.ZodString>;
57
+ external: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
58
+ }, z.core.$strip>>;
59
+ bucket: z.ZodOptional<z.ZodObject<{
60
+ provider: z.ZodEnum<{
61
+ railway: "railway";
62
+ fly: "fly";
63
+ }>;
64
+ name: z.ZodOptional<z.ZodString>;
65
+ region: z.ZodOptional<z.ZodString>;
66
+ external: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
67
+ }, z.core.$strip>>;
68
+ }, z.core.$strip>>;
69
+ fly: z.ZodOptional<z.ZodObject<{
70
+ org: z.ZodOptional<z.ZodString>;
71
+ postgresPlan: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>>;
73
+ railway: z.ZodOptional<z.ZodObject<{
74
+ workspace: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strip>>;
76
+ }, z.core.$strip>;
77
+ export declare function hasDeployConfig(projectRoot: string): Promise<boolean>;
78
+ /**
79
+ * Read the `deploy` block out of `stack.json`, returning null when the project
80
+ * has never been deployed. A block that exists but does not validate is a hard
81
+ * error rather than a fallback to defaults, for the reason above.
82
+ */
83
+ export declare function loadDeployConfig(projectRoot: string): Promise<DeployConfig | null>;
84
+ /**
85
+ * Write the `deploy` block back, leaving the rest of `stack.json` untouched.
86
+ *
87
+ * The file is re-read first rather than reusing the copy loaded at startup,
88
+ * because a deploy runs long enough for `compose` or an editor to have
89
+ * rewritten it in the meantime, and clobbering an installed pack log would be a
90
+ * far worse outcome than a stale provider name.
91
+ */
92
+ export declare function saveDeployConfig(projectRoot: string, config: DeployConfig): Promise<void>;
93
+ export declare function createDeployConfig(projectName: string, environment?: string): DeployConfig;
94
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/deploy/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA2B/C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqB7B,CAAC;AA2BH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG3E;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAkBxF;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/F;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,SAAsB,GAAG,YAAY,CAQvG"}
@@ -0,0 +1,36 @@
1
+ import { StackConfig } from '../types/types.js';
2
+ import { DeployTarget, ServeMode } from './types.js';
3
+ /** Absolute path to a target's app directory, honoring `stack.json` -> `paths`. */
4
+ export declare function targetRoot(projectRoot: string, target: DeployTarget, config: StackConfig | null): string;
5
+ /**
6
+ * Which of the three apps this project actually has. A template composed
7
+ * without the admin app should not be offered an admin deploy, and asking the
8
+ * filesystem is more reliable than trusting a `stack.json` that predates a
9
+ * removed app.
10
+ */
11
+ export declare function detectAvailableTargets(projectRoot: string, config: StackConfig | null): Promise<DeployTarget[]>;
12
+ /**
13
+ * How a target ships.
14
+ *
15
+ * A Dockerfile wins whenever there is one. It is the deployment the project's
16
+ * authors wrote and tested, and both providers build it as-is, so generating an
17
+ * image over the top would quietly drop their SSR server. Without one the CLI
18
+ * has to produce the image itself, which it can only do for a build that emits
19
+ * a folder of files.
20
+ *
21
+ * Returns null when neither is possible, which assignment validation turns into
22
+ * a reportable issue rather than a failure halfway through a remote build.
23
+ */
24
+ export declare function detectServeMode(root: string, target: DeployTarget): Promise<ServeMode | null>;
25
+ /** Serve mode per target. A null entry means the app cannot ship at all yet. */
26
+ export type ServeModes = Partial<Record<DeployTarget, ServeMode | null>>;
27
+ export declare function detectServeModes(projectRoot: string, targets: DeployTarget[], config: StackConfig | null): Promise<ServeModes>;
28
+ /** Drop the targets that cannot ship, leaving what the plan can be built from. */
29
+ export declare function deployableModes(modes: ServeModes): Partial<Record<DeployTarget, ServeMode>>;
30
+ /**
31
+ * Find the directory a static build lands in. Vite's default is `dist`, but a
32
+ * TanStack Start build writes `.output/public`, so both are probed before
33
+ * falling back to the catalog default. Returns a path relative to the app root.
34
+ */
35
+ export declare function detectStaticDir(root: string, target: DeployTarget): Promise<string>;
36
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/deploy/detect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAsB1D,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,CAKxG;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAUrH;AAUD;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAqBnG;AAED,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;AAEzE,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,YAAY,EAAE,EACvB,MAAM,EAAE,WAAW,GAAG,IAAI,GACzB,OAAO,CAAC,UAAU,CAAC,CASrB;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAS3F;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAUzF"}
@@ -0,0 +1,14 @@
1
+ import { DryRunResponse } from './runner.js';
2
+ /**
3
+ * Sample provider output for `deploy --dry-run`.
4
+ *
5
+ * A dry run executes nothing, so every command comes back empty, and an adapter
6
+ * that parses a connection string out of its output would stop the walk at the
7
+ * first service. These stand-ins keep the run going to the end, which is the
8
+ * whole point of a dry run: seeing every command, not just the first few.
9
+ *
10
+ * The values are obviously fake so nobody mistakes a dry run for a real one.
11
+ */
12
+ export declare const DRY_RUN_PLACEHOLDER = "dry-run-placeholder";
13
+ export declare const DRY_RUN_RESPONSES: DryRunResponse[];
14
+ //# sourceMappingURL=dry-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dry-run.d.ts","sourceRoot":"","sources":["../../src/deploy/dry-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAUzD,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAwE7C,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { DeployPlan, DeployTarget, ManagedService, ServiceOutputs, TargetEnvPlan, TargetUrls } from './types.js';
2
+ export type { TargetEnvPlan } from './types.js';
3
+ /**
4
+ * Env vars the deploy owns. A value the user left in a local `.env` never
5
+ * overrides one of these: the whole point is that the deployed apps point at
6
+ * the infrastructure this command just provisioned, not at localhost.
7
+ */
8
+ export declare const MANAGED_KEYS: Record<DeployTarget, string[]>;
9
+ export interface BuildEnvPlanInput {
10
+ plan: DeployPlan;
11
+ /** Connection values from each provisioned service. */
12
+ serviceOutputs: Partial<Record<ManagedService, ServiceOutputs>>;
13
+ /** Public origin for each target, resolved before any build runs. */
14
+ urls: TargetUrls;
15
+ /** Parsed local `.env` contents per target, used to carry third-party secrets over. */
16
+ localEnv?: Partial<Record<DeployTarget, Record<string, string>>>;
17
+ /** Keys each app declares in `.env.example`, used to decide what to forward and what is missing. */
18
+ declaredKeys?: Partial<Record<DeployTarget, string[]>>;
19
+ /**
20
+ * Keys a provider wired onto the app itself, out of band (Fly's `mpg attach`
21
+ * sets `DATABASE_URL` this way). Nothing local knows the value, but the app
22
+ * has it, so they are not reported as missing.
23
+ */
24
+ externallyProvided?: Partial<Record<DeployTarget, string[]>>;
25
+ }
26
+ export declare function buildEnvPlan(input: BuildEnvPlanInput): TargetEnvPlan[];
27
+ export interface PreviewEnvPlanInput {
28
+ plan: DeployPlan;
29
+ localEnv?: Partial<Record<DeployTarget, Record<string, string>>>;
30
+ declaredKeys?: Partial<Record<DeployTarget, string[]>>;
31
+ }
32
+ /**
33
+ * The env plan as it will look once the run has settled every origin and
34
+ * connection string, for the summary shown before anything is created.
35
+ *
36
+ * Building that summary from empty inputs instead would report every value the
37
+ * deploy is about to set (`DATABASE_URL`, `VITE_API_BASE_URL`, and the rest) as
38
+ * unset, directly above the prompt asking whether to go ahead. The shape is
39
+ * known from the plan even though the values are not, so it is filled with
40
+ * stand-ins and run through the same code the real pass uses.
41
+ */
42
+ export declare function previewEnvPlan(input: PreviewEnvPlanInput): TargetEnvPlan[];
43
+ interface ManagedEnvInput {
44
+ target: DeployTarget;
45
+ environment: string;
46
+ port?: number;
47
+ serviceOutputs: Partial<Record<ManagedService, ServiceOutputs>>;
48
+ urls: TargetUrls;
49
+ }
50
+ /**
51
+ * Compute the deploy-owned env for one target. Keys whose source is not
52
+ * available yet are simply absent, so a frontend-only deploy does not stamp an
53
+ * empty `VITE_API_BASE_URL` over a working one.
54
+ */
55
+ export declare function managedEnvFor(input: ManagedEnvInput): Record<string, string>;
56
+ /** Every env var to apply to a target, managed values winning over forwarded ones. */
57
+ export declare function mergedEnv(plan: TargetEnvPlan): Record<string, string>;
58
+ /**
59
+ * Parse a `.env` file into a flat map. Handles the `export KEY=value` prefix and
60
+ * single or double quoted values, and drops comments and blank lines. Escapes
61
+ * are left alone: dotenv's own handling of them varies by implementation, and a
62
+ * value is only ever passed through verbatim from here.
63
+ */
64
+ export declare function parseEnvContent(content: string): Record<string, string>;
65
+ /** Keys declared in a `.env.example`, in file order and deduped. */
66
+ export declare function declaredEnvKeys(exampleContent: string): string[];
67
+ //# sourceMappingURL=env-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-plan.d.ts","sourceRoot":"","sources":["../../src/deploy/env-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,aAAa,EACb,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAkBvD,CAAC;AAmBF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,uDAAuD;IACvD,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IAChE,qEAAqE;IACrE,IAAI,EAAE,UAAU,CAAC;IACjB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,oGAAoG;IACpG,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACvD;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;CAC9D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,aAAa,EAAE,CAwBtE;AAQD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,aAAa,EAAE,CAa1E;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IAChE,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAoB5E;AAyDD,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAErE;AAYD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBvE;AAcD,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAEhE"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Work out the command that applies pending migrations inside the deployed
3
+ * backend container.
4
+ *
5
+ * The template ships a `migration:latest` script, so that is used when present:
6
+ * it already knows where the schema lives and which Prisma config to load.
7
+ * Otherwise fall back to invoking Prisma directly against the schema, which
8
+ * works for a stock layout.
9
+ */
10
+ export declare function resolveMigrationCommand(backendRoot: string, projectRoot: string): Promise<string[]>;
11
+ //# sourceMappingURL=migrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/deploy/migrations.ts"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAUzG"}
@@ -0,0 +1,31 @@
1
+ import { DeployProviderAdapter } from './providers/types.js';
2
+ import { CommandRunner } from './runner.js';
3
+ import { DeployOutcome, DeployPlan, DeployTarget, ManagedService, ProviderId, ServiceOutputs } from './types.js';
4
+ export interface RunDeployInput {
5
+ plan: DeployPlan;
6
+ runner: CommandRunner;
7
+ /** Swap in fakes for tests. Defaults to the real provider adapters. */
8
+ adapters?: Partial<Record<ProviderId, DeployProviderAdapter>>;
9
+ /** Parsed local `.env` per target, so third-party keys carry over. */
10
+ localEnv?: Partial<Record<DeployTarget, Record<string, string>>>;
11
+ /** Keys each app declares in `.env.example`. */
12
+ declaredKeys?: Partial<Record<DeployTarget, string[]>>;
13
+ /** Assume services already exist; reuse the values in `knownServiceOutputs`. */
14
+ skipProvision?: boolean;
15
+ knownServiceOutputs?: Partial<Record<ManagedService, ServiceOutputs>>;
16
+ skipMigrations?: boolean;
17
+ /** Skip the provider auth probe. Used by `--dry-run`, where no command really runs. */
18
+ skipAuthCheck?: boolean;
19
+ log?: (message: string) => void;
20
+ }
21
+ /**
22
+ * Walk the plan.
23
+ *
24
+ * The order is forced by a dependency cycle in the env: the two frontends inline
25
+ * the backend's origin at build time, and the backend needs their origins for
26
+ * CORS. It is broken by settling every public URL in a reserve pass before
27
+ * anything is built, so by the time env vars are computed all of them are known.
28
+ */
29
+ export declare function runDeploy(input: RunDeployInput): Promise<DeployOutcome>;
30
+ export declare function involvedProviders(plan: DeployPlan): ProviderId[];
31
+ //# sourceMappingURL=orchestrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../../src/deploy/orchestrate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EAEV,YAAY,EACZ,cAAc,EAEd,UAAU,EACV,cAAc,EAGf,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC9D,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,gDAAgD;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACvD,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IACtE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,uFAAuF;IACvF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CA+J7E;AAmDD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,CAOhE"}
@@ -0,0 +1,23 @@
1
+ import { StackConfig } from '../types/types.js';
2
+ import { Assignment } from './assign.js';
3
+ import { DeployConfig, DeployPlan, DeployTarget, ServeMode } from './types.js';
4
+ export interface BuildPlanInput {
5
+ projectRoot: string;
6
+ config: DeployConfig;
7
+ assignment: Assignment;
8
+ stackConfig: StackConfig | null;
9
+ /** Detected serve mode per target, overriding the catalog default. */
10
+ serveModes?: Partial<Record<DeployTarget, ServeMode>>;
11
+ /** Detected static output directory per target, relative to the app root. */
12
+ staticDirs?: Partial<Record<DeployTarget, string>>;
13
+ }
14
+ /**
15
+ * Turn an assignment plus the saved config into a plan where nothing is left
16
+ * implicit: every app name, region, and root path is resolved here so the
17
+ * provider adapters never have to invent one, and so the summary the user
18
+ * confirms is exactly what runs.
19
+ */
20
+ export declare function buildPlan(input: BuildPlanInput): DeployPlan;
21
+ /** Fold the resolved plan back into the config so the next run reuses the same names. */
22
+ export declare function applyPlanToConfig(config: DeployConfig, plan: DeployPlan): DeployConfig;
23
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/deploy/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EAGZ,SAAS,EAEV,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IACtD,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAmD3D;AAkBD,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,CAoCtF"}