@vercel/build-utils 14.10.2 → 14.12.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 14.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6e68e60: Add `onMiss` to `Prerender`.
8
+
9
+ ```ts
10
+ onMiss?: 'sync' | 'dynamic';
11
+ ```
12
+
13
+ Declares how a request is served when no prerendered output is available for
14
+ it yet. Absent means `sync`: block the response on rendering it. `dynamic`
15
+ serves the request dynamically while the static shell is regenerated in the
16
+ background. The value is carried unvalidated so an unknown mode cannot fail
17
+ a deploy.
18
+
19
+ ## 14.11.0
20
+
21
+ ### Minor Changes
22
+
23
+ - 888f59e: Define an optional builder-owned development manifest for function identities, local invocation targets, trigger metadata, and native schedule definitions. Conventional functions can use host-owned per-entrypoint discovery; frameworks can override it. The host retains ownership of processes, readiness, and registration reconciliation.
24
+
25
+ ### Patch Changes
26
+
27
+ - 7eb63c0: Accept runtime-specific schedule entrypoints and provide build plumbing for lowering dedicated entrypoints to function targets. All schedule entrypoints must use one runtime, including for static frameworks and `framework: null`. Entrypoints must also match the runtime of frameworks that own one (Next.js, FastAPI, Express). The builder contract still supports multiple entrypoints per function for future runtimes.
28
+
3
29
  ## 14.10.2
4
30
 
5
31
  ### Patch Changes
@@ -0,0 +1,84 @@
1
+ # Development manifest
2
+
3
+ Builders may export `getDevManifest`, typed as `GetDevManifest`, independently
4
+ of `build()` and `startDevServer()`. It describes deployment function identities,
5
+ their local invocation targets, and optional native schedule definitions.
6
+ Queues and Schedules share the function registry instead of separate discovery APIs.
7
+
8
+ ## Inputs
9
+
10
+ - `workPath`: absolute project or service root.
11
+ - `build`: the original builder entry before source expansion or filtering for a
12
+ framework development command; its source is relative to `workPath`.
13
+ - `files`: real source paths relative to `workPath`, using forward slashes,
14
+ respecting ignore rules and excluding synthetic aliases.
15
+ - `config`: resolved, builder-scoped authored configuration, including functions.
16
+ Do not independently reload vercel.json; the host may resolve vercel.ts or
17
+ partition function patterns between builders. Explicitly empty maps stay empty.
18
+ - `env`: effective development environment, including injected resources.
19
+ Do not mutate inputs or log credentials.
20
+
21
+ For services, paths are service-root-relative and `config.serviceName` supplies
22
+ production consumer scoping where applicable.
23
+
24
+ ## Functions and invocation
25
+
26
+ Every `DevFunction` has a deployment `outputPath` with no leading slash or
27
+ `.func` suffix. It is the identity referenced by a Schedule's `target.function`,
28
+ not necessarily the source filename or the public URL. `sourceFile` optionally
29
+ identifies the original source for source-backed functions.
30
+
31
+ `invocation` is one of:
32
+
33
+ - `http`: a root-relative pathname in the owning framework dev server, including
34
+ its base path. No origin, query string, or fragment. The host supplies the origin.
35
+ - `entrypoint`: a discrete builder entrypoint relative to `workPath`. The host
36
+ selects that function directly, without re-entering public routing, redirects,
37
+ rewrites, or an unrelated catch-all. This is also the host's conventional
38
+ per-entrypoint fallback target.
39
+
40
+ Functions without Queue subscriptions remain discoverable. The host derives
41
+ Queue subscriptions from normalized `experimentalTriggers`; direct Schedules
42
+ resolve the same registry by output identity and use Schedule CloudEvents.
43
+ `matchedFunctionPatterns` lists authored function keys resolved by the provider
44
+ so the host can aggregate unmatched diagnostics across owners.
45
+
46
+ Use existing deployment normalization for output paths and
47
+ `getLambdaOptionsFromFunction` for source-backed trigger metadata. Queue consumer
48
+ identity comes from the matched configuration pattern, not the output path.
49
+
50
+ ## Generic fallback
51
+
52
+ Conventional per-entrypoint builders need no custom hook. The host can use its
53
+ known source/output mapping, with the same zero-config versus explicit-build
54
+ identity rules as deployment. A v3 result has one function artifact, but that
55
+ does not guarantee a source-equals-public-URL mapping. Middleware, framework
56
+ sentinels, and unknown multi-output modes must not be guessed. Variable-version
57
+ builders need a known per-entrypoint convention or resolved output metadata.
58
+
59
+ The optional hook is available to v2, v3, and variable-version builders. When
60
+ present it is authoritative, including an empty manifest; no fallback runs.
61
+ Absence means the host may use its supported conventional mapping.
62
+
63
+ ## Native schedules
64
+
65
+ `schedules` optionally contains framework-native definitions in the static BOA
66
+ `Schedule` shape. These refer to function output identities or Queue topics.
67
+ They are metadata, not a request for a provider-owned timer. Nitro Tasks can use
68
+ a direct Schedule function target without becoming Queue callbacks. Hosting and
69
+ executing these definitions requires the separate Schedules integration.
70
+
71
+ ## Snapshot lifecycle
72
+
73
+ - Retain provider scopes before filtering framework builders for native dev commands.
74
+ - Discovery does not require the runtime to be listening. Invocation waits for
75
+ the owning runtime's readiness and follows its current process after restart.
76
+ - Providers must not start another application server, scheduler, poller, or broker.
77
+ - Cache until source/config/environment inputs change; providers must not retain
78
+ stale process-global discovery caches.
79
+ - Validate the complete candidate set and discard superseded async results.
80
+ Errors retain the last valid snapshot.
81
+ - Empty snapshots remove only that owner's registrations. Updates/removals must
82
+ preserve existing acknowledgments and active leases in delivery state.
83
+ - Live runtime-generated updates need an authoritative refresh signal; source
84
+ watching alone does not promise discovery of virtual or ignored manifests.
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 PrerenderInitialMetadata } from './prerender';
6
+ import { Prerender, type PrerenderInitialMetadata, type PrerenderOnMiss } from './prerender';
7
7
  import download, { downloadFile, type DownloadedFiles, isSymbolicLink, isDirectory, isExternalSymlink, isExternalSymlinkTarget, getSymlinkTarget } from './fs/download';
