void 0.9.2 → 0.10.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/README.md +1 -0
- package/dist/{auth-cmd-CPkWrQR9.mjs → auth-cmd-DBnbrX9Y.mjs} +2 -2
- package/dist/{better-auth-shared-ChVbrq52.mjs → better-auth-shared-D0Mbmx5V.mjs} +1 -1
- package/dist/{better-auth-shared-CmEQZs1T.d.mts → better-auth-shared-a7H3wk9J.d.mts} +2 -2
- package/dist/{cache-1SVxZ7BK.mjs → cache-DNX0hLsO.mjs} +1 -1
- package/dist/{cancel-deploy-JaFClLr7.mjs → cancel-deploy-CDzkVaYZ.mjs} +1 -1
- package/dist/cli/cli.mjs +205 -36
- package/dist/{client-DIfOFf1W.mjs → client-D4awzTnj.mjs} +149 -45
- package/dist/{config-BVEC0lti.mjs → config-8dLIngKW.mjs} +1 -1
- package/dist/{create-project-DCUrFJxa.mjs → create-project-CGodxfzH.mjs} +1 -1
- package/dist/{db-DiddQC2v.mjs → db-ERzz4oly.mjs} +16 -16
- package/dist/{delete-CYknzwXU.mjs → delete-CJZGDLBR.mjs} +1 -1
- package/dist/{deploy-CRU9fGjE.mjs → deploy-Cwa5sooV.mjs} +97 -108
- package/dist/{domain-B7RntQ1r.mjs → domain-WvoAHE6w.mjs} +1 -1
- package/dist/{drizzle-2fs1qTgy.mjs → drizzle-DqstQTGq.mjs} +1 -1
- package/dist/{env-Bvw0wMTI.mjs → env-Cx4czPsR.mjs} +3 -3
- package/dist/{env-helpers-Bd2wVdxz.d.mts → env-helpers-ZatKyjen.d.mts} +1 -1
- package/dist/{env-types-D6qI1ThV.mjs → env-types-CaJaIRXU.mjs} +1 -1
- package/dist/{env-validation-DBJsxZLz.mjs → env-validation-LH6eoyW-.mjs} +3 -3
- package/dist/{gen-CZdNWIaA.mjs → gen-Dgi4D7GC.mjs} +3 -3
- package/dist/git-metadata-Ce0AtSZL.mjs +82 -0
- package/dist/github-cmd-CUB041gj.mjs +308 -0
- package/dist/{handler-xflsMwWM.d.mts → handler-DczZlaXR.d.mts} +24 -4
- package/dist/{headers-Y0jshugF.mjs → headers-BNWymgnH.mjs} +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +60 -55
- package/dist/{init-BHupO7Fm.mjs → init-DvaRDMIc.mjs} +125 -80
- package/dist/{link-7MoXUMaI.mjs → link-CpbWJY3P.mjs} +2 -2
- package/dist/{list-N2mCHv8q.mjs → list-BkwE5vH4.mjs} +1 -1
- package/dist/{login-tt1OmNVg.mjs → login-Ca6mhQVI.mjs} +1 -1
- package/dist/{logs-Cl7q2CjZ.mjs → logs-ArQzZquo.mjs} +1 -1
- package/dist/{mcp-BXD35N2J.mjs → mcp-Cc2MMXdQ.mjs} +1 -1
- package/dist/{node-CHWVVjO6.mjs → node-B07cZs0d.mjs} +4 -4
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +1 -0
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +8 -6
- package/dist/pages/index.mjs +3 -3
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +30 -12
- package/dist/{plugin-inference-BUBhHt_1.mjs → plugin-inference-C3fLzFvP.mjs} +3 -1
- package/dist/{prepare-CrlAVbWS.mjs → prepare-DH2WnEpD.mjs} +14 -19
- package/dist/{preset-CIJG2O7a.mjs → preset-B7ZQZn0u.mjs} +2 -2
- package/dist/{project-cmd-CLrqSbqj.mjs → project-cmd-CWZeawuN.mjs} +8 -8
- package/dist/{project-tsconfig-HAGjfY6w.mjs → project-tsconfig-BTNuNoJ0.mjs} +18 -4
- package/dist/{protocol-DYca39yJ.d.mts → protocol-63PHtCHS.d.mts} +8 -5
- package/dist/{rollback-CEbAwbHK.mjs → rollback-BJ60ktsW.mjs} +1 -1
- package/dist/{route-types-jxRfWuCb.mjs → route-types-D03ryMXz.mjs} +3 -2
- package/dist/{runner-DLZ9E_cX.mjs → runner-BQyKUqAL.mjs} +1 -1
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +3 -3
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +2 -2
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.d.mts +2 -2
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.d.mts +2 -2
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.d.mts +2 -2
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.d.mts +2 -2
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/env-helpers.d.mts +1 -1
- package/dist/runtime/env-public-client.d.mts +1 -1
- package/dist/runtime/env-public.d.mts +2 -2
- package/dist/runtime/env-public.mjs +1 -1
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +2 -2
- package/dist/runtime/handler.mjs +68 -2
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws.d.mts +3 -3
- package/dist/{scan-BNC_1OsY.mjs → scan-DGEp1-1Q.mjs} +19 -11
- package/dist/{scan-2YmJkYAf.mjs → scan-VCAM1oh3.mjs} +55 -29
- package/dist/{secret-C_uTY7xx.mjs → secret-BRbXyu7E.mjs} +1 -1
- package/dist/{types-Dm9kep2X.d.mts → types-BnHMXezo.d.mts} +12 -3
- package/package.json +2 -2
- package/schema.json +3 -3
- package/skills/void/docs/guide/deployment.md +37 -11
- package/skills/void/docs/guide/edge/headers.md +10 -3
- package/skills/void/docs/guide/edge/rewrites.md +5 -5
- package/skills/void/docs/guide/pages-routing/layouts.md +8 -7
- package/skills/void/docs/guide/pages-routing/loaders.md +1 -1
- package/skills/void/docs/guide/pages-routing/overview.md +32 -5
- package/skills/void/docs/guide/server-routing.md +28 -0
- package/skills/void/docs/node_modules/void/AGENTS.md +15 -14
- package/skills/void/docs/node_modules/void/README.md +1 -0
- package/skills/void/docs/reference/api.md +44 -1
- package/skills/void/docs/reference/cli.md +65 -2
- package/skills/void/docs/reference/config.md +1 -1
- /package/dist/{auth-migrations-CuQkjjWE.mjs → auth-migrations-BP-hMzYl.mjs} +0 -0
- /package/dist/{auth-CDeb2XAl.d.mts → auth-nEUVHuFI.d.mts} +0 -0
- /package/dist/{defer-CouVukrf.mjs → defer-C-bdSM_b.mjs} +0 -0
- /package/dist/{dist-DR9sIMbM.mjs → dist-5cGIJHQQ.mjs} +0 -0
- /package/dist/{dotenv-Bkoqyq9r.mjs → dotenv-lS94ymhM.mjs} +0 -0
- /package/dist/{env-raw-RDkMnSTC.mjs → env-raw-Dtj1UAoK.mjs} +0 -0
- /package/dist/{fetch-error-CimrygMq.d.mts → fetch-error-BQMdPvge.d.mts} +0 -0
- /package/dist/{fetch-error-BFIoojjf.mjs → fetch-error-C6qffTl2.mjs} +0 -0
- /package/dist/{head-BsSTGnIe.d.mts → head-JAH2l3fg.d.mts} +0 -0
- /package/dist/{log-CWWZV4V1.mjs → log-BdD_Fpms.mjs} +0 -0
- /package/dist/{package-json-B2TD0JLu.mjs → package-json-Bg_GJdJB.mjs} +0 -0
- /package/dist/{pg-CMZ_5wsC.mjs → pg-CempqvEJ.mjs} +0 -0
- /package/dist/{providers-3Kkv63Ha.d.mts → providers-BkiAlEad.d.mts} +0 -0
- /package/dist/{providers-uC0PJg1c.mjs → providers-BwPbdHdi.mjs} +0 -0
- /package/dist/{runner-pg-Cv9V7ydr.mjs → runner-pg-BAheiT6v.mjs} +0 -0
- /package/dist/{skills-BRKc--As.mjs → skills--OMgLmXW.mjs} +0 -0
- /package/dist/{standard-schema-Dnsh2vnl.d.mts → standard-schema-BCBv-QaP.d.mts} +0 -0
- /package/dist/{subcommand-prompt-OD-x_Tsm.mjs → subcommand-prompt-ClwpLlKD.mjs} +0 -0
- /package/dist/{yarn-pnp-0SwYgQxx.mjs → yarn-pnp-DhCHHLAz.mjs} +0 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { s as import_picocolors } from "./output-DeiS4oEX.mjs";
|
|
2
|
+
import { c as createCodeChallenge, d as getToken, l as createCodeVerifier, m as openBrowser, n as PlatformClient, o as parsePlatformErrorBody, s as awaitBrowserCallback, t as PlatformApiError } from "./client-D4awzTnj.mjs";
|
|
3
|
+
import { _ as me, c as R, i as Ee, l as Re, x as q } from "./dist-abzUneor.mjs";
|
|
4
|
+
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
|
+
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
6
|
+
import { t as collectGitDeployMetadata } from "./git-metadata-Ce0AtSZL.mjs";
|
|
7
|
+
import { randomBytes } from "node:crypto";
|
|
8
|
+
//#region src/cli/github-cmd.ts
|
|
9
|
+
/**
|
|
10
|
+
* Map a PlatformApiError status + error code string to a friendly user message.
|
|
11
|
+
* Returns null for unrecognised cases (caller should re-throw).
|
|
12
|
+
*/
|
|
13
|
+
function describeConnectError(status, errorCode) {
|
|
14
|
+
const code = errorCode ?? "";
|
|
15
|
+
if (status === 409) {
|
|
16
|
+
if (code.includes("already connected")) return "This project is already connected to a GitHub repository.";
|
|
17
|
+
if (code.includes("not active")) return "Installation is not active. Re-install the GitHub App and try again.";
|
|
18
|
+
}
|
|
19
|
+
if (status === 400 && code.includes("not accessible")) return "Repository not accessible by this installation. Check the App has access to it.";
|
|
20
|
+
if (status === 403) return "You don't have access to this project.";
|
|
21
|
+
if (status === 404) return "Project or installation not found.";
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Extract `owner/repo` from a `https://github.com/owner/repo(.git)?` URL.
|
|
26
|
+
* Returns null for non-GitHub URLs or null input.
|
|
27
|
+
*/
|
|
28
|
+
function parseGithubRepoFullName(repositoryUrl) {
|
|
29
|
+
if (!repositoryUrl) return null;
|
|
30
|
+
try {
|
|
31
|
+
const url = new URL(repositoryUrl);
|
|
32
|
+
if (url.hostname !== "github.com") return null;
|
|
33
|
+
const parts = url.pathname.replace(/^\//, "").replace(/\.git$/, "").split("/");
|
|
34
|
+
if (parts.length < 2 || !parts[0] || !parts[1]) return null;
|
|
35
|
+
return `${parts[0]}/${parts[1]}`;
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Format a list of GitHub App installations into a human-readable string.
|
|
42
|
+
* One block per installation:
|
|
43
|
+
* account_login (account_type) — selection, N repos, status
|
|
44
|
+
* [repo list for 'selected' installs]
|
|
45
|
+
*/
|
|
46
|
+
function formatInstallations(installations) {
|
|
47
|
+
return installations.map((inst) => {
|
|
48
|
+
const header = `${inst.account_login} (${inst.account_type}) [id: ${inst.installation_id}] — ${inst.repository_selection}, ${inst.repositories.length} repos, ${inst.status}`;
|
|
49
|
+
if (inst.repository_selection === "selected" && inst.repositories.length > 0) return `${header}\n${inst.repositories.map((r) => ` • ${r.full_name}`).join("\n")}`;
|
|
50
|
+
return header;
|
|
51
|
+
}).join("\n\n");
|
|
52
|
+
}
|
|
53
|
+
async function runGithubCommand(root, args) {
|
|
54
|
+
const token = getToken(root);
|
|
55
|
+
if (!token) {
|
|
56
|
+
R.error("Not logged in. Run `void auth login` first.");
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
const client = new PlatformClient(token, { root });
|
|
60
|
+
switch (args.subcommand) {
|
|
61
|
+
case "install": return runInstall(root, client);
|
|
62
|
+
case "installations": return runInstallations(client);
|
|
63
|
+
case "connect": return runConnect(root, client, args);
|
|
64
|
+
case "link": return runGithubLink(root, client);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `void github install` — print the GitHub App install URL and open it.
|
|
69
|
+
*
|
|
70
|
+
* If the account has no linked GitHub identity, the server returns a 403 with
|
|
71
|
+
* the stable code `github_identity_required` (Task 3). Rather than telling the
|
|
72
|
+
* user to `void auth login` (which risks forking into a second account), we run
|
|
73
|
+
* the link flow inline and retry the install URL exactly once.
|
|
74
|
+
*
|
|
75
|
+
* `linkIdentity` is injectable so tests can supply a fake linker instead of
|
|
76
|
+
* starting a real localhost callback server / browser.
|
|
77
|
+
*/
|
|
78
|
+
async function runInstall(root, client, linkIdentity = runGithubLink) {
|
|
79
|
+
let url;
|
|
80
|
+
try {
|
|
81
|
+
({url} = await client.getGithubInstallUrl());
|
|
82
|
+
} catch (err) {
|
|
83
|
+
if (err instanceof PlatformApiError && err.status === 403 && err.code === "github_identity_required") {
|
|
84
|
+
R.message("Your Void account needs a linked GitHub identity. Starting the GitHub link…");
|
|
85
|
+
await linkIdentity(root, client);
|
|
86
|
+
try {
|
|
87
|
+
({url} = await client.getGithubInstallUrl());
|
|
88
|
+
} catch (retryErr) {
|
|
89
|
+
if (retryErr instanceof PlatformApiError && retryErr.status === 403 && retryErr.code === "github_identity_required") {
|
|
90
|
+
R.error("Could not start the GitHub App install after linking. Try `void github link`, then `void github install` again.");
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
throw retryErr;
|
|
94
|
+
}
|
|
95
|
+
} else throw err;
|
|
96
|
+
}
|
|
97
|
+
R.message(`Open this URL to install the Void GitHub App:\n${import_picocolors.default.cyan(url)}`);
|
|
98
|
+
const { execFile } = await import("node:child_process");
|
|
99
|
+
openBrowser(url, execFile);
|
|
100
|
+
R.message("After installing, run `void github connect` to link a repository to your project.");
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Link the current Void account (the logged-in CLI token holder) to a GitHub
|
|
104
|
+
* identity. Drives the platform's 3-endpoint link flow with a localhost +
|
|
105
|
+
* PKCE handshake, mirroring `void auth login`.
|
|
106
|
+
*
|
|
107
|
+
* Exported so Task 5 can call it (e.g. when `github install` returns 403 for a
|
|
108
|
+
* GitHub-less account, prompt to link and retry). The success path is
|
|
109
|
+
* non-exiting so a caller can continue; only error paths exit/throw.
|
|
110
|
+
*/
|
|
111
|
+
async function runGithubLink(root, client) {
|
|
112
|
+
const verifier = createCodeVerifier();
|
|
113
|
+
const challenge = createCodeChallenge(verifier);
|
|
114
|
+
const state = randomBytes(32).toString("hex");
|
|
115
|
+
let status;
|
|
116
|
+
try {
|
|
117
|
+
({status} = await awaitBrowserCallback({
|
|
118
|
+
state,
|
|
119
|
+
buildAuthUrl: async (callback) => {
|
|
120
|
+
callback.searchParams.set("state", state);
|
|
121
|
+
const { url } = await client.getGithubLinkUrl(callback.href, challenge);
|
|
122
|
+
return url;
|
|
123
|
+
},
|
|
124
|
+
describeError: (p) => p.get("error") ? "GitHub authorization failed." : null,
|
|
125
|
+
onUrl: (url) => R.message(`Open this URL to link your GitHub account:\n${import_picocolors.default.cyan(url)}`),
|
|
126
|
+
finalize: async (params) => {
|
|
127
|
+
const linkCode = params.get("link_code");
|
|
128
|
+
if (!linkCode) throw new Error("github: link callback did not return a link code.");
|
|
129
|
+
return client.completeGithubLink(linkCode, verifier);
|
|
130
|
+
}
|
|
131
|
+
}));
|
|
132
|
+
} catch (err) {
|
|
133
|
+
if (err instanceof PlatformApiError && err.code === "github_already_linked") {
|
|
134
|
+
R.error("Your Void account is already linked to a different GitHub account.");
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
if (err instanceof PlatformApiError && (err.status === 409 || err.code === "github_identity_conflict")) {
|
|
138
|
+
R.error("This GitHub account is already linked to another Void account.");
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
throw err;
|
|
142
|
+
}
|
|
143
|
+
if (status === "already_linked") R.success("GitHub account already linked.");
|
|
144
|
+
else R.success("GitHub account linked.");
|
|
145
|
+
}
|
|
146
|
+
async function runInstallations(client) {
|
|
147
|
+
const installations = await client.listGithubInstallations();
|
|
148
|
+
if (installations.length === 0) {
|
|
149
|
+
R.info("No GitHub App installations. Run `void github install` first.");
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
R.message(formatInstallations(installations));
|
|
153
|
+
}
|
|
154
|
+
async function runConnect(root, client, args) {
|
|
155
|
+
const isTTY = process.stdin.isTTY === true;
|
|
156
|
+
let projectId;
|
|
157
|
+
const requestedSlug = getRequestedProjectSlug({ projectSlug: args.projectName || void 0 });
|
|
158
|
+
if (requestedSlug) {
|
|
159
|
+
const resolved = resolveProjectBySlug(await client.listProjects(), requestedSlug);
|
|
160
|
+
if (!resolved) {
|
|
161
|
+
R.error(`connect: No project found with slug '${requestedSlug}'.`);
|
|
162
|
+
process.exit(1);
|
|
163
|
+
}
|
|
164
|
+
projectId = resolved.projectId;
|
|
165
|
+
} else {
|
|
166
|
+
const linked = readProjectConfig(root);
|
|
167
|
+
if (linked) projectId = linked.projectId;
|
|
168
|
+
else if (!isTTY) {
|
|
169
|
+
R.error("connect: No project specified. Pass a project name or --project <name>, set VOID_PROJECT, or link one with `void project link`.");
|
|
170
|
+
process.exit(1);
|
|
171
|
+
} else {
|
|
172
|
+
const projects = await client.listProjects();
|
|
173
|
+
if (projects.length === 0) {
|
|
174
|
+
R.error("No projects found. Create one first with `void deploy`.");
|
|
175
|
+
process.exit(1);
|
|
176
|
+
}
|
|
177
|
+
const picked = await Ee({
|
|
178
|
+
message: "Select a project:",
|
|
179
|
+
options: projects.map((p) => ({
|
|
180
|
+
value: p.id,
|
|
181
|
+
label: p.slug
|
|
182
|
+
}))
|
|
183
|
+
});
|
|
184
|
+
if (q(picked)) {
|
|
185
|
+
me("Cancelled.");
|
|
186
|
+
process.exit(0);
|
|
187
|
+
}
|
|
188
|
+
projectId = picked;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const installations = (await client.listGithubInstallations()).filter((i) => i.status === "active");
|
|
192
|
+
if (installations.length === 0) {
|
|
193
|
+
R.error("No active GitHub App installation. Run `void github install` first.");
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
let installation;
|
|
197
|
+
if (args.installationId) {
|
|
198
|
+
const found = installations.find((i) => i.installation_id === args.installationId);
|
|
199
|
+
if (!found) {
|
|
200
|
+
R.error(`connect: No active installation found with id '${args.installationId}'.`);
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
203
|
+
installation = found;
|
|
204
|
+
} else if (installations.length === 1) installation = installations[0];
|
|
205
|
+
else if (!isTTY) {
|
|
206
|
+
R.error("connect: Multiple installations found. Pass --installation <id>.");
|
|
207
|
+
process.exit(1);
|
|
208
|
+
} else {
|
|
209
|
+
const picked = await Ee({
|
|
210
|
+
message: "Select a GitHub App installation:",
|
|
211
|
+
options: installations.map((i) => ({
|
|
212
|
+
value: i.installation_id,
|
|
213
|
+
label: `${i.account_login} (${i.account_type}) [id: ${i.installation_id}]`
|
|
214
|
+
}))
|
|
215
|
+
});
|
|
216
|
+
if (q(picked)) {
|
|
217
|
+
me("Cancelled.");
|
|
218
|
+
process.exit(0);
|
|
219
|
+
}
|
|
220
|
+
installation = installations.find((i) => i.installation_id === picked);
|
|
221
|
+
}
|
|
222
|
+
let repoFullName;
|
|
223
|
+
if (args.repo) repoFullName = args.repo;
|
|
224
|
+
else if (installation.repository_selection === "selected") if (installation.repositories.length === 0) {
|
|
225
|
+
R.error("connect: The installation has no accessible repositories. Update the GitHub App install to grant access.");
|
|
226
|
+
process.exit(1);
|
|
227
|
+
} else if (installation.repositories.length === 1) repoFullName = installation.repositories[0].full_name;
|
|
228
|
+
else if (!isTTY) {
|
|
229
|
+
R.error("connect: Multiple repositories available. Pass --repo <owner/repo>.");
|
|
230
|
+
process.exit(1);
|
|
231
|
+
} else {
|
|
232
|
+
const picked = await Ee({
|
|
233
|
+
message: "Select a repository:",
|
|
234
|
+
options: installation.repositories.map((r) => ({
|
|
235
|
+
value: r.full_name,
|
|
236
|
+
label: r.full_name
|
|
237
|
+
}))
|
|
238
|
+
});
|
|
239
|
+
if (q(picked)) {
|
|
240
|
+
me("Cancelled.");
|
|
241
|
+
process.exit(0);
|
|
242
|
+
}
|
|
243
|
+
repoFullName = picked;
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
if (!isTTY) {
|
|
247
|
+
R.error("connect: --repo <owner/repo> is required in non-interactive mode for an all-repositories installation.");
|
|
248
|
+
process.exit(1);
|
|
249
|
+
}
|
|
250
|
+
const gitDefault = parseGithubRepoFullName(collectGitDeployMetadata(root, null).repositoryUrl);
|
|
251
|
+
const input = await Re({
|
|
252
|
+
message: "Repository (owner/repo):",
|
|
253
|
+
placeholder: gitDefault ?? "owner/repo",
|
|
254
|
+
initialValue: gitDefault ?? ""
|
|
255
|
+
});
|
|
256
|
+
if (q(input)) {
|
|
257
|
+
me("Cancelled.");
|
|
258
|
+
process.exit(0);
|
|
259
|
+
}
|
|
260
|
+
repoFullName = input.trim();
|
|
261
|
+
if (!repoFullName) {
|
|
262
|
+
R.error("connect: Repository is required.");
|
|
263
|
+
process.exit(1);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const branchDefault = args.branch ?? collectGitDeployMetadata(root, null).gitRef ?? "main";
|
|
267
|
+
let branch;
|
|
268
|
+
if (args.branch) branch = args.branch;
|
|
269
|
+
else if (!isTTY) {
|
|
270
|
+
R.error("connect: --branch is required in non-interactive mode. Pass --branch <name>.");
|
|
271
|
+
process.exit(1);
|
|
272
|
+
} else {
|
|
273
|
+
const input = await Re({
|
|
274
|
+
message: "Branch to deploy from:",
|
|
275
|
+
placeholder: branchDefault,
|
|
276
|
+
initialValue: branchDefault
|
|
277
|
+
});
|
|
278
|
+
if (q(input)) {
|
|
279
|
+
me("Cancelled.");
|
|
280
|
+
process.exit(0);
|
|
281
|
+
}
|
|
282
|
+
branch = input.trim() || branchDefault;
|
|
283
|
+
}
|
|
284
|
+
const executor = args.executor ?? "container";
|
|
285
|
+
try {
|
|
286
|
+
await client.connectGithub(projectId, {
|
|
287
|
+
installationId: installation.installation_id,
|
|
288
|
+
repoFullName,
|
|
289
|
+
branch,
|
|
290
|
+
buildExecutor: executor
|
|
291
|
+
});
|
|
292
|
+
} catch (err) {
|
|
293
|
+
if (err instanceof PlatformApiError) {
|
|
294
|
+
const body = parsePlatformErrorBody(err.body);
|
|
295
|
+
const code = body?.error ?? body?.message ?? "";
|
|
296
|
+
const message = describeConnectError(err.status, code);
|
|
297
|
+
if (message !== null) {
|
|
298
|
+
R.error(`connect: ${message}`);
|
|
299
|
+
process.exit(1);
|
|
300
|
+
}
|
|
301
|
+
throw err;
|
|
302
|
+
}
|
|
303
|
+
throw err;
|
|
304
|
+
}
|
|
305
|
+
R.success(`Connected ${repoFullName} (${branch}) → project. Push to ${branch} to deploy.`);
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
export { runGithubCommand };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as HeadDescriptor } from "./head-
|
|
2
|
-
import { r as AuthUser, t as AuthSession } from "./auth-
|
|
3
|
-
import { t as StandardSchemaV1 } from "./standard-schema-
|
|
1
|
+
import { n as HeadDescriptor } from "./head-JAH2l3fg.mjs";
|
|
2
|
+
import { r as AuthUser, t as AuthSession } from "./auth-nEUVHuFI.mjs";
|
|
3
|
+
import { t as StandardSchemaV1 } from "./standard-schema-BCBv-QaP.mjs";
|
|
4
4
|
import * as _$_cloudflare_sandbox0 from "@cloudflare/sandbox";
|
|
5
5
|
import { Context, Env, MiddlewareHandler } from "hono";
|
|
6
6
|
import { RewriteDestination } from "void/routes";
|
|
@@ -162,6 +162,17 @@ declare module "hono" {
|
|
|
162
162
|
type CloudContext = Context<CloudEnv>;
|
|
163
163
|
type HandlerFn = (c: CloudContext) => unknown | Promise<unknown>;
|
|
164
164
|
type MiddlewareFn = MiddlewareHandler<CloudEnv>;
|
|
165
|
+
type BasicAuthOptionValue = string | (() => string);
|
|
166
|
+
interface BasicAuthOptions {
|
|
167
|
+
/** Username required by the Basic auth challenge. */
|
|
168
|
+
username: BasicAuthOptionValue;
|
|
169
|
+
/** Password required by the Basic auth challenge. */
|
|
170
|
+
password: BasicAuthOptionValue;
|
|
171
|
+
/** Browser prompt realm. Defaults to "Restricted". */
|
|
172
|
+
realm?: BasicAuthOptionValue;
|
|
173
|
+
/** Response body for failed authentication. Defaults to "Authentication required". */
|
|
174
|
+
message?: BasicAuthOptionValue;
|
|
175
|
+
}
|
|
165
176
|
/** Pre-rendered asset tags injected by the SSR build. */
|
|
166
177
|
type RenderAssetTags = {
|
|
167
178
|
/** CSS stylesheet links for `<head>`. */css: string; /** JS modulepreload links for `<head>` (only when page needs JS). */
|
|
@@ -243,6 +254,15 @@ declare namespace defineHandler {
|
|
|
243
254
|
*/
|
|
244
255
|
declare function defineMiddleware(handler: MiddlewareHandler<CloudEnv>): MiddlewareHandler<CloudEnv>;
|
|
245
256
|
/**
|
|
257
|
+
* Create Basic authentication middleware for temporary site gates and
|
|
258
|
+
* pre-launch protection.
|
|
259
|
+
*
|
|
260
|
+
* Void internal endpoints under `/__void` are always excluded so deploy-time
|
|
261
|
+
* migrations, prerendering, cron/queue dispatch, and remote binding helpers
|
|
262
|
+
* continue to reach Void's own internal-token checks.
|
|
263
|
+
*/
|
|
264
|
+
declare function basicAuth(options: BasicAuthOptions): MiddlewareHandler<CloudEnv>;
|
|
265
|
+
/**
|
|
246
266
|
* Identity function that provides type inference for scheduled jobs.
|
|
247
267
|
* At runtime it simply returns the function passed to it.
|
|
248
268
|
*/
|
|
@@ -263,4 +283,4 @@ declare function defineHead<P = Record<string, unknown>>(handler: (c: CloudConte
|
|
|
263
283
|
*/
|
|
264
284
|
declare function defineQueue<T = unknown>(handler: QueueFn<T>): TypedQueueHandler<T>;
|
|
265
285
|
//#endregion
|
|
266
|
-
export {
|
|
286
|
+
export { defer as C, runValidation as D, ValidatorSlots as E, InferProps as S, HandlerInput as T, defineQueue as _, CloudEnv as a, Deferred as b, QueueRetryOptions as c, TypedQueueHandler as d, VoidAssetRewriteError as f, defineMiddleware as g, defineHead as h, CloudContextVariables as i, RenderAssetTags as l, defineHandler as m, CloudBindings as n, QueueBatch as o, basicAuth as p, CloudContext as r, QueueMessage as s, BasicAuthOptions as t, TypedHandler as u, defineRender as v, ValidationError as w, DeferredState as x, defineScheduled as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
2
|
-
import { a as convertRedirectsConfig, d as parseHostPrefixedSource, i as convertHeadersConfig, o as convertRewritesConfig, r as convertFallbacksConfig, s as countSplats, t as VALID_REDIRECT_STATUSES, u as isProtocolRelative } from "./config-
|
|
3
|
-
import { i as voidWarn } from "./log-
|
|
2
|
+
import { a as convertRedirectsConfig, d as parseHostPrefixedSource, i as convertHeadersConfig, o as convertRewritesConfig, r as convertFallbacksConfig, s as countSplats, t as VALID_REDIRECT_STATUSES, u as isProtocolRelative } from "./config-8dLIngKW.mjs";
|
|
3
|
+
import { i as voidWarn } from "./log-BdD_Fpms.mjs";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/cli/headers.ts
|
|
6
6
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as HeadDescriptor } from "./head-
|
|
2
|
-
import { r as AuthUser } from "./auth-
|
|
3
|
-
import { C as HandlerInput, _ as
|
|
1
|
+
import { n as HeadDescriptor } from "./head-JAH2l3fg.mjs";
|
|
2
|
+
import { r as AuthUser } from "./auth-nEUVHuFI.mjs";
|
|
3
|
+
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, x as DeferredState, y as defineScheduled } from "./handler-DczZlaXR.mjs";
|
|
4
4
|
import { QueueMap } from "./runtime/queues.mjs";
|
|
5
5
|
import { PluginConfig } from "@cloudflare/vite-plugin";
|
|
6
6
|
import { Plugin } from "vite";
|
|
@@ -29,4 +29,4 @@ declare function voidPlugin(options?: {
|
|
|
29
29
|
auxiliaryWorkers?: PluginConfig["auxiliaryWorkers"];
|
|
30
30
|
}): Array<Plugin>;
|
|
31
31
|
//#endregion
|
|
32
|
-
export { type AuthUser, type CloudContext, type CloudContextVariables, type CloudEnv, type Deferred, type DeferredState, type HandlerInput, type HeadDescriptor, type InferProps, type QueueBatch, type QueueMap, type QueueMessage, type QueueRetryOptions, type RenderAssetTags, type TypedHandler, type TypedQueueHandler, type ValidatorSlots, VoidAssetRewriteError, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
|
|
32
|
+
export { type AuthUser, type BasicAuthOptions, type CloudContext, type CloudContextVariables, type CloudEnv, type Deferred, type DeferredState, type HandlerInput, type HeadDescriptor, type InferProps, type QueueBatch, type QueueMap, type QueueMessage, type QueueRetryOptions, type RenderAssetTags, type TypedHandler, type TypedQueueHandler, type ValidatorSlots, VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
|