void 0.24.0 → 0.25.0
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 +19 -106
- package/dist/{account-cmd-vJhh5lrb.mjs → account-cmd-DcR1ywt8.mjs} +5 -5
- package/dist/{auth-CQkSDS50.mjs → auth-7wuZ5ob8.mjs} +3 -3
- package/dist/{auth-DX3JURcX.mjs → auth-CdgZ9uag.mjs} +1 -1
- package/dist/{auth-link-D75t9wO2.mjs → auth-link-Z6E5DYvM.mjs} +5 -6
- package/dist/{auth-router-ClfhL1J7.mjs → auth-router-BdM4avI8.mjs} +7 -7
- package/dist/{build-cmd-zMi1iFnS.mjs → build-cmd-CEE7D-hM.mjs} +6 -7
- package/dist/{cache-ZtQmyxVV.mjs → cache-TcZnBLtH.mjs} +6 -7
- package/dist/{cancel-deploy-Box0kkEV.mjs → cancel-deploy-CYoZmcmR.mjs} +4 -6
- package/dist/{cf-access-BGe5sWXF.mjs → cf-access-AHKBzmuu.mjs} +1 -1
- package/dist/cf-build-output-ChY6-XWP.mjs +2 -0
- package/dist/cli/cli.mjs +45 -45
- package/dist/cli/cloudflare-operation-process.mjs +2 -2
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/client-B4Me-9HE.mjs +2 -0
- package/dist/{client-DKAsFA4X.mjs → client-RsPo8wsP.mjs} +103 -25
- package/dist/{cloudflare-cmd-CmY8dGkd.mjs → cloudflare-cmd-bhwCxAN6.mjs} +2 -2
- package/dist/{cloudflare-connect-IiR3ZieC.mjs → cloudflare-connect-CuhRgk3k.mjs} +2 -2
- package/dist/{cloudflare-operations-BCdXSsmo.mjs → cloudflare-operations-BhbK6yTq.mjs} +1 -1
- package/dist/{cloudflare-operations-DzH-A966.mjs → cloudflare-operations-CjaV4lZi.mjs} +2 -2
- package/dist/{connect-B-usTnlF.mjs → connect-DCvUmPXY.mjs} +12 -9
- package/dist/{create-project-FWbf5Olo.mjs → create-project-C734I-Mu.mjs} +1 -1
- package/dist/{create-project-CYOOAYcn.mjs → create-project-eAPgYq35.mjs} +6 -6
- package/dist/{db-Ck2eZ2iB.mjs → db-C07GEdKF.mjs} +25 -28
- package/dist/{delete-sK56qtzZ.mjs → delete-pKMVsrpJ.mjs} +5 -6
- package/dist/deploy-BDu1vhSH.mjs +2 -0
- package/dist/{deploy-gCVaiJbS.mjs → deploy-DfsAe-T0.mjs} +9212 -8902
- package/dist/{dev-inbox-P0u4tM8Y.mjs → dev-inbox-D64ZKUod.mjs} +5 -6
- package/dist/{domain-DFfQE8jg.mjs → domain-D3uA9ize.mjs} +8 -8
- package/dist/{email-CdnhUHvJ.mjs → email-z3o2cwjH.mjs} +7 -7
- package/dist/{env-DmGdHi5i.mjs → env-3Q8-_2IH.mjs} +6 -8
- package/dist/{env-validation-zZOCcQVZ.mjs → env-validation-cZBvGWaP.mjs} +1 -1
- package/dist/gen-ById9r2j.mjs +2 -0
- package/dist/{gen-CshAkukR.mjs → gen-NjwoG9FK.mjs} +2 -4
- package/dist/{github-cmd-DftuEvIt.mjs → github-cmd-DquUq-b1.mjs} +7 -16
- package/dist/help-DPGBwomV.mjs +2 -0
- package/dist/{help-Dotbf6iz.mjs → help-DRZXC4fj.mjs} +3 -3
- package/dist/index.d.mts +18 -14
- package/dist/index.mjs +2166 -2096
- package/dist/{info-B97bTX9N.mjs → info-BmA3_IFZ.mjs} +1 -3
- package/dist/{init-BTQEZZGJ.mjs → init-DT7yuuyl.mjs} +16 -18
- package/dist/{link-B46sYH0K.mjs → link-CXOlqh2F.mjs} +6 -7
- package/dist/{list-BnPrIsU_.mjs → list-eEWVJEPn.mjs} +8 -9
- package/dist/{local-d1-2CMnpuW_.mjs → local-d1-Df4XpwhW.mjs} +1 -1
- package/dist/login-C98-sw79.mjs +2 -0
- package/dist/{login-BuiMyUrx.mjs → login-pWQHYVu2.mjs} +9 -7
- package/dist/{logs-CZG9d-ic.mjs → logs-DnxVX7TR.mjs} +7 -8
- package/dist/migrate-CEu2X5DB.mjs +2 -0
- package/dist/{migrate-q4_njtaW.mjs → migrate-CV1on-yJ.mjs} +2 -4
- package/dist/{operator-args-B3BTmSoi.mjs → operator-args-CAVcmwUt.mjs} +1 -1
- package/dist/{operator-auth-7erYc6Lt.mjs → operator-auth-CkmTE3rt.mjs} +2 -2
- package/dist/{operator-client-CpHjTd0t.mjs → operator-client-LmwjxT6q.mjs} +2 -2
- package/dist/{operator-cmd-DGqPJUD3.mjs → operator-cmd-d-IEKgNk.mjs} +6 -6
- package/dist/{output-CbM85T4k.mjs → output-BBsUwdyT.mjs} +5 -5
- package/dist/pages/client.d.mts +3 -0
- package/dist/pages/client.mjs +120 -29
- package/dist/{platform-args-3k8X9-H_.mjs → platform-args-Bzf8JPc2.mjs} +1 -1
- package/dist/platform-args-Cq6EjQro.mjs +2 -0
- package/dist/{platform-auth-config-DDrxUy4m.mjs → platform-auth-config-0V0lA3pF.mjs} +7 -7
- package/dist/{platform-auth-protection-BLadnnct.mjs → platform-auth-protection-DFeJ-JkK.mjs} +8 -8
- package/dist/{platform-auth-recovery-CmCzX2Fl.mjs → platform-auth-recovery-ICy4muq6.mjs} +7 -7
- package/dist/{platform-cmd-pMTRhvYs.mjs → platform-cmd-BPySFOew.mjs} +1 -1
- package/dist/{platform-cmd-DMDEc9uS.mjs → platform-cmd-D7vSWMvV.mjs} +37 -27
- package/dist/platform-discovery-DDDUvnqp.mjs +27 -0
- package/dist/{platform-domain-Di6EYrQl.mjs → platform-domain-CUdY064e.mjs} +4 -4
- package/dist/{platform-lifecycle-BFdSi9Qt.mjs → platform-lifecycle-BaUdTRPU.mjs} +1 -1
- package/dist/{platform-lifecycle-BBoNzojY.mjs → platform-lifecycle-Dm09JNkn.mjs} +3901 -3651
- package/dist/{platform-management-CWOQOWXm.mjs → platform-management-BSEc_ZeG.mjs} +47 -10
- package/dist/platform-management-Bp6aoH2C.mjs +2 -0
- package/dist/{platform-plans-config-Vl9BP3H4.mjs → platform-plans-config-B0pOVQyW.mjs} +3 -3
- package/dist/{platform-recovery-BJnQJEtQ.mjs → platform-recovery-WOZ95Uze.mjs} +3 -3
- package/dist/{prepare-CBLT3CHH.mjs → prepare-39EvOhI6.mjs} +1 -3
- package/dist/{project-DKG5Ra8p.mjs → project-BkbfDs0V.mjs} +1 -1
- package/dist/{project-DsblYifa.mjs → project-IOjBU8R6.mjs} +1 -1
- package/dist/{project-cmd-DxnXstAq.mjs → project-cmd-Bs5A392E.mjs} +21 -22
- package/dist/{project-team-BmHcaALJ.mjs → project-team-ohAWWaew.mjs} +8 -9
- package/dist/{project-token-GionZlBI.mjs → project-token-CP01Jna6.mjs} +6 -9
- package/dist/{project-zero-trust-JLCjVQA7.mjs → project-zero-trust-BzkVgx35.mjs} +5 -6
- package/dist/{prompts-BNUoTiaf.mjs → prompts-6OSVA7DJ.mjs} +58 -15
- package/dist/{prompts-2TGE6oXx.mjs → prompts-ZAuJlyCj.mjs} +1 -1
- package/dist/{provision-CVku1JFU.mjs → provision-BEv0k-qz.mjs} +1 -1
- package/dist/{provision-CaoxO_U7.mjs → provision-Btj1jppf.mjs} +5 -7
- package/dist/{requests-BOjIVAeF.mjs → requests-B3PBuGlX.mjs} +5 -6
- package/dist/{rollback-CwR3pLj3.mjs → rollback-DDub9GsO.mjs} +9 -10
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/email.mjs +35 -17
- package/dist/runtime/routing.mjs +1 -1
- package/dist/{secret-ByWJWBUG.mjs → secret-3c72lY1U.mjs} +15 -16
- package/dist/{skills-C1PlclPt.mjs → skills-BPQUGClu.mjs} +1 -1
- package/dist/{subcommand-prompt-klFCfcor.mjs → subcommand-prompt-Dhom39bd.mjs} +2 -2
- package/dist/sveltekit.d.mts +1 -1
- package/dist/sveltekit.mjs +4 -9
- package/dist/{wrangler-7K-bW_DL.mjs → wrangler-DhUerFkW.mjs} +10 -15
- package/package.json +21 -21
- package/sandbox.Dockerfile +1 -1
- package/skills/void/docs/guide/ai.md +24 -86
- package/skills/void/docs/guide/auth.md +0 -2
- package/skills/void/docs/guide/database/d1.md +7 -7
- package/skills/void/docs/guide/deployment.md +58 -124
- package/skills/void/docs/guide/env-vars.md +1 -5
- package/skills/void/docs/guide/index.md +19 -18
- package/skills/void/docs/guide/kv.md +0 -2
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +49 -47
- package/skills/void/docs/guide/pages-routing/overview.md +2 -2
- package/skills/void/docs/guide/platform/administration/email.md +0 -2
- package/skills/void/docs/guide/platform/administration/operations.md +11 -22
- package/skills/void/docs/guide/platform/administration/plans.md +1 -5
- package/skills/void/docs/guide/platform/administration/zero-trust.md +1 -4
- package/skills/void/docs/guide/platform/development/schema-ci.md +7 -1
- package/skills/void/docs/guide/platform/installation/maintenance.md +30 -10
- package/skills/void/docs/guide/platform/installation/prerequisites.md +79 -7
- package/skills/void/docs/guide/quickstart.md +37 -80
- package/skills/void/docs/guide/sandboxes.md +36 -46
- package/skills/void/docs/guide/self-hosted-platform.md +20 -0
- package/skills/void/docs/guide/websockets.md +0 -2
- package/skills/void/docs/integrations/frameworks/overview.md +2 -2
- package/skills/void/docs/integrations/frameworks/sveltekit.md +40 -25
- package/skills/void/docs/integrations/nodejs-bun-deno.md +7 -2
- package/skills/void/docs/reference/api/resources.md +27 -0
- package/skills/void/docs/reference/api.md +1 -1
- package/skills/void/docs/reference/cli/deploy.md +1 -1
- package/skills/void/docs/reference/cli/platform-operations.md +4 -8
- package/skills/void/docs/reference/cli/platform.md +5 -0
- package/skills/void/docs/reference/resource-inference.md +11 -8
- package/dist/cf-build-output-_0HNWysu.mjs +0 -2
- package/dist/client-B9UBI03V.mjs +0 -2
- package/dist/deploy-irP5q0-x.mjs +0 -2
- package/dist/gen-DvQTWzDU.mjs +0 -2
- package/dist/help-mabuIV98.mjs +0 -2
- package/dist/login-DIy9Sb-U.mjs +0 -2
- package/dist/migrate-BCiJ8w0f.mjs +0 -2
- package/dist/platform-args-DdnM6WIf.mjs +0 -2
- package/dist/platform-management-DG47jys8.mjs +0 -2
- package/skills/void/docs/guide/env-migration.md +0 -109
- package/dist/{cf-build-output-BPqOT964.mjs → cf-build-output-U8o1Gl6X.mjs} +1 -1
- package/dist/{env-validation-C_8tPdhs.mjs → env-validation-vBSQ8gw5.mjs} +1 -1
- package/dist/{platform-registry-DkPPXfp_.mjs → platform-registry-KfNEF84O.mjs} +1 -1
|
@@ -4,10 +4,8 @@ import { m as readConfig } from "./config-Br_JZD6u.mjs";
|
|
|
4
4
|
import { a as inferDurableResourceName, i as deriveDurableResourceIdentity, t as analyzeApplicationSync } from "./application-analysis-BVsVqc11.mjs";
|
|
5
5
|
import { n as VOID_LOCK_FILE } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
+
import { isRecord } from "@void/deploy-core";
|
|
7
8
|
//#region src/cli/info.ts
|
|
8
|
-
function isRecord(value) {
|
|
9
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10
|
-
}
|
|
11
9
|
function readRecordedResources(root, resources) {
|
|
12
10
|
const path = join(root, VOID_LOCK_FILE);
|
|
13
11
|
if (!existsSync(path)) return [];
|
|
@@ -2,33 +2,32 @@ import { a as join, i as isAbsolute, l as relative, n as dirname, t as basename,
|
|
|
2
2
|
import { r as detectFramework } from "./plugin-inference-CXWnn79A.mjs";
|
|
3
3
|
import { n as readProjectPaths, o as TYPED_CONFIG_FILE } from "./project-paths-GgcMozYz.mjs";
|
|
4
4
|
import { m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
5
|
-
import { l as writeProjectConfig, n as readDeploymentPlatform, r as readProjectConfig, s as writeDeploymentPlatform, t as attachSelectedPlatform } from "./project-
|
|
6
|
-
import { c as getToken } from "./auth-CQkSDS50.mjs";
|
|
5
|
+
import { l as writeProjectConfig, n as readDeploymentPlatform, r as readProjectConfig, s as writeDeploymentPlatform, t as attachSelectedPlatform } from "./project-BkbfDs0V.mjs";
|
|
7
6
|
import { r as materializeCloudflareConfig } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
8
|
-
import { A as writeProvisionedWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE } from "./wrangler-
|
|
9
|
-
import {
|
|
7
|
+
import { A as writeProvisionedWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE } from "./wrangler-DhUerFkW.mjs";
|
|
8
|
+
import { c as getToken } from "./auth-7wuZ5ob8.mjs";
|
|
10
9
|
import { n as parseDotenvFile, t as expandDotenv } from "./dotenv-VQxupEUv.mjs";
|
|
10
|
+
import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-B8GeM0RM.mjs";
|
|
11
11
|
import { t as MagicString } from "./dist-AoCzRTJE.mjs";
|
|
12
|
-
import { A as confirm, B as note, H as outro, K as select, L as log,
|
|
13
|
-
import { t as writeDrizzleConfig } from "./config-D8MOgiQV.mjs";
|
|
12
|
+
import { A as confirm, B as note, H as outro, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
14
13
|
import { n as getPackageDir, t as detectAgents } from "./agents-B_pX_HmQ.mjs";
|
|
15
|
-
import {
|
|
14
|
+
import { r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
15
|
+
import { i as migrateFrameworkAdapterPaths, t as migrateLegacyVoidConfig } from "./migrate-CV1on-yJ.mjs";
|
|
16
16
|
import { o as formatProjectCommand } from "./cloudflare-process-B-wekeR6.mjs";
|
|
17
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-eAPgYq35.mjs";
|
|
18
|
+
import { t as writeDrizzleConfig } from "./config-D8MOgiQV.mjs";
|
|
17
19
|
import { n as writeVoidProjectConfig, t as canRewriteVoidProjectConfig } from "./config-write-B1f88wJA.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { t as promptForLoginToken } from "./login-BuiMyUrx.mjs";
|
|
22
|
-
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-DMDEc9uS.mjs";
|
|
23
|
-
import { t as connectCloudflare } from "./cloudflare-connect-IiR3ZieC.mjs";
|
|
20
|
+
import { t as promptForLoginToken } from "./login-pWQHYVu2.mjs";
|
|
21
|
+
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-D7vSWMvV.mjs";
|
|
22
|
+
import { t as connectCloudflare } from "./cloudflare-connect-CuhRgk3k.mjs";
|
|
24
23
|
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-BV4AzNul.mjs";
|
|
25
24
|
import { createRequire } from "node:module";
|
|
26
25
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
27
26
|
import { fileURLToPath } from "node:url";
|
|
28
27
|
import { parseSync } from "vite";
|
|
29
|
-
import { spawnSync } from "node:child_process";
|
|
30
28
|
import { parse } from "jsonc-parser";
|
|
31
29
|
import { parseArgs } from "node:util";
|
|
30
|
+
import { spawnSync } from "node:child_process";
|
|
32
31
|
//#region src/cli/deploy-setup.ts
|
|
33
32
|
async function ensureToken(root) {
|
|
34
33
|
const existing = getToken(root);
|
|
@@ -1933,7 +1932,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1933
1932
|
let selectedApiUrl = null;
|
|
1934
1933
|
let promptedForPlatform = false;
|
|
1935
1934
|
try {
|
|
1936
|
-
const { getApiUrl, getSiteDomain } = await import("./auth-
|
|
1935
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-CdgZ9uag.mjs");
|
|
1937
1936
|
selectedApiUrl = getApiUrl(root);
|
|
1938
1937
|
getSiteDomain(root);
|
|
1939
1938
|
} catch (error) {
|
|
@@ -2611,7 +2610,6 @@ function injectAgentBlock(root) {
|
|
|
2611
2610
|
}
|
|
2612
2611
|
async function runInitCommand(root, initArgs) {
|
|
2613
2612
|
console.log();
|
|
2614
|
-
intro(cliTitle("init"));
|
|
2615
2613
|
const targeted = Boolean(initArgs && (initArgs.tsconfig || initArgs.github || initArgs.agents));
|
|
2616
2614
|
if (!targeted) root = await resolveInitRoot(root);
|
|
2617
2615
|
const hadTypedConfig = existsSync(join(root, TYPED_CONFIG_FILE));
|
|
@@ -2680,7 +2678,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2680
2678
|
injectAgentBlock(root);
|
|
2681
2679
|
const agents = detectAgents(root);
|
|
2682
2680
|
if (agents.length > 0) {
|
|
2683
|
-
const { linkSkillsForSpecificAgents } = await import("./skills-
|
|
2681
|
+
const { linkSkillsForSpecificAgents } = await import("./skills-BPQUGClu.mjs");
|
|
2684
2682
|
linkSkillsForSpecificAgents(root, agents);
|
|
2685
2683
|
} else log.info("No coding agent detected; read the bundled docs linked in AGENTS.md");
|
|
2686
2684
|
}
|
|
@@ -2714,7 +2712,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2714
2712
|
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2715
2713
|
if (shouldSetupGithub && !githubStepSkipForSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2716
2714
|
if (!voidPlatformDiscovery) {
|
|
2717
|
-
const { getApiUrl } = await import("./auth-
|
|
2715
|
+
const { getApiUrl } = await import("./auth-CdgZ9uag.mjs");
|
|
2718
2716
|
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2719
2717
|
}
|
|
2720
2718
|
if (!voidPlatformDiscovery.capabilities.githubActions) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { l as writeProjectConfig, r as readProjectConfig, t as attachSelectedPlatform } from "./project-
|
|
2
|
-
import { c as getToken, s as getSiteDomain } from "./auth-
|
|
3
|
-
import { H as outro, L as log,
|
|
4
|
-
import {
|
|
5
|
-
import { c as import_picocolors
|
|
6
|
-
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-
|
|
1
|
+
import { l as writeProjectConfig, r as readProjectConfig, t as attachSelectedPlatform } from "./project-BkbfDs0V.mjs";
|
|
2
|
+
import { c as getToken, s as getSiteDomain } from "./auth-7wuZ5ob8.mjs";
|
|
3
|
+
import { H as outro, L as log, O as cancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
+
import { r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
5
|
+
import { c as import_picocolors } from "./output-BBsUwdyT.mjs";
|
|
6
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-eAPgYq35.mjs";
|
|
7
7
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
8
8
|
//#region src/cli/link.ts
|
|
9
9
|
function projectLabel(slug, root, url) {
|
|
@@ -13,7 +13,6 @@ function projectLabel(slug, root, url) {
|
|
|
13
13
|
}
|
|
14
14
|
async function runLink(root, slug) {
|
|
15
15
|
console.log();
|
|
16
|
-
intro(cliTitle("project link"));
|
|
17
16
|
const existing = readProjectConfig(root);
|
|
18
17
|
if (existing) {
|
|
19
18
|
log.warn(`Already linked to ${projectLabel(existing.slug, root)}`);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
3
|
-
import { H as outro, L as log
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
1
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-BkbfDs0V.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-7wuZ5ob8.mjs";
|
|
3
|
+
import { H as outro, L as log } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
+
import { r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
5
|
+
import { a as ensureUtc, c as import_picocolors, d as tablePrefix, i as dim, o as formatCount } from "./output-BBsUwdyT.mjs";
|
|
6
6
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
7
7
|
//#region src/cli/list.ts
|
|
8
8
|
async function runListCommand(root, slug) {
|
|
9
9
|
console.log();
|
|
10
|
-
intro(cliTitle("project status"));
|
|
11
10
|
const platform = readDeploymentPlatform(root);
|
|
12
11
|
if (platform === "cloudflare") return showCloudflareDeployments(root, slug);
|
|
13
12
|
if (platform === "none") throw new Error("project: Deployment is disabled. Run `void init` to choose a platform.");
|
|
@@ -43,7 +42,7 @@ async function runListCommand(root, slug) {
|
|
|
43
42
|
}
|
|
44
43
|
async function showCloudflareDeployments(root, slug) {
|
|
45
44
|
if (slug) throw new Error("project: A project name selects a Void platform project and is not used for direct Cloudflare apps.");
|
|
46
|
-
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
45
|
+
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-BhbK6yTq.mjs");
|
|
47
46
|
const status = await readCloudflareWorkerStatus(resolveCloudflareOperationContext(root));
|
|
48
47
|
if (status.versions.length === 0) {
|
|
49
48
|
outro(`No deployments for ${status.workerName}.`);
|
|
@@ -64,7 +63,7 @@ async function showCloudflareDeployments(root, slug) {
|
|
|
64
63
|
const renderedStatus = row.status === "live" ? import_picocolors.default.bold(import_picocolors.default.green(row.status)) : dim(row.status);
|
|
65
64
|
console.log(`${prefix}${row.id.padEnd(idWidth)} ${renderedStatus}${"".padEnd(statusWidth - row.status.length)} ${row.migrations.padEnd(10)} ${row.deployed}`);
|
|
66
65
|
}
|
|
67
|
-
outro(`${status.workerName} — ${rows.length
|
|
66
|
+
outro(`${status.workerName} — ${formatCount(rows.length, "version")}`);
|
|
68
67
|
}
|
|
69
68
|
async function showDeployments(client, projectId, slug) {
|
|
70
69
|
const { deployments, activeDeploymentId } = await client.listDeployments(projectId);
|
|
@@ -87,7 +86,7 @@ async function showDeployments(client, projectId, slug) {
|
|
|
87
86
|
console.log(prefix);
|
|
88
87
|
console.log(header);
|
|
89
88
|
for (const line of lines) console.log(line);
|
|
90
|
-
outro(`${slug} — ${deployments.length
|
|
89
|
+
outro(`${slug} — ${formatCount(deployments.length, "deployment")}`);
|
|
91
90
|
}
|
|
92
91
|
function computeDisplayStatus(d, activeDeploymentId) {
|
|
93
92
|
if (d.status === "failed") return "failed";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as join, i as isAbsolute, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { y as readRootWranglerConfig } from "./wrangler-
|
|
2
|
+
import { y as readRootWranglerConfig } from "./wrangler-DhUerFkW.mjs";
|
|
3
3
|
import { r as getMiniflareDatabasePath } from "./runner-Ol0TNjk6.mjs";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as getApiUrl, c as getToken, f as removeToken, g as saveToken, h as savePlatformToken, l as getTokenSource, m as runPlatformLogin, p as runLogin } from "./auth-
|
|
2
|
-
import { H as outro, K as select, L as log,
|
|
3
|
-
import {
|
|
4
|
-
import { c as import_picocolors,
|
|
1
|
+
import { a as getApiUrl, c as getToken, f as removeToken, g as saveToken, h as savePlatformToken, l as getTokenSource, m as runPlatformLogin, p as runLogin } from "./auth-7wuZ5ob8.mjs";
|
|
2
|
+
import { H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
3
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
4
|
+
import { c as import_picocolors, r as createSpinner } from "./output-BBsUwdyT.mjs";
|
|
5
5
|
//#region src/cli/login.ts
|
|
6
6
|
async function selectPlatformLoginMethod(platform, requestedId) {
|
|
7
7
|
const providers = platform?.authenticationProviders ?? ["github", "google"];
|
|
@@ -29,7 +29,7 @@ async function selectPlatformLoginMethod(platform, requestedId) {
|
|
|
29
29
|
return methods.find((method) => method.id === provider);
|
|
30
30
|
}
|
|
31
31
|
async function promptForLoginToken(root = process.cwd(), platform) {
|
|
32
|
-
const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-
|
|
32
|
+
const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-BPySFOew.mjs").then(({ discoverPlatform }) => discoverPlatform(getApiUrl(root))));
|
|
33
33
|
const s = createSpinner();
|
|
34
34
|
s.start(`Opening browser for ${providerName} login...`);
|
|
35
35
|
try {
|
|
@@ -48,12 +48,14 @@ async function promptForLoginToken(root = process.cwd(), platform) {
|
|
|
48
48
|
}
|
|
49
49
|
async function runLoginCommand(root = process.cwd()) {
|
|
50
50
|
console.log();
|
|
51
|
-
intro(cliTitle("login"));
|
|
52
51
|
const existing = getToken(root);
|
|
53
52
|
let expiredEnvToken = false;
|
|
54
53
|
if (existing) {
|
|
55
54
|
const tokenSource = getTokenSource();
|
|
56
|
-
const client = new PlatformClient(existing, {
|
|
55
|
+
const client = new PlatformClient(existing, {
|
|
56
|
+
root,
|
|
57
|
+
checkPlatformVersion: false
|
|
58
|
+
});
|
|
57
59
|
try {
|
|
58
60
|
await client.whoami();
|
|
59
61
|
if (tokenSource === "ci") {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
3
|
-
import { $ as wrapTextWithPrefix, H as outro, L as log
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-BkbfDs0V.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-7wuZ5ob8.mjs";
|
|
3
|
+
import { $ as wrapTextWithPrefix, H as outro, L as log } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
+
import { r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
5
|
+
import { c as import_picocolors, i as dim, o as formatCount } from "./output-BBsUwdyT.mjs";
|
|
6
6
|
//#region src/cli/logs.ts
|
|
7
7
|
async function runLogsCommand(root, filter, range, deployment, level) {
|
|
8
8
|
console.log();
|
|
9
|
-
intro(cliTitle("project logs"));
|
|
10
9
|
const platform = readDeploymentPlatform(root);
|
|
11
10
|
if (platform === "cloudflare") {
|
|
12
|
-
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-
|
|
11
|
+
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-BhbK6yTq.mjs");
|
|
13
12
|
if (range !== "1h") log.warn("Cloudflare tail streams live logs; --range does not select historical entries.");
|
|
14
13
|
if (level && level !== "all" && level !== "error") log.warn("Cloudflare tail cannot filter individual console levels; showing all invocation logs.");
|
|
15
14
|
await tailCloudflareWorker(resolveCloudflareOperationContext(root), {
|
|
@@ -48,7 +47,7 @@ async function runLogsCommand(root, filter, range, deployment, level) {
|
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
50
49
|
for (const entry of entries) printEntry(entry);
|
|
51
|
-
outro(dim(
|
|
50
|
+
outro(dim(formatCount(entries.length, "log entry", "log entries")));
|
|
52
51
|
}
|
|
53
52
|
function printEntry(entry) {
|
|
54
53
|
const time = formatTime(entry.timestamp);
|
|
@@ -2,9 +2,8 @@ import { a as join, n as dirname } from "./dist-BVqXeR_h.mjs";
|
|
|
2
2
|
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-GgcMozYz.mjs";
|
|
3
3
|
import { g as validateConfig } from "./config-Br_JZD6u.mjs";
|
|
4
4
|
import { n as VOID_LOCK_FILE, o as seedCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
5
|
-
import "./wrangler-
|
|
6
|
-
import { H as outro, L as log
|
|
7
|
-
import { r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
5
|
+
import "./wrangler-DhUerFkW.mjs";
|
|
6
|
+
import { H as outro, L as log } from "./prompts-6OSVA7DJ.mjs";
|
|
8
7
|
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
9
8
|
import { parseSync } from "vite";
|
|
10
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -302,7 +301,6 @@ function migrateLegacyVoidConfig(root) {
|
|
|
302
301
|
}
|
|
303
302
|
async function runMigrateCommand(root) {
|
|
304
303
|
console.log();
|
|
305
|
-
intro(cliTitle("migrate"));
|
|
306
304
|
if (migrateLegacyVoidConfig(root)) log.success(`Migrated project settings to ${TYPED_CONFIG_FILE}. Commit it and ${VOID_LOCK_FILE} when present.`);
|
|
307
305
|
else log.info("No legacy project configuration found.");
|
|
308
306
|
outro("Configuration migration complete.");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as writeKeyringPassword, S as readKeyringPassword, c as platformCredentialAccount, o as listPlatformConnections, r as getActivePlatformConnection, s as normalizePlatformApiUrl, x as deleteKeyringPassword } from "./platform-registry-
|
|
2
|
-
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-
|
|
1
|
+
import { C as writeKeyringPassword, S as readKeyringPassword, c as platformCredentialAccount, o as listPlatformConnections, r as getActivePlatformConnection, s as normalizePlatformApiUrl, x as deleteKeyringPassword } from "./platform-registry-KfNEF84O.mjs";
|
|
2
|
+
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-LmwjxT6q.mjs";
|
|
3
3
|
/** Operator authority never comes from repository-controlled metadata. */
|
|
4
4
|
function resolveOperatorOrigin(connection = "") {
|
|
5
5
|
if (connection) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { s as normalizePlatformApiUrl } from "./platform-registry-KfNEF84O.mjs";
|
|
1
2
|
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as ensureCloudflaredToken } from "./cf-access-BGe5sWXF.mjs";
|
|
3
|
+
import { t as ensureCloudflaredToken } from "./cf-access-AHKBzmuu.mjs";
|
|
4
4
|
const OPERATOR_MAX_TIMEOUT_MS = 36e5;
|
|
5
5
|
var OperatorClientError = class extends Error {
|
|
6
6
|
code;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-
|
|
2
|
-
import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-
|
|
1
|
+
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-LmwjxT6q.mjs";
|
|
2
|
+
import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-CkmTE3rt.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { setTimeout } from "node:timers/promises";
|
|
5
5
|
import { createInterface } from "node:readline/promises";
|
|
@@ -137,9 +137,9 @@ async function runAuth(origin, args) {
|
|
|
137
137
|
if (args.action === "login" || args.action === "token" && args.tokenStdin) {
|
|
138
138
|
if (!args.tokenStdin && !process.stdin.isTTY) throw new OperatorClientError("Browser login requires an interactive terminal. Use --token-stdin to exchange an API session.", "interactive_login_required");
|
|
139
139
|
const apiToken = args.tokenStdin ? await readOperatorApiTokenStdin() : await (async () => {
|
|
140
|
-
const { discoverPlatform } = await import("./platform-cmd-
|
|
141
|
-
const { selectPlatformLoginMethod } = await import("./login-
|
|
142
|
-
const { runPlatformLogin } = await import("./auth-
|
|
140
|
+
const { discoverPlatform } = await import("./platform-cmd-BPySFOew.mjs");
|
|
141
|
+
const { selectPlatformLoginMethod } = await import("./login-C98-sw79.mjs");
|
|
142
|
+
const { runPlatformLogin } = await import("./auth-CdgZ9uag.mjs");
|
|
143
143
|
return runPlatformLogin(origin, (await selectPlatformLoginMethod(await discoverPlatform(origin), args.providerExplicit ? args.provider : void 0)).id, (url) => process.stderr.write(`Sign in at ${url}\n`));
|
|
144
144
|
})();
|
|
145
145
|
const session = await exchangeOperatorSession(origin, apiToken);
|
|
@@ -313,7 +313,7 @@ async function migrateDeploymentAssets(client, origin, args) {
|
|
|
313
313
|
}
|
|
314
314
|
async function runOperatorCommand(args) {
|
|
315
315
|
if (!args.action) {
|
|
316
|
-
const { printHelpPage } = await import("./help-
|
|
316
|
+
const { printHelpPage } = await import("./help-DPGBwomV.mjs");
|
|
317
317
|
printHelpPage(["platform", args.group]);
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
|
|
2
2
|
import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
|
|
3
|
-
import { L as log, P as isCI, nt as settings, q as spinner } from "./prompts-
|
|
3
|
+
import { L as log, P as isCI, nt as settings, q as spinner } from "./prompts-6OSVA7DJ.mjs";
|
|
4
4
|
//#region src/cli/output.ts
|
|
5
5
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
6
|
+
function formatCount(count, singular, plural = `${singular}s`) {
|
|
7
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
8
|
+
}
|
|
6
9
|
/** Keep recovery commands on the same CLI when using the local checkout launcher. */
|
|
7
10
|
function cliCommandName() {
|
|
8
11
|
const entryName = process.argv[1]?.split(/[\\/]/).at(-1);
|
|
@@ -51,9 +54,6 @@ function createSpinner(options, isTerminal = process.stdout.isTTY === true) {
|
|
|
51
54
|
}
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
|
-
function cliTitle(command) {
|
|
55
|
-
return import_picocolors.default.blue(`void ${command}`);
|
|
56
|
-
}
|
|
57
57
|
function sectionTitle(title) {
|
|
58
58
|
return import_picocolors.default.reset(import_picocolors.default.blue(title));
|
|
59
59
|
}
|
|
@@ -86,4 +86,4 @@ function ensureUtc(s) {
|
|
|
86
86
|
return s + "Z";
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
|
-
export {
|
|
89
|
+
export { ensureUtc as a, import_picocolors as c, tablePrefix as d, dim as i, sanitizeTerminalText as l, cliCommandName as n, formatCount as o, createSpinner as r, helpLine as s, categoryTitle as t, sectionTitle as u };
|
package/dist/pages/client.d.mts
CHANGED
|
@@ -106,6 +106,8 @@ type PageNavigationEngine = {
|
|
|
106
106
|
flushAll(): void;
|
|
107
107
|
setPopStateHandler(handler: (url: string, options: VisitOptions$1) => void): void;
|
|
108
108
|
start(): void;
|
|
109
|
+
/** Called after the adapter commits the initial page DOM. */
|
|
110
|
+
commitInitialRender(): void;
|
|
109
111
|
};
|
|
110
112
|
export declare function createPageNavigationEngine(config: PageNavigationEngineConfig): Promise<PageNavigationEngine>;
|
|
111
113
|
//#endregion
|
|
@@ -223,6 +225,7 @@ export declare function createVoidRouter(config: VoidRouterConfig): Promise<{
|
|
|
223
225
|
initialComponent: unknown;
|
|
224
226
|
initialLayouts: Array<unknown>;
|
|
225
227
|
start(): void;
|
|
228
|
+
commitInitialRender(): void;
|
|
226
229
|
}>;
|
|
227
230
|
export declare function scheduleHydration(el: Element, loader: () => Promise<unknown>, props: Record<string, unknown>, strategy: string, hydrateFn: (el: Element, mod: unknown, props: Record<string, unknown>) => void | Promise<void>): void;
|
|
228
231
|
export declare function initIslands(islands: Record<string, () => Promise<unknown>>, hydrateFn: (el: Element, mod: unknown, props: Record<string, unknown>) => void | Promise<void>): void;
|
package/dist/pages/client.mjs
CHANGED
|
@@ -60,6 +60,103 @@ async function createActionErrorFromResponse(response, url) {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
|
+
//#region src/pages/scroll-restoration.ts
|
|
64
|
+
const STORAGE_PREFIX = "void:scroll:";
|
|
65
|
+
function readKey(state) {
|
|
66
|
+
return typeof state?.__voidScrollKey === "string" ? state.__voidScrollKey : null;
|
|
67
|
+
}
|
|
68
|
+
function readPosition(value) {
|
|
69
|
+
if (!value || typeof value !== "object") return null;
|
|
70
|
+
const { x, y } = value;
|
|
71
|
+
return typeof x === "number" && Number.isFinite(x) && typeof y === "number" && Number.isFinite(y) ? {
|
|
72
|
+
x,
|
|
73
|
+
y
|
|
74
|
+
} : null;
|
|
75
|
+
}
|
|
76
|
+
function newKey() {
|
|
77
|
+
return crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(4)).join("-");
|
|
78
|
+
}
|
|
79
|
+
function currentUrl$1() {
|
|
80
|
+
return window.location.pathname + window.location.search + window.location.hash;
|
|
81
|
+
}
|
|
82
|
+
/** Positions belong to the rendered entry, even after the browser starts a traversal. */
|
|
83
|
+
function createScrollRestoration() {
|
|
84
|
+
const positions = /* @__PURE__ */ new Map();
|
|
85
|
+
let renderedKey = null;
|
|
86
|
+
let renderedUrl = currentUrl$1();
|
|
87
|
+
let ready = false;
|
|
88
|
+
function read(key) {
|
|
89
|
+
if (!key) return null;
|
|
90
|
+
const position = positions.get(key);
|
|
91
|
+
if (position) return position;
|
|
92
|
+
try {
|
|
93
|
+
const saved = readPosition(JSON.parse(sessionStorage.getItem(STORAGE_PREFIX + key) || "null"));
|
|
94
|
+
if (saved) return saved;
|
|
95
|
+
} catch {}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
function save() {
|
|
99
|
+
if (!ready || !renderedKey) return;
|
|
100
|
+
const position = {
|
|
101
|
+
x: window.scrollX,
|
|
102
|
+
y: window.scrollY
|
|
103
|
+
};
|
|
104
|
+
positions.set(renderedKey, position);
|
|
105
|
+
try {
|
|
106
|
+
sessionStorage.setItem(STORAGE_PREFIX + renderedKey, JSON.stringify(position));
|
|
107
|
+
} catch {}
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
get ready() {
|
|
111
|
+
return ready;
|
|
112
|
+
},
|
|
113
|
+
start() {
|
|
114
|
+
renderedKey = readKey(history.state);
|
|
115
|
+
if (!renderedKey) {
|
|
116
|
+
renderedKey = newKey();
|
|
117
|
+
history.replaceState({
|
|
118
|
+
...history.state,
|
|
119
|
+
__voidScrollKey: renderedKey
|
|
120
|
+
}, "");
|
|
121
|
+
}
|
|
122
|
+
history.scrollRestoration = "manual";
|
|
123
|
+
window.addEventListener("pagehide", save);
|
|
124
|
+
return read(renderedKey);
|
|
125
|
+
},
|
|
126
|
+
save,
|
|
127
|
+
writeHistory(url, replace) {
|
|
128
|
+
renderedKey = newKey();
|
|
129
|
+
const state = {
|
|
130
|
+
...replace ? history.state : {},
|
|
131
|
+
__voidScrollKey: renderedKey
|
|
132
|
+
};
|
|
133
|
+
if (replace) history.replaceState(state, "", url);
|
|
134
|
+
else history.pushState(state, "", url);
|
|
135
|
+
},
|
|
136
|
+
commit() {
|
|
137
|
+
renderedKey = readKey(history.state) ?? renderedKey;
|
|
138
|
+
renderedUrl = currentUrl$1();
|
|
139
|
+
ready = true;
|
|
140
|
+
},
|
|
141
|
+
pop(state) {
|
|
142
|
+
save();
|
|
143
|
+
let key = readKey(state);
|
|
144
|
+
const newFragment = key === renderedKey && currentUrl$1() !== renderedUrl;
|
|
145
|
+
if (!key || newFragment) {
|
|
146
|
+
key = newKey();
|
|
147
|
+
history.replaceState({
|
|
148
|
+
...state,
|
|
149
|
+
__voidScrollKey: key
|
|
150
|
+
}, "");
|
|
151
|
+
}
|
|
152
|
+
return newFragment ? null : read(key) ?? readPosition({
|
|
153
|
+
x: state?.scrollX,
|
|
154
|
+
y: state?.scrollY
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
63
160
|
//#region src/pages/navigation-engine.ts
|
|
64
161
|
const PAGE_DATA_SCRIPT_ID = "__VOID_PAGE_DATA__";
|
|
65
162
|
const STATIC_PAGE_DATA_PREFIX = "/_void/pages";
|
|
@@ -138,6 +235,9 @@ async function createPageNavigationEngine(config) {
|
|
|
138
235
|
let _htmlDeferredRegistry = null;
|
|
139
236
|
let _currentFetchUrl = window.location.pathname + window.location.search;
|
|
140
237
|
let popStateHandler = null;
|
|
238
|
+
let initialScrollPosition = null;
|
|
239
|
+
const initialUrl = window.location.pathname + window.location.search + window.location.hash;
|
|
240
|
+
const scrollRestoration = createScrollRestoration();
|
|
141
241
|
function getPageDataCacheKey(url, method = "GET") {
|
|
142
242
|
return `${method}:${url}`;
|
|
143
243
|
}
|
|
@@ -329,16 +429,8 @@ async function createPageNavigationEngine(config) {
|
|
|
329
429
|
deferredWindow.__rejectDeferred = (group, error) => _htmlDeferredRegistry?.resolve(group, void 0, error);
|
|
330
430
|
function commitHashNavigation(effectiveFetchUrl, hash, options, writeHistory) {
|
|
331
431
|
_currentFetchUrl = effectiveFetchUrl;
|
|
332
|
-
if (writeHistory)
|
|
333
|
-
|
|
334
|
-
else {
|
|
335
|
-
history.replaceState({
|
|
336
|
-
scrollX: window.scrollX,
|
|
337
|
-
scrollY: window.scrollY
|
|
338
|
-
}, "");
|
|
339
|
-
history.pushState({}, "", effectiveFetchUrl + hash);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
432
|
+
if (writeHistory) scrollRestoration.writeHistory(effectiveFetchUrl + hash, !!options.replace);
|
|
433
|
+
scrollRestoration.commit();
|
|
342
434
|
if (options._scrollPosition) {
|
|
343
435
|
window.scrollTo(options._scrollPosition.x, options._scrollPosition.y);
|
|
344
436
|
return;
|
|
@@ -536,15 +628,9 @@ async function createPageNavigationEngine(config) {
|
|
|
536
628
|
_currentFetchUrl = commitTarget.fetchUrl;
|
|
537
629
|
if (!options.preserveState) {
|
|
538
630
|
const historyUrl = commitTarget.fetchUrl + commitTarget.hash;
|
|
539
|
-
|
|
540
|
-
else {
|
|
541
|
-
history.replaceState({
|
|
542
|
-
scrollX: window.scrollX,
|
|
543
|
-
scrollY: window.scrollY
|
|
544
|
-
}, "");
|
|
545
|
-
history.pushState({}, "", historyUrl);
|
|
546
|
-
}
|
|
631
|
+
scrollRestoration.writeHistory(historyUrl, !!options.replace);
|
|
547
632
|
}
|
|
633
|
+
scrollRestoration.commit();
|
|
548
634
|
const doScroll = () => {
|
|
549
635
|
if (options.preserveScroll) return;
|
|
550
636
|
if (options._scrollPosition) window.scrollTo(options._scrollPosition.x, options._scrollPosition.y);
|
|
@@ -570,6 +656,7 @@ async function createPageNavigationEngine(config) {
|
|
|
570
656
|
initialComponent,
|
|
571
657
|
initialLayouts,
|
|
572
658
|
prepareVisit(url, options = {}) {
|
|
659
|
+
if (!options._popstate) scrollRestoration.save();
|
|
573
660
|
const hashIndex = url.indexOf("#");
|
|
574
661
|
const hash = hashIndex !== -1 ? url.slice(hashIndex) : "";
|
|
575
662
|
const fetchUrl = hashIndex !== -1 ? url.slice(0, hashIndex) : url;
|
|
@@ -686,12 +773,14 @@ async function createPageNavigationEngine(config) {
|
|
|
686
773
|
setPopStateHandler(handler) {
|
|
687
774
|
popStateHandler = handler;
|
|
688
775
|
},
|
|
776
|
+
commitInitialRender() {
|
|
777
|
+
const saved = initialScrollPosition;
|
|
778
|
+
initialScrollPosition = null;
|
|
779
|
+
scrollRestoration.commit();
|
|
780
|
+
if (saved && _nextNavigationId === 0) window.scrollTo(saved.x, saved.y);
|
|
781
|
+
},
|
|
689
782
|
start() {
|
|
690
|
-
|
|
691
|
-
history.replaceState({
|
|
692
|
-
scrollX: window.scrollX,
|
|
693
|
-
scrollY: window.scrollY
|
|
694
|
-
}, "");
|
|
783
|
+
initialScrollPosition = scrollRestoration.start();
|
|
695
784
|
initClientHead(initialPageData.head);
|
|
696
785
|
if (deferredWindow.__deferredQueue) {
|
|
697
786
|
for (const entry of deferredWindow.__deferredQueue) if (entry.length === 3) _htmlDeferredRegistry?.resolve(entry[0], void 0, entry[2]);
|
|
@@ -699,14 +788,15 @@ async function createPageNavigationEngine(config) {
|
|
|
699
788
|
delete deferredWindow.__deferredQueue;
|
|
700
789
|
}
|
|
701
790
|
window.addEventListener("popstate", (e) => {
|
|
702
|
-
const saved = e.state;
|
|
703
791
|
const url = window.location.pathname + window.location.search + window.location.hash;
|
|
792
|
+
const saved = scrollRestoration.pop(e.state);
|
|
793
|
+
if (!scrollRestoration.ready && url === initialUrl) {
|
|
794
|
+
initialScrollPosition = saved;
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
704
797
|
const options = {
|
|
705
798
|
preserveState: true,
|
|
706
|
-
_scrollPosition: saved
|
|
707
|
-
x: saved.scrollX ?? 0,
|
|
708
|
-
y: saved.scrollY ?? 0
|
|
709
|
-
} : null,
|
|
799
|
+
_scrollPosition: saved,
|
|
710
800
|
_popstate: true
|
|
711
801
|
};
|
|
712
802
|
if (popStateHandler) popStateHandler(url, options);
|
|
@@ -1020,7 +1110,8 @@ async function createVoidRouter(config) {
|
|
|
1020
1110
|
initialPageData: engine.initialPageData,
|
|
1021
1111
|
initialComponent: engine.initialComponent,
|
|
1022
1112
|
initialLayouts: engine.initialLayouts,
|
|
1023
|
-
start: engine.start
|
|
1113
|
+
start: engine.start,
|
|
1114
|
+
commitInitialRender: engine.commitInitialRender
|
|
1024
1115
|
};
|
|
1025
1116
|
}
|
|
1026
1117
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as operatorGroups, r as parseOperatorArgs } from "./operator-args-
|
|
1
|
+
import { n as operatorGroups, r as parseOperatorArgs } from "./operator-args-CAVcmwUt.mjs";
|
|
2
2
|
import { PLATFORM_LOGIN_KINDS, normalizePlatformDashboardUrl, parsePlatformLoginId } from "@void/platform";
|
|
3
3
|
import { parsePlatformPlanId } from "@void/platform/plans";
|
|
4
4
|
//#region src/cli/platform-config-args.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { u as openBrowser } from "./auth-
|
|
2
|
-
import { A as confirm, K as select, U as password, X as text, tt as isCancel, z as multiselect } from "./prompts-
|
|
3
|
-
import { n as OperatorClient } from "./operator-client-
|
|
4
|
-
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-
|
|
5
|
-
import { execFile } from "node:child_process";
|
|
1
|
+
import { u as openBrowser } from "./auth-7wuZ5ob8.mjs";
|
|
2
|
+
import { A as confirm, K as select, U as password, X as text, tt as isCancel, z as multiselect } from "./prompts-6OSVA7DJ.mjs";
|
|
3
|
+
import { n as OperatorClient } from "./operator-client-LmwjxT6q.mjs";
|
|
4
|
+
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-CkmTE3rt.mjs";
|
|
6
5
|
import { parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration } from "@void/platform";
|
|
7
6
|
import { stripVTControlCharacters } from "node:util";
|
|
7
|
+
import { execFile } from "node:child_process";
|
|
8
8
|
import { setTimeout } from "node:timers/promises";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
//#region src/cli/platform-auth-config.ts
|
|
@@ -140,11 +140,11 @@ async function configurationInput(args, existing) {
|
|
|
140
140
|
}
|
|
141
141
|
async function runPlatformAuthConfig(args) {
|
|
142
142
|
if (args.action === "recover") {
|
|
143
|
-
const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-
|
|
143
|
+
const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-ICy4muq6.mjs");
|
|
144
144
|
return runPlatformAuthRecovery(args);
|
|
145
145
|
}
|
|
146
146
|
if (args.action === "protection") {
|
|
147
|
-
const { runPlatformProtectionConfig } = await import("./platform-auth-protection-
|
|
147
|
+
const { runPlatformProtectionConfig } = await import("./platform-auth-protection-DFeJ-JkK.mjs");
|
|
148
148
|
return runPlatformProtectionConfig(args);
|
|
149
149
|
}
|
|
150
150
|
const origin = resolveOperatorOrigin(args.connection);
|