@rebasepro/cli 0.16.0 → 0.16.1-canary.g1ad04b7

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/bundle.d.ts CHANGED
@@ -193,6 +193,25 @@ export interface VendorResult {
193
193
  * the upload is compressed: crossing it means "getting close", not "will fail".
194
194
  */
195
195
  export declare const VENDOR_SIZE_WARN_BYTES: number;
196
+ /**
197
+ * Where vendoring stops being an optimisation and becomes a bundle nobody can
198
+ * deploy.
199
+ *
200
+ * Past this, shipping the tree anyway trades a faster cold start for a 413 — and
201
+ * the 413 arrives at deploy time, after a build nobody watches, with a remedy
202
+ * (`--no-vendor`) that requires knowing this happened. Unvendoring here costs
203
+ * 40–60s of cold start and produces a bundle that uploads; that is the better
204
+ * side of the trade to be on by default.
205
+ *
206
+ * 200 MB assumes a **2x** floor on compression, which is pessimistic for a tree
207
+ * of JavaScript (3–5x is typical) and deliberately so: source maps and prebuilt
208
+ * binaries compress far worse than source, and the failure this prevents is
209
+ * asymmetric — a bundle refused at the door versus a minute of cold start.
210
+ * `--vendor` overrides it, for a deploy path with no upload at all (a Dockerfile
211
+ * built from source, where the tree is copied into an image and the control
212
+ * plane never sees it).
213
+ */
214
+ export declare const VENDOR_SIZE_MAX_BYTES: number;
196
215
  /**
197
216
  * Install the bundle's declared dependencies into the bundle itself.
198
217
  *
@@ -37,6 +37,47 @@ export declare function triggerInfo(dep: DeploymentRow): {
37
37
  };
38
38
  /** Shape one deployment row into the stable JSON view the CLI publishes. */
39
39
  export declare function deploymentView(dep: DeploymentRow): Record<string, unknown>;
40
+ /** What `POST /api/functions/deploy/cancel` answers. */
41
+ export interface CancelResponse {
42
+ success: boolean;
43
+ /**
44
+ * The deployment that was cancelled — `null` when there was none.
45
+ *
46
+ * Nullable because "nothing was in flight" is a real, successful outcome
47
+ * and not an error: a project's `status` column can claim `deploying` while
48
+ * no deployment row backs the claim, and cancelling is what clears it.
49
+ */
50
+ deploymentId: string | null;
51
+ buildJobDeleted: boolean;
52
+ /** The request cleared a stuck `deploying` claim rather than stopping a build. */
53
+ unstranded?: boolean;
54
+ /** The status the project settled on when it did. */
55
+ projectStatus?: string | null;
56
+ }
57
+ /**
58
+ * What `rebase cloud cancel` says it did.
59
+ *
60
+ * Split out of the command because there are now two outcomes behind one
61
+ * `success: true`, and only one of them is "a build was stopped". The control
62
+ * plane learned to clear a project stranded at `deploying` with no deployment
63
+ * row behind it — the state `prospector` was wedged in for five days — and it
64
+ * reports that through this same endpoint. An unbranched caller printed
65
+ * "Cancelled deployment null" for it, which reads as a bug in the thing that
66
+ * had just fixed the bug.
67
+ *
68
+ * The ABSENT ID is what decides, not the `unstranded` flag: the flag is the
69
+ * server being explicit, and it is the newer half of the contract. Branching on
70
+ * the id means a client that meets a control plane which grew the behaviour
71
+ * without the flag still says something true.
72
+ */
73
+ export declare function cancelView(res: CancelResponse): {
74
+ /** The headline, for `success()`. */
75
+ headline: string;
76
+ /** Dimmed follow-ups, printed under it. */
77
+ notes: string[];
78
+ /** The stable JSON view, which is what a piped run gets. */
79
+ json: Record<string, unknown>;
80
+ };
40
81
  /**
41
82
  * Rows shown when `--limit` is not given.
42
83
  *
@@ -1,4 +1,4 @@
1
- import { type DeployTarget, type CloudClient } from "./context";
1
+ import { type DeployTarget, type CloudClient } from "./context.js";
2
2
  export declare function listProjects(rawArgs: string[]): Promise<void>;
3
3
  /**
4
4
  * Where this project says it runs.
@@ -9,8 +9,9 @@ export declare function listProjects(rawArgs: string[]): Promise<void>;
9
9
  * never contradicted by a failure; it just sits in the record. The CLI used to
10
10
  * default to `hetzner`/`nbg1` unconditionally, which is how projects running on
11
11
  * our GKE cluster came to describe themselves as Hetzner in the console — and
12
- * `provider` is half the Stripe compute lookup key (`compute_<provider>_<vmSize>`),
13
- * so that is a mispricing, not a cosmetic slip.
12
+ * `provider` also decides which substrate's rules a project's dials are clamped
13
+ * to Autopilot's 250m floor and 1:1-6.5:1 band do not apply on Hetzner or EKS
14
+ * — so a wrong value here resizes pods, it is not a cosmetic slip.
14
15
  *
15
16
  * The control plane already publishes the infrastructure that actually exists,
16
17
  * and the console's create wizard reads it. Ask the same question here.
@@ -39,10 +40,19 @@ export declare const CREATE_PROJECT_FLAGS: {
39
40
  readonly "--branch": StringConstructor;
40
41
  readonly "--provider": StringConstructor;
41
42
  readonly "--region": StringConstructor;
42
- readonly "--vm-size": StringConstructor;
43
43
  readonly "--org": StringConstructor;
44
44
  readonly "--link": BooleanConstructor;
45
45
  readonly "-n": "--name";
46
+ readonly "--cpu": StringConstructor;
47
+ readonly "--memory": StringConstructor;
48
+ readonly "--replicas": StringConstructor;
49
+ readonly "--spot": StringConstructor;
50
+ readonly "--scale-to-zero": StringConstructor;
51
+ readonly "--db-mode": StringConstructor;
52
+ readonly "--db-instances": StringConstructor;
53
+ readonly "--db-cpu": StringConstructor;
54
+ readonly "--db-memory": StringConstructor;
55
+ readonly "--storage": StringConstructor;
46
56
  };
47
57
  export declare function createProject(rawArgs: string[]): Promise<void>;
48
58
  /**
@@ -106,7 +106,16 @@ export declare function resourcesCommand(action: string | undefined, rawArgs: st
106
106
  * the same shape `buildSettingsPatch` uses. Returns an error string rather than
107
107
  * throwing, because the caller owns how a refusal is printed in JSON mode.
108
108
  */
109
- export declare function buildDialPatch(rawArgs: string[]): {
109
+ export declare function buildDialPatch(rawArgs: string[],
110
+ /**
111
+ * `requireOne: false` for `projects create`, where naming no dial is the
112
+ * ordinary case — a new project takes the platform default. On
113
+ * `resources set` a patch with nothing in it is a typo, and saying so beats
114
+ * a success message for a change nobody made.
115
+ */
116
+ opts?: {
117
+ requireOne?: boolean;
118
+ }): {
110
119
  patch: Record<string, unknown>;
111
120
  error?: string;
112
121
  };
@@ -1,4 +1,4 @@
1
- import { type LibpqUrlFinding } from "../utils/libpq-url";
1
+ import { type LibpqUrlFinding } from "../utils/libpq-url.js";
2
2
  /**
3
3
  * Find connection strings libpq cannot parse, anywhere in the project.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { PackageManager, PMCommands } from "../utils/package-manager";
1
+ import type { PackageManager, PMCommands } from "../utils/package-manager.js";
2
2
  /**
3
3
  * Every scaffolded file that carries a `{{PLACEHOLDER}}`.
4
4
  *
@@ -0,0 +1,45 @@
1
+ /** What a single finding is about. */
2
+ export type PortabilityIssueKind = "node-builtin" | "node-only-package" | "module-scope-env" | "root-barrel-import" | "unknown-package";
3
+ export interface PortabilityIssue {
4
+ kind: PortabilityIssueKind;
5
+ /** 1-based line in the function file. */
6
+ line: number;
7
+ /** One sentence, already phrased for a terminal. */
8
+ message: string;
9
+ /**
10
+ * Whether this is a problem *today*, on Node, rather than only a constraint
11
+ * on where the function could run. Exactly one kind is:
12
+ * `module-scope-env`, which is a latent crash on any host where a variable
13
+ * happens to be unset at import time, and takes every other function in the
14
+ * same directory down with it — the loader reports a file that throws on
15
+ * import as simply "skipped".
16
+ */
17
+ actionable: boolean;
18
+ }
19
+ export interface FunctionPortability {
20
+ /** Function name — the filename without extension, as it mounts. */
21
+ name: string;
22
+ /** Path relative to the project root. */
23
+ file: string;
24
+ /** Empty when the function depends on nothing host-specific. */
25
+ issues: PortabilityIssue[];
26
+ /** True when `issues` contains nothing that pins it to Node. */
27
+ portable: boolean;
28
+ }
29
+ /** Analyse one function file's source. Exported for testing. */
30
+ export declare function analyseFunctionSource(source: string, name: string, file: string): FunctionPortability;
31
+ /**
32
+ * Analyse every function in a directory.
33
+ *
34
+ * @param functionsDir Absolute path to the functions directory.
35
+ * @param projectRoot For rendering paths people recognise.
36
+ */
37
+ export declare function analyseFunctionsDirectory(functionsDir: string, projectRoot: string): FunctionPortability[];
38
+ /**
39
+ * The lines to print after a build, or nothing at all.
40
+ *
41
+ * Silent when every function is portable and nothing is actionable, because a
42
+ * report that always prints is a report nobody reads. Actionable findings are
43
+ * always shown; the rest collapse to a single count with a pointer.
44
+ */
45
+ export declare function summarisePortability(results: FunctionPortability[]): string[];
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- export * from "./cli";
2
- export * from "./commands/init";
3
- export * from "./commands/schema";
4
- export * from "./commands/db";
5
- export * from "./commands/dev";
6
- export * from "./commands/build";
7
- export * from "./commands/eject";
8
- export * from "./commands/start";
9
- export * from "./commands/auth";
10
- export * from "./commands/doctor";
11
- export * from "./commands/generate_sdk";
12
- export * from "./commands/cloud";
13
- export * from "./commands/apps";
14
- export * from "./utils/project";
15
- export * from "./utils/package-manager";
16
- export * from "./manifest";
17
- export * from "./bundle";
1
+ export * from "./cli.js";
2
+ export * from "./commands/init.js";
3
+ export * from "./commands/schema.js";
4
+ export * from "./commands/db.js";
5
+ export * from "./commands/dev.js";
6
+ export * from "./commands/build.js";
7
+ export * from "./commands/eject.js";
8
+ export * from "./commands/start.js";
9
+ export * from "./commands/auth.js";
10
+ export * from "./commands/doctor.js";
11
+ export * from "./commands/generate_sdk.js";
12
+ export * from "./commands/cloud/index.js";
13
+ export * from "./commands/apps.js";
14
+ export * from "./utils/project.js";
15
+ export * from "./utils/package-manager.js";
16
+ export * from "./manifest.js";
17
+ export * from "./bundle.js";