@vercel/build-utils 14.3.0 → 14.4.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/CHANGELOG.md +30 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/prerender.d.ts +24 -15
- package/dist/prerender.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @vercel/build-utils
|
|
2
2
|
|
|
3
|
+
## 14.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f8add0a: Replace `prerenderClassification` on `Prerender` with `initialMetadata`.
|
|
8
|
+
|
|
9
|
+
The platform consumes only the request-time compute mode and the HTML shell
|
|
10
|
+
size, so the flattened four-field taxonomy (`routeType`, `response`,
|
|
11
|
+
`compute`, `htmlSize`) is reduced to a single grouped field:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
initialMetadata?: {
|
|
15
|
+
compute: 'blocking' | 'resuming' | 'static';
|
|
16
|
+
htmlSize?: number;
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The group is named `initialMetadata` because the values describe the
|
|
21
|
+
deployment as it was built: revalidation can regenerate a route's output over
|
|
22
|
+
the deployment's lifetime, so readers must treat them as initial values, not
|
|
23
|
+
live state. `@vercel/next` reads `compute` and `htmlSize` off the v4
|
|
24
|
+
prerender-manifest taxonomy and deliberately ignores `routeType` and
|
|
25
|
+
`response`; the values are still carried unvalidated so a compute mode added
|
|
26
|
+
by a future framework release cannot hard-fail a deploy, and they are still
|
|
27
|
+
set only on the primary output of each prerender group. `htmlSize: 0` is a
|
|
28
|
+
real size (a shell that postponed everything); `htmlSize` is absent when
|
|
29
|
+
there is no HTML shell to measure (route handlers, Pages Router). Absence of
|
|
30
|
+
the whole group remains legitimate (`notFoundRoutes`, Pages Router
|
|
31
|
+
`fallback: false`, older frameworks).
|
|
32
|
+
|
|
3
33
|
## 14.3.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import FileFsRef from './file-fs-ref';
|
|
|
3
3
|
import FileRef from './file-ref';
|
|
4
4
|
import { Lambda, createLambda, getLambdaOptionsFromFunction, sanitizeConsumerName } from './lambda';
|
|
5
5
|
import { NodejsLambda, type NodejsLambdaOptions } from './nodejs-lambda';
|
|
6
|
-
import { Prerender, type
|
|
6
|
+
import { Prerender, type PrerenderInitialMetadata } from './prerender';
|
|
7
7
|
import download, { downloadFile, DownloadedFiles, isSymbolicLink, isDirectory, isExternalSymlink, isExternalSymlinkTarget, getSymlinkTarget } from './fs/download';
|
|
8
8
|
import getWriteableDirectory from './fs/get-writable-directory';
|
|
9
9
|
import glob, { GlobOptions } from './fs/glob';
|
|
@@ -20,7 +20,7 @@ import { getServiceUrlEnvVars, getExperimentalServiceUrlEnvVars } from './get-se
|
|
|
20
20
|
import { cloneEnv } from './clone-env';
|
|
21
21
|
import { hardLinkDir } from './hard-link-dir';
|
|
22
22
|
import { validateNpmrc } from './validate-npmrc';
|
|
23
|
-
export type { NodejsLambdaOptions,
|
|
23
|
+
export type { NodejsLambdaOptions, PrerenderInitialMetadata };
|
|
24
24
|
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, getNodeBinPaths, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion, getOrCreateBunBinary, detectPackageManager, runNpmInstall, NpmInstallOutput, runBundleInstall, runPipInstall, PipInstallResult, runShellScript, runCustomInstallCommand, resetCustomInstallCommandSet, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, getServiceUrlEnvVars, getExperimentalServiceUrlEnvVars, streamToBuffer, streamToBufferChunks, debug, isSymbolicLink, isDirectory, isExternalSymlink, isExternalSymlinkTarget, getSymlinkTarget, getLambdaOptionsFromFunction, sanitizeConsumerName, scanParentDirs, findPackageJson, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, type CliType, };
|
|
25
25
|
export { EdgeFunction } from './edge-function';
|
|
26
26
|
export { ContainerImage } from './container-image';
|
package/dist/index.js
CHANGED
|
@@ -35406,13 +35406,13 @@ var Prerender = class {
|
|
|
35406
35406
|
chain,
|
|
35407
35407
|
exposeErrBody,
|
|
35408
35408
|
partialFallback,
|
|
35409
|
-
|
|
35409
|
+
initialMetadata
|
|
35410
35410
|
}) {
|
|
35411
35411
|
this.type = "Prerender";
|
|
35412
35412
|
this.expiration = expiration;
|
|
35413
35413
|
this.staleExpiration = staleExpiration;
|
|
35414
35414
|
this.sourcePath = sourcePath;
|
|
35415
|
-
this.
|
|
35415
|
+
this.initialMetadata = initialMetadata;
|
|
35416
35416
|
this.lambda = lambda;
|
|
35417
35417
|
if (this.lambda) {
|
|
35418
35418
|
this.lambda.operationType = this.lambda.operationType || "ISR";
|
package/dist/prerender.d.ts
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import type { File, HasField, Chain } from './types';
|
|
2
2
|
import { Lambda } from './lambda';
|
|
3
3
|
/**
|
|
4
|
-
* The framework's own description of what it prerendered
|
|
5
|
-
*
|
|
4
|
+
* The framework's own description of what it prerendered at build time,
|
|
5
|
+
* rather than re-deriving it from build artifacts. These are *initial*
|
|
6
|
+
* values: revalidation can regenerate a route's output over the lifetime of
|
|
7
|
+
* a deployment, so readers must treat them as the state as of the build,
|
|
8
|
+
* not as live state.
|
|
6
9
|
*/
|
|
7
|
-
export interface
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export interface PrerenderInitialMetadata {
|
|
11
|
+
/**
|
|
12
|
+
* What has to happen at request time to finish the response, as of build
|
|
13
|
+
* time: `static` needs no server compute, `resuming` streams the static
|
|
14
|
+
* response while the server resumes postponed work, and `blocking` cannot
|
|
15
|
+
* start the response until request-time compute starts.
|
|
16
|
+
*/
|
|
13
17
|
compute: 'blocking' | 'resuming' | 'static';
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Byte size of the prerendered HTML shell, when the entry has one. `0` is
|
|
20
|
+
* a real size — a shell that postponed everything — and `undefined` means
|
|
21
|
+
* there is no HTML shell to measure (route handlers, Pages Router).
|
|
22
|
+
*/
|
|
15
23
|
htmlSize?: number;
|
|
16
24
|
}
|
|
17
25
|
interface PrerenderOptions {
|
|
@@ -32,7 +40,7 @@ interface PrerenderOptions {
|
|
|
32
40
|
chain?: Chain;
|
|
33
41
|
exposeErrBody?: boolean;
|
|
34
42
|
partialFallback?: boolean;
|
|
35
|
-
|
|
43
|
+
initialMetadata?: PrerenderInitialMetadata;
|
|
36
44
|
}
|
|
37
45
|
export declare class Prerender {
|
|
38
46
|
type: 'Prerender';
|
|
@@ -63,11 +71,12 @@ export declare class Prerender {
|
|
|
63
71
|
exposeErrBody?: boolean;
|
|
64
72
|
partialFallback?: boolean;
|
|
65
73
|
/**
|
|
66
|
-
* The framework's
|
|
67
|
-
* framework did not provide
|
|
68
|
-
* Pages Router `fallback: false` templates
|
|
74
|
+
* The framework's build-time serving metadata for this prerender.
|
|
75
|
+
* `undefined` when the framework did not provide it, which is legitimate:
|
|
76
|
+
* not-found routes, Pages Router `fallback: false` templates, and builds
|
|
77
|
+
* from frameworks that predate the field carry none.
|
|
69
78
|
*/
|
|
70
|
-
|
|
71
|
-
constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, partialFallback,
|
|
79
|
+
initialMetadata?: PrerenderInitialMetadata;
|
|
80
|
+
constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, partialFallback, initialMetadata, }: PrerenderOptions);
|
|
72
81
|
}
|
|
73
82
|
export {};
|
package/dist/prerender.js
CHANGED
|
@@ -40,13 +40,13 @@ class Prerender {
|
|
|
40
40
|
chain,
|
|
41
41
|
exposeErrBody,
|
|
42
42
|
partialFallback,
|
|
43
|
-
|
|
43
|
+
initialMetadata
|
|
44
44
|
}) {
|
|
45
45
|
this.type = "Prerender";
|
|
46
46
|
this.expiration = expiration;
|
|
47
47
|
this.staleExpiration = staleExpiration;
|
|
48
48
|
this.sourcePath = sourcePath;
|
|
49
|
-
this.
|
|
49
|
+
this.initialMetadata = initialMetadata;
|
|
50
50
|
this.lambda = lambda;
|
|
51
51
|
if (this.lambda) {
|
|
52
52
|
this.lambda.operationType = this.lambda.operationType || "ISR";
|