@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.
- package/dist/{cli-DtlLnANf.js → cli-C8n6X5xr.js} +3753 -1599
- package/dist/cli.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/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/types/types.d.ts +7 -0
- 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/json.d.ts +11 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -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,CAA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ider } 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;I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AG,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"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ExecResult } from '../utils/exec.js';
|
|
2
|
+
export interface CommandSpec {
|
|
3
|
+
command: string;
|
|
4
|
+
args: string[];
|
|
5
|
+
cwd: string;
|
|
6
|
+
/** Piped to the child's stdin, for CLIs that read secrets there instead of argv. */
|
|
7
|
+
stdin?: string;
|
|
8
|
+
/** Extra environment for the child, layered over the parent's. */
|
|
9
|
+
env?: Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Substrings replaced with `***` whenever the command is echoed or recorded.
|
|
12
|
+
* Provider adapters pass every secret they touch, so a `--dry-run` transcript
|
|
13
|
+
* or an error message can be pasted into an issue without leaking anything.
|
|
14
|
+
*/
|
|
15
|
+
secrets?: string[];
|
|
16
|
+
/** Return a non-zero result instead of throwing. For probes like `whoami`. */
|
|
17
|
+
allowFailure?: boolean;
|
|
18
|
+
/** Short description of what this command is for, shown in dry-run output. */
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class CommandFailedError extends Error {
|
|
22
|
+
readonly spec: CommandSpec;
|
|
23
|
+
readonly result: ExecResult;
|
|
24
|
+
constructor(spec: CommandSpec, result: ExecResult);
|
|
25
|
+
}
|
|
26
|
+
export interface CommandRunner {
|
|
27
|
+
run(spec: CommandSpec): Promise<ExecResult>;
|
|
28
|
+
/** Every command this runner has seen, in order, with secrets already masked. */
|
|
29
|
+
readonly transcript: string[];
|
|
30
|
+
/**
|
|
31
|
+
* True when nothing is really executed. Lets a step that inspects the result
|
|
32
|
+
* of a command on disk (the local frontend build) skip its check instead of
|
|
33
|
+
* failing on output that was never produced.
|
|
34
|
+
*/
|
|
35
|
+
readonly dryRun?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Render a command the way it would be typed, with secret values masked. */
|
|
38
|
+
export declare function formatCommand(spec: CommandSpec): string;
|
|
39
|
+
export declare function maskSecrets(text: string, secrets: string[]): string;
|
|
40
|
+
export interface ProcessRunnerOptions {
|
|
41
|
+
/** Called with each command before it runs, already masked. */
|
|
42
|
+
onCommand?: (line: string) => void;
|
|
43
|
+
/** Called with each output line from the child process. */
|
|
44
|
+
onOutput?: (line: string) => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Runs commands for real. Non-zero exits throw {@link CommandFailedError}
|
|
48
|
+
* unless the spec opts out, so a provider adapter reads as a straight sequence
|
|
49
|
+
* of steps and the orchestrator decides what a failure means.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createProcessRunner(options?: ProcessRunnerOptions): CommandRunner;
|
|
52
|
+
export interface DryRunResponse {
|
|
53
|
+
/** Substring of the rendered command line this entry answers. */
|
|
54
|
+
match: string;
|
|
55
|
+
stdout: string | ((spec: CommandSpec) => string);
|
|
56
|
+
/**
|
|
57
|
+
* Exit code to report. Defaults to success. Set it non-zero for the lookups
|
|
58
|
+
* whose failure is what drives the interesting branch: a dry run of a project
|
|
59
|
+
* that has never deployed should walk the create path, not the reuse one.
|
|
60
|
+
*/
|
|
61
|
+
exitCode?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface DryRunOptions {
|
|
64
|
+
onCommand?: (line: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Canned stdout for commands whose output the adapter parses. Keyed by a
|
|
67
|
+
* substring of the rendered command; the first match wins. Without an entry
|
|
68
|
+
* the command resolves with empty output, which adapters treat as "nothing
|
|
69
|
+
* discovered" and fall back to their deterministic defaults.
|
|
70
|
+
*/
|
|
71
|
+
responses?: DryRunResponse[];
|
|
72
|
+
}
|
|
73
|
+
/** Records what would run without touching the network. Backs `deploy --dry-run`. */
|
|
74
|
+
export declare function createDryRunRunner(options?: DryRunOptions): CommandRunner;
|
|
75
|
+
export type CommandHandler = (spec: CommandSpec) => ExecResult | Promise<ExecResult>;
|
|
76
|
+
/**
|
|
77
|
+
* A runner driven by a handler function. Tests use it to assert the exact
|
|
78
|
+
* commands an adapter issues and to feed back realistic provider output.
|
|
79
|
+
*/
|
|
80
|
+
export declare function createScriptedRunner(handler: CommandHandler): CommandRunner;
|
|
81
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/deploy/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,kBA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,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,aAAkB,GAAG,aAAa,CAgB7E;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,WAAW,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CAY3E"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for `hype-stack deploy`.
|
|
3
|
+
*
|
|
4
|
+
* The deploy pipeline is split into pure planning (everything in this folder
|
|
5
|
+
* except `runner.ts` and the provider adapters' `run` calls) and execution. The
|
|
6
|
+
* planner turns flags plus `stack.json` into a fully resolved {@link DeployPlan};
|
|
7
|
+
* the executor walks that plan and shells out. Keeping the split sharp is what
|
|
8
|
+
* lets the whole thing be tested without a cloud account.
|
|
9
|
+
*/
|
|
10
|
+
/** An app the CLI can host. Matches the three apps the template ships. */
|
|
11
|
+
export type DeployTarget = "backend" | "frontend" | "admin";
|
|
12
|
+
/** A backing service the CLI can provision and wire into the backend. */
|
|
13
|
+
export type ManagedService = "postgres" | "valkey" | "bucket";
|
|
14
|
+
/** A hosting provider the CLI knows how to drive. */
|
|
15
|
+
export type ProviderId = "railway" | "fly";
|
|
16
|
+
/** Anything a provider can be assigned to. Targets and services share the assignment machinery. */
|
|
17
|
+
export type DeployResource = DeployTarget | ManagedService;
|
|
18
|
+
/**
|
|
19
|
+
* How a target is served, which decides what the provider has to do with the
|
|
20
|
+
* build output.
|
|
21
|
+
*
|
|
22
|
+
* - `node`: a long-lived Node process (the Hono backend, the TanStack Start SSR
|
|
23
|
+
* server). Needs a container or a Node runtime, and can hold WebSockets open.
|
|
24
|
+
* - `static`: a folder of prebuilt files behind a CDN (the admin SPA).
|
|
25
|
+
*/
|
|
26
|
+
export type ServeMode = "node" | "static";
|
|
27
|
+
export interface TargetSpec {
|
|
28
|
+
target: DeployTarget;
|
|
29
|
+
/** Human label used in prompts, notes, and the summary table. */
|
|
30
|
+
label: string;
|
|
31
|
+
serveMode: ServeMode;
|
|
32
|
+
/** Workspace path key in `stack.json` -> `paths`, used to locate the app directory. */
|
|
33
|
+
pathKey: DeployTarget;
|
|
34
|
+
/** Fallback app directory when `stack.json` has no `paths` entry. */
|
|
35
|
+
defaultRoot: string;
|
|
36
|
+
/** Package manager script that produces the deployable artifact. */
|
|
37
|
+
buildScript: string;
|
|
38
|
+
/** Artifact directory, relative to the app root, that a static host uploads. */
|
|
39
|
+
staticDir?: string;
|
|
40
|
+
/** Port a `node` target listens on. */
|
|
41
|
+
port?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface ServiceSpec {
|
|
44
|
+
service: ManagedService;
|
|
45
|
+
label: string;
|
|
46
|
+
/** Env vars this service contributes to the backend once provisioned. */
|
|
47
|
+
provides: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface ProviderSpec {
|
|
50
|
+
id: ProviderId;
|
|
51
|
+
label: string;
|
|
52
|
+
/** Binary the adapter shells out to. */
|
|
53
|
+
bin: string;
|
|
54
|
+
/** How to install the binary, shown when it is missing from PATH. */
|
|
55
|
+
install: string;
|
|
56
|
+
/** Docs link shown alongside install instructions. */
|
|
57
|
+
docs: string;
|
|
58
|
+
}
|
|
59
|
+
export interface TargetConfig {
|
|
60
|
+
provider: ProviderId;
|
|
61
|
+
/** Remote app/service name. Defaults to `<projectName>-<target>`. */
|
|
62
|
+
app?: string;
|
|
63
|
+
/** Provider region id (`iad`, `us-west1`, ...). Provider default when unset. */
|
|
64
|
+
region?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Public origin this target will be reachable at. Set it to pin a custom
|
|
67
|
+
* domain; leave it unset to let the provider allocate one.
|
|
68
|
+
*/
|
|
69
|
+
url?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ServiceConfig {
|
|
72
|
+
provider: ProviderId;
|
|
73
|
+
/** Remote resource name. Defaults to `<projectName>-<service>`. */
|
|
74
|
+
name?: string;
|
|
75
|
+
region?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Skip provisioning and use these connection values as-is. Lets someone point
|
|
78
|
+
* the deploy at a database or bucket they already run somewhere else.
|
|
79
|
+
*/
|
|
80
|
+
external?: Record<string, string>;
|
|
81
|
+
}
|
|
82
|
+
export interface FlySettings {
|
|
83
|
+
/**
|
|
84
|
+
* Organization slug. Fly only auto-selects an org when the account has
|
|
85
|
+
* exactly one personal org; anything else makes `flyctl` open a picker, which
|
|
86
|
+
* would hang a non-interactive deploy.
|
|
87
|
+
*/
|
|
88
|
+
org?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Managed Postgres plan (`basic`, `launch`, `scale`, ...). Fly prompts for
|
|
91
|
+
* one when it is not passed on the command line.
|
|
92
|
+
*/
|
|
93
|
+
postgresPlan?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface RailwaySettings {
|
|
96
|
+
/**
|
|
97
|
+
* Workspace id or name used when creating the project. Railway refuses to
|
|
98
|
+
* pick one for an account that belongs to more than a single workspace.
|
|
99
|
+
*/
|
|
100
|
+
workspace?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface DeployConfig {
|
|
103
|
+
version: number;
|
|
104
|
+
/** Prefix for generated remote resource names. */
|
|
105
|
+
projectName: string;
|
|
106
|
+
/** Deployment environment name, used for provider environments and `VITE_ENVIRONMENT`. */
|
|
107
|
+
environment: string;
|
|
108
|
+
/** Provider used for any target or service without an explicit assignment. */
|
|
109
|
+
defaultProvider?: ProviderId;
|
|
110
|
+
targets: Partial<Record<DeployTarget, TargetConfig>>;
|
|
111
|
+
services: Partial<Record<ManagedService, ServiceConfig>>;
|
|
112
|
+
fly?: FlySettings;
|
|
113
|
+
railway?: RailwaySettings;
|
|
114
|
+
}
|
|
115
|
+
export interface PlannedTarget {
|
|
116
|
+
target: DeployTarget;
|
|
117
|
+
spec: TargetSpec;
|
|
118
|
+
provider: ProviderId;
|
|
119
|
+
/** Remote app/service name, always resolved (never left to a provider default). */
|
|
120
|
+
app: string;
|
|
121
|
+
region?: string;
|
|
122
|
+
/** Public origin pinned in config, or resolved during the reserve phase. */
|
|
123
|
+
url?: string;
|
|
124
|
+
/** Absolute path to the app directory in the project. */
|
|
125
|
+
root: string;
|
|
126
|
+
}
|
|
127
|
+
export interface PlannedService {
|
|
128
|
+
service: ManagedService;
|
|
129
|
+
spec: ServiceSpec;
|
|
130
|
+
provider: ProviderId;
|
|
131
|
+
name: string;
|
|
132
|
+
region?: string;
|
|
133
|
+
/** When set, the service is not provisioned and these values are used directly. */
|
|
134
|
+
external?: Record<string, string>;
|
|
135
|
+
}
|
|
136
|
+
export interface DeployPlan {
|
|
137
|
+
projectName: string;
|
|
138
|
+
environment: string;
|
|
139
|
+
projectRoot: string;
|
|
140
|
+
targets: PlannedTarget[];
|
|
141
|
+
services: PlannedService[];
|
|
142
|
+
fly: FlySettings;
|
|
143
|
+
railway: RailwaySettings;
|
|
144
|
+
}
|
|
145
|
+
/** Connection values a provisioned service contributes to the backend env. */
|
|
146
|
+
export type ServiceOutputs = Record<string, string>;
|
|
147
|
+
/** Public origins resolved for each target, keyed by target. */
|
|
148
|
+
export type TargetUrls = Partial<Record<DeployTarget, string>>;
|
|
149
|
+
export interface DeployStepResult {
|
|
150
|
+
/** Stable id, e.g. `provision:postgres` or `deploy:backend`. */
|
|
151
|
+
id: string;
|
|
152
|
+
label: string;
|
|
153
|
+
status: "ok" | "skipped" | "failed";
|
|
154
|
+
detail?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface TargetEnvPlan {
|
|
157
|
+
target: DeployTarget;
|
|
158
|
+
/** Values this command computed. Always applied. */
|
|
159
|
+
managed: Record<string, string>;
|
|
160
|
+
/** Values carried over from the project's local `.env`, e.g. third-party API keys. */
|
|
161
|
+
forwarded: Record<string, string>;
|
|
162
|
+
/**
|
|
163
|
+
* Keys the app declares in `.env.example` that nothing could fill. The deploy
|
|
164
|
+
* still runs, because a missing Resend key should not block a first deploy,
|
|
165
|
+
* but they are reported so the user knows what to set.
|
|
166
|
+
*/
|
|
167
|
+
missing: string[];
|
|
168
|
+
/** Keys skipped because their local value only makes sense on a dev machine. */
|
|
169
|
+
skippedLocal: string[];
|
|
170
|
+
}
|
|
171
|
+
export interface DeployOutcome {
|
|
172
|
+
plan: DeployPlan;
|
|
173
|
+
steps: DeployStepResult[];
|
|
174
|
+
urls: TargetUrls;
|
|
175
|
+
serviceOutputs: Partial<Record<ManagedService, ServiceOutputs>>;
|
|
176
|
+
/**
|
|
177
|
+
* What each app actually received, once every origin and connection string
|
|
178
|
+
* was known. The pre-flight preview only estimates this, so the follow-up
|
|
179
|
+
* warnings are read from here instead.
|
|
180
|
+
*/
|
|
181
|
+
envPlans: TargetEnvPlan[];
|
|
182
|
+
/** True when every step finished without a failure. */
|
|
183
|
+
ok: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface DeployOptions {
|
|
186
|
+
cwd?: string;
|
|
187
|
+
/** Provider for anything without a more specific assignment. */
|
|
188
|
+
provider?: string;
|
|
189
|
+
/** Per-resource provider overrides, e.g. `{ backend: "fly", bucket: "railway" }`. */
|
|
190
|
+
assign?: Partial<Record<DeployResource, string>>;
|
|
191
|
+
/** Deployment environment name. Defaults to the saved value, then `production`. */
|
|
192
|
+
environment?: string;
|
|
193
|
+
/** Restrict the run to these targets. Empty or omitted means every configured target. */
|
|
194
|
+
only?: DeployTarget[];
|
|
195
|
+
/** Print every command that would run without executing any of them. */
|
|
196
|
+
dryRun?: boolean;
|
|
197
|
+
/** Skip provisioning; assume the services already exist and reuse saved outputs. */
|
|
198
|
+
skipProvision?: boolean;
|
|
199
|
+
/** Skip `prisma migrate deploy` against the provisioned database. */
|
|
200
|
+
skipMigrations?: boolean;
|
|
201
|
+
/** Skip prompts, accept defaults. */
|
|
202
|
+
yes?: boolean;
|
|
203
|
+
/** Fly organization slug, persisted into `stack.json`. */
|
|
204
|
+
flyOrg?: string;
|
|
205
|
+
/** Railway workspace id or name, persisted into `stack.json`. */
|
|
206
|
+
railwayWorkspace?: string;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE5D,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9D,qDAAqD;AACrD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;AAE3C,mGAAmG;AACnG,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,cAAc,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,uFAAuF;IACvF,OAAO,EAAE,YAAY,CAAC;IACtB,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,OAAO,EA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,MAAM,CAAC,CAAC;IAChC,sFAAsF;IACtF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC;;;;OAIG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gFAAgF;IAChF,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IAChE;;;;OAIG;IACH,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,uDAAuD;IACvD,EAAE,EAAE,OAAO,CAAC;CACb;AAID,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;IACtB,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qCAAqC;IACrC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ export { createProgram } from './cli';
|
|
|
2
2
|
export { createCommand } from './commands/create';
|
|
3
3
|
export { initCommand, ensureInit } from './commands/init';
|
|
4
4
|
export { composeCommand } from './commands/compose';
|
|
5
|
+
export { deployCommand } from './commands/deploy';
|
|
5
6
|
export { loginCommand } from './commands/login';
|
|
6
7
|
export { logoutCommand } from './commands/logout';
|
|
7
8
|
export type { StackConfig, CreateOptions, InitOptions, DetectedWorkspace, CodeEditor, StackPaths, AppPaths, PackManifest, PackFile, PackTier, FileStrategy, PackListItem, PackAuthorization, PackAuthorizationMap, ComposeOptions, } from './types/types';
|
|
9
|
+
export type { DeployConfig, DeployOptions, DeployOutcome, DeployPlan, DeployTarget, ManagedService, ProviderId, } from './deploy/types';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,GACf,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACd,UAAU,GACX,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n,
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, c as t, i as n, l as r, o as i, r as a, s as o, t as s } from "./cli-C8n6X5xr.js";
|
|
2
|
+
export { i as composeCommand, r as createCommand, s as createProgram, e as deployCommand, o as ensureInit, t as initCommand, n as loginCommand, a as logoutCommand };
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeployConfig } from '../deploy/types.js';
|
|
1
2
|
/**
|
|
2
3
|
* An editor the user can ship rules for. A project can carry several at once,
|
|
3
4
|
* because a team rarely agrees on one: the formats live in different folders, so
|
|
@@ -43,6 +44,12 @@ export interface StackConfig {
|
|
|
43
44
|
/** Deduped `.env.example` section slugs (EnvSection) the installed packs declare. */
|
|
44
45
|
envSections?: EnvSection[];
|
|
45
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* What `hype-stack deploy` created and where. Written by `deploy`, and by
|
|
49
|
+
* nothing else, so a re-run reuses the same apps and services instead of
|
|
50
|
+
* provisioning a second set. Absent until the first deploy.
|
|
51
|
+
*/
|
|
52
|
+
deploy?: DeployConfig;
|
|
46
53
|
}
|
|
47
54
|
export interface CreateOptions {
|
|
48
55
|
name?: string;
|