@vinext/cloudflare 1.0.0-beta.6 → 1.0.0-beta.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.
Files changed (58) hide show
  1. package/README.md +62 -12
  2. package/dist/cache/cdn-adapter-config.d.ts +30 -0
  3. package/dist/cache/cdn-adapter-config.js +87 -0
  4. package/dist/cache/cdn-adapter.d.ts +47 -15
  5. package/dist/cache/cdn-adapter.js +49 -13
  6. package/dist/cache/cdn-adapter.runtime.d.ts +26 -4
  7. package/dist/cache/cdn-adapter.runtime.js +131 -33
  8. package/dist/cache/cdn-adapter.worker.d.ts +30 -0
  9. package/dist/cache/cdn-adapter.worker.js +371 -0
  10. package/dist/cache/cdn-build-id.d.ts +6 -0
  11. package/dist/cache/cdn-build-id.js +9 -0
  12. package/dist/cache/kv-data-adapter.d.ts +21 -5
  13. package/dist/cache/kv-data-adapter.runtime.d.ts +38 -4
  14. package/dist/cache/kv-data-adapter.runtime.js +116 -42
  15. package/dist/cache/kv-key.d.ts +4 -5
  16. package/dist/cache/response-store-adapter.d.ts +37 -0
  17. package/dist/cache/response-store-adapter.js +39 -0
  18. package/dist/cache/response-store-adapter.self-contained.worker.d.ts +17 -0
  19. package/dist/cache/response-store-adapter.self-contained.worker.js +10 -0
  20. package/dist/cache/response-store-adapter.service-binding.worker.d.ts +15 -0
  21. package/dist/cache/response-store-adapter.service-binding.worker.js +9 -0
  22. package/dist/cache/response-store-adapter.worker.d.ts +14 -0
  23. package/dist/cache/response-store-adapter.worker.js +254 -0
  24. package/dist/cache/response-store-cdn.runtime.d.ts +5 -0
  25. package/dist/cache/response-store-cdn.runtime.js +41 -0
  26. package/dist/cache/response-store-data.runtime.d.ts +34 -0
  27. package/dist/cache/response-store-data.runtime.js +289 -0
  28. package/dist/cacheability-artifact.d.ts +9 -0
  29. package/dist/cacheability-artifact.js +191 -0
  30. package/dist/cacheability-manifest-limits.d.ts +4 -0
  31. package/dist/cacheability-manifest-limits.js +7 -0
  32. package/dist/cacheability-probe.d.ts +49 -0
  33. package/dist/cacheability-probe.js +660 -0
  34. package/dist/cdn-warm.d.ts +110 -11
  35. package/dist/cdn-warm.js +864 -82
  36. package/dist/cli.js +15 -1
  37. package/dist/deploy-config.d.ts +13 -10
  38. package/dist/deploy-config.js +21 -3
  39. package/dist/deploy-help.d.ts +3 -4
  40. package/dist/deploy-help.js +43 -6
  41. package/dist/deploy.d.ts +77 -23
  42. package/dist/deploy.js +666 -84
  43. package/dist/images/images-optimizer.d.ts +3 -4
  44. package/dist/prerender-kv-populate.d.ts +3 -4
  45. package/dist/prerender-kv-populate.js +4 -3
  46. package/dist/tpr.d.ts +9 -10
  47. package/dist/tpr.js +3 -3
  48. package/dist/utils/cache-control-metadata.d.ts +3 -4
  49. package/dist/version-deploy.d.ts +19 -16
  50. package/dist/version-deploy.js +29 -12
  51. package/dist/version-headers.d.ts +2 -0
  52. package/dist/version-headers.js +2 -0
  53. package/dist/worker-deployment-url.d.ts +8 -3
  54. package/dist/worker-deployment-url.js +23 -1
  55. package/dist/workers-dev-url.d.ts +2 -3
  56. package/dist/wrangler-version-metadata.d.ts +7 -0
  57. package/dist/wrangler-version-metadata.js +9 -0
  58. package/package.json +14 -7
