void 0.7.0 → 0.7.2
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/agents-DqkFfc2c.mjs +151 -0
- package/dist/{auth-cmd-Dx8oPKZC.mjs → auth-cmd-Dk0acCT5.mjs} +2 -2
- package/dist/{better-auth-shared-C9_GHSkR.d.mts → better-auth-shared-CZsIpjey.d.mts} +1 -1
- package/dist/{cache-W82I8ihI.mjs → cache-DGSZ5Bh6.mjs} +2 -2
- package/dist/{cancel-deploy-BOBTqqh0.mjs → cancel-deploy-CrY3kt93.mjs} +1 -1
- package/dist/cli/cli.mjs +37 -177
- package/dist/{client-snXOjrp1.mjs → client-DCqnMpDt.mjs} +161 -18
- package/dist/{create-project-BIA15W7z.mjs → create-project-Bg88Kq_I.mjs} +3 -3
- package/dist/{db-DsRoMcfN.mjs → db-ClNu7vYQ.mjs} +13 -13
- package/dist/{delete-DAP6yDc7.mjs → delete-DXcX1yQZ.mjs} +2 -2
- package/dist/{deploy-BPKblFx6.mjs → deploy-BkjqNk9U.mjs} +888 -185
- package/dist/{domain-BGofcQ6I.mjs → domain-CDQhvYNZ.mjs} +1 -1
- package/dist/{env-CyG3tvU0.mjs → env-CnrQY2b6.mjs} +1 -1
- package/dist/{env-helpers-Dr9Y7RnE.d.mts → env-helpers-CbeM_7-k.d.mts} +1 -1
- package/dist/{gen-U0Ktr4Zd.mjs → gen-C0EY2k27.mjs} +1 -1
- package/dist/{handler-B0ds0OHJ.d.mts → handler-dKQWyF-G.d.mts} +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +13 -12
- package/dist/{init-C7wS5iGP.mjs → init-CPny6w9D.mjs} +63 -28
- package/dist/{link-p2R6NbgN.mjs → link-eZ0aiHFK.mjs} +2 -2
- package/dist/{list-Bfel-QLc.mjs → list-ztyEz4TW.mjs} +2 -2
- package/dist/{login-CkcXUiIu.mjs → login-B5HHT32i.mjs} +1 -1
- package/dist/{logs-DmkrRvx6.mjs → logs-J4BN0LXd.mjs} +1 -1
- package/dist/{mcp-CaQzfeUi.mjs → mcp-Bdu9bnjR.mjs} +1 -1
- package/dist/{node-DDfXj10V.mjs → node-DFqMcZR1.mjs} +3 -3
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +3 -0
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +23 -18
- package/dist/{prepare-BAtWufvm.mjs → prepare-DKkx-2Kt.mjs} +1 -1
- package/dist/{project-cmd-B7lQp3F3.mjs → project-cmd-DKiQYdSd.mjs} +8 -8
- package/dist/{protocol-BWzXs2A2.d.mts → protocol-CK4OFwfR.d.mts} +2 -2
- package/dist/{rollback-gyC59l7U.mjs → rollback-ZNvT8T54.mjs} +1 -1
- package/dist/{runner-6Ep3fNQu.mjs → runner-BUPRnMFN.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 +2 -2
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- 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 +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/migration-handler.mjs +2 -2
- 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/{secret-CeRSukgM.mjs → secret-BXHx515u.mjs} +2 -2
- package/dist/{skills-ipldjlKE.mjs → skills-CbuYOthf.mjs} +1 -1
- package/package.json +20 -20
- package/skills/void/docs/guide/deployment.md +4 -6
- package/skills/void/docs/index.md +3 -3
- package/skills/void/docs/node_modules/void/AGENTS.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +208 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +18 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +31 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +17 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +249 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +18 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/build.md +40 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +119 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +44 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +64 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +88 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/dev.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +102 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/fmt.md +41 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +101 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/implode.md +23 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +128 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +147 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/lint.md +50 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +173 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +61 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +324 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/test.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +132 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +49 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/vpx.md +66 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/why.md +39 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/index.md +12 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/team.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/generator/README.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/monorepo/README.md +29 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +208 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +18 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +31 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +17 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +249 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +18 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/build.md +40 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +119 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +44 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +64 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +88 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/dev.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +102 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/fmt.md +41 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +101 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/implode.md +23 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +128 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +147 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/lint.md +50 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +173 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +61 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +324 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/test.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +132 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +49 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/vpx.md +66 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/why.md +39 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/index.md +12 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/team.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/generator/README.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/monorepo/README.md +29 -0
- package/skills/void/docs/reference/cli.md +10 -7
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +0 -55
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +0 -2230
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +0 -55
- package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +0 -2230
- package/skills/void/docs/node_modules/void/node_modules/vite/README.md +0 -20
- /package/dist/{auth-BdsJ0Aff.d.mts → auth-DrfOTMmr.d.mts} +0 -0
- /package/dist/{auth-migrations-BAtAck2g.mjs → auth-migrations-BwLPwRgH.mjs} +0 -0
- /package/dist/{better-auth-shared-CdYmQGry.mjs → better-auth-shared-APuDaPqW.mjs} +0 -0
- /package/dist/{defer-DcxEsVH1.mjs → defer-2ARBu8Et.mjs} +0 -0
- /package/dist/{drizzle-NnudE_UN.mjs → drizzle-C-NRqGhx.mjs} +0 -0
- /package/dist/{env-raw-BDL4TvdN.mjs → env-raw-DtfQ9E31.mjs} +0 -0
- /package/dist/{fetch-error-BQ8sZ5Nd.mjs → fetch-error-CEr0ACTl.mjs} +0 -0
- /package/dist/{fetch-error-CVZ5CGA-.d.mts → fetch-error-DflegrF3.d.mts} +0 -0
- /package/dist/{head-P-egrtFE.d.mts → head-CZGAunBV.d.mts} +0 -0
- /package/dist/{headers-DCXc7mDs.mjs → headers-YVkHjOyq.mjs} +0 -0
- /package/dist/{preset-D4I73kT4.mjs → preset-DFvePt0l.mjs} +0 -0
- /package/dist/{project-slug-CKam8lF9.mjs → project-slug-KRvHQEQI.mjs} +0 -0
- /package/dist/{resolve-project-Br5BR03U.mjs → resolve-project-DdjLQ2tB.mjs} +0 -0
- /package/dist/{runner-pg-D0wWHYnr.mjs → runner-pg-BI6f6Ncm.mjs} +0 -0
- /package/dist/{standard-schema-9CRjx-uR.d.mts → standard-schema-BfGDWXff.d.mts} +0 -0
- /package/dist/{subcommand-prompt-BKjuNAPb.mjs → subcommand-prompt-BMS1TNG5.mjs} +0 -0
- /package/dist/{types-mHOEwpW4.d.mts → types-AdKzPp2C.d.mts} +0 -0
- /package/dist/{yarn-pnp-BFqMV_bl.mjs → yarn-pnp-6LD6_3Ej.mjs} +0 -0
|
@@ -3,6 +3,7 @@ import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
|
3
3
|
import { s as import_picocolors } from "./output-BwlcIYSR.mjs";
|
|
4
4
|
import { t as isVoidInternalStaging } from "./project-TqORyHn8.mjs";
|
|
5
5
|
import { t as cfAccessHeaders } from "./cf-access-Dee5cXxL.mjs";
|
|
6
|
+
import { r as getPackageDir } from "./agents-DqkFfc2c.mjs";
|
|
6
7
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
7
8
|
import { homedir } from "node:os";
|
|
8
9
|
import { Entry } from "@napi-rs/keyring";
|
|
@@ -265,9 +266,34 @@ function isGatedHost(apiUrl) {
|
|
|
265
266
|
var client_exports = /* @__PURE__ */ __exportAll({
|
|
266
267
|
PlatformApiError: () => PlatformApiError,
|
|
267
268
|
PlatformClient: () => PlatformClient,
|
|
269
|
+
isCliOutdatedError: () => isCliOutdatedError,
|
|
268
270
|
isExpiredTokenError: () => isExpiredTokenError,
|
|
269
|
-
parsePlatformErrorBody: () => parsePlatformErrorBody
|
|
271
|
+
parsePlatformErrorBody: () => parsePlatformErrorBody,
|
|
272
|
+
readCliVersion: () => readCliVersion
|
|
270
273
|
});
|
|
274
|
+
/**
|
|
275
|
+
* Current CLI version. Sent as `X-Void-CLI-Version` on every platform
|
|
276
|
+
* request so the platform's CLI-version gate can refuse stale CLIs
|
|
277
|
+
* cleanly (HTTP 426 + `cli_outdated`) instead of letting a wire
|
|
278
|
+
* mismatch surface as an opaque parse error.
|
|
279
|
+
*
|
|
280
|
+
* Resolved once per process. Returns `null` when package.json can't be
|
|
281
|
+
* read or has no `version` string — the ctor then OMITS the header
|
|
282
|
+
* entirely. We deliberately do NOT send a placeholder string like
|
|
283
|
+
* "unknown": the platform treats present-but-unparseable headers as a
|
|
284
|
+
* stale-CLI signal and would 426 the request, bricking the CLI on any
|
|
285
|
+
* packaging error. Missing-header is the documented pass-through path.
|
|
286
|
+
*/
|
|
287
|
+
function readCliVersion() {
|
|
288
|
+
try {
|
|
289
|
+
const pkgPath = join(getPackageDir(), "package.json");
|
|
290
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
291
|
+
return typeof pkg.version === "string" ? pkg.version : null;
|
|
292
|
+
} catch {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
const VOID_CLI_VERSION = readCliVersion();
|
|
271
297
|
function parsePlatformErrorBody(body) {
|
|
272
298
|
try {
|
|
273
299
|
const parsed = JSON.parse(body);
|
|
@@ -277,16 +303,29 @@ function parsePlatformErrorBody(body) {
|
|
|
277
303
|
return null;
|
|
278
304
|
}
|
|
279
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Detects the `cli_outdated` 426 response shape emitted by the platform's
|
|
308
|
+
* `cliVersionGate` middleware. When present, callers should surface the
|
|
309
|
+
* server's `message` field verbatim — it already includes upgrade
|
|
310
|
+
* instructions — rather than the default `<action>: <status> <body>`
|
|
311
|
+
* which would dump raw JSON at the user.
|
|
312
|
+
*/
|
|
313
|
+
function isCliOutdatedError(err) {
|
|
314
|
+
if (!(err instanceof PlatformApiError)) return false;
|
|
315
|
+
if (err.status !== 426) return false;
|
|
316
|
+
return parsePlatformErrorBody(err.body)?.error === "cli_outdated";
|
|
317
|
+
}
|
|
280
318
|
var PlatformApiError = class extends Error {
|
|
281
319
|
status;
|
|
282
320
|
body;
|
|
283
321
|
code;
|
|
284
322
|
constructor(action, status, body) {
|
|
285
|
-
|
|
323
|
+
const parsed = parsePlatformErrorBody(body);
|
|
324
|
+
const message = status === 426 && parsed?.error === "cli_outdated" && parsed.message ? parsed.message : `${action}: ${status} ${body}`;
|
|
325
|
+
super(message);
|
|
286
326
|
this.name = "PlatformApiError";
|
|
287
327
|
this.status = status;
|
|
288
328
|
this.body = body;
|
|
289
|
-
const parsed = parsePlatformErrorBody(body);
|
|
290
329
|
this.code = parsed?.error ?? parsed?.message;
|
|
291
330
|
}
|
|
292
331
|
};
|
|
@@ -303,12 +342,17 @@ function isExpiredTokenError(error) {
|
|
|
303
342
|
var PlatformClient = class {
|
|
304
343
|
baseUrl;
|
|
305
344
|
authHeaders;
|
|
345
|
+
cliLog;
|
|
306
346
|
constructor(token, options) {
|
|
307
347
|
if (typeof options === "string") this.baseUrl = options;
|
|
308
|
-
else
|
|
348
|
+
else {
|
|
349
|
+
this.baseUrl = options?.apiUrl ?? getApiUrl(options?.root);
|
|
350
|
+
this.cliLog = options?.cliLog;
|
|
351
|
+
}
|
|
309
352
|
ensureCloudflaredToken(this.baseUrl);
|
|
310
353
|
this.authHeaders = {
|
|
311
354
|
Authorization: `Bearer ${token}`,
|
|
355
|
+
...VOID_CLI_VERSION !== null && { "X-Void-CLI-Version": VOID_CLI_VERSION },
|
|
312
356
|
...cfAccessHeaders(process.env)
|
|
313
357
|
};
|
|
314
358
|
}
|
|
@@ -394,26 +438,125 @@ var PlatformClient = class {
|
|
|
394
438
|
};
|
|
395
439
|
}
|
|
396
440
|
}
|
|
397
|
-
|
|
398
|
-
|
|
441
|
+
/**
|
|
442
|
+
* Request presigned R2 PUT URLs for a batch of assets. Each entry carries
|
|
443
|
+
* both `blake3` (storage key) and `md5` (wire-level integrity primitive)
|
|
444
|
+
* so the platform can sign a PUT URL that R2 enforces against the bytes
|
|
445
|
+
* the CLI is about to upload. See design doc 0068 for the full protocol.
|
|
446
|
+
*/
|
|
447
|
+
async requestUploadUrls(projectId, assets) {
|
|
448
|
+
const url = `${this.baseUrl}/projects/${projectId}/deploy/upload-urls`;
|
|
449
|
+
this.cliLog?.info("upload_urls_post", {
|
|
450
|
+
url,
|
|
451
|
+
assetCount: assets.length
|
|
452
|
+
});
|
|
453
|
+
const res = await fetch(url, {
|
|
454
|
+
method: "POST",
|
|
455
|
+
headers: {
|
|
456
|
+
"Content-Type": "application/json",
|
|
457
|
+
...this.authHeaders
|
|
458
|
+
},
|
|
459
|
+
body: JSON.stringify({ assets })
|
|
460
|
+
});
|
|
461
|
+
const cfRay = res.headers.get("cf-ray");
|
|
462
|
+
const cfCacheStatus = res.headers.get("cf-cache-status");
|
|
463
|
+
this.cliLog?.info("upload_urls_response", {
|
|
464
|
+
status: res.status,
|
|
465
|
+
cfRay,
|
|
466
|
+
cfCacheStatus
|
|
467
|
+
});
|
|
468
|
+
if (!res.ok) await throwPlatformApiError("Failed to request upload URLs", res);
|
|
469
|
+
return (await res.json()).urls;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Manifest-only (direct-to-R2) deploy. POSTs a JSON body containing the
|
|
473
|
+
* deploy manifest, asset manifest (no asset bytes), and any worker module
|
|
474
|
+
* bytes (base64-encoded). Streams an NDJSON response that the caller can
|
|
475
|
+
* apply with the existing `applyDeployEvent` machinery.
|
|
476
|
+
*/
|
|
477
|
+
async *finalizeDeploy(projectId, payload) {
|
|
478
|
+
const url = `${this.baseUrl}/projects/${projectId}/deploy`;
|
|
479
|
+
yield* this.streamDeployRequest(url, {
|
|
399
480
|
method: "POST",
|
|
400
|
-
headers: {
|
|
401
|
-
|
|
481
|
+
headers: {
|
|
482
|
+
"Content-Type": "application/json",
|
|
483
|
+
...this.authHeaders
|
|
484
|
+
},
|
|
485
|
+
body: JSON.stringify(payload)
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* POST + NDJSON-stream-reader used by `finalizeDeploy()`. Captures
|
|
490
|
+
* `cf-ray` + `cf-cache-status` for postmortem correlation.
|
|
491
|
+
*/
|
|
492
|
+
async *streamDeployRequest(url, init) {
|
|
493
|
+
const cliLog = this.cliLog;
|
|
494
|
+
cliLog?.info("deploy_post", { url });
|
|
495
|
+
let res;
|
|
496
|
+
try {
|
|
497
|
+
res = await fetch(url, init);
|
|
498
|
+
} catch (err) {
|
|
499
|
+
cliLog?.error("deploy_fetch_rejected", err, { url });
|
|
500
|
+
throw err;
|
|
501
|
+
}
|
|
502
|
+
const cfRay = res.headers.get("cf-ray");
|
|
503
|
+
const cfCacheStatus = res.headers.get("cf-cache-status");
|
|
504
|
+
cliLog?.info("deploy_response", {
|
|
505
|
+
status: res.status,
|
|
506
|
+
cfRay,
|
|
507
|
+
cfCacheStatus,
|
|
508
|
+
contentType: res.headers.get("content-type")
|
|
402
509
|
});
|
|
403
510
|
if (!res.ok) await throwPlatformApiError("Deploy failed", res);
|
|
404
511
|
const reader = res.body.getReader();
|
|
405
512
|
const decoder = new TextDecoder();
|
|
406
513
|
let buffer = "";
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (
|
|
514
|
+
let bytesRead = 0;
|
|
515
|
+
let firstByteAt = null;
|
|
516
|
+
const startedAt = Date.now();
|
|
517
|
+
let eventCount = 0;
|
|
518
|
+
let lastEventName = "<none>";
|
|
519
|
+
try {
|
|
520
|
+
while (true) {
|
|
521
|
+
const { done, value } = await reader.read();
|
|
522
|
+
if (done) {
|
|
523
|
+
cliLog?.info("deploy_stream_eof", {
|
|
524
|
+
bytesRead,
|
|
525
|
+
eventCount,
|
|
526
|
+
lastEvent: lastEventName
|
|
527
|
+
});
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
if (firstByteAt === null) {
|
|
531
|
+
firstByteAt = Date.now() - startedAt;
|
|
532
|
+
cliLog?.info("deploy_stream_ttfb", { ttfbMs: firstByteAt });
|
|
533
|
+
}
|
|
534
|
+
bytesRead += value.byteLength;
|
|
535
|
+
buffer += decoder.decode(value, { stream: true });
|
|
536
|
+
let newlineIdx;
|
|
537
|
+
while ((newlineIdx = buffer.indexOf("\n")) !== -1) {
|
|
538
|
+
const line = buffer.slice(0, newlineIdx);
|
|
539
|
+
buffer = buffer.slice(newlineIdx + 1);
|
|
540
|
+
if (line.trim()) {
|
|
541
|
+
const event = JSON.parse(line);
|
|
542
|
+
eventCount++;
|
|
543
|
+
lastEventName = event.event ?? "<no-event-field>";
|
|
544
|
+
cliLog?.info("deploy_event", {
|
|
545
|
+
eventCount,
|
|
546
|
+
event: lastEventName,
|
|
547
|
+
raw: line.slice(0, 200)
|
|
548
|
+
});
|
|
549
|
+
yield event;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
416
552
|
}
|
|
553
|
+
} catch (err) {
|
|
554
|
+
cliLog?.error("deploy_stream_error", err, {
|
|
555
|
+
bytesRead,
|
|
556
|
+
eventCount,
|
|
557
|
+
lastEvent: lastEventName
|
|
558
|
+
});
|
|
559
|
+
throw err;
|
|
417
560
|
}
|
|
418
561
|
}
|
|
419
562
|
async listSecrets(projectId) {
|
|
@@ -562,4 +705,4 @@ var PlatformClient = class {
|
|
|
562
705
|
}
|
|
563
706
|
};
|
|
564
707
|
//#endregion
|
|
565
|
-
export {
|
|
708
|
+
export { isExpiredTokenError as a, getToken as c, removeToken as d, runLogin as f, isCliOutdatedError as i, getTokenSource as l, PlatformClient as n, parsePlatformErrorBody as o, saveToken as p, client_exports as r, getSiteDomain as s, PlatformApiError as t, isStagingMode as u };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as import_picocolors } from "./output-BwlcIYSR.mjs";
|
|
2
2
|
import { _ as me, c as R, i as Ee, l as Re, x as q } from "./dist-Dayj3gCK.mjs";
|
|
3
3
|
import { a as writeProjectConfig } from "./project-TqORyHn8.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { n as validateProjectSlug } from "./project-slug-
|
|
6
|
-
import { n as inferDefaultSlug } from "./resolve-project-
|
|
4
|
+
import { s as getSiteDomain, t as PlatformApiError } from "./client-DCqnMpDt.mjs";
|
|
5
|
+
import { n as validateProjectSlug } from "./project-slug-KRvHQEQI.mjs";
|
|
6
|
+
import { n as inferDefaultSlug } from "./resolve-project-DdjLQ2tB.mjs";
|
|
7
7
|
//#region src/cli/prompt.ts
|
|
8
8
|
async function promptProjectSetupAction(message = "Set up a Void project:", options = {}) {
|
|
9
9
|
const result = await Ee({
|
|
@@ -2,12 +2,12 @@ import { a as join, o as relative, r as extname, s as resolve } from "./pathe.M-
|
|
|
2
2
|
import { i as dim, n as cliTitle, s as import_picocolors } from "./output-BwlcIYSR.mjs";
|
|
3
3
|
import { c as R, g as ge, y as ye } from "./dist-Dayj3gCK.mjs";
|
|
4
4
|
import { r as readProjectConfig } from "./project-TqORyHn8.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { c as getToken, n as PlatformClient } from "./client-DCqnMpDt.mjs";
|
|
6
6
|
import { c as getDatabaseDialect, f as readConfig } from "./config-BIa9HwVX.mjs";
|
|
7
7
|
import { n as detectFramework } from "./plugin-inference-oZ6Ybu2_.mjs";
|
|
8
8
|
import { a as writeJournal, i as stripSqlExt, r as readJournal, t as collectMigrations } from "./collect-CjeZgz5D.mjs";
|
|
9
9
|
import { n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence } from "./validate-CaMavMxu.mjs";
|
|
10
|
-
import { formatTimestamp } from "./gen-
|
|
10
|
+
import { formatTimestamp } from "./gen-C0EY2k27.mjs";
|
|
11
11
|
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
13
13
|
import { execFileSync } from "node:child_process";
|
|
@@ -100,7 +100,7 @@ async function runPush(root, dialect) {
|
|
|
100
100
|
else {
|
|
101
101
|
const { mkdirSync } = await import("node:fs");
|
|
102
102
|
const { dirname } = await import("node:path");
|
|
103
|
-
const { getMiniflareDatabasePath } = await import("./runner-
|
|
103
|
+
const { getMiniflareDatabasePath } = await import("./runner-BUPRnMFN.mjs");
|
|
104
104
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
105
105
|
mkdirSync(dirname(dbPath), { recursive: true });
|
|
106
106
|
configPath = writeDrizzleConfig(root, dbPath);
|
|
@@ -157,7 +157,7 @@ async function runStatus(root, dialect) {
|
|
|
157
157
|
localApplied = [];
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
160
|
-
const { getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-
|
|
160
|
+
const { getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-BUPRnMFN.mjs");
|
|
161
161
|
localApplied = await getAppliedMigrations(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
|
|
162
162
|
}
|
|
163
163
|
const localSet = new Set(localApplied.map((m) => m.name));
|
|
@@ -215,7 +215,7 @@ async function resetDatabase(root, dialect) {
|
|
|
215
215
|
});
|
|
216
216
|
return migrations.length;
|
|
217
217
|
}
|
|
218
|
-
const { getMiniflareDatabasePath, runMigrations } = await import("./runner-
|
|
218
|
+
const { getMiniflareDatabasePath, runMigrations } = await import("./runner-BUPRnMFN.mjs");
|
|
219
219
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
220
220
|
rmSync(dbPath, { force: true });
|
|
221
221
|
rmSync(dbPath + "-wal", { force: true });
|
|
@@ -242,7 +242,7 @@ async function runSeed(root, file, dialect) {
|
|
|
242
242
|
ye("Done.");
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
245
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
245
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BUPRnMFN.mjs");
|
|
246
246
|
const db = await openSqliteDatabase(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
|
|
247
247
|
try {
|
|
248
248
|
db.exec(sql);
|
|
@@ -265,7 +265,7 @@ async function runExecute(root, command, file, dialect) {
|
|
|
265
265
|
ye("Done.");
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
268
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BUPRnMFN.mjs");
|
|
269
269
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
270
270
|
if (!existsSync(dbPath)) {
|
|
271
271
|
R.error("No local database found. Run `void dev` first.");
|
|
@@ -362,7 +362,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
364
|
if (dialect === "postgresql") {
|
|
365
|
-
const { applyPgMigrations } = await import("./runner-pg-
|
|
365
|
+
const { applyPgMigrations } = await import("./runner-pg-BI6f6Ncm.mjs");
|
|
366
366
|
const applied = await withPgClient(root, async (client) => {
|
|
367
367
|
let existingRows = [];
|
|
368
368
|
try {
|
|
@@ -386,7 +386,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
386
386
|
ye("Done.");
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
|
-
const { getMiniflareDatabasePath, getAppliedMigrations, runMigrations } = await import("./runner-
|
|
389
|
+
const { getMiniflareDatabasePath, getAppliedMigrations, runMigrations } = await import("./runner-BUPRnMFN.mjs");
|
|
390
390
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
391
391
|
try {
|
|
392
392
|
const existingRows = await getAppliedMigrations(dbPath);
|
|
@@ -421,7 +421,7 @@ async function runStudio(root, dialect) {
|
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
423
|
const { writeDrizzleConfig } = await import("./config-BzM9Dy7T.mjs").then((n) => n.t);
|
|
424
|
-
const { getMiniflareDatabasePath } = await import("./runner-
|
|
424
|
+
const { getMiniflareDatabasePath } = await import("./runner-BUPRnMFN.mjs");
|
|
425
425
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
426
426
|
if (!existsSync(dbPath)) {
|
|
427
427
|
R.error("No local database found. Run `void dev` first.");
|
|
@@ -637,7 +637,7 @@ async function runRenameMigrations(root, dialect) {
|
|
|
637
637
|
process.exit(1);
|
|
638
638
|
}
|
|
639
639
|
else {
|
|
640
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
640
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BUPRnMFN.mjs");
|
|
641
641
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
642
642
|
if (existsSync(dbPath)) try {
|
|
643
643
|
const db = await openSqliteDatabase(dbPath);
|
|
@@ -715,7 +715,7 @@ async function runExport(root, args, dialect) {
|
|
|
715
715
|
} else process.stdout.write(output);
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
718
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BUPRnMFN.mjs");
|
|
719
719
|
const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
|
|
720
720
|
if (!existsSync(dbPath)) {
|
|
721
721
|
R.error("No local database found. Run `void dev` first.");
|
|
@@ -842,7 +842,7 @@ async function runSeedModule(root, seedPath, dialect) {
|
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
844
|
const { drizzle } = await import("drizzle-orm/better-sqlite3");
|
|
845
|
-
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-
|
|
845
|
+
const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-BUPRnMFN.mjs");
|
|
846
846
|
const sqlite = await openSqliteDatabase(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
|
|
847
847
|
try {
|
|
848
848
|
const options = getDrizzleSchemaOptions(schema);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as cliTitle, r as createSpinner } from "./output-BwlcIYSR.mjs";
|
|
2
2
|
import { _ as me, c as R, g as ge, l as Re, u as Se, x as q, y as ye } from "./dist-Dayj3gCK.mjs";
|
|
3
3
|
import { i as removeProjectConfig, r as readProjectConfig } from "./project-TqORyHn8.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as resolveProjectBySlug } from "./resolve-project-
|
|
4
|
+
import { c as getToken, n as PlatformClient } from "./client-DCqnMpDt.mjs";
|
|
5
|
+
import { r as resolveProjectBySlug } from "./resolve-project-DdjLQ2tB.mjs";
|
|
6
6
|
//#region src/cli/delete.ts
|
|
7
7
|
async function runDeleteCommand(root, slug, options) {
|
|
8
8
|
console.log();
|