@rebasepro/cli 0.9.1-canary.f0ac103 → 0.9.1-canary.fd3754b
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/commands/cloud/context.d.ts +5 -101
- package/dist/commands/cloud/deploy.d.ts +2 -2
- package/dist/commands/cloud/projects.d.ts +2 -2
- package/dist/commands/init.d.ts +0 -8
- package/dist/index.es.js +1669 -3367
- package/dist/index.es.js.map +1 -1
- package/dist/utils/package-manager.d.ts +5 -19
- package/package.json +8 -8
- package/templates/overlays/baas/README.md +1 -19
- package/templates/overlays/baas/backend/package.json +2 -2
- package/templates/overlays/baas/backend/src/index.ts +3 -23
- package/templates/overlays/baas/backend/tsconfig.json +1 -2
- package/templates/template/.env.example +3 -13
- package/templates/template/backend/package.json +3 -4
- package/templates/template/backend/src/env.ts +1 -30
- package/templates/template/backend/src/index.ts +2 -18
- package/templates/template/config/collections/presets/blank/index.ts +1 -3
- package/templates/template/config/collections/presets/ecommerce/index.ts +1 -3
- package/templates/template/frontend/src/App.tsx +2 -1
- package/dist/commands/cloud/deployments.d.ts +0 -39
- package/dist/commands/cloud/domains.d.ts +0 -1
- package/dist/commands/cloud/env.d.ts +0 -6
- package/dist/commands/cloud/extensions.d.ts +0 -3
- package/dist/commands/cloud/power.d.ts +0 -4
- package/dist/commands/cloud/settings.d.ts +0 -8
- package/templates/template/gitignore +0 -31
- package/templates/template/npmrc +0 -10
|
@@ -28,42 +28,9 @@ export declare function requireClient(rawArgs: string[]): Promise<{
|
|
|
28
28
|
client: CloudClient;
|
|
29
29
|
url: string;
|
|
30
30
|
}>;
|
|
31
|
-
export declare function fetchTenantBaseDomain(client: CloudClient, url: string): Promise<string | undefined>;
|
|
32
|
-
/**
|
|
33
|
-
* Public host for a project — `<subdomain>.<base>`, or the bare subdomain when
|
|
34
|
-
* the base domain is unknown.
|
|
35
|
-
*
|
|
36
|
-
* It deliberately never falls back to a guessed domain. The user copies this
|
|
37
|
-
* string into a browser, so a plausible-but-wrong hostname is worse than an
|
|
38
|
-
* obviously incomplete one: `acme.rebase.pro` looks reachable and isn't, while
|
|
39
|
-
* `acme` reads as "the subdomain is acme" and prompts no wasted debugging.
|
|
40
|
-
*/
|
|
41
|
-
export declare function formatTenantHost(subdomain: string | undefined, baseDomain: string | undefined): string | undefined;
|
|
42
|
-
/** The fields of a project row this module needs to render a host. */
|
|
43
|
-
export interface HostableProject {
|
|
44
|
-
subdomain?: string;
|
|
45
|
-
/** Resolved server-side; absent on control planes older than the host hook. */
|
|
46
|
-
host?: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The host to display for a project.
|
|
50
|
-
*
|
|
51
|
-
* Prefers `host` off the record: the control plane resolves it through the same
|
|
52
|
-
* `tenantHost()` the ingress uses, so it accounts for the project's *cluster*
|
|
53
|
-
* base domain. The CLI cannot compute that itself — `clusters` is admin-only
|
|
54
|
-
* under RLS, so a normal user's token cannot read `baseDomain`, and a project on
|
|
55
|
-
* a second cluster is served somewhere the platform default does not name.
|
|
56
|
-
*
|
|
57
|
-
* `baseDomain` (from `platform-config`) remains the fallback for a control plane
|
|
58
|
-
* that predates the hook — right for the single-cluster case, which is every
|
|
59
|
-
* project today.
|
|
60
|
-
*/
|
|
61
|
-
export declare function projectHost(project: HostableProject, baseDomain: string | undefined): string | undefined;
|
|
62
31
|
export interface ProjectLink {
|
|
63
32
|
url: string;
|
|
64
33
|
projectId: string;
|
|
65
|
-
/** The project's subdomain — the slug users see in console URLs and type into --project. */
|
|
66
|
-
slug?: string;
|
|
67
34
|
projectName?: string;
|
|
68
35
|
orgId?: string;
|
|
69
36
|
}
|
|
@@ -71,80 +38,17 @@ export declare function readLink(cwd?: string): ProjectLink | null;
|
|
|
71
38
|
export declare function writeLink(link: ProjectLink, cwd?: string): void;
|
|
72
39
|
export declare function removeLink(cwd?: string): boolean;
|
|
73
40
|
/**
|
|
74
|
-
*
|
|
41
|
+
* Resolve the project id to operate on: explicit `--project` flag wins,
|
|
75
42
|
* otherwise the linked project. Exits with guidance when neither is present.
|
|
76
|
-
* The value is a slug (the project's subdomain, as shown in console URLs) or,
|
|
77
|
-
* for old scripts and link files, a raw project UUID.
|
|
78
43
|
*/
|
|
79
|
-
export declare function
|
|
80
|
-
/**
|
|
81
|
-
* Resolve a project reference — slug or UUID — to the internal id the API
|
|
82
|
-
* takes, or undefined when no such project is visible. Slugs cost one lookup;
|
|
83
|
-
* UUIDs pass through untouched so linked directories and old scripts skip the
|
|
84
|
-
* round-trip.
|
|
85
|
-
*/
|
|
86
|
-
export declare function lookupProjectId(ref: string, client: CloudClient): Promise<string | undefined>;
|
|
87
|
-
/** Like `lookupProjectId`, but exits with guidance when the ref matches nothing. */
|
|
88
|
-
export declare function resolveProjectRef(ref: string, client: CloudClient): Promise<string>;
|
|
89
|
-
/** `requireProjectRef` + `resolveProjectRef` in one step. */
|
|
90
|
-
export declare function requireProject(rawArgs: string[], client: CloudClient): Promise<string>;
|
|
91
|
-
/**
|
|
92
|
-
* The project reference to SHOW: the slug the user typed or the linked slug.
|
|
93
|
-
* Never resolves — for human output only. Old link files predate `slug` and
|
|
94
|
-
* fall back to the stored id.
|
|
95
|
-
*/
|
|
96
|
-
export declare function displayProjectRef(rawArgs: string[]): string;
|
|
97
|
-
/**
|
|
98
|
-
* Resolve and latch the output mode for this invocation. Call once at the top of
|
|
99
|
-
* `cloudCommand`, before anything can print or `fail`. Returns the resolved mode
|
|
100
|
-
* (handy for tests, which otherwise leave it at its `false` default).
|
|
101
|
-
*/
|
|
102
|
-
export declare function initOutputMode(rawArgs: string[]): boolean;
|
|
103
|
-
/** Whether the current invocation is emitting machine-readable JSON. */
|
|
104
|
-
export declare function isJsonMode(): boolean;
|
|
105
|
-
/** Force the mode (tests only — production latches it via `initOutputMode`). */
|
|
106
|
-
export declare function setJsonModeForTest(value: boolean): void;
|
|
107
|
-
/** Write one JSON value to stdout, followed by a newline. */
|
|
108
|
-
export declare function printJson(value: unknown): void;
|
|
109
|
-
/**
|
|
110
|
-
* The one output primitive every new command uses: in JSON mode emit `json`
|
|
111
|
-
* (and nothing else); otherwise run `human`. Keeping the two behind a single
|
|
112
|
-
* call is what guarantees a command can never print a table AND a JSON blob.
|
|
113
|
-
*/
|
|
114
|
-
export declare function emit(human: () => void, json: unknown): void;
|
|
44
|
+
export declare function requireProjectId(rawArgs: string[]): string;
|
|
115
45
|
/** Print an error (+ optional hint) and exit non-zero. Never returns. */
|
|
116
|
-
export declare function fail(message: string, hint?: string
|
|
117
|
-
/**
|
|
118
|
-
* Confirm a destructive/irreversible action, respecting non-interactive use.
|
|
119
|
-
*
|
|
120
|
-
* With `--yes`/`-y` it proceeds silently. In JSON mode or a non-TTY it REFUSES
|
|
121
|
-
* to prompt — a prompt that can hang is a known repo landmine — and fails,
|
|
122
|
-
* telling the caller to pass `--yes`. Only an interactive terminal gets a real
|
|
123
|
-
* confirm prompt; declining there aborts cleanly (exit 0).
|
|
124
|
-
*/
|
|
125
|
-
export declare function confirmDestructive(opts: {
|
|
126
|
-
yes: boolean;
|
|
127
|
-
prompt: string;
|
|
128
|
-
}): Promise<void>;
|
|
129
|
-
/**
|
|
130
|
-
* Positional tokens after `rebase cloud` — `[group, action, arg1, …]`.
|
|
131
|
-
*
|
|
132
|
-
* Deliberately NOT `arg({}, { permissive: true })._`: in permissive mode `arg`
|
|
133
|
-
* pushes UNKNOWN FLAGS onto `_` too, so `rollback --yes --json` would report
|
|
134
|
-
* `--yes` as the deployment id. Operand extraction must see operands only, so
|
|
135
|
-
* anything starting with `-` is dropped — the same filter the db backup handler
|
|
136
|
-
* has always used.
|
|
137
|
-
*/
|
|
138
|
-
export declare function cloudPositionals(rawArgs: string[]): string[];
|
|
46
|
+
export declare function fail(message: string, hint?: string): never;
|
|
139
47
|
export declare function success(message: string): void;
|
|
140
48
|
/** Colorize a deployment / resource status token. */
|
|
141
49
|
export declare function colorStatus(status: string | undefined): string;
|
|
142
|
-
/**
|
|
143
|
-
|
|
144
|
-
* — including `null`, which the API sends for an unset column and which used to
|
|
145
|
-
* print the literal string "null" (e.g. `Custom domain: null`).
|
|
146
|
-
*/
|
|
147
|
-
export declare function keyValues(rows: Array<[string, string | null | undefined]>): void;
|
|
50
|
+
/** Render a two-column key/value block with aligned keys. */
|
|
51
|
+
export declare function keyValues(rows: Array<[string, string | undefined]>): void;
|
|
148
52
|
/**
|
|
149
53
|
* Surface an SDK/HTTP error consistently. The SDK throws RebaseApiError with
|
|
150
54
|
* a `.status` and `.message`; anything else falls back to its string form.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function deployCommand(rawArgs: string[],
|
|
2
|
-
export declare function logsCommand(rawArgs: string[],
|
|
1
|
+
export declare function deployCommand(rawArgs: string[], projectId: string): Promise<void>;
|
|
2
|
+
export declare function logsCommand(rawArgs: string[], projectId: string): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type CloudClient } from "./context";
|
|
2
2
|
export declare function listProjects(rawArgs: string[]): Promise<void>;
|
|
3
3
|
export declare function createProject(rawArgs: string[]): Promise<void>;
|
|
4
|
-
export declare function projectInfo(rawArgs: string[],
|
|
5
|
-
export declare function deleteProject(rawArgs: string[],
|
|
4
|
+
export declare function projectInfo(rawArgs: string[], projectId: string): Promise<void>;
|
|
5
|
+
export declare function deleteProject(rawArgs: string[], projectId: string): Promise<void>;
|
|
6
6
|
export declare function firstRow(client: CloudClient, collection: string, projectId: string): Promise<Record<string, unknown> | undefined>;
|
|
7
7
|
export declare function latestDeployment(client: CloudClient, projectId: string): Promise<{
|
|
8
8
|
id: string | number;
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { PackageManager, PMCommands } from "../utils/package-manager";
|
|
2
|
-
/** Returns an error message, or null when the name is a valid package name. */
|
|
3
|
-
export declare function validateProjectName(name: string): string | null;
|
|
4
2
|
export type TemplatePreset = "blog" | "ecommerce" | "blank";
|
|
5
3
|
/**
|
|
6
4
|
* How much of Rebase to scaffold.
|
|
@@ -30,12 +28,6 @@ export interface InitOptions {
|
|
|
30
28
|
pm: PackageManager;
|
|
31
29
|
/** Command helpers for the detected PM. */
|
|
32
30
|
pmCommands: PMCommands;
|
|
33
|
-
/** Cloud project slug (its subdomain) to link the scaffold to. */
|
|
34
|
-
cloudProject?: string;
|
|
35
|
-
/** One-time setup key that authenticates the cloud link. */
|
|
36
|
-
setupKey?: string;
|
|
37
|
-
/** Control-plane URL the setup key is redeemed against. */
|
|
38
|
-
cloudUrl?: string;
|
|
39
31
|
}
|
|
40
32
|
export interface BuildQuestionsParams {
|
|
41
33
|
nameArg?: string;
|