void 0.8.7 → 0.8.9
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/cli/cli.mjs
CHANGED
|
@@ -1516,7 +1516,7 @@ else if (command === "deploy") {
|
|
|
1516
1516
|
R.error(err instanceof Error ? err.message : String(err));
|
|
1517
1517
|
process.exit(1);
|
|
1518
1518
|
}
|
|
1519
|
-
import("../deploy-
|
|
1519
|
+
import("../deploy-Dm-sLnvz.mjs").then((n) => n.t).then(({ runDeploy }) => {
|
|
1520
1520
|
runDeploy(root, {
|
|
1521
1521
|
projectSlug: deployArgs.projectSlug,
|
|
1522
1522
|
dir: deployArgs.dir,
|
|
@@ -1646,7 +1646,7 @@ else if (command === "-v" || command === "--version") {
|
|
|
1646
1646
|
return;
|
|
1647
1647
|
}
|
|
1648
1648
|
case "deploy": {
|
|
1649
|
-
const { runDeploy } = await import("../deploy-
|
|
1649
|
+
const { runDeploy } = await import("../deploy-Dm-sLnvz.mjs").then((n) => n.t);
|
|
1650
1650
|
await runDeploy(root);
|
|
1651
1651
|
return;
|
|
1652
1652
|
}
|
|
@@ -1988,11 +1988,38 @@ async function generateWrapper(workerDir, workerMain, root, features) {
|
|
|
1988
1988
|
if (!existsSync(handlerPath)) handlerPath = join(import.meta.dirname, "..", "runtime", handlerFilename_);
|
|
1989
1989
|
if (!existsSync(handlerPath)) handlerPath = join(import.meta.dirname, "..", "..", "dist", "runtime", handlerFilename_);
|
|
1990
1990
|
if (!existsSync(handlerPath)) throw new Error(`Migration handler not found: ${handlerFilename_}. Run "pnpm -C packages/void build" first.`);
|
|
1991
|
-
|
|
1991
|
+
if (features.migrationDialect === "postgresql") await bundlePgMigrationHandler(root, workerDir, handlerPath);
|
|
1992
|
+
else copyFileSync(handlerPath, join(workerDir, "__void_migration_handler.mjs"));
|
|
1992
1993
|
}
|
|
1993
1994
|
const wrapperSource = generateWrapperSource(renamedName, handlerFilename, features, migrations, migrationPlanBundle);
|
|
1994
1995
|
writeFileSync(join(workerDir, workerMain), wrapperSource);
|
|
1995
1996
|
}
|
|
1997
|
+
async function bundlePgMigrationHandler(root, workerDir, handlerPath) {
|
|
1998
|
+
const tmpDir = join(root, ".void", "migration-handler");
|
|
1999
|
+
mkdirSync(tmpDir, { recursive: true });
|
|
2000
|
+
const outDir = join(tmpDir, "out");
|
|
2001
|
+
await build({
|
|
2002
|
+
root: tmpDir,
|
|
2003
|
+
logLevel: "silent",
|
|
2004
|
+
ssr: { noExternal: ["pg", "pg-cloudflare"] },
|
|
2005
|
+
build: {
|
|
2006
|
+
outDir,
|
|
2007
|
+
emptyOutDir: true,
|
|
2008
|
+
minify: false,
|
|
2009
|
+
ssr: handlerPath,
|
|
2010
|
+
target: "esnext",
|
|
2011
|
+
rollupOptions: {
|
|
2012
|
+
input: handlerPath,
|
|
2013
|
+
external: [/^cloudflare:/, /^node:/],
|
|
2014
|
+
output: {
|
|
2015
|
+
entryFileNames: "__void_migration_handler.mjs",
|
|
2016
|
+
chunkFileNames: "__void_migration_handler-[hash].mjs"
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
});
|
|
2021
|
+
for (const file of readdirSync(outDir)) copyFileSync(join(outDir, file), join(workerDir, file));
|
|
2022
|
+
}
|
|
1996
2023
|
/**
|
|
1997
2024
|
* Bundle a worker entry into a self-contained module.
|
|
1998
2025
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as __toESM } from "./chunk-DJd-R1mw.mjs";
|
|
2
2
|
import { a as join, n as dirname, s as relative } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
3
3
|
import { u as require_picocolors } from "./output-DeiS4oEX.mjs";
|
|
4
|
-
import { C as isSandboxEnabled, D as resolveAssetRoutingPolicy, E as hasDocumentRoutes, S as SANDBOX_MIGRATION_TAG, T as hasApiRoutes, _ as normalizeWranglerCompatibilityFlags, a as prerenderPagesNode, b as resolveLiveBindingConfig, c as filterLoadedEnv, d as LIVE_MIGRATION_TAG, f as ensureWranglerCompat, g as nextDurableObjectMigrationTag, h as hasDurableObjectSqliteMigration, i as prerenderPages, l as resolveRemoteMode, m as ensureWranglerNodejsAlsFlag, n as resolveDistDir, o as DEFAULT_PROXY_URL, p as ensureWranglerCompatibilityDate, r as resolveWorkerDirName, s as STAGING_PROXY_URL, u as stripInternalEnvKeys, v as readExistingLiveBindingConfig, w as resolveSandboxConfig, x as syncWranglerBindings, y as readWranglerCompat } from "./deploy-
|
|
4
|
+
import { C as isSandboxEnabled, D as resolveAssetRoutingPolicy, E as hasDocumentRoutes, S as SANDBOX_MIGRATION_TAG, T as hasApiRoutes, _ as normalizeWranglerCompatibilityFlags, a as prerenderPagesNode, b as resolveLiveBindingConfig, c as filterLoadedEnv, d as LIVE_MIGRATION_TAG, f as ensureWranglerCompat, g as nextDurableObjectMigrationTag, h as hasDurableObjectSqliteMigration, i as prerenderPages, l as resolveRemoteMode, m as ensureWranglerNodejsAlsFlag, n as resolveDistDir, o as DEFAULT_PROXY_URL, p as ensureWranglerCompatibilityDate, r as resolveWorkerDirName, s as STAGING_PROXY_URL, u as stripInternalEnvKeys, v as readExistingLiveBindingConfig, w as resolveSandboxConfig, x as syncWranglerBindings, y as readWranglerCompat } from "./deploy-Dm-sLnvz.mjs";
|
|
5
5
|
import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-CCMrHYQm.mjs";
|
|
6
6
|
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
|
|
7
7
|
import { c as getToken, u as isStagingMode } from "./client-CCOKwNUz.mjs";
|
|
@@ -2,5 +2,11 @@ import { MigrationEntry } from "./migration-handler.mjs";
|
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/migration-handler-pg.d.ts
|
|
4
4
|
declare function createMigrationHandler(env: Record<string, unknown>, migrations: Array<MigrationEntry>, _dialect: "sqlite" | "postgresql", runAuthMigrations?: () => Promise<void>): (request: Request) => Promise<Response>;
|
|
5
|
+
/**
|
|
6
|
+
* `pg` falls back to `pgpass` when no password is present in the connection
|
|
7
|
+
* config and the server requests one. Workers have no pgpass file, and the
|
|
8
|
+
* Node fs/path polyfills can throw before `pg` reports the auth failure.
|
|
9
|
+
*/
|
|
10
|
+
declare function disablePgPassFallback(client: unknown): void;
|
|
5
11
|
//#endregion
|
|
6
|
-
export { createMigrationHandler };
|
|
12
|
+
export { createMigrationHandler, disablePgPassFallback };
|
|
@@ -29,6 +29,7 @@ async function runPgMigrations(env, migrations) {
|
|
|
29
29
|
};
|
|
30
30
|
const { Client } = await import("pg");
|
|
31
31
|
const client = new Client({ connectionString: hyperdrive.connectionString });
|
|
32
|
+
disablePgPassFallback(client);
|
|
32
33
|
await client.connect();
|
|
33
34
|
try {
|
|
34
35
|
await client.query(`CREATE TABLE IF NOT EXISTS _void_migrations (
|
|
@@ -81,5 +82,18 @@ async function runPgMigrations(env, migrations) {
|
|
|
81
82
|
await client.end();
|
|
82
83
|
}
|
|
83
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* `pg` falls back to `pgpass` when no password is present in the connection
|
|
87
|
+
* config and the server requests one. Workers have no pgpass file, and the
|
|
88
|
+
* Node fs/path polyfills can throw before `pg` reports the auth failure.
|
|
89
|
+
*/
|
|
90
|
+
function disablePgPassFallback(client) {
|
|
91
|
+
const pgClient = client;
|
|
92
|
+
if (pgClient.password == null) {
|
|
93
|
+
const noPassword = async () => void 0;
|
|
94
|
+
pgClient.password = noPassword;
|
|
95
|
+
if (pgClient.connectionParameters) pgClient.connectionParameters.password = noPassword;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
84
98
|
//#endregion
|
|
85
|
-
export { createMigrationHandler };
|
|
99
|
+
export { createMigrationHandler, disablePgPassFallback };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "void",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/voidzero-dev/void.git",
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
"valibot": ">=1.0.0-beta.7",
|
|
334
334
|
"vite": "^8.0.0",
|
|
335
335
|
"zod": "^3.25.0 || ^4.0.0",
|
|
336
|
-
"@void/md": "0.8.
|
|
336
|
+
"@void/md": "0.8.9"
|
|
337
337
|
},
|
|
338
338
|
"peerDependenciesMeta": {
|
|
339
339
|
"@void/md": {
|