package/dist/cli.js CHANGED
@@ -38,16 +38,30 @@ async function deployCommand() {
38
38
  root: process.cwd(),
39
39
  preview: parsed.preview,
40
40
  env: parsed.env,
41
+ config: parsed.config,
41
42
  skipBuild: parsed.skipBuild,
42
43
  dryRun: parsed.dryRun,
44
+ verbose: parsed.verbose,
43
45
  name: parsed.name,
44
46
  prerenderAll: parsed.prerenderAll,
45
47
  prerenderConcurrency: parsed.prerenderConcurrency,
46
48
  warmCdnCache: parsed.warmCdnCache,
49
+ warmCdnTarget: parsed.warmCdnTarget,
47
50
  warmCdnConcurrency: parsed.warmCdnConcurrency,
48
51
  warmCdnTimeout: parsed.warmCdnTimeout,
49
52
  warmCdnRetries: parsed.warmCdnRetries,
50
- warmCdnStrict: parsed.warmCdnStrict,
53
+ warmCdnDiscoveryTimeout: parsed.warmCdnDiscoveryTimeout,
54
+ warmCdnDiscoveryRetries: parsed.warmCdnDiscoveryRetries,
55
+ warmCdnProbeTimeout: parsed.warmCdnProbeTimeout,
56
+ warmCdnProbeRetries: parsed.warmCdnProbeRetries,
57
+ warmCdnCertify: parsed.warmCdnCertify,
58
+ warmCdnReadinessTimeout: parsed.warmCdnReadinessTimeout,
59
+ warmCdnReadinessRetries: parsed.warmCdnReadinessRetries,
60
+ warmCdnReadinessProbes: parsed.warmCdnReadinessProbes,
61
+ warmCdnReadinessProbeDelay: parsed.warmCdnReadinessProbeDelay,
62
+ dangerouslyPromoteOnCdnWarmError: parsed.dangerouslyPromoteOnCdnWarmError,
63
+ warmCdnPromote: parsed.warmCdnPromote,
64
+ warmCdnPromotionDelay: parsed.warmCdnPromotionDelay,
51
65
  warmCdnIncludeFallbacks: parsed.warmCdnIncludeFallbacks,
52
66
  experimentalTPR: parsed.experimentalTPR,
53
67
  tprCoverage: parsed.tprCoverage,
@@ -8,7 +8,7 @@ import { VinextCacheConfig } from "vinext/internal/cache-adapters";
8
8
  * Returns true when the config both imports the package and invokes
9
9
  * `cloudflare(...)` in the plugin list.
10
10
  */
11
- declare function viteConfigHasCloudflarePlugin(root: string): boolean;
11
+ export declare function viteConfigHasCloudflarePlugin(root: string): boolean;
12
12
  /**
13
13
  * Detect whether the Vite config assigns a CDN or data cache adapter — i.e. the
14
14
  * `cdn` or `data` field of the `vinext({ cache })` option is given a value.
@@ -17,14 +17,18 @@ declare function viteConfigHasCloudflarePlugin(root: string): boolean;
17
17
  * an unreadable or absent config is treated as configured so a deploy is never
18
18
  * blocked on a false negative.
19
19
  */
20
- declare function viteConfigHasCacheAdapter(root: string): boolean;
21
- type ResolvedKvDataAdapterConfig = {
20
+ export declare function viteConfigHasCacheAdapter(root: string): boolean;
21
+ export type ResolvedKvDataAdapterConfig = {
22
22
  binding: string;
23
23
  appPrefix?: string;
24
24
  ttlSeconds?: number;
25
25
  };
26
- declare function resolveKvDataAdapterConfig(cache: VinextCacheConfig | null | undefined): ResolvedKvDataAdapterConfig | null;
27
- declare function viteConfigHasImageAdapter(root: string): boolean;
26
+ export type ResolvedCdnAdapterConfig = {
27
+ versionMetadataBinding: string;
28
+ };
29
+ export declare function resolveCdnAdapterConfig(cache: VinextCacheConfig | null | undefined): ResolvedCdnAdapterConfig | null;
30
+ export declare function resolveKvDataAdapterConfig(cache: VinextCacheConfig | null | undefined): ResolvedKvDataAdapterConfig | null;
31
+ export declare function viteConfigHasImageAdapter(root: string): boolean;
28
32
  /**
29
33
  * Detect whether an existing user-authored Worker entry wires up a cache
30
34
  * backend imperatively via one of the `setCacheHandler` / `setDataCacheHandler`
@@ -39,16 +43,15 @@ declare function viteConfigHasImageAdapter(root: string): boolean;
39
43
  * missing Worker entry returns false (nothing to inspect — defer to other
40
44
  * checks).
41
45
  */
42
- declare function workerEntryHasCacheHandler(root: string): boolean;
46
+ export declare function workerEntryHasCacheHandler(root: string): boolean;
43
47
  /**
44
48
  * Build the error thrown when an ISR/cached app is deployed without a cache
45
49
  * adapter configured in the Vite config. Production deployments need a
46
50
  * persistent cache backend; vinext no longer scaffolds one into the Worker
47
51
  * entry, so it must be declared via `vinext({ cache })`.
48
52
  */
49
- declare function formatMissingCacheAdapterError(options: {
53
+ export declare function formatMissingCacheAdapterError(options: {
50
54
  configFile?: string;
51
55
  }): string;
52
- declare function formatImageOptimizationHint(): string;
53
- //#endregion
54
- export { ResolvedKvDataAdapterConfig, formatImageOptimizationHint, formatMissingCacheAdapterError, resolveKvDataAdapterConfig, viteConfigHasCacheAdapter, viteConfigHasCloudflarePlugin, viteConfigHasImageAdapter, workerEntryHasCacheHandler };
56
+ export declare function formatImageOptimizationHint(): string;
57
+ //#endregion
@@ -1,6 +1,8 @@
1
1
  import { DEFAULT_KV_DATA_CACHE_BINDING } from "./cache/kv-data-adapter.js";
2
- import path from "node:path";
2
+ import { DEFAULT_CDN_VERSION_METADATA_BINDING } from "./cache/cdn-adapter.js";
3
3
  import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
4
6
  import { findViteConfigPath } from "vinext/internal/utils/project";
5
7
  //#region src/deploy-config.ts
6
8
  function escapeRegExp(value) {
@@ -84,9 +86,25 @@ function viteConfigHasCacheAdapter(root) {
84
86
  return true;
85
87
  }
86
88
  const block = extractCacheBlock(content);
87
- if (!block) return false;
89
+ if (!block) {
90
+ const assigned = /\bcache\s*:\s*([^,}\n]+)/.exec(content)?.[1].trim();
91
+ return Boolean(assigned && assigned !== "undefined" && assigned !== "null");
92
+ }
88
93
  return cacheFieldAssigned(block, "cdn") || cacheFieldAssigned(block, "data");
89
94
  }
95
+ function isCloudflareCdnAdapterPath(adapter) {
96
+ const normalized = adapter.replace(/\\/g, "/");
97
+ return ["cdn-adapter.runtime", "response-store-cdn.runtime"].some((runtime) => {
98
+ const bundledRuntime = fileURLToPath(new URL(`./cache/${runtime}.js`, import.meta.url)).replace(/\\/g, "/");
99
+ return normalized === `@vinext/cloudflare/cache/${runtime}` || normalized === `@vinext/cloudflare/cache/${runtime}.js` || normalized === bundledRuntime;
100
+ });
101
+ }
102
+ function resolveCdnAdapterConfig(cache) {
103
+ const cdn = cache?.cdn;
104
+ if (!cdn?.adapter || !isCloudflareCdnAdapterPath(cdn.adapter)) return null;
105
+ const options = cdn.options;
106
+ return { versionMetadataBinding: typeof options?.versionMetadataBinding === "string" && options.versionMetadataBinding.length > 0 ? options.versionMetadataBinding : DEFAULT_CDN_VERSION_METADATA_BINDING };
107
+ }
90
108
  function isCloudflareKvDataAdapterPath(adapter) {
91
109
  const normalized = adapter.replace(/\\/g, "/");
92
110
  return normalized === "@vinext/cloudflare/cache/kv-data-adapter.runtime" || normalized === "@vinext/cloudflare/cache/kv-data-adapter.runtime.js" || normalized.endsWith("/cache/kv-data-adapter.runtime.js");
@@ -166,4 +184,4 @@ function formatImageOptimizationHint() {
166
184
  return " [vinext] next/image is served unoptimized. To enable edge image\n optimization via Cloudflare Images, run:\n\n vinext init --platform=cloudflare --image-optimization=cloudflare-images\n\n This adds the imagesOptimizer() option to your Vite config and the matching\n IMAGES binding to your Wrangler config without replacing existing settings.";
167
185
  }
168
186
  //#endregion
169
- export { formatImageOptimizationHint, formatMissingCacheAdapterError, resolveKvDataAdapterConfig, viteConfigHasCacheAdapter, viteConfigHasCloudflarePlugin, viteConfigHasImageAdapter, workerEntryHasCacheHandler };
187
+ export { formatImageOptimizationHint, formatMissingCacheAdapterError, resolveCdnAdapterConfig, resolveKvDataAdapterConfig, viteConfigHasCacheAdapter, viteConfigHasCloudflarePlugin, viteConfigHasImageAdapter, workerEntryHasCacheHandler };
@@ -1,5 +1,4 @@
1
1
  //#region src/deploy-help.d.ts
2
- declare function formatDeployHelp(): string;
3
- declare function printDeployHelp(): void;
4
- //#endregion
5
- export { formatDeployHelp, printDeployHelp };
2
+ export declare function formatDeployHelp(): string;
3
+ export declare function printDeployHelp(): void;
4
+ //#endregion
@@ -18,6 +18,7 @@ function formatDeployHelp() {
18
18
  --config <path> Wrangler config path (default: wrangler.jsonc/json/toml)
19
19
  --skip-build Skip the build step (use existing dist/)
20
20
  --dry-run Validate setup without building or deploying
21
+ --verbose Print raw output from internal Wrangler commands
21
22
  --prerender-all Pre-render discovered routes after building (future
22
23
  releases will auto-populate the remote cache)
23
24
  --prerender-concurrency <count>
@@ -25,11 +26,44 @@ function formatDeployHelp() {
25
26
  --experimental-warm-cdn-cache
26
27
  Upload a Worker version, warm build-discovered paths
27
28
  through the production URL, then promote it (experimental)
29
+ --warm-cdn-target <origin>
30
+ HTTPS origin to use for discovery, probing, and warming
31
+ (overrides URLs inferred from Wrangler output)
28
32
  --warm-cdn-concurrency <count>
29
- Maximum number of CDN warmup requests in parallel
30
- --warm-cdn-timeout <ms> Per-request CDN warmup timeout (default: 5000)
31
- --warm-cdn-retries <n> Retries for transient CDN warmup failures (default: 1)
32
- --warm-cdn-strict Fail deploy when any CDN warmup request fails
33
+ Maximum number of CDN warmup requests in parallel (default: 25)
34
+ --warm-cdn-timeout <ms> Per-request CDN warmup timeout (default: 10000)
35
+ --warm-cdn-retries <n> Retries per failed CDN warmup request (default: 1;
36
+ staged-version propagation default: 60)
37
+ --warm-cdn-discovery-timeout <ms>
38
+ Total staged path-discovery deadline (default: 120000)
39
+ --warm-cdn-discovery-retries <n>
40
+ Optional staged path-discovery retry limit
41
+ (default: derived from the discovery deadline)
42
+ --warm-cdn-probe-timeout <ms>
43
+ Abort when cacheability probing makes no progress for
44
+ this duration (default: 120000)
45
+ --warm-cdn-probe-retries <n>
46
+ Cacheability-probe retries (default: 2)
47
+ --warm-cdn-certify With --experimental-warm-cdn-cache, re-request warmed
48
+ entries using headers only and require every planned
49
+ entry to be reusable before promotion
50
+ --warm-cdn-readiness-timeout <ms>
51
+ Explicit total staged-readiness deadline (default:
52
+ 120000)
53
+ --warm-cdn-readiness-retries <n>
54
+ Staged-readiness retries (default: 60)
55
+ --warm-cdn-readiness-probes <count>
56
+ Consecutive successful staged-readiness probes
57
+ required before warming (default: 6)
58
+ --warm-cdn-readiness-probe-delay <ms>
59
+ Delay between staged-readiness probes (default: 1000)
60
+ --dangerously-promote-on-cdn-warm-error
61
+ Promote even when ordinary staged warmup cannot be
62
+ verified (never bypasses --warm-cdn-certify)
63
+ --warm-cdn-no-promote Leave the warmed Worker version staged at 0% traffic;
64
+ production triggers are still applied before warming
65
+ --warm-cdn-promotion-delay <ms>
66
+ Delay before promotion after warmup (default: 15000)
33
67
  --warm-cdn-include-fallbacks
34
68
  Also warm PPR fallback-shell placeholder paths
35
69
  -h, --help Show this help
@@ -46,8 +80,9 @@ function formatDeployHelp() {
46
80
  a custom domain (zone analytics are unavailable on *.workers.dev) and the
47
81
  CLOUDFLARE_API_TOKEN environment variable with Zone.Analytics read permission.
48
82
 
49
- CDN warmup requests populate the edge cache only in the Cloudflare data centers
50
- reached by the warmup run; they do not globally prefill every edge location.
83
+ Workers Cache automatically uses tiered caching. Warmed entries can therefore
84
+ be reused outside the data center reached by the warmup request after cache
85
+ propagation, but the deploy does not wait for every edge location to fill.
51
86
 
52
87
  Examples:
53
88
  npx @vinext/cloudflare deploy Build and deploy to production
@@ -59,6 +94,8 @@ function formatDeployHelp() {
59
94
  vinext-cloudflare deploy --dry-run Validate setup without building or deploying
60
95
  vinext-cloudflare deploy --name my-app Deploy with a custom Worker name
61
96
  vinext-cloudflare deploy --experimental-warm-cdn-cache Warm build-discovered paths during version deploy (experimental)
97
+ vinext-cloudflare deploy --experimental-warm-cdn-cache --warm-cdn-target https://example.com
98
+ Warm an explicit production origin
62
99
  vinext-cloudflare deploy --experimental-tpr Enable TPR during deploy
63
100
  vinext-cloudflare deploy --experimental-tpr --tpr-coverage 95 Cover 95% of traffic
64
101
  vinext-cloudflare deploy --experimental-tpr --tpr-limit 500 Cap at 500 pages
package/dist/deploy.d.ts CHANGED
@@ -1,9 +1,13 @@
1
+ import { CdnWarmOptions, CdnWarmRequestPlan, PrerenderWarmPlan } from "./cdn-warm.js";
1
2
  import { parseWranglerConfig } from "./tpr.js";
2
3
  import { WranglerDeploymentStatus, WranglerVersionTraffic } from "./version-deploy.js";
3
4
  import { KVBulkPair } from "./prerender-kv-populate.js";
4
5
  import { spawn } from "node:child_process";
6
+ import { VinextCacheConfig } from "vinext/internal/config/prerender";
7
+ import { ProjectInfo } from "vinext/internal/utils/project";
5
8
  //#region src/deploy.d.ts
6
- type DeployOptions = {
9
+ export declare const DEFAULT_CDN_WARM_PROMOTION_DELAY_MS = 15000;
10
+ export type DeployOptions = {
7
11
  /** Project root directory */
8
12
  root: string;
9
13
  /** Deploy to preview environment (default: production) */
@@ -18,20 +22,46 @@ type DeployOptions = {
18
22
  skipBuild?: boolean;
19
23
  /** Dry run — validate setup but don't build or deploy */
20
24
  dryRun?: boolean;
25
+ /** Print raw output from internal Wrangler commands. */
26
+ verbose?: boolean;
21
27
  /** Pre-render all discovered routes into the dist output after building */
22
28
  prerenderAll?: boolean;
23
29
  /** Maximum number of routes to prerender in parallel */
24
30
  prerenderConcurrency?: number;
25
31
  /** Warm Cloudflare's CDN cache by requesting build-discovered paths for the uploaded version */
26
32
  warmCdnCache?: boolean;
33
+ /** Explicit production origin to use for CDN discovery, probing, and warming */
34
+ warmCdnTarget?: string;
27
35
  /** Maximum number of CDN warmup requests to issue in parallel */
28
36
  warmCdnConcurrency?: number;
29
37
  /** Per-request CDN warmup timeout in milliseconds */
30
38
  warmCdnTimeout?: number;
31
39
  /** Number of CDN warmup retries for transient failures */
32
40
  warmCdnRetries?: number;
33
- /** Fail deployment if any CDN warmup request fails */
34
- warmCdnStrict?: boolean;
41
+ /** Maximum duration of staged Worker path discovery */
42
+ warmCdnDiscoveryTimeout?: number;
43
+ /** Number of transient staged Worker path discovery retries */
44
+ warmCdnDiscoveryRetries?: number;
45
+ /** Abort after this duration without a completed cacheability probe */
46
+ warmCdnProbeTimeout?: number;
47
+ /** Number of transient staged Worker cacheability probe retries */
48
+ warmCdnProbeRetries?: number;
49
+ /** Re-request warmed identities and require reusable CDN hits before promotion */
50
+ warmCdnCertify?: boolean;
51
+ /** Maximum duration of staged Worker readiness verification */
52
+ warmCdnReadinessTimeout?: number;
53
+ /** Number of staged Worker readiness retries */
54
+ warmCdnReadinessRetries?: number;
55
+ /** Consecutive successful probes required before warming the staged Worker */
56
+ warmCdnReadinessProbes?: number;
57
+ /** Delay between staged Worker readiness probes in milliseconds */
58
+ warmCdnReadinessProbeDelay?: number;
59
+ /** Promote even when staged CDN warmup cannot be completed */
60
+ dangerouslyPromoteOnCdnWarmError?: boolean;
61
+ /** Promote the warmed Worker version to 100% traffic (default: true) */
62
+ warmCdnPromote?: boolean;
63
+ /** Delay between successful warmup and promotion in milliseconds */
64
+ warmCdnPromotionDelay?: number;
35
65
  /** Include PPR fallback-shell placeholder paths during CDN warmup */
36
66
  warmCdnIncludeFallbacks?: boolean;
37
67
  /** Enable experimental TPR (Traffic-aware Pre-Rendering) */
@@ -43,7 +73,7 @@ type DeployOptions = {
43
73
  /** TPR: analytics lookback window in hours (default: 24) */
44
74
  tprWindow?: number;
45
75
  };
46
- declare function parseDeployArgs(args: string[]): {
76
+ export declare function parseDeployArgs(args: string[]): {
47
77
  help: boolean;
48
78
  preview: boolean;
49
79
  env: string | undefined;
@@ -51,13 +81,26 @@ declare function parseDeployArgs(args: string[]): {
51
81
  config: string | undefined;
52
82
  skipBuild: boolean;
53
83
  dryRun: boolean;
84
+ verbose: boolean;
54
85
  prerenderAll: boolean;
55
86
  prerenderConcurrency: number | undefined;
56
87
  warmCdnCache: boolean;
88
+ warmCdnTarget: string | undefined;
57
89
  warmCdnConcurrency: number | undefined;
58
90
  warmCdnTimeout: number | undefined;
59
91
  warmCdnRetries: number | undefined;
60
- warmCdnStrict: boolean;
92
+ warmCdnDiscoveryTimeout: number | undefined;
93
+ warmCdnDiscoveryRetries: number | undefined;
94
+ warmCdnProbeTimeout: number | undefined;
95
+ warmCdnProbeRetries: number | undefined;
96
+ warmCdnCertify: boolean;
97
+ warmCdnReadinessTimeout: number | undefined;
98
+ warmCdnReadinessRetries: number | undefined;
99
+ warmCdnReadinessProbes: number | undefined;
100
+ warmCdnReadinessProbeDelay: number | undefined;
101
+ dangerouslyPromoteOnCdnWarmError: boolean;
102
+ warmCdnPromote: boolean;
103
+ warmCdnPromotionDelay: number | undefined;
61
104
  warmCdnIncludeFallbacks: boolean;
62
105
  experimentalTPR: boolean;
63
106
  tprCoverage: number | undefined;
@@ -76,7 +119,7 @@ declare function parseDeployArgs(args: string[]): {
76
119
  *
77
120
  * Passing `undefined` is a no-op; the callback runs with `process.env` untouched.
78
121
  */
79
- declare function withCloudflareEnv<T>(env: string | undefined, fn: () => Promise<T>): Promise<T>;
122
+ export declare function withCloudflareEnv<T>(env: string | undefined, fn: () => Promise<T>): Promise<T>;
80
123
  type WranglerDeployArgs = {
81
124
  args: string[];
82
125
  env: string | undefined;
@@ -85,9 +128,9 @@ type WranglerKVBulkPutArgs = {
85
128
  args: string[];
86
129
  env: string | undefined;
87
130
  };
88
- declare function validateWranglerEnvName(env: string): string;
89
- declare function buildWranglerDeployArgs(options: Pick<DeployOptions, "preview" | "env" | "name" | "config">): WranglerDeployArgs;
90
- declare function buildWranglerKVBulkPutArgs(options: {
131
+ export declare function validateWranglerEnvName(env: string): string;
132
+ export declare function buildWranglerDeployArgs(options: Pick<DeployOptions, "preview" | "env" | "name" | "config">): WranglerDeployArgs;
133
+ export declare function buildWranglerKVBulkPutArgs(options: {
91
134
  binding: string;
92
135
  env?: string;
93
136
  filePath: string;
@@ -98,30 +141,41 @@ declare function buildWranglerKVBulkPutArgs(options: {
98
141
  * Invoking the JavaScript file through `process.execPath` avoids the `.cmd`
99
142
  * shim and command shell that package managers create on Windows.
100
143
  */
101
- declare function resolveWranglerBin(root: string, resolvePackageJson?: (root: string) => string | null): string;
102
- declare function buildNodeCliInvocation(scriptPath: string, args: string[], nodeExecutable?: string): {
144
+ export declare function resolveWranglerBin(root: string, resolvePackageJson?: (root: string) => string | null): string;
145
+ export declare function buildNodeCliInvocation(scriptPath: string, args: string[], nodeExecutable?: string): {
103
146
  file: string;
104
147
  args: string[];
105
148
  };
106
- declare function buildWranglerInvocation(root: string, options: Pick<DeployOptions, "preview" | "env" | "name" | "config">, nodeExecutable?: string): {
149
+ export declare function buildWranglerInvocation(root: string, options: Pick<DeployOptions, "preview" | "env" | "name" | "config">, nodeExecutable?: string): {
107
150
  file: string;
108
151
  args: string[];
109
152
  env: string | undefined;
110
153
  };
111
- declare function runWranglerKVBulkPut(root: string, options: {
154
+ export declare function runWranglerKVBulkPut(root: string, options: {
112
155
  binding: string;
113
156
  env?: string;
114
157
  pairs: KVBulkPair[];
115
158
  tempDir?: string;
116
159
  }, execute?: typeof spawn, nodeExecutable?: string): Promise<void>;
117
- declare function runWranglerDeploy(root: string, options: Pick<DeployOptions, "preview" | "env" | "name" | "config">, execute?: typeof spawn): Promise<string>;
118
- declare function deployWithCdnWarmup(root: string, paths: readonly string[], options: Pick<DeployOptions, "preview" | "env" | "name" | "config" | "warmCdnConcurrency" | "warmCdnTimeout" | "warmCdnRetries" | "warmCdnStrict">): Promise<string>;
119
- declare function resolveCdnWarmupTargetUrl(root: string, deployedUrl: string | null): string | null;
120
- declare function resolveCdnWarmupTargetUrl(root: string, deployedUrl: string | null, options: Pick<DeployOptions, "preview" | "env" | "config">): string | null;
121
- declare function getZeroPercentStagingTraffic(deployment: WranglerDeploymentStatus | null, versionId: string): WranglerVersionTraffic[] | null;
160
+ export declare function runWranglerDeploy(root: string, options: Pick<DeployOptions, "preview" | "env" | "name" | "config">, execute?: typeof spawn): Promise<string>;
161
+ export declare function hasCdnWarmRequests(plan: Omit<CdnWarmRequestPlan, "pagesDataPaths"> & {
162
+ pagesDataPaths?: readonly string[];
163
+ }): boolean;
164
+ export declare function projectRequiresRouteCacheabilityProbeManifest(project: Pick<ProjectInfo, "isAppRouter" | "isPagesRouter">, cacheConfig: VinextCacheConfig | null): boolean;
165
+ type CdnWarmDeployOptions = Pick<DeployOptions, "preview" | "env" | "name" | "config" | "verbose" | "warmCdnTarget" | "warmCdnConcurrency" | "warmCdnTimeout" | "warmCdnRetries" | "warmCdnDiscoveryTimeout" | "warmCdnDiscoveryRetries" | "warmCdnProbeTimeout" | "warmCdnProbeRetries" | "warmCdnCertify" | "warmCdnReadinessTimeout" | "warmCdnReadinessRetries" | "warmCdnReadinessProbes" | "warmCdnReadinessProbeDelay" | "dangerouslyPromoteOnCdnWarmError" | "warmCdnPromote" | "warmCdnPromotionDelay"> & Pick<CdnWarmOptions, "deploymentId" | "expectedBuildId" | "expectedRscBuildId" | "loadingShellPaths" | "pagesDataPaths" | "routeHandlerPaths" | "routePatterns" | "rscPaths" | "statusSource"> & {
166
+ /** Probe a staged Worker and upload the resulting manifest as a second version. */
167
+ cacheabilityProbe?: boolean;
168
+ discoverWarmPlan?: (target: {
169
+ headers?: HeadersInit;
170
+ targetUrl: string;
171
+ }) => Promise<PrerenderWarmPlan>;
172
+ };
173
+ export declare function deployWithCdnWarmup(root: string, paths: readonly string[], options: CdnWarmDeployOptions): Promise<string>;
174
+ export declare function resolveCdnWarmupTargetUrl(root: string, deployedUrl: string | null): string | null;
175
+ export declare function resolveCdnWarmupTargetUrl(root: string, deployedUrl: string | null, options: Pick<DeployOptions, "preview" | "env" | "config" | "warmCdnTarget">): string | null;
176
+ export declare function getZeroPercentStagingTraffic(deployment: WranglerDeploymentStatus | null, versionId: string): WranglerVersionTraffic[] | null;
122
177
  type ParsedWranglerConfig = NonNullable<ReturnType<typeof parseWranglerConfig>>;
123
- declare function resolveWorkerNameForVersionOverride(config: ParsedWranglerConfig | null, options: Pick<DeployOptions, "preview" | "env" | "name">): string | undefined;
124
- declare function buildVersionOverrideHeaders(workerName: string | undefined, versionId: string): HeadersInit | undefined;
125
- declare function deploy(options: DeployOptions): Promise<void>;
126
- //#endregion
127
- export { DeployOptions, buildNodeCliInvocation, buildVersionOverrideHeaders, buildWranglerDeployArgs, buildWranglerInvocation, buildWranglerKVBulkPutArgs, deploy, deployWithCdnWarmup, getZeroPercentStagingTraffic, parseDeployArgs, resolveCdnWarmupTargetUrl, resolveWorkerNameForVersionOverride, resolveWranglerBin, runWranglerDeploy, runWranglerKVBulkPut, validateWranglerEnvName, withCloudflareEnv };
178
+ export declare function resolveWorkerNameForVersionOverride(config: ParsedWranglerConfig | null, options: Pick<DeployOptions, "preview" | "env" | "name">): string | undefined;
179
+ export declare function buildVersionOverrideHeaders(workerName: string | undefined, versionId: string): HeadersInit | undefined;
180
+ export declare function deploy(options: DeployOptions): Promise<void>;
181
+ //#endregion