vinext 0.2.1 → 1.0.0-beta.0
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/README.md +50 -29
- package/dist/build/client-build-config.d.ts +13 -92
- package/dist/build/client-build-config.js +17 -95
- package/dist/build/prerender-paths.d.ts +23 -0
- package/dist/build/prerender-paths.js +296 -0
- package/dist/build/prerender.d.ts +12 -1
- package/dist/build/prerender.js +1 -1
- package/dist/cache/cache-adapters-virtual.d.ts +7 -1
- package/dist/cache/cache-adapters-virtual.js +26 -2
- package/dist/check.js +5 -0
- package/dist/cli.js +33 -53
- package/dist/config/next-config.js +1 -2
- package/dist/config/prerender.d.ts +11 -1
- package/dist/config/prerender.js +19 -1
- package/dist/config/tsconfig-paths.js +5 -1
- package/dist/image/image-adapters-virtual.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +248 -146
- package/dist/init-cloudflare.js +12 -3
- package/dist/init-platform.d.ts +10 -1
- package/dist/init-platform.js +78 -12
- package/dist/init.d.ts +11 -3
- package/dist/init.js +129 -31
- package/dist/server/app-browser-entry.js +4 -6
- package/dist/server/app-browser-navigation-controller.js +6 -3
- package/dist/server/app-browser-state.js +1 -1
- package/dist/server/app-browser-visible-commit.js +1 -1
- package/dist/server/app-layout-param-observation.d.ts +1 -1
- package/dist/server/app-page-cache-render.d.ts +1 -1
- package/dist/server/app-page-dispatch.d.ts +1 -1
- package/dist/server/app-page-dispatch.js +3 -3
- package/dist/server/app-page-render.d.ts +1 -1
- package/dist/server/app-page-route-wiring.js +3 -3
- package/dist/server/app-route-handler-execution.d.ts +1 -1
- package/dist/server/app-route-handler-execution.js +1 -1
- package/dist/server/app-rsc-cache-busting.js +0 -1
- package/dist/server/app-rsc-handler.js +1 -1
- package/dist/server/app-rsc-render-mode.d.ts +2 -5
- package/dist/server/app-rsc-render-mode.js +2 -12
- package/dist/server/app-server-action-execution.js +4 -4
- package/dist/server/app-ssr-entry.js +2 -2
- package/dist/server/dev-module-runner.js +1 -1
- package/dist/server/dev-origin-check.d.ts +2 -2
- package/dist/server/dev-origin-check.js +2 -2
- package/dist/server/dev-server.js +4 -4
- package/dist/server/image-optimization.d.ts +12 -1
- package/dist/server/image-optimization.js +13 -1
- package/dist/server/isr-cache.d.ts +12 -4
- package/dist/server/isr-cache.js +2 -2
- package/dist/server/pages-page-data.js +1 -1
- package/dist/server/pages-page-response.js +2 -2
- package/dist/server/pages-request-pipeline.js +1 -1
- package/dist/server/prerender-manifest.d.ts +15 -1
- package/dist/server/prerender-manifest.js +29 -1
- package/dist/server/prod-server.d.ts +6 -5
- package/dist/server/prod-server.js +6 -7
- package/dist/server/static-file-cache.js +1 -1
- package/dist/shims/cache.d.ts +1 -1
- package/dist/shims/cdn-cache.d.ts +2 -7
- package/dist/shims/cdn-cache.js +2 -14
- package/dist/shims/form.d.ts +1 -1
- package/dist/shims/navigation.react-server.js +1 -1
- package/dist/shims/request-state-types.d.ts +2 -2
- package/dist/shims/unified-request-context.d.ts +1 -1
- package/dist/utils/project.d.ts +1 -1
- package/dist/utils/vite-version.d.ts +3 -13
- package/dist/utils/vite-version.js +38 -30
- package/package.json +31 -13
- package/dist/cloudflare/index.d.ts +0 -3
- package/dist/cloudflare/index.js +0 -3
- package/dist/packages/cloudflare/src/cache/cdn-adapter.runtime.js +0 -102
- package/dist/packages/cloudflare/src/cache/kv-data-adapter.runtime.d.ts +0 -126
- package/dist/packages/cloudflare/src/cache/kv-data-adapter.runtime.js +0 -442
- package/dist/packages/cloudflare/src/deploy-config.js +0 -150
- package/dist/packages/cloudflare/src/deploy-help.js +0 -55
- package/dist/packages/cloudflare/src/deploy.js +0 -272
- package/dist/packages/cloudflare/src/tpr.d.ts +0 -45
- package/dist/packages/cloudflare/src/tpr.js +0 -582
- package/dist/packages/cloudflare/src/utils/cache-control-metadata.js +0 -20
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { detectProject, findInNodeModules, formatMissingCloudflarePluginError, getMissingDeps } from "../../../utils/project.js";
|
|
2
|
-
import { loadNextConfig, resolveNextConfig } from "../../../config/next-config.js";
|
|
3
|
-
import { formatVinextPrerenderLabel, loadVinextPrerenderConfigFromViteConfig, resolveVinextPrerenderDecision } from "../../../config/prerender.js";
|
|
4
|
-
import { runPrerender } from "../../../build/run-prerender.js";
|
|
5
|
-
import { loadDotenv } from "../../../config/dotenv.js";
|
|
6
|
-
import { runTPR } from "./tpr.js";
|
|
7
|
-
import { formatImageOptimizationHint, formatMissingCacheAdapterError, viteConfigHasCacheAdapter, viteConfigHasCloudflarePlugin, viteConfigHasImageAdapter, workerEntryHasCacheHandler } from "./deploy-config.js";
|
|
8
|
-
import { createRequire } from "node:module";
|
|
9
|
-
import fs from "node:fs";
|
|
10
|
-
import path from "node:path";
|
|
11
|
-
import { pathToFileURL } from "node:url";
|
|
12
|
-
import { parseArgs } from "node:util";
|
|
13
|
-
import { execFileSync } from "node:child_process";
|
|
14
|
-
//#region ../cloudflare/src/deploy.ts
|
|
15
|
-
/**
|
|
16
|
-
* vinext-cloudflare deploy — one-command Cloudflare Workers deployment.
|
|
17
|
-
*
|
|
18
|
-
* Takes any Next.js app and deploys it to Cloudflare Workers:
|
|
19
|
-
*
|
|
20
|
-
* 1. Validates the project was prepared by `vinext init --platform=cloudflare`
|
|
21
|
-
* 2. Runs the Vite build
|
|
22
|
-
* 3. Deploys to Cloudflare Workers via Wrangler
|
|
23
|
-
*/
|
|
24
|
-
function parsePositiveIntegerArg(raw, flag) {
|
|
25
|
-
if (raw === "") throw new Error(`${flag} requires a value, but none was provided.`);
|
|
26
|
-
const parsed = Number(raw);
|
|
27
|
-
if (!Number.isInteger(parsed) || parsed <= 0) throw new Error(`${flag} expects a positive integer, but got "${raw}".`);
|
|
28
|
-
return parsed;
|
|
29
|
-
}
|
|
30
|
-
/** Deploy command flag definitions for util.parseArgs. */
|
|
31
|
-
const deployArgOptions = {
|
|
32
|
-
help: {
|
|
33
|
-
type: "boolean",
|
|
34
|
-
short: "h",
|
|
35
|
-
default: false
|
|
36
|
-
},
|
|
37
|
-
preview: {
|
|
38
|
-
type: "boolean",
|
|
39
|
-
default: false
|
|
40
|
-
},
|
|
41
|
-
env: { type: "string" },
|
|
42
|
-
name: { type: "string" },
|
|
43
|
-
"skip-build": {
|
|
44
|
-
type: "boolean",
|
|
45
|
-
default: false
|
|
46
|
-
},
|
|
47
|
-
"dry-run": {
|
|
48
|
-
type: "boolean",
|
|
49
|
-
default: false
|
|
50
|
-
},
|
|
51
|
-
"prerender-all": {
|
|
52
|
-
type: "boolean",
|
|
53
|
-
default: false
|
|
54
|
-
},
|
|
55
|
-
"prerender-concurrency": { type: "string" },
|
|
56
|
-
"experimental-tpr": {
|
|
57
|
-
type: "boolean",
|
|
58
|
-
default: false
|
|
59
|
-
},
|
|
60
|
-
"tpr-coverage": { type: "string" },
|
|
61
|
-
"tpr-limit": { type: "string" },
|
|
62
|
-
"tpr-window": { type: "string" }
|
|
63
|
-
};
|
|
64
|
-
function parseDeployArgs(args) {
|
|
65
|
-
const { values } = parseArgs({
|
|
66
|
-
args,
|
|
67
|
-
options: deployArgOptions,
|
|
68
|
-
strict: true
|
|
69
|
-
});
|
|
70
|
-
function parseIntArg(name, raw) {
|
|
71
|
-
if (!raw) return void 0;
|
|
72
|
-
const n = parseInt(raw, 10);
|
|
73
|
-
if (isNaN(n)) {
|
|
74
|
-
console.error(` --${name} must be a number (got: ${raw})`);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
return n;
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
help: values.help,
|
|
81
|
-
preview: values.preview,
|
|
82
|
-
env: values.env?.trim() || void 0,
|
|
83
|
-
name: values.name?.trim() || void 0,
|
|
84
|
-
skipBuild: values["skip-build"],
|
|
85
|
-
dryRun: values["dry-run"],
|
|
86
|
-
prerenderAll: values["prerender-all"],
|
|
87
|
-
prerenderConcurrency: values["prerender-concurrency"] === void 0 ? void 0 : parsePositiveIntegerArg(values["prerender-concurrency"], "--prerender-concurrency"),
|
|
88
|
-
experimentalTPR: values["experimental-tpr"],
|
|
89
|
-
tprCoverage: parseIntArg("tpr-coverage", values["tpr-coverage"]),
|
|
90
|
-
tprLimit: parseIntArg("tpr-limit", values["tpr-limit"]),
|
|
91
|
-
tprWindow: parseIntArg("tpr-window", values["tpr-window"])
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Run a function with `process.env.CLOUDFLARE_ENV` set to the given value,
|
|
96
|
-
* restoring the previous state (whether set or absent) after the function
|
|
97
|
-
* resolves or throws.
|
|
98
|
-
*
|
|
99
|
-
* The `@cloudflare/vite-plugin` reads `CLOUDFLARE_ENV` from `process.env` to
|
|
100
|
-
* drive the multi-environment merge applied to the emitted `wrangler.json`.
|
|
101
|
-
* Without this propagation the `--env <name>` CLI flag is silently ignored at
|
|
102
|
-
* build time and the top-level config is emitted regardless. See issue #1210.
|
|
103
|
-
*
|
|
104
|
-
* Passing `undefined` is a no-op; the callback runs with `process.env` untouched.
|
|
105
|
-
*/
|
|
106
|
-
async function withCloudflareEnv(env, fn) {
|
|
107
|
-
if (env === void 0 || env === "") return fn();
|
|
108
|
-
const hadPrev = "CLOUDFLARE_ENV" in process.env;
|
|
109
|
-
const prev = process.env.CLOUDFLARE_ENV;
|
|
110
|
-
process.env.CLOUDFLARE_ENV = env;
|
|
111
|
-
try {
|
|
112
|
-
return await fn();
|
|
113
|
-
} finally {
|
|
114
|
-
if (hadPrev) process.env.CLOUDFLARE_ENV = prev;
|
|
115
|
-
else delete process.env.CLOUDFLARE_ENV;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
async function loadProjectViteApi(root) {
|
|
119
|
-
let vitePath;
|
|
120
|
-
try {
|
|
121
|
-
vitePath = createRequire(path.join(root, "package.json")).resolve("vite");
|
|
122
|
-
} catch {
|
|
123
|
-
vitePath = "vite";
|
|
124
|
-
}
|
|
125
|
-
return await (vitePath === "vite" ? import(vitePath) : import(pathToFileURL(vitePath).href));
|
|
126
|
-
}
|
|
127
|
-
async function runBuild(info, env) {
|
|
128
|
-
console.log("\n Building for Cloudflare Workers...\n");
|
|
129
|
-
const { createBuilder } = await loadProjectViteApi(info.root);
|
|
130
|
-
await withCloudflareEnv(env, async () => {
|
|
131
|
-
await (await createBuilder({ root: info.root })).buildApp();
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
function validateWranglerEnvName(env) {
|
|
135
|
-
if (env.includes("\0")) throw new Error("Wrangler environment names cannot contain null bytes.");
|
|
136
|
-
return env;
|
|
137
|
-
}
|
|
138
|
-
function buildWranglerDeployArgs(options) {
|
|
139
|
-
const args = ["deploy"];
|
|
140
|
-
const env = options.env || (options.preview ? "preview" : void 0);
|
|
141
|
-
if (env) args.push("--env", validateWranglerEnvName(env));
|
|
142
|
-
return {
|
|
143
|
-
args,
|
|
144
|
-
env
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Resolve Wrangler's JavaScript CLI entrypoint in node_modules.
|
|
149
|
-
*
|
|
150
|
-
* Invoking the JavaScript file through `process.execPath` avoids the `.cmd`
|
|
151
|
-
* shim and command shell that package managers create on Windows.
|
|
152
|
-
*/
|
|
153
|
-
function resolveWranglerBin(root, resolvePackageJson = (projectRoot) => {
|
|
154
|
-
try {
|
|
155
|
-
return createRequire(path.join(projectRoot, "package.json")).resolve("wrangler/package.json");
|
|
156
|
-
} catch {
|
|
157
|
-
return findInNodeModules(projectRoot, "wrangler/package.json");
|
|
158
|
-
}
|
|
159
|
-
}) {
|
|
160
|
-
const packageJsonPath = resolvePackageJson(root);
|
|
161
|
-
if (packageJsonPath) {
|
|
162
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
163
|
-
const bin = typeof packageJson.bin === "string" ? packageJson.bin : packageJson.bin?.wrangler;
|
|
164
|
-
if (bin) return path.resolve(path.dirname(packageJsonPath), bin);
|
|
165
|
-
}
|
|
166
|
-
return path.join(root, "node_modules", "wrangler", "bin", "wrangler.js");
|
|
167
|
-
}
|
|
168
|
-
function buildNodeCliInvocation(scriptPath, args, nodeExecutable = process.execPath) {
|
|
169
|
-
return {
|
|
170
|
-
file: nodeExecutable,
|
|
171
|
-
args: [scriptPath, ...args]
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function buildWranglerInvocation(root, options, nodeExecutable = process.execPath) {
|
|
175
|
-
const wranglerBin = resolveWranglerBin(root);
|
|
176
|
-
const { args, env } = buildWranglerDeployArgs(options);
|
|
177
|
-
return {
|
|
178
|
-
...buildNodeCliInvocation(wranglerBin, args, nodeExecutable),
|
|
179
|
-
env
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
function runWranglerDeploy(root, options, execute = execFileSync) {
|
|
183
|
-
const execOpts = {
|
|
184
|
-
cwd: root,
|
|
185
|
-
stdio: "pipe",
|
|
186
|
-
encoding: "utf-8",
|
|
187
|
-
shell: false
|
|
188
|
-
};
|
|
189
|
-
const { file, args, env } = buildWranglerInvocation(root, options);
|
|
190
|
-
if (env) console.log(`\n Deploying to env: ${env}...`);
|
|
191
|
-
else console.log("\n Deploying to production...");
|
|
192
|
-
const output = execute(file, args, execOpts);
|
|
193
|
-
const urlMatch = output.match(/https:\/\/[^\s]+\.workers\.dev[^\s]*/);
|
|
194
|
-
const deployedUrl = urlMatch ? urlMatch[0] : null;
|
|
195
|
-
if (output.trim()) for (const line of output.trim().split("\n")) console.log(` ${line}`);
|
|
196
|
-
return deployedUrl ?? "(URL not detected in wrangler output)";
|
|
197
|
-
}
|
|
198
|
-
async function deploy(options) {
|
|
199
|
-
const deployEnv = validateWranglerEnvName(options.env || (options.preview ? "preview" : "production"));
|
|
200
|
-
const root = path.resolve(options.root);
|
|
201
|
-
loadDotenv({
|
|
202
|
-
root,
|
|
203
|
-
mode: "production"
|
|
204
|
-
});
|
|
205
|
-
console.log("\n vinext-cloudflare deploy\n");
|
|
206
|
-
const info = detectProject(root);
|
|
207
|
-
if (!info.isAppRouter && !info.isPagesRouter) {
|
|
208
|
-
console.error(" Error: No app/ or pages/ directory found.");
|
|
209
|
-
console.error(" vinext-cloudflare deploy requires a Next.js project with an app/ or pages/ directory");
|
|
210
|
-
console.error(" (also checks src/app/ and src/pages/).\n");
|
|
211
|
-
process.exit(1);
|
|
212
|
-
}
|
|
213
|
-
if (options.name) info.projectName = options.name;
|
|
214
|
-
console.log(` Project: ${info.projectName}`);
|
|
215
|
-
console.log(` Router: ${info.isAppRouter ? "App Router" : "Pages Router"}`);
|
|
216
|
-
console.log(` ISR: ${info.hasISR ? "detected" : "none"}`);
|
|
217
|
-
const missingScaffolding = [!info.hasViteConfig && "Vite config", !info.hasWranglerConfig && "Wrangler config"].filter((value) => Boolean(value));
|
|
218
|
-
if (missingScaffolding.length > 0) throw new Error(`Missing Cloudflare deployment setup: ${missingScaffolding.join(", ")}. Run \`vinext init --platform=cloudflare\` first.`);
|
|
219
|
-
const missingDeps = getMissingDeps(info);
|
|
220
|
-
if (missingDeps.length > 0) throw new Error(`Missing deployment dependencies: ${missingDeps.map((dependency) => dependency.name).join(", ")}. Run \`vinext init --platform=cloudflare\` first.`);
|
|
221
|
-
if (info.hasViteConfig && !viteConfigHasCloudflarePlugin(root)) throw new Error(formatMissingCloudflarePluginError({ isAppRouter: info.isAppRouter }));
|
|
222
|
-
if (info.hasISR && !viteConfigHasCacheAdapter(root) && !workerEntryHasCacheHandler(root)) throw new Error(formatMissingCacheAdapterError({}));
|
|
223
|
-
if (!viteConfigHasImageAdapter(root)) {
|
|
224
|
-
console.log();
|
|
225
|
-
console.log(formatImageOptimizationHint());
|
|
226
|
-
}
|
|
227
|
-
if (options.dryRun) {
|
|
228
|
-
console.log("\n Dry run complete. No build or deploy performed.\n");
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
const buildEnv = deployEnv === "production" && !options.env ? void 0 : deployEnv;
|
|
232
|
-
if (!options.skipBuild) await runBuild(info, buildEnv);
|
|
233
|
-
else console.log("\n Skipping build (--skip-build)");
|
|
234
|
-
{
|
|
235
|
-
const nextConfig = await resolveNextConfig(await loadNextConfig(info.root), info.root);
|
|
236
|
-
const vinextPrerenderConfig = !options.prerenderAll && nextConfig.output !== "export" ? await withCloudflareEnv(buildEnv, async () => {
|
|
237
|
-
return loadVinextPrerenderConfigFromViteConfig(await loadProjectViteApi(info.root), info.root);
|
|
238
|
-
}) : null;
|
|
239
|
-
const prerenderDecision = resolveVinextPrerenderDecision({
|
|
240
|
-
prerenderAllFlag: options.prerenderAll,
|
|
241
|
-
vinextPrerenderConfig,
|
|
242
|
-
nextOutput: nextConfig.output
|
|
243
|
-
});
|
|
244
|
-
if (prerenderDecision) {
|
|
245
|
-
console.log(`\n ${formatVinextPrerenderLabel(prerenderDecision)}`);
|
|
246
|
-
if (nextConfig.enablePrerenderSourceMaps) {
|
|
247
|
-
process.setSourceMapsEnabled(true);
|
|
248
|
-
Error.stackTraceLimit = Math.max(Error.stackTraceLimit, 50);
|
|
249
|
-
}
|
|
250
|
-
await runPrerender({
|
|
251
|
-
root: info.root,
|
|
252
|
-
concurrency: options.prerenderConcurrency
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (options.experimentalTPR) {
|
|
257
|
-
console.log();
|
|
258
|
-
const tprResult = await runTPR({
|
|
259
|
-
root,
|
|
260
|
-
coverage: Math.max(1, Math.min(100, options.tprCoverage ?? 90)),
|
|
261
|
-
limit: Math.max(1, options.tprLimit ?? 1e3),
|
|
262
|
-
window: Math.max(1, options.tprWindow ?? 24)
|
|
263
|
-
});
|
|
264
|
-
if (tprResult.skipped) console.log(` TPR: Skipped (${tprResult.skipped})`);
|
|
265
|
-
}
|
|
266
|
-
const url = runWranglerDeploy(root, { env: deployEnv === "production" && !options.env ? void 0 : deployEnv });
|
|
267
|
-
console.log("\n ─────────────────────────────────────────");
|
|
268
|
-
console.log(` Deployed to: ${url}`);
|
|
269
|
-
console.log(" ─────────────────────────────────────────\n");
|
|
270
|
-
}
|
|
271
|
-
//#endregion
|
|
272
|
-
export { deploy, parseDeployArgs };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//#region ../cloudflare/src/tpr.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* TPR: Traffic-aware Pre-Rendering
|
|
4
|
-
*
|
|
5
|
-
* Uses Cloudflare zone analytics to determine which pages actually get
|
|
6
|
-
* traffic, and pre-renders only those during deploy. The pre-rendered
|
|
7
|
-
* HTML is uploaded to KV in the same format ISR uses at runtime — no
|
|
8
|
-
* runtime changes needed.
|
|
9
|
-
*
|
|
10
|
-
* Flow:
|
|
11
|
-
* 1. Parse wrangler config to find custom domain and KV namespace
|
|
12
|
-
* 2. Resolve the Cloudflare zone for the custom domain
|
|
13
|
-
* 3. Query zone analytics (GraphQL) for top pages by request count
|
|
14
|
-
* 4. Walk ranked list until coverage threshold is met
|
|
15
|
-
* 5. Start the built production server locally
|
|
16
|
-
* 6. Fetch each hot route to produce HTML
|
|
17
|
-
* 7. Upload pre-rendered HTML to KV (same KVCacheEntry format ISR reads)
|
|
18
|
-
*
|
|
19
|
-
* TPR is an experimental feature enabled via --experimental-tpr. It
|
|
20
|
-
* gracefully skips when no custom domain, no API token, no traffic data,
|
|
21
|
-
* or no KV namespace is configured.
|
|
22
|
-
*/
|
|
23
|
-
type TPROptions = {
|
|
24
|
-
/** Project root directory. */root: string; /** Traffic coverage percentage (0–100). Default: 90. */
|
|
25
|
-
coverage: number; /** Hard cap on number of pages to pre-render. Default: 1000. */
|
|
26
|
-
limit: number; /** Analytics lookback window in hours. Default: 24. */
|
|
27
|
-
window: number;
|
|
28
|
-
};
|
|
29
|
-
type TPRResult = {
|
|
30
|
-
/** Total unique page paths found in analytics. */totalPaths: number; /** Number of pages successfully pre-rendered and uploaded. */
|
|
31
|
-
prerenderedCount: number; /** Actual traffic coverage achieved (percentage). */
|
|
32
|
-
coverageAchieved: number; /** Wall-clock duration of the TPR step in milliseconds. */
|
|
33
|
-
durationMs: number; /** If TPR was skipped, the reason. */
|
|
34
|
-
skipped?: string;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Run the TPR pipeline: query traffic, select routes, pre-render, upload.
|
|
38
|
-
*
|
|
39
|
-
* Designed to be called between the build step and wrangler deploy in the
|
|
40
|
-
* `vinext-cloudflare deploy` pipeline. Gracefully skips (never errors) when
|
|
41
|
-
* the prerequisites aren't met.
|
|
42
|
-
*/
|
|
43
|
-
declare function runTPR(options: TPROptions): Promise<TPRResult>;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { TPROptions, TPRResult, runTPR };
|