void 1.12.0 → 1.12.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/{account-cmd-D_0qJ9fx.mjs → account-cmd-CdJQba_Q.mjs} +4 -4
- package/dist/{application-analysis-Cx2S63z5.mjs → application-analysis-DVeN8yoi.mjs} +1 -1
- package/dist/{application-routing-BAXpnawu.mjs → application-routing-KKw4Y84h.mjs} +1 -1
- package/dist/{auth-Boz0lrb3.mjs → auth-A7cZ8aXA.mjs} +1 -1
- package/dist/{auth-DlLDymuc.mjs → auth-CqwJwItO.mjs} +1 -1
- package/dist/{auth-link-C97r9p2N.mjs → auth-link-D9MWA_dj.mjs} +4 -4
- package/dist/{auth-router-BmzEgzYx.mjs → auth-router-FskgTU3B.mjs} +1 -1
- package/dist/{build-cmd-BaFsyZrz.mjs → build-cmd-B7OJ0U5R.mjs} +2 -2
- package/dist/build-id-4IV4hC1-.mjs +13 -0
- package/dist/{cache-xO711ATQ.mjs → cache-wSpi3aeM.mjs} +2 -2
- package/dist/{cancel-deploy-Di11ynsr.mjs → cancel-deploy-DMWzkAlb.mjs} +2 -2
- package/dist/{cf-access-FaIm95jA.mjs → cf-access-DHklo7Rg.mjs} +33 -19
- package/dist/{cf-build-output-Ca201_n1.mjs → cf-build-output-Cso7Vh-t.mjs} +4 -2
- package/dist/cf-build-output-Wpk_e5CI.mjs +1 -0
- package/dist/cli/cli.mjs +1 -1
- package/dist/cli/cloudflare-operation-process.mjs +1 -1
- package/dist/cli/db-execute-process.d.mts +2 -0
- package/dist/cli/db-execute-process.mjs +57 -0
- package/dist/{cli-main-DlW6lB8s.mjs → cli-main-DaLrQfPS.mjs} +37 -344
- package/dist/{client-ImIe7Mjq.mjs → client-DE2m2ldh.mjs} +4 -4
- package/dist/{client-DkYzDEC0.mjs → client-eLZwqkPH.mjs} +1 -1
- package/dist/{cloudflare-operations-BF0PSErW.mjs → cloudflare-operations-BIRQkYwL.mjs} +14 -8
- package/dist/cloudflare-operations-ByjFGats.mjs +1 -0
- package/dist/{connect-DDRQGfFE.mjs → connect-WG4TcR_d.mjs} +4 -4
- package/dist/{create-project-CY7sP8sI.mjs → create-project-8FdN6D2i.mjs} +2 -2
- package/dist/{create-project-Dro3K-az.mjs → create-project-CbuDH5Hv.mjs} +1 -1
- package/dist/{db-DmlaWVBu.mjs → db-BSuWV1PI.mjs} +1348 -69
- package/dist/db-args-BvMwAber.mjs +1 -0
- package/dist/db-args-CiQVg8SJ.mjs +321 -0
- package/dist/{delete-Uuq9ch6o.mjs → delete-WtLEfap2.mjs} +2 -2
- package/dist/{deploy-B9E7_rHC.mjs → deploy-DtJeunLF.mjs} +14 -14
- package/dist/{deploy-BB3rsZbP.mjs → deploy-GT4CW5fs.mjs} +1 -1
- package/dist/{deploy-managed-static-IKZyuc1W.mjs → deploy-managed-static-BWBsxOww.mjs} +5 -5
- package/dist/{deploy-security-notice-C3LalelR.mjs → deploy-security-notice-IRGy6Edf.mjs} +2 -2
- package/dist/deploy.mjs +4 -4
- package/dist/{domain-B_xY1yZ5.mjs → domain-mweyYXSw.mjs} +3 -3
- package/dist/{email-BIC15L7a.mjs → email-DoDqRH6i.mjs} +5 -5
- package/dist/{email-cloudflare-C447nOqq.mjs → email-cloudflare-DeYH3Ke7.mjs} +2 -2
- package/dist/{env-DJPZYHT5.mjs → env-DaAoYR2-.mjs} +3 -3
- package/dist/{gen-DiTZlDx8.mjs → gen-aOtHhZLD.mjs} +1 -1
- package/dist/gen-vhBDHs3q.mjs +1 -0
- package/dist/{github-cmd-DPmby8x-.mjs → github-cmd-BR19Ffdz.mjs} +2 -2
- package/dist/{help-9wfMyXHb.mjs → help-DvClCzqL.mjs} +9 -1
- package/dist/help-fKPzcTJv.mjs +1 -0
- package/dist/index.mjs +16 -206
- package/dist/{info-BWEWaOBo.mjs → info-P6MBiVJi.mjs} +2 -2
- package/dist/{init-BuTPVLPO.mjs → init-B2VZ2Hut.mjs} +63 -18
- package/dist/installed-packages-tfmYd-cC.mjs +198 -0
- package/dist/{link-BiesPyT4.mjs → link-Dyz9IGcM.mjs} +3 -3
- package/dist/{list-CkonftPQ.mjs → list-VGYBMjmx.mjs} +4 -4
- package/dist/login-BbSQTZ6d.mjs +1 -0
- package/dist/{login-BSOSah1j.mjs → login-jUBgfvzk.mjs} +3 -3
- package/dist/{logs-HOBUnroa.mjs → logs-kS1wuR4b.mjs} +3 -3
- package/dist/module-references-DWQmO6TW.mjs +27 -0
- package/dist/{mysql-sql-CB52k8tQ.mjs → mysql-lock-D8xtnI-D.mjs} +1 -118
- package/dist/mysql-sql-BIE7bc4Z.mjs +124 -0
- package/dist/{operator-ai-logging-ZDqqhnIq.mjs → operator-ai-logging-DD0n6zc2.mjs} +3 -3
- package/dist/{operator-args-DCkWbgT-.mjs → operator-args-nvetCWuz.mjs} +1 -1
- package/dist/{operator-auth-BjoPLgja.mjs → operator-auth-DMvn-y9X.mjs} +1 -1
- package/dist/{operator-client-DzebIntv.mjs → operator-client-dFNnXfyB.mjs} +4 -3
- package/dist/operator-cmd-jnjzuJKX.mjs +1 -0
- package/dist/{operator-cmd-AZoeI9Pl.mjs → operator-cmd-wML5HNfS.mjs} +13 -9
- package/dist/{operator-security-Bo26FP01.mjs → operator-security-D5MToU0p.mjs} +1 -1
- package/dist/pages/client.mjs +77 -9
- package/dist/pages/index.d.mts +6 -0
- package/dist/pages/index.mjs +276 -6
- package/dist/pages/protocol.mjs +1 -1
- package/dist/platform-args-CMwMoiLp.mjs +1 -0
- package/dist/{platform-args-lwCyQ6Xy.mjs → platform-args-CvZSuhYS.mjs} +1 -1
- package/dist/{platform-auth-config-DLRMPw1G.mjs → platform-auth-config-Bv3oQ2gE.mjs} +7 -7
- package/dist/{platform-auth-protection-HSmLmD3d.mjs → platform-auth-protection-OqzfhXwx.mjs} +5 -5
- package/dist/{platform-auth-recovery-BXPhTlKa.mjs → platform-auth-recovery-rmIYjXST.mjs} +4 -4
- package/dist/{platform-cmd-CqRjxFEU.mjs → platform-cmd-B3rO4RhU.mjs} +1 -1
- package/dist/{platform-cmd-DJ-fOYhL.mjs → platform-cmd-D_4z2Ijv.mjs} +6 -6
- package/dist/{platform-domain-CRsRJOws.mjs → platform-domain-CUq9odbd.mjs} +2 -2
- package/dist/{platform-lifecycle-bx_kpqo7.mjs → platform-lifecycle-DOSYo0UI.mjs} +1 -1
- package/dist/{platform-lifecycle-fau3VKv6.mjs → platform-lifecycle-DuoVruij.mjs} +138 -43
- package/dist/{platform-management-BRGhD-oF.mjs → platform-management-D_gt3qLb.mjs} +1 -1
- package/dist/{platform-management-CnKBdDx5.mjs → platform-management-MmO9IubR.mjs} +4 -4
- package/dist/{platform-plans-config-2C3_5EDs.mjs → platform-plans-config-DiydtNKY.mjs} +3 -3
- package/dist/{platform-recovery-poxgOOAY.mjs → platform-recovery-P_FVslfd.mjs} +2 -2
- package/dist/{platform-setup-DYylapHD.mjs → platform-setup-Lph9i-rh.mjs} +1 -1
- package/dist/{plugin-inference-7O11_E4H.mjs → plugin-inference-COlq96WJ.mjs} +2 -27
- package/dist/prepare-DcwigRUS.mjs +1 -0
- package/dist/{prepare-DWjn1Lzd.mjs → prepare-WvijE289.mjs} +1 -1
- package/dist/{prepare-BbvlKreR.mjs → prepare-co1o1FFd.mjs} +1 -1
- package/dist/{project-cmd-DyUEFi2b.mjs → project-cmd-BWJTplpc.mjs} +18 -18
- package/dist/{project-security-DZEQgnsS.mjs → project-security-BV1xfj1K.mjs} +1 -1
- package/dist/{project-security--tYGFPGo.mjs → project-security-CY_aahvW.mjs} +2 -2
- package/dist/{project-team-BszTHgzC.mjs → project-team-BlIFXlmT.mjs} +2 -2
- package/dist/{project-token-DBDy4NdV.mjs → project-token-CMsB7I1-.mjs} +2 -2
- package/dist/{project-zero-trust-D9sUouij.mjs → project-zero-trust-BI6pdpx4.mjs} +2 -2
- package/dist/{protocol-CE3wP-H1.mjs → protocol-4rEnumif.mjs} +10 -3
- package/dist/{redirect-DD825Stf.mjs → redirect-Dyvuil0Q.mjs} +5 -2
- package/dist/{requests-CBokjiOi.mjs → requests-CfmJxNYg.mjs} +2 -2
- package/dist/{rollback-CEeHNFUn.mjs → rollback-DL5HuAsM.mjs} +3 -3
- package/dist/{runner-mysql-3XDKrn-g.mjs → runner-mysql-D549vGGm.mjs} +2 -1
- package/dist/{runner-mysql-r688x6Y9.mjs → runner-mysql-DOjbj-N1.mjs} +1 -1
- package/dist/runtime/db/migrations/mysql-handler.mjs +2 -1
- package/dist/runtime/routing/index.mjs +2 -2
- package/dist/{secret-Deqo3n_N.mjs → secret-C-WBaUSS.mjs} +3 -3
- package/docs/guide/jobs.md +1 -1
- package/docs/guide/pages-routing/actions-and-forms.md +36 -15
- package/docs/guide/pages-routing/errors.md +3 -1
- package/docs/guide/pages-routing/overview.md +20 -0
- package/docs/guide/platform/administration/zero-trust.md +1 -1
- package/docs/guide/platform/installation/maintenance.md +5 -3
- package/docs/guide/queues.md +1 -1
- package/docs/integrations/frameworks/sveltekit.md +1 -1
- package/docs/reference/api/pages.md +4 -0
- package/docs/reference/cli/database.md +42 -6
- package/docs/reference/cli/platform-security.md +1 -1
- package/docs/reference/cli/platform-zero-trust.md +4 -3
- package/docs/reference/cli/setup.md +4 -0
- package/package.json +7 -7
- package/dist/cf-build-output-Dy7N0hQN.mjs +0 -1
- package/dist/cloudflare-operations-dpRD-2Px.mjs +0 -1
- package/dist/gen-CQDiPi8m.mjs +0 -1
- package/dist/help-Dy3w4rPq.mjs +0 -1
- package/dist/login-DWCZeCX9.mjs +0 -1
- package/dist/operator-cmd-DEnHFmJF.mjs +0 -1
- package/dist/platform-args-DNbNZ_RR.mjs +0 -1
- package/dist/prepare-BmG2E6TI.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-uD8oG6U2.mjs";
|
|
2
|
-
import { a as join, c as resolve, i as isAbsolute, l as toSlash, n as dirname,
|
|
2
|
+
import { a as join, c as resolve, i as isAbsolute, l as toSlash, n as dirname, s as relative, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
3
3
|
import { t as require_picocolors } from "./picocolors-D1NxSLw-.mjs";
|
|
4
|
-
import { a as assertSandboxNamespaceConfig, c as resolveSandboxConfig, d as hasEmailHandlers, g as scanJobsSync, i as SANDBOX_MIGRATION_TAG, l as sandboxContainerConfig, n as getNativeWorkerSourceFiles, o as hasSandboxSqliteMigration, p as scanQueuesSync, r as DEFAULT_SANDBOX_CLASS_NAME, t as analyzeApplicationSync } from "./application-analysis-
|
|
5
|
-
import { l as inferBindingsFromSource,
|
|
4
|
+
import { a as assertSandboxNamespaceConfig, c as resolveSandboxConfig, d as hasEmailHandlers, g as scanJobsSync, i as SANDBOX_MIGRATION_TAG, l as sandboxContainerConfig, n as getNativeWorkerSourceFiles, o as hasSandboxSqliteMigration, p as scanQueuesSync, r as DEFAULT_SANDBOX_CLASS_NAME, t as analyzeApplicationSync } from "./application-analysis-DVeN8yoi.mjs";
|
|
5
|
+
import { l as inferBindingsFromSource, n as FRAMEWORK_SCAN_DIRS, p as applyBindingOverrides, t as DEFAULT_SCAN_DIRS } from "./plugin-inference-COlq96WJ.mjs";
|
|
6
6
|
import { a as isAssetBypassRule, d as hasDocumentRoutes, l as edgeRulesNeedWorker, n as mergeRoutingRules, o as isGeneratedAssetHeaders, p as resolveAssetRoutingPolicy, s as resolveAssetWorkerBypass, t as lintRoutingPhases, u as hasApiRoutes } from "./headers-DqBsjDxg.mjs";
|
|
7
7
|
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-dh9431bN.mjs";
|
|
8
8
|
import { A as syncWranglerWebSockets, E as resolveLiveBindingConfig, O as syncWranglerBindings, T as readWranglerWebSocketTombstones, a as LIVE_MIGRATION_TAG, b as readRootWranglerConfig, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as normalizeWranglerCompatibilityFlags, h as nextDurableObjectMigrationTag, k as syncWranglerDurableObjects, m as hasDurableObjectSqliteMigration, p as findBindingNameOwner, u as ensureWranglerCompat, v as readExistingLiveBindingConfig, x as readWranglerCompat } from "./wrangler-DVe5KV5G.mjs";
|
|
@@ -12,8 +12,9 @@ import { c as getDatabaseCasing, l as getDatabaseDialect, p as readConfig, u as
|
|
|
12
12
|
import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-CYOYkVwO.mjs";
|
|
13
13
|
import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-D9hwSySP.mjs";
|
|
14
14
|
import { t as Buffer } from "./node-buffer-D7kgjaDs.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { t as staticModuleReferences } from "./module-references-DWQmO6TW.mjs";
|
|
16
|
+
import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-CqwJwItO.mjs";
|
|
17
|
+
import { n as ensurePlatformProxyAccess } from "./cf-access-DHklo7Rg.mjs";
|
|
17
18
|
import { n as scopedAccessCredentials } from "./cf-access-DmkKPcAI.mjs";
|
|
18
19
|
import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-CoDaaFsA.mjs";
|
|
19
20
|
import { t as migrateBuiltWranglerConfig } from "./cf-config-migrate-D271BTiw.mjs";
|
|
@@ -32,17 +33,18 @@ import { n as scanWranglerDotenvKeys } from "./dotenv-BG6RQavH.mjs";
|
|
|
32
33
|
import { _ as isRouteEnabledForEnvironment, a as createBoundaryManifest, c as resolveLayoutIds, h as invalidateSourceAnalysis, i as patternToRegex, x as convertPathToPattern } from "./scan-Ct_SEzH4.mjs";
|
|
33
34
|
import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./raw-5rak34QN.mjs";
|
|
34
35
|
import { i as isClientManifest, t as ASSET_EXTENSIONS } from "./assets-Br6_BeFJ.mjs";
|
|
36
|
+
import { r as findVoidDependentPackages, t as findDependencyClosure } from "./installed-packages-tfmYd-cC.mjs";
|
|
35
37
|
import { i as loadVoidAuthConfig, n as devAuthConfigImporter, o as viteAuthConfigImporter, t as AUTH_CONFIG_ENVIRONMENT } from "./config-BFX5ZB1J.mjs";
|
|
36
38
|
import { a as resolveDistDir, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate, t as collectPages } from "./isr-config-DiTnL9Tb.mjs";
|
|
37
39
|
import { t as assertNoPrerenderFailures } from "./prerender-render-BAdYhivW.mjs";
|
|
38
|
-
import { h as prerenderPagesNode, m as prerenderPages, n as SEND_EMAIL_BINDING } from "./email-cloudflare-
|
|
39
|
-
import { a as safeJsonStringify } from "./protocol-
|
|
40
|
-
import { n as completeApplicationAnalysis } from "./application-routing-
|
|
40
|
+
import { h as prerenderPagesNode, m as prerenderPages, n as SEND_EMAIL_BINDING } from "./email-cloudflare-DeYH3Ke7.mjs";
|
|
41
|
+
import { a as safeJsonStringify } from "./protocol-4rEnumif.mjs";
|
|
42
|
+
import { n as completeApplicationAnalysis } from "./application-routing-KKw4Y84h.mjs";
|
|
41
43
|
import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, r as getSsrServerEntryPath, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-Bwb9ev8K.mjs";
|
|
42
44
|
import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-DqgLa6gc.mjs";
|
|
43
45
|
import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "./handler-DCrDLzw2.mjs";
|
|
44
46
|
import { r as defer } from "./validation-error-CtcAvyI7.mjs";
|
|
45
|
-
import
|
|
47
|
+
import { builtinModules, createRequire } from "node:module";
|
|
46
48
|
import { chmodSync, closeSync, cpSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
47
49
|
import { createRunnableDevEnvironment, defaultServerConditions, isFileServingAllowed, isRunnableDevEnvironment, loadEnv, normalizePath, parseSync, resolveEnvPrefix } from "vite";
|
|
48
50
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -508,7 +510,7 @@ function readVoidDevCredentials(root) {
|
|
|
508
510
|
*/
|
|
509
511
|
async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
510
512
|
const { select, text, isCancel, log } = await import("./dist-C47zy_kJ.mjs");
|
|
511
|
-
const { PlatformClient } = await import("./client-
|
|
513
|
+
const { PlatformClient } = await import("./client-eLZwqkPH.mjs");
|
|
512
514
|
const { attachSelectedPlatform, writeProjectConfig } = await import("./project-uXKua1it.mjs");
|
|
513
515
|
const { inferDefaultSlug } = await import("./resolve-project-YsTH-U9I.mjs");
|
|
514
516
|
const { printSuccess } = await import("./output-D7K9TWIA.mjs");
|
|
@@ -538,7 +540,7 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
|
538
540
|
let slug;
|
|
539
541
|
if (result === "__create__") {
|
|
540
542
|
const { validateProjectSlug } = await import("./project-slug-BUy0lmyR.mjs");
|
|
541
|
-
const { createProjectWithSlugRetry } = await import("./create-project-
|
|
543
|
+
const { createProjectWithSlugRetry } = await import("./create-project-CbuDH5Hv.mjs");
|
|
542
544
|
let created;
|
|
543
545
|
try {
|
|
544
546
|
created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
|
|
@@ -3237,198 +3239,6 @@ export default {
|
|
|
3237
3239
|
`);
|
|
3238
3240
|
return entryPath;
|
|
3239
3241
|
}
|
|
3240
|
-
// src/installed-packages.ts
|
|
3241
|
-
function readManifest(dir) {
|
|
3242
|
-
try {
|
|
3243
|
-
return JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
3244
|
-
} catch {
|
|
3245
|
-
return;
|
|
3246
|
-
}
|
|
3247
|
-
}
|
|
3248
|
-
/** The directory Node loads `name` from for code in `fromDir`. Ignores `exports`. */
|
|
3249
|
-
function findInstalledPackage(name, fromDir) {
|
|
3250
|
-
const pnp = module.findPnpApi?.(fromDir);
|
|
3251
|
-
if (pnp) try {
|
|
3252
|
-
const manifest = pnp.resolveToUnqualified(`${name}/package.json`, `${fromDir}/`);
|
|
3253
|
-
return manifest ? dirname(manifest) : void 0;
|
|
3254
|
-
} catch {
|
|
3255
|
-
return;
|
|
3256
|
-
}
|
|
3257
|
-
for (let dir = fromDir;; dir = dirname(dir)) {
|
|
3258
|
-
const candidate = join(dir, "node_modules", name);
|
|
3259
|
-
if (existsSync(join(candidate, "package.json"))) return realpathSync(candidate);
|
|
3260
|
-
if (dirname(dir) === dir) return;
|
|
3261
|
-
}
|
|
3262
|
-
}
|
|
3263
|
-
function isVoidPackage(name) {
|
|
3264
|
-
return name === "void" || name.startsWith("@void/");
|
|
3265
|
-
}
|
|
3266
|
-
/** The `exports` conditions that an import matches in Vite's SSR graph. */
|
|
3267
|
-
const IMPORT_CONDITIONS = /* @__PURE__ */ new Set([
|
|
3268
|
-
"node",
|
|
3269
|
-
"import",
|
|
3270
|
-
"module",
|
|
3271
|
-
"default"
|
|
3272
|
-
]);
|
|
3273
|
-
/**
|
|
3274
|
-
* Vite's SSR graph also matches `production` or `development`, as NODE_ENV says. Vite sets
|
|
3275
|
-
* NODE_ENV before it runs the plugin hooks that call this.
|
|
3276
|
-
*/
|
|
3277
|
-
function matchesImport(condition) {
|
|
3278
|
-
const mode = process.env.NODE_ENV === "production" ? "production" : "development";
|
|
3279
|
-
return IMPORT_CONDITIONS.has(condition) || condition === mode;
|
|
3280
|
-
}
|
|
3281
|
-
/** The target an import picks from an `exports` value: its first matching key, as in Node. */
|
|
3282
|
-
function importTarget(value) {
|
|
3283
|
-
if (typeof value === "string") return value;
|
|
3284
|
-
if (Array.isArray(value)) {
|
|
3285
|
-
for (const item of value) {
|
|
3286
|
-
const target = importTarget(item);
|
|
3287
|
-
if (target) return target;
|
|
3288
|
-
}
|
|
3289
|
-
return;
|
|
3290
|
-
}
|
|
3291
|
-
if (!value || typeof value !== "object") return;
|
|
3292
|
-
for (const [key, item] of Object.entries(value)) {
|
|
3293
|
-
const target = matchesImport(key) ? importTarget(item) : void 0;
|
|
3294
|
-
if (target) return target;
|
|
3295
|
-
}
|
|
3296
|
-
}
|
|
3297
|
-
function isFile(path) {
|
|
3298
|
-
try {
|
|
3299
|
-
return statSync(path).isFile();
|
|
3300
|
-
} catch {
|
|
3301
|
-
return false;
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3304
|
-
/** The file an import of the package loads: `exports` ".", then `module`, then `main`. */
|
|
3305
|
-
function findImportEntry(dir, manifest) {
|
|
3306
|
-
const exports = manifest.exports;
|
|
3307
|
-
const entry = importTarget(exports && typeof exports === "object" && Object.keys(exports).some((key) => key.startsWith(".")) ? exports["."] : exports) ?? (typeof manifest.module === "string" ? manifest.module : void 0) ?? (typeof manifest.main === "string" ? manifest.main : "index.js");
|
|
3308
|
-
for (const candidate of [
|
|
3309
|
-
entry,
|
|
3310
|
-
`${entry}.js`,
|
|
3311
|
-
`${entry}/index.js`
|
|
3312
|
-
]) {
|
|
3313
|
-
const file = join(dir, candidate);
|
|
3314
|
-
if (isFile(file)) return file;
|
|
3315
|
-
}
|
|
3316
|
-
}
|
|
3317
|
-
/** Whether Node loads a `.mjs` or `.js` file in the package as an ES module. */
|
|
3318
|
-
function isEsmFile(file, dir, manifest) {
|
|
3319
|
-
if (file.endsWith(".mjs")) return true;
|
|
3320
|
-
if (!file.endsWith(".js")) return false;
|
|
3321
|
-
for (let scope = dirname(file); scope.startsWith(`${dir}/`); scope = dirname(scope)) {
|
|
3322
|
-
const nested = readManifest(scope);
|
|
3323
|
-
if (nested) return nested.type === "module";
|
|
3324
|
-
}
|
|
3325
|
-
return manifest.type === "module";
|
|
3326
|
-
}
|
|
3327
|
-
/** A dynamic `import()` argument that is a single string literal naming a relative file. */
|
|
3328
|
-
const RELATIVE_LITERAL = /^(["'])(\.{1,2}\/[^"']*)\1$/;
|
|
3329
|
-
/** The relative files that a module's imports, re-exports and `import()` calls name. */
|
|
3330
|
-
function relativeImports(code, parsed) {
|
|
3331
|
-
const specifiers = staticModuleReferences(parsed, code).map((reference) => reference.source);
|
|
3332
|
-
for (const { moduleRequest } of parsed.module.dynamicImports) {
|
|
3333
|
-
const literal = RELATIVE_LITERAL.exec(code.slice(moduleRequest.start, moduleRequest.end));
|
|
3334
|
-
if (literal) specifiers.push(literal[2]);
|
|
3335
|
-
}
|
|
3336
|
-
return specifiers.filter((specifier) => /^\.{1,2}\//.test(specifier));
|
|
3337
|
-
}
|
|
3338
|
-
/** The most files of one package that the check reads. A package with more stays with Node. */
|
|
3339
|
-
const MAX_PACKAGE_MODULES = 2e3;
|
|
3340
|
-
/**
|
|
3341
|
-
* Vite's SSR module runner evaluates an inlined package as ES modules. The package's import
|
|
3342
|
-
* entry and every file it reaches through relative imports must be one. So the ES module
|
|
3343
|
-
* wrapper in Node's dual-package guide, or any ES module of the package that imports a
|
|
3344
|
-
* CommonJS file, keeps the package with Node.
|
|
3345
|
-
*/
|
|
3346
|
-
function shipsEsm(packageDir, manifest) {
|
|
3347
|
-
const dir = normalize(packageDir);
|
|
3348
|
-
const entry = findImportEntry(dir, manifest);
|
|
3349
|
-
if (!entry) return false;
|
|
3350
|
-
const files = [entry];
|
|
3351
|
-
const seen = new Set(files);
|
|
3352
|
-
for (const file of files) {
|
|
3353
|
-
if (!isEsmFile(file, dir, manifest)) return false;
|
|
3354
|
-
let code;
|
|
3355
|
-
try {
|
|
3356
|
-
code = readFileSync(file, "utf8");
|
|
3357
|
-
} catch {
|
|
3358
|
-
return false;
|
|
3359
|
-
}
|
|
3360
|
-
const parsed = parseSync(file, code, {
|
|
3361
|
-
lang: "js",
|
|
3362
|
-
sourceType: "module"
|
|
3363
|
-
});
|
|
3364
|
-
if (parsed.errors.length > 0) return false;
|
|
3365
|
-
for (const specifier of relativeImports(code, parsed)) {
|
|
3366
|
-
const next = join(dirname(file), specifier);
|
|
3367
|
-
if (/\.[cm]?js$/.test(next) && !seen.has(next)) {
|
|
3368
|
-
if (seen.size >= MAX_PACKAGE_MODULES) return false;
|
|
3369
|
-
seen.add(next);
|
|
3370
|
-
files.push(next);
|
|
3371
|
-
}
|
|
3372
|
-
}
|
|
3373
|
-
}
|
|
3374
|
-
return true;
|
|
3375
|
-
}
|
|
3376
|
-
/**
|
|
3377
|
-
* Installed ES module packages that list `void` or an `@void/` package as a dependency, among
|
|
3378
|
-
* the app's own dependencies and, through them, the packages they depend on (the rule
|
|
3379
|
-
* vite-plugin-svelte applies to Svelte libraries). Vite leaves a package in node_modules to Node,
|
|
3380
|
-
* whose `void/*` imports then skip Void's plugins: the generated `void/db` and the Node target's
|
|
3381
|
-
* guard. Listing these packages in `ssr.noExternal` keeps them in Vite's graph.
|
|
3382
|
-
*/
|
|
3383
|
-
function findVoidDependentPackages(root) {
|
|
3384
|
-
const app = readManifest(root);
|
|
3385
|
-
if (!app) return [];
|
|
3386
|
-
const found = /* @__PURE__ */ new Set();
|
|
3387
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3388
|
-
const visit = (names, fromDir) => {
|
|
3389
|
-
for (const name of names) {
|
|
3390
|
-
if (isVoidPackage(name)) continue;
|
|
3391
|
-
const dir = findInstalledPackage(name, fromDir);
|
|
3392
|
-
if (!dir || seen.has(dir)) continue;
|
|
3393
|
-
seen.add(dir);
|
|
3394
|
-
const manifest = readManifest(dir);
|
|
3395
|
-
const dependencies = {
|
|
3396
|
-
...manifest?.dependencies,
|
|
3397
|
-
...manifest?.optionalDependencies
|
|
3398
|
-
};
|
|
3399
|
-
if (!manifest || !Object.keys({
|
|
3400
|
-
...dependencies,
|
|
3401
|
-
...manifest.peerDependencies
|
|
3402
|
-
}).some(isVoidPackage) || !shipsEsm(dir, manifest)) continue;
|
|
3403
|
-
found.add(name);
|
|
3404
|
-
visit(Object.keys(dependencies), dir);
|
|
3405
|
-
}
|
|
3406
|
-
};
|
|
3407
|
-
visit(Object.keys({
|
|
3408
|
-
...app.dependencies,
|
|
3409
|
-
...app.devDependencies,
|
|
3410
|
-
...app.optionalDependencies
|
|
3411
|
-
}), root);
|
|
3412
|
-
return [...found].sort();
|
|
3413
|
-
}
|
|
3414
|
-
/** `name` and every package it depends on, as installed for code in `fromDir`. */
|
|
3415
|
-
function findDependencyClosure(name, fromDir) {
|
|
3416
|
-
const found = /* @__PURE__ */ new Set();
|
|
3417
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3418
|
-
const visit = (dependency, from) => {
|
|
3419
|
-
const dir = findInstalledPackage(dependency, from);
|
|
3420
|
-
if (!dir || seen.has(dir)) return;
|
|
3421
|
-
seen.add(dir);
|
|
3422
|
-
found.add(dependency);
|
|
3423
|
-
const manifest = readManifest(dir);
|
|
3424
|
-
for (const next of Object.keys({
|
|
3425
|
-
...manifest?.dependencies,
|
|
3426
|
-
...manifest?.optionalDependencies
|
|
3427
|
-
})) visit(next, dir);
|
|
3428
|
-
};
|
|
3429
|
-
visit(name, fromDir);
|
|
3430
|
-
return [...found].sort();
|
|
3431
|
-
}
|
|
3432
3242
|
// src/plugin-migration.ts
|
|
3433
3243
|
function readDatabaseUrl(root) {
|
|
3434
3244
|
return loadLocalEnv(root).DATABASE_URL;
|
|
@@ -3485,7 +3295,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
3485
3295
|
const authWithFiles = authUrl !== void 0 && authUrl === url;
|
|
3486
3296
|
if (url) {
|
|
3487
3297
|
const { validateMigrations } = await import("./validate-CZYUIfR-.mjs");
|
|
3488
|
-
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-
|
|
3298
|
+
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-DOjbj-N1.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-DMJquR3d.mjs").then((runner) => runner.getPgAppliedMigrations(url));
|
|
3489
3299
|
const appliedSet = new Set(appliedNames);
|
|
3490
3300
|
const pending = allMigrations.filter((migration) => !appliedSet.has(migration.name));
|
|
3491
3301
|
if (pending.length > 0) try {
|
|
@@ -3494,14 +3304,14 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
3494
3304
|
refuse(err);
|
|
3495
3305
|
return;
|
|
3496
3306
|
}
|
|
3497
|
-
const applied = dialect === "mysql" ? await import("./runner-mysql-
|
|
3307
|
+
const applied = dialect === "mysql" ? await import("./runner-mysql-DOjbj-N1.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url, authWithFiles ? async (names) => {
|
|
3498
3308
|
logApplied(names);
|
|
3499
3309
|
await migrateAuth(url);
|
|
3500
3310
|
} : void 0)) : await import("./runner-pg-DMJquR3d.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
|
|
3501
3311
|
if (!authWithFiles) logApplied(applied);
|
|
3502
3312
|
}
|
|
3503
3313
|
if (authUrl && !authWithFiles) {
|
|
3504
|
-
const { withMySqlMigrationLockAt } = await import("./runner-mysql-
|
|
3314
|
+
const { withMySqlMigrationLockAt } = await import("./runner-mysql-DOjbj-N1.mjs");
|
|
3505
3315
|
await withMySqlMigrationLockAt(authUrl, () => migrateAuth(authUrl));
|
|
3506
3316
|
}
|
|
3507
3317
|
} else if (hasSqlMigrations) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as join, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
-
import { h as inferDurableResourceName, m as deriveDurableResourceIdentity, t as analyzeApplicationSync } from "./application-analysis-
|
|
2
|
+
import { h as inferDurableResourceName, m as deriveDurableResourceIdentity, t as analyzeApplicationSync } from "./application-analysis-DVeN8yoi.mjs";
|
|
3
3
|
import { n as VOID_LOCK_FILE } from "./cloudflare-config-D9UFH_A5.mjs";
|
|
4
4
|
import { p as readConfig } from "./config-Dv5jri1-.mjs";
|
|
5
|
-
import { a as deriveWebSocketClassNameFromName, o as inferWebSocketResourceName } from "./plugin-inference-
|
|
5
|
+
import { a as deriveWebSocketClassNameFromName, o as inferWebSocketResourceName } from "./plugin-inference-COlq96WJ.mjs";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
import { isRecord } from "@void/deploy-core";
|
|
8
8
|
// src/cli/info.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as __toESM } from "./rolldown-runtime-uD8oG6U2.mjs";
|
|
1
2
|
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-Cr_xGE_K.mjs";
|
|
2
3
|
import { a as join, c as resolve, i as isAbsolute, n as dirname, s as relative, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
3
4
|
import { i as materializeCloudflareConfig, l as ensureGitignoreLines, n as VOID_LOCK_FILE } from "./cloudflare-config-D9UFH_A5.mjs";
|
|
@@ -7,20 +8,21 @@ import { F as canRewriteVoidProjectConfig, I as renderVoidConfig, L as writeVoid
|
|
|
7
8
|
import { c as getDatabaseCasing, l as getDatabaseDialect, p as readConfig, s as databaseConfigValue } from "./config-Dv5jri1-.mjs";
|
|
8
9
|
import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BSoW3QCB.mjs";
|
|
9
10
|
import { n as snapshotDrizzleOutputs } from "./generate-Dq2Bgw75.mjs";
|
|
10
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
11
|
+
import { r as detectFramework } from "./plugin-inference-COlq96WJ.mjs";
|
|
11
12
|
import { t as hasOwnKey } from "./has-own-key-D9QEnAkF.mjs";
|
|
12
13
|
import { i as readPackageJson, n as hasPackageDependency, t as getPackageDependencies } from "./package-json-4xUI3xLz.mjs";
|
|
13
14
|
import { n as getOwnVersion, r as getPackageDir, t as detectAgents } from "./agents-64FnLwxP.mjs";
|
|
14
15
|
import { t as connectCloudflare } from "./cloudflare-connect-BgpHcSg3.mjs";
|
|
15
|
-
import { c as getToken } from "./auth-
|
|
16
|
-
import { r as PlatformClient } from "./client-
|
|
17
|
-
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-
|
|
18
|
-
import { t as promptForLoginToken } from "./login-
|
|
16
|
+
import { c as getToken } from "./auth-CqwJwItO.mjs";
|
|
17
|
+
import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
|
|
18
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-8FdN6D2i.mjs";
|
|
19
|
+
import { t as promptForLoginToken } from "./login-jUBgfvzk.mjs";
|
|
19
20
|
import { c as writeDeploymentPlatform, n as readDeploymentPlatform, r as readProjectConfig, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-dh9431bN.mjs";
|
|
20
21
|
import { t as parseDotenvFile } from "./dotenv-BG6RQavH.mjs";
|
|
21
22
|
import { i as migrateFrameworkAdapterPaths, t as migrateLegacyVoidConfig } from "./migrate-BNZL1hee.mjs";
|
|
22
23
|
import { _ as printDone, a as createSpinner, f as formatUrl, g as note, l as formatDuration, v as printNextStep, y as printSuccess } from "./output-BZLnu0z8.mjs";
|
|
23
|
-
import {
|
|
24
|
+
import { t as require_picocolors } from "./picocolors-D1NxSLw-.mjs";
|
|
25
|
+
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-D_4z2Ijv.mjs";
|
|
24
26
|
import { d as findWorkspaceMemberRoot, f as findWorkspaceRoot, h as patchViteConfigWithVoidPlugin, m as stripYamlLineComment, p as parsePackageManagerField, s as formatProjectCommand } from "./cloudflare-process-60r4Z2Zf.mjs";
|
|
25
27
|
import { i as hasLocalLockfile, n as drizzleKitBin, r as findInstalledYarnPnpRuntime, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DgWbE7z5.mjs";
|
|
26
28
|
import { createRequire } from "node:module";
|
|
@@ -581,6 +583,7 @@ var dependencies = {
|
|
|
581
583
|
"vitest": "5.1.1"
|
|
582
584
|
};
|
|
583
585
|
// src/cli/starter-ui.css?raw
|
|
586
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
584
587
|
var starter_ui_default = ":root {\n --text: rgb(22 23 29 / 70%);\n --text-h: #16171d;\n --bg: #fff;\n --border: #e5e4e7;\n --code-bg: #f2f1f4;\n --accent: #6c3bff;\n --error: #b42318;\n --social-bg: #f2f1f4;\n --radius-inner: 4px;\n --radius-element: 6px;\n --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;\n\n --sans: system-ui, 'Segoe UI', Roboto, sans-serif;\n --heading: system-ui, 'Segoe UI', Roboto, sans-serif;\n --mono: ui-monospace, Consolas, monospace;\n\n font: 18px/145% var(--sans);\n letter-spacing: 0.18px;\n color-scheme: light dark;\n color: var(--text);\n background: var(--bg);\n font-synthesis: none;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n\n @media (max-width: 1024px) {\n font-size: 16px;\n }\n}\n\n@supports (corner-shape: squircle) {\n :root {\n /* Squircle curves need about twice the radius to read as rounded. */\n --radius-inner: 8px;\n --radius-element: 12px;\n }\n\n :where(.starter, .starter *),\n .starter *::before,\n .starter *::after {\n corner-shape: squircle;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --text: rgb(255 255 255 / 70%);\n --text-h: #fff;\n --bg: #16171d;\n --border: #3b3440;\n --code-bg: #3b3440;\n --accent: #b39aff;\n --error: #fda29b;\n --social-bg: #3b3440;\n --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;\n }\n}\n\n.starter {\n width: 1126px;\n max-width: 100%;\n margin: 0 auto;\n text-align: center;\n border-inline: 1px solid var(--border);\n min-height: 100svh;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n}\n\nh1,\nh2 {\n font-family: var(--heading);\n font-weight: 500;\n color: var(--text-h);\n}\n\nh1 {\n font-size: 56px;\n letter-spacing: -1.68px;\n margin: 32px 0;\n @media (max-width: 1024px) {\n font-size: 36px;\n margin: 20px 0;\n }\n}\nh2 {\n font-size: 24px;\n line-height: 118%;\n letter-spacing: -0.24px;\n margin: 0 0 8px;\n @media (max-width: 1024px) {\n font-size: 20px;\n }\n}\np {\n margin: 0;\n}\n\ncode {\n font-family: var(--mono);\n display: inline-flex;\n border-radius: var(--radius-inner);\n color: var(--text-h);\n font-size: 15px;\n line-height: 135%;\n padding: 4px 8px;\n background: var(--code-bg);\n}\n\n.hero {\n position: relative;\n\n .base,\n .framework,\n .void {\n inset-inline: 0;\n margin: 0 auto;\n }\n\n .base {\n width: 170px;\n position: relative;\n z-index: 0;\n }\n\n .framework,\n .void {\n position: absolute;\n }\n\n .framework {\n z-index: 1;\n top: 34px;\n height: 28px;\n transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) scale(1.4);\n }\n\n .void {\n z-index: 0;\n top: 107px;\n height: 22px;\n width: auto;\n transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) scale(0.8);\n }\n}\n\n#center {\n display: flex;\n flex-direction: column;\n gap: 25px;\n padding-bottom: 24px;\n place-content: center;\n place-items: center;\n flex-grow: 1;\n\n @media (max-width: 1024px) {\n padding: 32px 20px 24px;\n gap: 18px;\n }\n}\n\n.starter-intro {\n width: min(720px, 100%);\n padding-inline: 20px;\n box-sizing: border-box;\n\n a {\n color: var(--accent);\n }\n\n @media (max-width: 1024px) {\n padding-inline: 0;\n }\n}\n\n.starter-description {\n display: grid;\n gap: 12px;\n\n > p:nth-child(2) {\n text-wrap: balance;\n }\n}\n\n.starter-demo {\n border-top: 1px solid var(--border);\n padding: 32px;\n text-align: left;\n\n @media (max-width: 1024px) {\n padding: 24px 20px;\n }\n}\n\n.demo-content {\n max-width: 640px;\n margin: 0 auto;\n display: grid;\n gap: 24px;\n\n h2 {\n margin: 0;\n }\n}\n\n.messages {\n list-style: none;\n margin: 0;\n padding: 0;\n display: grid;\n gap: 12px;\n\n li {\n padding: 12px 16px;\n border: 1px solid var(--border);\n border-radius: var(--radius-element);\n overflow-wrap: anywhere;\n }\n\n strong {\n display: block;\n color: var(--text-h);\n font-weight: 500;\n }\n\n small {\n font-size: 14px;\n }\n}\n\n.message-form {\n display: grid;\n gap: 12px;\n\n label {\n color: var(--text-h);\n }\n\n input,\n button {\n font: inherit;\n color: var(--text-h);\n background: var(--social-bg);\n border: 1px solid var(--border);\n border-radius: var(--radius-element);\n padding: 10px 12px;\n\n &:focus-visible {\n outline: 2px solid var(--accent);\n outline-offset: 2px;\n }\n }\n\n input {\n flex: 1;\n min-width: 0;\n }\n\n button {\n cursor: pointer;\n\n &:hover {\n border-color: var(--accent);\n }\n\n &:disabled {\n cursor: wait;\n opacity: 0.6;\n }\n }\n}\n\n.message-fields {\n display: flex;\n gap: 8px;\n\n @media (max-width: 480px) {\n flex-direction: column;\n }\n}\n\n.message-form [data-void-form-error] {\n color: var(--error);\n font-size: 14px;\n}\n\n#next-steps {\n display: flex;\n border-top: 1px solid var(--border);\n text-align: left;\n\n & > div {\n flex: 1 1 0;\n padding: 32px;\n @media (max-width: 1024px) {\n padding: 24px 20px;\n }\n }\n\n .icon {\n color: var(--accent);\n margin-bottom: 16px;\n width: 22px;\n height: 22px;\n }\n\n @media (max-width: 1024px) {\n flex-direction: column;\n text-align: center;\n }\n}\n\n#docs {\n border-right: 1px solid var(--border);\n\n @media (max-width: 1024px) {\n border-right: none;\n border-bottom: 1px solid var(--border);\n }\n}\n\n#next-steps ul {\n list-style: none;\n padding: 0;\n display: flex;\n gap: 8px;\n margin: 32px 0 0;\n\n a {\n color: var(--text-h);\n font-size: 16px;\n border-radius: var(--radius-element);\n background: var(--social-bg);\n display: flex;\n padding: 6px 12px;\n align-items: center;\n gap: 8px;\n text-decoration: none;\n transition: box-shadow 0.3s;\n\n &:hover {\n box-shadow: var(--shadow);\n }\n .button-icon {\n height: 18px;\n width: 18px;\n }\n }\n\n @media (max-width: 1024px) {\n margin-top: 20px;\n flex-wrap: wrap;\n justify-content: center;\n\n li {\n flex: 1 1 calc(50% - 8px);\n }\n\n a {\n width: 100%;\n justify-content: center;\n box-sizing: border-box;\n }\n }\n}\n\n#spacer {\n height: 88px;\n border-top: 1px solid var(--border);\n @media (max-width: 1024px) {\n height: 48px;\n }\n}\n\n.ticks {\n position: relative;\n width: 100%;\n\n &::before,\n &::after {\n content: '';\n position: absolute;\n top: -4.5px;\n border: 5px solid transparent;\n }\n\n &::before {\n left: 0;\n border-left-color: var(--border);\n }\n &::after {\n right: 0;\n border-right-color: var(--border);\n }\n}\n";
|
|
585
588
|
// src/cli/template.ts
|
|
586
589
|
const SCAFFOLD_GITIGNORE_LINES = [
|
|
@@ -601,12 +604,13 @@ const SCAFFOLD_BASE_DEV_DEPENDENCIES = {
|
|
|
601
604
|
typescript: "^7.0.2"
|
|
602
605
|
};
|
|
603
606
|
const SCAFFOLD_VITE_PLUS_DEV_DEPENDENCIES = {
|
|
607
|
+
"@cloudflare/oxlint-config": "^0.2.0",
|
|
604
608
|
vite: dependencies.vite,
|
|
605
609
|
"vite-plus": version
|
|
606
610
|
};
|
|
607
611
|
const SCAFFOLD_TOOLCHAIN_OPTIONS = [{
|
|
608
612
|
value: "vite-plus",
|
|
609
|
-
label: "Vite+",
|
|
613
|
+
label: import_picocolors.default.bold("Vite+ (recommended)"),
|
|
610
614
|
hint: "Uses the Vite+ toolchain and vp commands."
|
|
611
615
|
}, {
|
|
612
616
|
value: "vite",
|
|
@@ -663,7 +667,7 @@ const SCAFFOLD_FRAMEWORKS = {
|
|
|
663
667
|
adapterPlugin: "@void/vue/plugin",
|
|
664
668
|
pageExtension: "vue",
|
|
665
669
|
dependencies: { vue: "^3.5.30" },
|
|
666
|
-
devDependencies: {},
|
|
670
|
+
devDependencies: { typescript: "^6.0.3" },
|
|
667
671
|
tsconfigCompilerOptions: { jsx: "preserve" }
|
|
668
672
|
},
|
|
669
673
|
svelte: {
|
|
@@ -704,7 +708,7 @@ function createPagesStarterTemplate(options) {
|
|
|
704
708
|
const assets = join(getPackageDir(), "templates", "assets");
|
|
705
709
|
const files = {
|
|
706
710
|
"void.config.ts": renderVoidConfig({ routing: { typedRoutes: true } }, "// Generated by void init."),
|
|
707
|
-
"vite.config.ts": getViteConfig(framework, config),
|
|
711
|
+
"vite.config.ts": getViteConfig(framework, config, toolchain),
|
|
708
712
|
[`pages/index.${config.pageExtension}`]: getIndexPage(framework, starterMode),
|
|
709
713
|
"pages/style.css": starter_ui_default,
|
|
710
714
|
"pages/vite-env.d.ts": "/// <reference types=\"vite/client\" />\n",
|
|
@@ -741,29 +745,68 @@ function createPagesStarterTemplate(options) {
|
|
|
741
745
|
files
|
|
742
746
|
};
|
|
743
747
|
}
|
|
744
|
-
function getViteConfig(framework, config) {
|
|
745
|
-
|
|
748
|
+
function getViteConfig(framework, config, toolchain) {
|
|
749
|
+
const imports = toolchain === "vite-plus" ? `import cloudflare from "@cloudflare/oxlint-config/vite-plus";
|
|
750
|
+
import { defineConfig } from "vite-plus";` : "import { defineConfig } from \"vite\";";
|
|
751
|
+
const frameworkLintOverrides = {
|
|
752
|
+
react: [],
|
|
753
|
+
vue: [{
|
|
754
|
+
files: ["**/*.vue"],
|
|
755
|
+
rules: { "no-undef": "off" }
|
|
756
|
+
}],
|
|
757
|
+
svelte: [{
|
|
758
|
+
files: ["**/*.svelte"],
|
|
759
|
+
rules: {
|
|
760
|
+
"no-undef": "off",
|
|
761
|
+
"prefer-const": "off"
|
|
762
|
+
}
|
|
763
|
+
}],
|
|
764
|
+
solid: [{
|
|
765
|
+
files: ["**/*.{jsx,tsx}"],
|
|
766
|
+
rules: {
|
|
767
|
+
"react/immutability": "off",
|
|
768
|
+
"react/no-unknown-property": "off",
|
|
769
|
+
"react/purity": "off",
|
|
770
|
+
"react/rules-of-hooks": "off"
|
|
771
|
+
}
|
|
772
|
+
}]
|
|
773
|
+
}[framework];
|
|
774
|
+
const overrides = frameworkLintOverrides.length ? ` overrides: ${indent(JSON.stringify(frameworkLintOverrides, null, 2), 4).trimStart()},\n` : "";
|
|
775
|
+
const lint = toolchain === "vite-plus" ? ` lint: {
|
|
776
|
+
extends: [cloudflare],
|
|
777
|
+
env: cloudflare.env,
|
|
778
|
+
ignorePatterns: [
|
|
779
|
+
...cloudflare.ignorePatterns,
|
|
780
|
+
"**/dist/**",
|
|
781
|
+
"**/.void/**",
|
|
782
|
+
"**/.wrangler/**",
|
|
783
|
+
"**/.cloudflare/**",
|
|
784
|
+
],
|
|
785
|
+
${overrides} },
|
|
786
|
+
` : "";
|
|
787
|
+
if (framework === "react") return `${imports}
|
|
746
788
|
import { voidPlugin } from "void";
|
|
747
789
|
import { ${config.adapterImport} } from "${config.adapterPlugin}";
|
|
748
790
|
|
|
749
791
|
export default defineConfig({
|
|
750
|
-
plugins: [
|
|
792
|
+
${lint} plugins: [
|
|
751
793
|
voidPlugin(),
|
|
752
794
|
${config.adapterImport}({ react: { compiler: true } }),
|
|
753
795
|
],
|
|
754
796
|
});
|
|
755
797
|
`;
|
|
756
|
-
return
|
|
798
|
+
return `${imports}
|
|
757
799
|
import { voidPlugin } from "void";
|
|
758
800
|
import { ${config.adapterImport} } from "${config.adapterPlugin}";
|
|
759
801
|
|
|
760
802
|
export default defineConfig({
|
|
761
|
-
plugins: [voidPlugin(), ${config.adapterImport}()],
|
|
803
|
+
${lint} plugins: [voidPlugin(), ${config.adapterImport}()],
|
|
762
804
|
});
|
|
763
805
|
`;
|
|
764
806
|
}
|
|
765
807
|
function getIndexServer() {
|
|
766
|
-
return `import { defineHandler
|
|
808
|
+
return `import { defineHandler } from "void";
|
|
809
|
+
import type { InferProps } from "void";
|
|
767
810
|
import { db, desc } from "void/db";
|
|
768
811
|
import { messages } from "@schema";
|
|
769
812
|
import { createInsertSchema } from "void/drizzle-zod";
|
|
@@ -822,10 +865,11 @@ export const messages = sqliteTable("messages", {
|
|
|
822
865
|
}
|
|
823
866
|
function getSeedFile() {
|
|
824
867
|
return `import { defineSeed } from "void/seed";
|
|
868
|
+
import type { messages } from "./schema";
|
|
825
869
|
|
|
826
870
|
const SAMPLE_MESSAGES = ["Hello from Void"];
|
|
827
871
|
|
|
828
|
-
export default defineSeed<typeof
|
|
872
|
+
export default defineSeed<{ messages: typeof messages }>(async ({ db, schema }) => {
|
|
829
873
|
await db.insert(schema.messages).values(
|
|
830
874
|
SAMPLE_MESSAGES.map((text) => ({
|
|
831
875
|
text,
|
|
@@ -1220,6 +1264,7 @@ const EMPTY_PROJECT_ALLOWED_PACKAGES = /* @__PURE__ */ new Set([
|
|
|
1220
1264
|
"hono",
|
|
1221
1265
|
"vite",
|
|
1222
1266
|
"vite-plus",
|
|
1267
|
+
"@cloudflare/oxlint-config",
|
|
1223
1268
|
"typescript",
|
|
1224
1269
|
"@rolldown/plugin-babel",
|
|
1225
1270
|
"@vitejs/plugin-react",
|
|
@@ -1977,7 +2022,7 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1977
2022
|
let selectedApiUrl = null;
|
|
1978
2023
|
let promptedForPlatform = false;
|
|
1979
2024
|
try {
|
|
1980
|
-
const { getApiUrl, getSiteDomain } = await import("./auth-
|
|
2025
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-A7cZ8aXA.mjs");
|
|
1981
2026
|
selectedApiUrl = getApiUrl(root);
|
|
1982
2027
|
getSiteDomain(root);
|
|
1983
2028
|
} catch (error) {
|
|
@@ -2812,7 +2857,7 @@ async function runInitSteps(root, report, initArgs) {
|
|
|
2812
2857
|
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2813
2858
|
if (shouldSetupGithub && !workspaceSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2814
2859
|
if (!voidPlatformDiscovery) {
|
|
2815
|
-
const { getApiUrl } = await import("./auth-
|
|
2860
|
+
const { getApiUrl } = await import("./auth-A7cZ8aXA.mjs");
|
|
2816
2861
|
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2817
2862
|
}
|
|
2818
2863
|
if (!voidPlatformDiscovery.capabilities.githubActions) {
|