8
8
  import getWriteableDirectory from './fs/get-writable-directory';
9
9
  import glob, { type GlobOptions } from './fs/glob';
@@ -22,7 +22,7 @@ import { cloneEnv } from './clone-env';
22
22
  import { hardLinkDir } from './hard-link-dir';
23
23
  import { getNodeExecPath } from './get-node-exec-path';
24
24
  import { validateNpmrc } from './validate-npmrc';
25
- export type { NodejsLambdaOptions, PrerenderInitialMetadata };
25
+ export type { NodejsLambdaOptions, PrerenderInitialMetadata, PrerenderOnMiss };
26
26
  export type { LambdaAffinity } from './lambda';
27
27
  export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, type DownloadedFiles, getWriteableDirectory, glob, type GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, getNodeBinPaths, getNodeExecPath, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion, getOrCreateBunBinary, detectPackageManager, runNpmInstall, type NpmInstallOutput, runBundleInstall, runPipInstall, type 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, };
28
28
  export { EdgeFunction } from './edge-function';
@@ -50,6 +50,7 @@ export { getRegExpFromMatchers, resolveMiddlewareMatcher, } from './middleware-m
50
50
  export { BACKEND_FRAMEWORKS, BACKEND_BUILDERS, UNIFIED_BACKEND_BUILDER, type BackendFramework, isBackendFramework, isNodeBackendFramework, isBackendBuilder, isExperimentalBackendsEnabled, isExperimentalBackendsWithoutIntrospectionEnabled, shouldUseExperimentalBackends, PYTHON_FRAMEWORKS, type PythonFramework, isPythonFramework, } from './framework-helpers';
51
51
  export { isNodeEntrypoint } from './node-entrypoint';
52
52
  export * from './service-path-utils';
53
+ export * from './schedule-path-utils';
53
54
  export { getEncryptedEnv, type EncryptedEnvFile, } from './process-serverless/get-encrypted-env-file';
54
55
  export { getLambdaEnvironment } from './process-serverless/get-lambda-environment';
55
56
  export { getLambdaPreloadScripts, type BytecodeCachingOptions, } from './process-serverless/get-lambda-preload-scripts';