@hype-stack/cli 0.9.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.
- package/dist/{cli-latnLYWc.js → cli-C8n6X5xr.js} +4059 -1714
- 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/config/bin.js +7 -7
- package/dist/constants/constants.d.ts +55 -5
- package/dist/constants/constants.d.ts.map +1 -1
- package/dist/core/agents-md.d.ts +16 -0
- package/dist/core/agents-md.d.ts.map +1 -0
- package/dist/core/codemods.d.ts +8 -0
- package/dist/core/codemods.d.ts.map +1 -1
- package/dist/core/cursor-rules.d.ts +25 -0
- package/dist/core/cursor-rules.d.ts.map +1 -0
- package/dist/core/editor-config.d.ts +3 -11
- package/dist/core/editor-config.d.ts.map +1 -1
- package/dist/core/installer.d.ts.map +1 -1
- package/dist/core/mcp-config.d.ts +2 -0
- package/dist/core/mcp-config.d.ts.map +1 -1
- package/dist/core/readme.d.ts +1 -1
- package/dist/core/readme.d.ts.map +1 -1
- package/dist/deploy/assets.d.ts +73 -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/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 +31 -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 +56 -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 +81 -0
- package/dist/deploy/runner.d.ts.map +1 -0
- package/dist/deploy/types.d.ts +208 -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/mcp/tools/create-application.d.ts +16 -3
- package/dist/mcp/tools/create-application.d.ts.map +1 -1
- package/dist/types/types.d.ts +25 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils/exec.d.ts +8 -0
- package/dist/utils/exec.d.ts.map +1 -1
- package/dist/utils/fs.d.ts +2 -0
- package/dist/utils/fs.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
|
@@ -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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DeployTarget, PlannedTarget } from './types.js';
|
|
2
|
+
export interface ProjectEnv {
|
|
3
|
+
/** Values found in the project's `.env` files, per target. */
|
|
4
|
+
local: Partial<Record<DeployTarget, Record<string, string>>>;
|
|
5
|
+
/** Keys each app declares in its `.env.example`, per target. */
|
|
6
|
+
declared: Partial<Record<DeployTarget, string[]>>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Collect what the project already knows about its own configuration.
|
|
10
|
+
*
|
|
11
|
+
* `.env.example` is the contract: it lists everything an app needs, which is
|
|
12
|
+
* what makes it safe to forward matching values from `.env` and to report the
|
|
13
|
+
* rest as unset. A root `.env` is treated as shared defaults that the app's own
|
|
14
|
+
* file overrides.
|
|
15
|
+
*/
|
|
16
|
+
export declare function readProjectEnv(projectRoot: string, targets: PlannedTarget[]): Promise<ProjectEnv>;
|
|
17
|
+
//# sourceMappingURL=project-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-env.d.ts","sourceRoot":"","sources":["../../src/deploy/project-env.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,8DAA8D;IAC9D,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7D,gEAAgE;IAChE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;CACnD;AAOD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CA2BvG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ServiceOutputs } from '../types.js';
|
|
2
|
+
import { DeployProviderAdapter } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Region used when the plan does not pin one. Fly opens a region picker when
|
|
5
|
+
* `mpg create` and `redis create` are called without `--region`, which would
|
|
6
|
+
* hang a deploy that nobody is watching, so there has to be a fallback.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_FLY_REGION = "iad";
|
|
9
|
+
/** Fly prompts for a Managed Postgres plan the same way it prompts for a region. */
|
|
10
|
+
export declare const DEFAULT_POSTGRES_PLAN = "basic";
|
|
11
|
+
export declare function flyAppUrl(app: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Read the organization slugs out of `fly orgs list --json`. Newer flyctl
|
|
14
|
+
* prints an array of objects; older versions print a `{ "Name": "slug" }` map.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseOrgSlugs(output: string): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Parse the `Key: value` block Fly prints after provisioning. `fly storage
|
|
19
|
+
* create` and `fly redis status` both use this shape, and it is the only way to
|
|
20
|
+
* get at credentials Fly will not show again.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseFlyKeyValues(output: string): Record<string, string>;
|
|
23
|
+
/** Pull the first `redis://` or `rediss://` URL out of any Fly output. */
|
|
24
|
+
export declare function parseRedisUrl(output: string): string | null;
|
|
25
|
+
/** Pull the first `postgres://` or `postgresql://` URL out of any Fly output. */
|
|
26
|
+
export declare function parsePostgresUrl(output: string): string | null;
|
|
27
|
+
interface MpgCluster {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Find a Managed Postgres cluster in `fly mpg list --json` output.
|
|
33
|
+
*
|
|
34
|
+
* Every other `mpg` subcommand takes a cluster id, not a name, and Fly happily
|
|
35
|
+
* creates a second cluster with a name it already has. Looking the name up
|
|
36
|
+
* first is what makes a repeated deploy reuse the database instead of doubling
|
|
37
|
+
* it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function findClusterInList(output: string, name: string): MpgCluster | null;
|
|
40
|
+
/**
|
|
41
|
+
* Read the connection string out of `fly mpg status --json`. The uri lives
|
|
42
|
+
* under `credentials`, separate from the cluster fields under `data`, and the
|
|
43
|
+
* v1 and v2 APIs disagree on its key.
|
|
44
|
+
*/
|
|
45
|
+
export declare function parseMpgCredentials(output: string): string | null;
|
|
46
|
+
export declare const flyProvider: DeployProviderAdapter;
|
|
47
|
+
/**
|
|
48
|
+
* Names of the secrets already set on an app. Fly never returns the values, but
|
|
49
|
+
* the names are enough to tell a re-deploy apart from a bucket that was created
|
|
50
|
+
* outside this command.
|
|
51
|
+
*/
|
|
52
|
+
export declare function parseSecretNames(output: string): string[];
|
|
53
|
+
/** Map Tigris's AWS-shaped output onto the env names the backend's S3 client reads. */
|
|
54
|
+
export declare function tigrisOutputs(values: Record<string, string>, bucketName: string): ServiceOutputs | null;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=fly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../../src/deploy/providers/fly.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAEV,qBAAqB,EAMtB,MAAM,YAAY,CAAC;AAKpB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAE7C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBtD;AA6CD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxE;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG3D;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG9D;AAED,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAajF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAcjE;AAED,eAAO,MAAM,WAAW,EAAE,qBA+IzB,CAAC;AAgOF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAUzD;AAiBD,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAWvG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProviderId } from '../types.js';
|
|
2
|
+
import { flyProvider } from './fly.js';
|
|
3
|
+
import { railwayProvider } from './railway.js';
|
|
4
|
+
import { DeployProviderAdapter } from './types.js';
|
|
5
|
+
export declare const PROVIDER_ADAPTERS: Record<ProviderId, DeployProviderAdapter>;
|
|
6
|
+
export declare function getProviderAdapter(id: ProviderId): DeployProviderAdapter;
|
|
7
|
+
export { flyProvider, railwayProvider };
|
|
8
|
+
export type { AuthStatus, DeployProviderAdapter, DeployTargetInput, DeployTargetResult, ProviderContext, ProvisionInput, ProvisionResult, } from './types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deploy/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,UAAU,EAAE,qBAAqB,CAGvE,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,UAAU,GAAG,qBAAqB,CAExE;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACxC,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DeployProviderAdapter } from './types.js';
|
|
2
|
+
/** Service names Railway assigns to the databases it provisions. */
|
|
3
|
+
export declare const RAILWAY_POSTGRES_SERVICE = "Postgres";
|
|
4
|
+
export declare const RAILWAY_REDIS_SERVICE = "Redis";
|
|
5
|
+
/**
|
|
6
|
+
* Pull a Railway-generated hostname out of a command's output. `--json` shapes
|
|
7
|
+
* have shifted across CLI releases, so the JSON is searched for any `domain`
|
|
8
|
+
* key first and the raw text is scanned as a fallback.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseRailwayDomain(output: string): string | null;
|
|
11
|
+
export interface RailwayService {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Parse `railway service list --json`.
|
|
17
|
+
*
|
|
18
|
+
* Railway does not enforce unique service names, so `railway add` on a name
|
|
19
|
+
* that is already taken creates a second service rather than failing. Listing
|
|
20
|
+
* first is the only way a re-run lands on the same infrastructure. Railway's
|
|
21
|
+
* own CLI help says as much: "prefer service IDs ... when names may collide".
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseRailwayServices(output: string): RailwayService[];
|
|
24
|
+
/** Parse `railway variable list --kv` output into a map. */
|
|
25
|
+
export declare function parseRailwayVariables(output: string): Record<string, string>;
|
|
26
|
+
export declare const railwayProvider: DeployProviderAdapter;
|
|
27
|
+
/** Workspace names from `railway whoami --json`. */
|
|
28
|
+
export declare function parseRailwayWorkspaces(output: string): string[];
|
|
29
|
+
//# sourceMappingURL=railway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"railway.d.ts","sourceRoot":"","sources":["../../../src/deploy/providers/railway.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,qBAAqB,EAMtB,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,eAAO,MAAM,wBAAwB,aAAa,CAAC;AACnD,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAQ7C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWhE;AA+BD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CAcrE;AAED,4DAA4D;AAC5D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAoB5E;AAED,eAAO,MAAM,eAAe,EAAE,qBAwK7B,CAAC;AAqCF,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAa/D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { CommandRunner } from '../runner.js';
|
|
2
|
+
import { DeployPlan, DeployTarget, PlannedService, PlannedTarget, ProviderId, ServiceOutputs } from '../types.js';
|
|
3
|
+
export interface ProviderContext {
|
|
4
|
+
runner: CommandRunner;
|
|
5
|
+
plan: DeployPlan;
|
|
6
|
+
/** Project root. Every command runs from here so monorepo paths stay stable. */
|
|
7
|
+
cwd: string;
|
|
8
|
+
/** Progress line for the spinner or the headless log. */
|
|
9
|
+
log?: (message: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface AuthStatus {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
/** Account identifier the provider reported, shown in the confirmation summary. */
|
|
14
|
+
account?: string;
|
|
15
|
+
/** Why it failed, phrased as the command to run. */
|
|
16
|
+
fix?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ProvisionResult {
|
|
19
|
+
/** Connection values to inject into the backend env. */
|
|
20
|
+
outputs: ServiceOutputs;
|
|
21
|
+
/**
|
|
22
|
+
* Keys the provider wired straight onto the target app instead of handing
|
|
23
|
+
* back a value (Fly's `mpg attach` is the case that needs this). They are not
|
|
24
|
+
* reported as missing even though nothing local knows their value.
|
|
25
|
+
*/
|
|
26
|
+
providedByProvider?: string[];
|
|
27
|
+
/** One-line explanation surfaced in the summary. */
|
|
28
|
+
note?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ProvisionInput {
|
|
31
|
+
service: PlannedService;
|
|
32
|
+
/** The app the service is being wired into, when one is being deployed. */
|
|
33
|
+
backend?: PlannedTarget;
|
|
34
|
+
/**
|
|
35
|
+
* True when the consuming backend runs on a different provider. Same-provider
|
|
36
|
+
* wiring can use private networking and reference variables; cross-provider
|
|
37
|
+
* wiring has to resolve a publicly reachable connection string.
|
|
38
|
+
*/
|
|
39
|
+
crossProvider: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface DeployTargetInput {
|
|
42
|
+
target: PlannedTarget;
|
|
43
|
+
/** Full env for this target, managed values already merged over forwarded ones. */
|
|
44
|
+
env: Record<string, string>;
|
|
45
|
+
/** Values to mask in any echoed command. */
|
|
46
|
+
secrets: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Command to run against the new build before it takes traffic, used for
|
|
49
|
+
* database migrations. Providers that support a release hook should prefer
|
|
50
|
+
* it: the command runs from the image being shipped, and a failure stops the
|
|
51
|
+
* release instead of leaving a new version talking to an old schema.
|
|
52
|
+
*/
|
|
53
|
+
releaseCommand?: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface DeployTargetResult {
|
|
56
|
+
/** Public origin the provider reported. Compared against the reserved one. */
|
|
57
|
+
url?: string;
|
|
58
|
+
note?: string;
|
|
59
|
+
/**
|
|
60
|
+
* True when {@link DeployTargetInput.releaseCommand} ran as part of this
|
|
61
|
+
* deploy, so the orchestrator does not run it a second time over SSH.
|
|
62
|
+
*/
|
|
63
|
+
releaseRan?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface DeployProviderAdapter {
|
|
66
|
+
id: ProviderId;
|
|
67
|
+
/** Confirm the provider CLI is installed and logged in. Never throws. */
|
|
68
|
+
checkAuth(ctx: ProviderContext): Promise<AuthStatus>;
|
|
69
|
+
/**
|
|
70
|
+
* Create the remote app and settle its public origin before anything is
|
|
71
|
+
* built. The frontends bake the backend's URL into their bundle, so every URL
|
|
72
|
+
* has to be known up front rather than discovered after the fact.
|
|
73
|
+
*/
|
|
74
|
+
reserveTarget(ctx: ProviderContext, target: PlannedTarget): Promise<string>;
|
|
75
|
+
provisionService(ctx: ProviderContext, input: ProvisionInput): Promise<ProvisionResult>;
|
|
76
|
+
/** Push env vars to the remote app. Static hosts with no runtime env may no-op. */
|
|
77
|
+
setEnv(ctx: ProviderContext, input: DeployTargetInput): Promise<void>;
|
|
78
|
+
deployTarget(ctx: ProviderContext, input: DeployTargetInput): Promise<DeployTargetResult>;
|
|
79
|
+
/**
|
|
80
|
+
* Run a one-off command inside the deployed app, used for `prisma migrate
|
|
81
|
+
* deploy`. Providers that cannot do this leave it undefined and the
|
|
82
|
+
* orchestrator prints the command for the user to run.
|
|
83
|
+
*/
|
|
84
|
+
runRemote?(ctx: ProviderContext, target: PlannedTarget, command: string[]): Promise<{
|
|
85
|
+
ok: boolean;
|
|
86
|
+
output: string;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
89
|
+
/** Targets a provider is responsible for in this plan. */
|
|
90
|
+
export declare function targetsFor(plan: DeployPlan, provider: ProviderId): PlannedTarget[];
|
|
91
|
+
export declare function findTarget(plan: DeployPlan, target: DeployTarget): PlannedTarget | undefined;
|
|
92
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/deploy/providers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,OAAO,CAAC;IACZ,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,OAAO,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,aAAa,CAAC;IACtB,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,4CAA4C;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,UAAU,CAAC;IAEf,yEAAyE;IACzE,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAErD;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5E,gBAAgB,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAExF,mFAAmF;IACnF,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtE,YAAY,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE1F;;;;OAIG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtH;AAED,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,aAAa,EAAE,CAElF;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAG,aAAa,GAAG,SAAS,CAE5F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TargetEnvPlan } from './env-plan.js';
|
|
2
|
+
import { DeployOutcome, DeployPlan } from './types.js';
|
|
3
|
+
/** The plan as a block the user confirms before anything is created or billed. */
|
|
4
|
+
export declare function renderPlanSummary(plan: DeployPlan): string;
|
|
5
|
+
/** What each app will receive, so surprises show up before the deploy, not after. */
|
|
6
|
+
export declare function renderEnvSummary(envPlans: TargetEnvPlan[]): string;
|
|
7
|
+
/** What actually happened, step by step. */
|
|
8
|
+
export declare function renderOutcome(outcome: DeployOutcome): string;
|
|
9
|
+
/** Clickable list of every origin the deploy settled on. */
|
|
10
|
+
export declare function renderUrls(outcome: DeployOutcome): string;
|
|
11
|
+
/** Follow-up work the user still owns, or an empty list when there is none. */
|
|
12
|
+
export declare function collectWarnings(outcome: DeployOutcome): string[];
|
|
13
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/deploy/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5D,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CA+B1D;AAED,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAqBlE;AAED,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAa5D;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAQzD;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE,CAehE"}
|