@hype-stack/cli 1.0.0 → 1.1.0
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/{cli-DtlLnANf.js → cli-DdPVabIO.js} +4176 -1695
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/deploy.d.ts +26 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/template.d.ts.map +1 -1
- package/dist/config/bin.js +7 -7
- package/dist/core/onboard-catalog.d.ts.map +1 -1
- package/dist/deploy/assets.d.ts +114 -0
- package/dist/deploy/assets.d.ts.map +1 -0
- package/dist/deploy/assign.d.ts +58 -0
- package/dist/deploy/assign.d.ts.map +1 -0
- package/dist/deploy/auth.d.ts +52 -0
- package/dist/deploy/auth.d.ts.map +1 -0
- package/dist/deploy/build.d.ts +29 -0
- package/dist/deploy/build.d.ts.map +1 -0
- package/dist/deploy/catalog.d.ts +60 -0
- package/dist/deploy/catalog.d.ts.map +1 -0
- package/dist/deploy/config.d.ts +94 -0
- package/dist/deploy/config.d.ts.map +1 -0
- package/dist/deploy/detect.d.ts +36 -0
- package/dist/deploy/detect.d.ts.map +1 -0
- package/dist/deploy/dry-run.d.ts +14 -0
- package/dist/deploy/dry-run.d.ts.map +1 -0
- package/dist/deploy/env-plan.d.ts +67 -0
- package/dist/deploy/env-plan.d.ts.map +1 -0
- package/dist/deploy/migrations.d.ts +11 -0
- package/dist/deploy/migrations.d.ts.map +1 -0
- package/dist/deploy/orchestrate.d.ts +36 -0
- package/dist/deploy/orchestrate.d.ts.map +1 -0
- package/dist/deploy/plan.d.ts +23 -0
- package/dist/deploy/plan.d.ts.map +1 -0
- package/dist/deploy/project-env.d.ts +17 -0
- package/dist/deploy/project-env.d.ts.map +1 -0
- package/dist/deploy/providers/fly.d.ts +62 -0
- package/dist/deploy/providers/fly.d.ts.map +1 -0
- package/dist/deploy/providers/index.d.ts +9 -0
- package/dist/deploy/providers/index.d.ts.map +1 -0
- package/dist/deploy/providers/railway.d.ts +29 -0
- package/dist/deploy/providers/railway.d.ts.map +1 -0
- package/dist/deploy/providers/types.d.ts +92 -0
- package/dist/deploy/providers/types.d.ts.map +1 -0
- package/dist/deploy/report.d.ts +13 -0
- package/dist/deploy/report.d.ts.map +1 -0
- package/dist/deploy/runner.d.ts +87 -0
- package/dist/deploy/runner.d.ts.map +1 -0
- package/dist/deploy/types.d.ts +234 -0
- package/dist/deploy/types.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/types/types.d.ts +7 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/ui/option-hint.d.ts +34 -0
- package/dist/ui/option-hint.d.ts.map +1 -0
- package/dist/ui/pack-multiselect.d.ts.map +1 -1
- package/dist/ui/pack-select.d.ts.map +1 -1
- package/dist/utils/exec.d.ts +12 -0
- package/dist/utils/exec.d.ts.map +1 -1
- package/dist/utils/json.d.ts +11 -0
- package/dist/utils/json.d.ts.map +1 -0
- 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;
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWnE,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWnE,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAwW3E"}
|
|
@@ -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;AA6BzG,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,CA2J9E;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/commands/template.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAIV,sBAAsB,EAGvB,MAAM,mBAAmB,CAAC;AAsB3B;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/commands/template.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAIV,sBAAsB,EAGvB,MAAM,mBAAmB,CAAC;AAsB3B;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAgXzF"}
|
package/dist/config/bin.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { d as e, n as t, t as n, u as r } from "../cli-DdPVabIO.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:
|
|
8
|
-
if (!
|
|
7
|
+
function s({ command: t, dsn: n }) {
|
|
8
|
+
if (!n) return !1;
|
|
9
9
|
try {
|
|
10
10
|
return a.init({
|
|
11
|
-
dsn:
|
|
12
|
-
release: `@hype-stack/cli@${
|
|
11
|
+
dsn: n,
|
|
12
|
+
release: `@hype-stack/cli@${e}`,
|
|
13
13
|
sendDefaultPii: !1,
|
|
14
14
|
initialScope: { tags: {
|
|
15
|
-
command:
|
|
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" && (
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboard-catalog.d.ts","sourceRoot":"","sources":["../../src/core/onboard-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;CAUsB,CAAC;AAEhD,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAUzD,CAAC;AAIF,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAGzE;AA4CD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAGnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIjG;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE;IAAE,UAAU,EAAE;QAAE,OAAO,EAAE,UAAU,CAAA;KAAE,CAAA;CAAE,EAAE,GAAG,SAAS,GACzD,UAAU,EAAE,CAWd;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAStE;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"onboard-catalog.d.ts","sourceRoot":"","sources":["../../src/core/onboard-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;CAUsB,CAAC;AAEhD,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAUzD,CAAC;AAIF,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAGzE;AA4CD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAGnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIjG;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE;IAAE,UAAU,EAAE;QAAE,OAAO,EAAE,UAAU,CAAA;KAAE,CAAA;CAAE,EAAE,GAAG,SAAS,GACzD,UAAU,EAAE,CAWd;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAStE;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAc7C,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAalE"}
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Seconds a provider waits for the healthcheck to pass before calling the
|
|
14
|
+
* release failed. Long enough for a cold Node process and a Prisma pool, short
|
|
15
|
+
* enough that a crash loop is reported rather than waited out.
|
|
16
|
+
*/
|
|
17
|
+
export declare const HEALTHCHECK_TIMEOUT_SECONDS = 30;
|
|
18
|
+
/**
|
|
19
|
+
* Railway reads build and deploy settings from a `railway.json` at the root of
|
|
20
|
+
* what it is given, and everything else about a service can only be set from
|
|
21
|
+
* the dashboard. That file is the only way the CLI can ask for a healthcheck or
|
|
22
|
+
* a pre-deploy migration.
|
|
23
|
+
*
|
|
24
|
+
* It is per-project, not per-service, which is normally the end of the idea in
|
|
25
|
+
* a monorepo. It works here because each `railway up` uploads its own snapshot
|
|
26
|
+
* of the directory: write the settings for the target about to be pushed, push
|
|
27
|
+
* it, and the next target overwrites them.
|
|
28
|
+
*/
|
|
29
|
+
export declare const RAILWAY_CONFIG_FILE = "railway.json";
|
|
30
|
+
export interface RailwayConfigInput {
|
|
31
|
+
/** Dockerfile the service builds from, relative to the project root. */
|
|
32
|
+
dockerfilePath: string;
|
|
33
|
+
healthcheckPath: string;
|
|
34
|
+
/**
|
|
35
|
+
* Commands run in the new image before it takes traffic. Migrations belong
|
|
36
|
+
* here: Railway fails the deployment if one exits non-zero, so a release
|
|
37
|
+
* never goes out against a schema it cannot run on.
|
|
38
|
+
*/
|
|
39
|
+
preDeployCommand?: string[];
|
|
40
|
+
}
|
|
41
|
+
export declare function renderRailwayConfig(input: RailwayConfigInput): string;
|
|
42
|
+
/**
|
|
43
|
+
* Is there a `railway.json` or `railway.toml` the user wrote themselves? Their
|
|
44
|
+
* config wins outright: overwriting it would silently undo whatever they
|
|
45
|
+
* configured, and merging into it would mean guessing which half they meant.
|
|
46
|
+
*/
|
|
47
|
+
export declare function hasOwnRailwayConfig(projectRoot: string): Promise<boolean>;
|
|
48
|
+
export declare function writeRailwayConfig(projectRoot: string, input: RailwayConfigInput): Promise<void>;
|
|
49
|
+
/** Clear the generated config once the upload that needed it is done. */
|
|
50
|
+
export declare function removeRailwayConfig(projectRoot: string): Promise<void>;
|
|
51
|
+
export interface FlyTomlInput {
|
|
52
|
+
app: string;
|
|
53
|
+
region?: string;
|
|
54
|
+
internalPort: number;
|
|
55
|
+
/** Static targets run one always-on machine; a suspended SPA host is pointless latency. */
|
|
56
|
+
minMachines?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Command to run in a temporary machine built from the new image, before any
|
|
59
|
+
* traffic moves to it. This is where migrations belong: Fly aborts the whole
|
|
60
|
+
* deploy if it exits non-zero, so a release never goes out against a database
|
|
61
|
+
* it cannot run on.
|
|
62
|
+
*/
|
|
63
|
+
releaseCommand?: string;
|
|
64
|
+
/** Path Fly polls before the new machines take traffic. */
|
|
65
|
+
healthcheckPath?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare function renderFlyToml(input: FlyTomlInput): string;
|
|
68
|
+
export interface WriteFlyTomlInput {
|
|
69
|
+
projectRoot: string;
|
|
70
|
+
target: PlannedTarget;
|
|
71
|
+
internalPort: number;
|
|
72
|
+
releaseCommand?: string;
|
|
73
|
+
}
|
|
74
|
+
export declare function writeFlyToml(input: WriteFlyTomlInput): Promise<string>;
|
|
75
|
+
/**
|
|
76
|
+
* nginx config for a single-page app: every unknown path falls back to
|
|
77
|
+
* `index.html` so client-side routing survives a hard refresh.
|
|
78
|
+
*/
|
|
79
|
+
export declare function renderStaticNginxConf(port: number): string;
|
|
80
|
+
export interface StaticDockerfileInput {
|
|
81
|
+
/** Build output directory, relative to the project root. */
|
|
82
|
+
contentDir: string;
|
|
83
|
+
/** nginx config path, relative to the project root. */
|
|
84
|
+
configPath: string;
|
|
85
|
+
port: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Image for a prebuilt SPA. The bundle is built on the machine running the
|
|
89
|
+
* deploy (so the `VITE_*` values are the resolved production ones) and this
|
|
90
|
+
* image only has to serve it, which keeps the remote build to a single COPY.
|
|
91
|
+
*/
|
|
92
|
+
export declare function renderStaticDockerfile(input: StaticDockerfileInput): string;
|
|
93
|
+
export interface StaticImageAssets {
|
|
94
|
+
/** Dockerfile path relative to the project root. */
|
|
95
|
+
dockerfile: string;
|
|
96
|
+
/** nginx config path relative to the project root. */
|
|
97
|
+
nginxConf: string;
|
|
98
|
+
port: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Write the Dockerfile and nginx config that turn a built SPA into a container,
|
|
102
|
+
* for the providers that host containers rather than static assets.
|
|
103
|
+
*/
|
|
104
|
+
export declare function writeStaticImageAssets(projectRoot: string, target: PlannedTarget, contentDir: string): Promise<StaticImageAssets>;
|
|
105
|
+
/**
|
|
106
|
+
* Locate the Dockerfile a container target builds from, relative to the project
|
|
107
|
+
* root. Returns null when the app ships none, which is what turns into the
|
|
108
|
+
* "add a Dockerfile" error instead of a confusing remote build failure.
|
|
109
|
+
*/
|
|
110
|
+
export declare function findTargetDockerfile(projectRoot: string, target: PlannedTarget): Promise<string | null>;
|
|
111
|
+
export declare function toPosixRelative(from: string, to: string): string;
|
|
112
|
+
/** Keep generated deploy files out of git; they are reproducible from `stack.json`. */
|
|
113
|
+
export declare function ensureAssetsGitignored(projectRoot: string): Promise<void>;
|
|
114
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/deploy/assets.ts"],"names":[],"mappings":"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"}
|
|
@@ -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,52 @@
|
|
|
1
|
+
import { DeployProviderAdapter } from './providers/types.js';
|
|
2
|
+
import { CommandRunner } from './runner.js';
|
|
3
|
+
import { DeployPlan, ProviderId, ProviderSpec } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Sign in to every provider the plan touches, before the deploy is confirmed.
|
|
6
|
+
*
|
|
7
|
+
* A deploy that starts unauthenticated fails on its first command, several
|
|
8
|
+
* screens after the point where the user could have done something about it.
|
|
9
|
+
* So the login is settled here instead: while nothing has been created, while
|
|
10
|
+
* the question is still "do you want to do this", and while there is somebody
|
|
11
|
+
* at the keyboard to answer it.
|
|
12
|
+
*
|
|
13
|
+
* Nothing about it is optional. There is no path through this module that
|
|
14
|
+
* returns without a working login, which is the whole point.
|
|
15
|
+
*/
|
|
16
|
+
/** Extra environment for every deploy command. A key set to `undefined` is unset. */
|
|
17
|
+
export type AuthEnv = Record<string, string | undefined>;
|
|
18
|
+
export interface ProviderAuthOutcome {
|
|
19
|
+
/** Tokens the user supplied, to be layered onto every command in the run. */
|
|
20
|
+
env: AuthEnv;
|
|
21
|
+
/** Who each provider says we are. Saves the run a second round of probes. */
|
|
22
|
+
accounts: Partial<Record<ProviderId, string>>;
|
|
23
|
+
}
|
|
24
|
+
/** How the user wants to sign in. */
|
|
25
|
+
export type SignInMethod = "browser" | "browserless" | "token";
|
|
26
|
+
/**
|
|
27
|
+
* Everything the gate needs from outside itself: a shell, a terminal, and a
|
|
28
|
+
* person. Swapped out wholesale in tests, which is the only way to exercise a
|
|
29
|
+
* flow built out of prompts and other people's binaries.
|
|
30
|
+
*/
|
|
31
|
+
export interface AuthIO {
|
|
32
|
+
/** A runner carrying `env`, for the `--version` and `whoami` probes. */
|
|
33
|
+
createRunner(env: AuthEnv): CommandRunner;
|
|
34
|
+
/** Run a command with the terminal attached. Browser logins need a real TTY. */
|
|
35
|
+
runInteractive(command: string, args: string[], cwd: string): Promise<number>;
|
|
36
|
+
confirmInstall(spec: ProviderSpec): Promise<boolean>;
|
|
37
|
+
chooseMethod(spec: ProviderSpec): Promise<SignInMethod>;
|
|
38
|
+
readToken(spec: ProviderSpec): Promise<string>;
|
|
39
|
+
}
|
|
40
|
+
export declare function createAuthIO(): AuthIO;
|
|
41
|
+
export interface EnsureProviderAuthInput {
|
|
42
|
+
plan: DeployPlan;
|
|
43
|
+
providers: ProviderId[];
|
|
44
|
+
/** Nobody to ask: `--yes`, or a headless run driven by an agent. */
|
|
45
|
+
skipPrompts: boolean;
|
|
46
|
+
io?: AuthIO;
|
|
47
|
+
/** Swap in fakes for tests. Defaults to the real provider adapters. */
|
|
48
|
+
adapters?: Partial<Record<ProviderId, DeployProviderAdapter>>;
|
|
49
|
+
}
|
|
50
|
+
export declare function ensureProviderAuth(input: EnsureProviderAuthInput): Promise<ProviderAuthOutcome>;
|
|
51
|
+
export declare function unattendedFix(spec: ProviderSpec): string;
|
|
52
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/deploy/auth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;;GAWG;AAEH,qFAAqF;AACrF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,GAAG,EAAE,OAAO,CAAC;IACb,6EAA6E;IAC7E,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/C;AAED,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,wEAAwE;IACxE,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAAC;IAC1C,gFAAgF;IAChF,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9E,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACxD,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD;AAED,wBAAgB,YAAY,IAAI,MAAM,CAQrC;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,oEAAoE;IACpE,WAAW,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC;CAC/D;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAoBrG;AA6HD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAGxD"}
|
|
@@ -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,CAoCzD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,WAAW,CAgB7D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,YAAY,CA0B3D,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,CAoBxF;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"}
|