void 0.8.6 → 0.8.8

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-D-sNgH78.mjs").then((n) => n.t).then(({ runDeploy }) => {
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-D-sNgH78.mjs").then((n) => n.t);
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
- copyFileSync(handlerPath, join(workerDir, "__void_migration_handler.mjs"));
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
  *
@@ -2190,6 +2217,7 @@ function generateHandlersSource(root, features) {
2190
2217
  var deploy_exports = /* @__PURE__ */ __exportAll({
2191
2218
  applyDeployEvent: () => applyDeployEvent,
2192
2219
  ensurePreviouslyDeployedLiveBindingConfig: () => ensurePreviouslyDeployedLiveBindingConfig,
2220
+ generateDeployWrapperIfNeeded: () => generateDeployWrapperIfNeeded,
2193
2221
  hasDeploySchemaDrift: () => hasDeploySchemaDrift,
2194
2222
  promptDeployProjectConfig: () => promptDeployProjectConfig,
2195
2223
  resolveDeployLiveBindingConfig: () => resolveDeployLiveBindingConfig,
@@ -2205,6 +2233,11 @@ var deploy_exports = /* @__PURE__ */ __exportAll({
2205
2233
  const drizzleKitBin = join(fileURLToPath(import.meta.resolve("drizzle-kit")), "..", "bin.cjs");
2206
2234
  const deployDriftCheckDir = join(".void", "deploy-drift-check");
2207
2235
  var DeployEventError = class extends Error {};
2236
+ async function generateDeployWrapperIfNeeded(root, workerDir, workerMain, features) {
2237
+ if (!needsWrapper(features)) return false;
2238
+ await generateWrapper(workerDir, workerMain, root, features);
2239
+ return true;
2240
+ }
2208
2241
  const EMPTY_BINDINGS = {
2209
2242
  needsD1: false,
2210
2243
  needsKV: false,
@@ -2837,7 +2870,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
2837
2870
  }
2838
2871
  if (needsWrapper(wrapperFeatures)) {
2839
2872
  R.step("Generating wrapper...");
2840
- await generateWrapper(actualWorkerDir, actualWorkerMain, root, wrapperFeatures);
2873
+ await generateDeployWrapperIfNeeded(root, actualWorkerDir, actualWorkerMain, wrapperFeatures);
2841
2874
  R.info("Wrapper generated");
2842
2875
  }
2843
2876
  const wranglerCompat = resolveDeployWranglerCompat(root, voidConfig, workerDir, { dialect });
@@ -3038,7 +3071,9 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3038
3071
  }
3039
3072
  }
3040
3073
  const workerDirName = resolveWorkerDirName(distDir, fwPreset, frameworkBuildCmd);
3041
- const schedules = scanJobsSync(root, paths.cronsDir).flatMap((job) => job.crons.map((cron) => ({
3074
+ const rawJobs = scanJobsSync(root, paths.cronsDir);
3075
+ const rawQueues = scanQueuesSync(root, paths.queuesDir);
3076
+ const schedules = rawJobs.flatMap((job) => job.crons.map((cron) => ({
3042
3077
  name: job.name,
3043
3078
  cron
3044
3079
  })));
@@ -3054,7 +3089,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3054
3089
  sandboxClassName: sandboxConfig?.className,
3055
3090
  cliLog
3056
3091
  });
3057
- const queues = scanQueuesSync(root, paths.queuesDir).map((q) => ({
3092
+ const queues = rawQueues.map((q) => ({
3058
3093
  name: q.name,
3059
3094
  bindingName: q.bindingName,
3060
3095
  ...q.maxBatchSize != null && { maxBatchSize: q.maxBatchSize },
@@ -3181,7 +3216,22 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3181
3216
  dialect,
3182
3217
  webSockets
3183
3218
  });
3184
- const workerFiles = collectWorkerFiles(join(distDir, workerDirName));
3219
+ const workerDir = join(distDir, workerDirName);
3220
+ if (isFrameworkMode) {
3221
+ const wrapperFeatures = {
3222
+ auth: null,
3223
+ crons: rawJobs,
3224
+ queues: rawQueues,
3225
+ hasMigrations: validatedMigrations != null && validatedMigrations.length > 0,
3226
+ migrationDialect: dialect
3227
+ };
3228
+ if (needsWrapper(wrapperFeatures)) {
3229
+ R.step("Generating wrapper...");
3230
+ await generateDeployWrapperIfNeeded(root, workerDir, fwPreset?.workerMain ?? "index.js", wrapperFeatures);
3231
+ R.info("Wrapper generated");
3232
+ }
3233
+ }
3234
+ const workerFiles = collectWorkerFiles(workerDir);
3185
3235
  cliLog?.info("package_end", {
3186
3236
  mode: "full",
3187
3237
  durationMs: Date.now() - packageStartedAt
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-D-sNgH78.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-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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "void",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
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.6"
336
+ "@void/md": "0.8.8"
337
337
  },
338
338
  "peerDependenciesMeta": {
339
339
  "@void/md": {