@vinext/cloudflare 1.0.0-beta.2 → 1.0.0-beta.4

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/deploy.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { readPrerenderWarmPaths, warmCdnCache } from "./cdn-warm.js";
2
2
  import { parseWranglerConfig, runTPR } from "./tpr.js";
3
3
  import { formatImageOptimizationHint, formatMissingCacheAdapterError, resolveKvDataAdapterConfig, viteConfigHasCacheAdapter, viteConfigHasCloudflarePlugin, viteConfigHasImageAdapter, workerEntryHasCacheHandler } from "./deploy-config.js";
4
- import { parseWorkersDevUrl } from "./workers-dev-url.js";
5
4
  import { runWranglerDeploymentStatus, runWranglerTriggersDeploy, runWranglerVersionDeploy, runWranglerVersionUpload } from "./version-deploy.js";
5
+ import { parseWorkerDeploymentUrl } from "./worker-deployment-url.js";
6
6
  import { buildPrerenderKVPairs } from "./prerender-kv-populate.js";
7
7
  import { createRequire } from "node:module";
8
8
  import path from "node:path";
@@ -344,7 +344,7 @@ async function runWranglerDeploy(root, options, execute = spawn) {
344
344
  reject(/* @__PURE__ */ new Error(`Wrangler deploy failed with ${exitReason}.`));
345
345
  });
346
346
  });
347
- return parseWorkersDevUrl(output) ?? "(URL not detected in wrangler output)";
347
+ return parseWorkerDeploymentUrl(output) ?? "(URL not detected in wrangler output)";
348
348
  }
349
349
  async function deployWithCdnWarmup(root, paths, options) {
350
350
  const upload = runWranglerVersionUpload(root, options);
@@ -80,7 +80,7 @@ function buildPrerenderKVPairs(serverDir, options) {
80
80
  const revalidateSeconds = typeof route.revalidate === "number" ? route.revalidate : void 0;
81
81
  const expireSeconds = typeof route.expire === "number" ? route.expire : void 0;
82
82
  const expirationTtl = revalidateSeconds === void 0 ? void 0 : ttlSeconds;
83
- const tags = buildAppPageCacheTags(cachePathname, []);
83
+ const tags = buildAppPageCacheTags(cachePathname, route.tags ?? []);
84
84
  const metadata = buildMetadata(tags);
85
85
  const htmlKey = appIsrCacheKey(cachePathname, "html", manifest.buildId);
86
86
  const rscKey = appIsrCacheKey(cachePathname, "rsc", manifest.buildId);
@@ -0,0 +1,4 @@
1
+ //#region src/worker-deployment-url.d.ts
2
+ declare function parseWorkerDeploymentUrl(output: string): string | null;
3
+ //#endregion
4
+ export { parseWorkerDeploymentUrl };
@@ -0,0 +1,23 @@
1
+ import { parseWorkersDevUrl } from "./workers-dev-url.js";
2
+ //#region src/worker-deployment-url.ts
3
+ function parseWorkerDeploymentUrl(output) {
4
+ return parseWorkersDevUrl(output) ?? parseCustomDomainUrl(output);
5
+ }
6
+ function parseCustomDomainUrl(output) {
7
+ for (const line of output.split(/\r?\n/)) {
8
+ const match = /^\s*(\S+)\s+\(custom domain(?: - zone (?:id|name): [^)]+)?\)(?: \[([^\]\r\n]+)\])?\s*$/.exec(line);
9
+ const hostname = match?.[1];
10
+ if (!hostname) continue;
11
+ if (match[2]?.split(",").some((flag) => flag.trim() === "disabled")) continue;
12
+ try {
13
+ const url = new URL(`https://${hostname}`);
14
+ if (url.username !== "" || url.password !== "" || url.port !== "" || url.pathname !== "/" || url.search !== "" || url.hash !== "") continue;
15
+ return url.origin;
16
+ } catch {
17
+ continue;
18
+ }
19
+ }
20
+ return null;
21
+ }
22
+ //#endregion
23
+ export { parseWorkerDeploymentUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vinext/cloudflare",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "Cloudflare adapters for vinext (KV data cache and Images-backed image optimization).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,10 +54,10 @@
54
54
  "@types/node": "^25.9.2",
55
55
  "vite": "npm:@voidzero-dev/vite-plus-core@0.2.2",
56
56
  "vite-plus": "0.2.2",
57
- "vinext": "1.0.0-beta.2"
57
+ "vinext": "1.0.0-beta.4"
58
58
  },
59
59
  "peerDependencies": {
60
- "vinext": "^1.0.0-beta.2"
60
+ "vinext": "^1.0.0-beta.4"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">=22"