Update app and tooling

This commit is contained in:
Lawrence Chen 2026-01-29 17:36:26 -08:00
parent 3046531bdd
commit e620ec7349
4950 changed files with 2975120 additions and 10 deletions

856
node_modules/@vercel/build-utils/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,856 @@
# @vercel/build-utils
## 13.2.16
### Patch Changes
- Add maxConcurrency to experimentalTriggers ([#14725](https://github.com/vercel/vercel/pull/14725))
- Add maxConcurrency trigger field ([#14725](https://github.com/vercel/vercel/pull/14725))
## 13.2.15
### Patch Changes
- Optimize `getAvailableNodeVersions` to skip discontinued versions and use non-throwing `statSync` ([#14686](https://github.com/vercel/vercel/pull/14686))
## 13.2.14
### Patch Changes
- Add `experimentalServices` to `vercel.json` ([#14612](https://github.com/vercel/vercel/pull/14612))
## 13.2.13
### Patch Changes
- [python] experimental python runtime framework preset ([#14646](https://github.com/vercel/vercel/pull/14646))
## 13.2.12
### Patch Changes
- Add `findPackageJson` function for optimized package.json lookup without lockfile scanning. This improves `getNodeVersion` performance by avoiding unnecessary lockfile parsing. ([#14658](https://github.com/vercel/vercel/pull/14658))
## 13.2.10
### Patch Changes
- Add 'go' as a valid runtimeLanguage option for Lambda functions ([#14624](https://github.com/vercel/vercel/pull/14624))
## 13.2.9
### Patch Changes
- replace getRuntimeNodeVersion with getNodeVersion ([#14622](https://github.com/vercel/vercel/pull/14622))
## 13.2.8
### Patch Changes
- Remove getSpawnOptions ([#14604](https://github.com/vercel/vercel/pull/14604))
## 13.2.7
### Patch Changes
- Replace getNodeVersion with getRuntimeNodeVersion ([#14600](https://github.com/vercel/vercel/pull/14600))
- Add zero-config support for Koa.js ([#14567](https://github.com/vercel/vercel/pull/14567))
## 13.2.6
### Patch Changes
- Update http links in Node.js version incompatibility message to https ([#14583](https://github.com/vercel/vercel/pull/14583))
- Ensure internal build step runs if a build script is missing ([#14564](https://github.com/vercel/vercel/pull/14564))
## 13.2.5
### Patch Changes
- Adding in user configured deploymentId to build output type ([#14497](https://github.com/vercel/vercel/pull/14497))
- skip secondary installation for vercel.ts ([#14471](https://github.com/vercel/vercel/pull/14471))
## 13.2.4
### Patch Changes
- [python] only create api builders for `.py` files that export an app or handler ([#14493](https://github.com/vercel/vercel/pull/14493))
## 13.2.3
### Patch Changes
- Use `workspace:*` for workspace dependencies ([#14396](https://github.com/vercel/vercel/pull/14396))
## 13.2.2
### Patch Changes
- Bump NFT dependency ([#14373](https://github.com/vercel/vercel/pull/14373))
## 13.2.1
### Patch Changes
- Disables auto instrumentation when the app has manual instrumentation setup ([#14345](https://github.com/vercel/vercel/pull/14345))
## 13.2.0
### Minor Changes
- Remove env var check for node24 ([#14355](https://github.com/vercel/vercel/pull/14355))
## 13.1.2
### Patch Changes
- Support `runtimeLanguage` in build-utils ([#14344](https://github.com/vercel/vercel/pull/14344))
## 13.1.1
### Patch Changes
- Only run introspection when isExperimentalBackendsWithoutIntrospectionEnabled is truthy ([#14336](https://github.com/vercel/vercel/pull/14336))
## 13.1.0
### Minor Changes
- Remove --unsafe-perm from npm install command ([#14302](https://github.com/vercel/vercel/pull/14302))
## 13.0.2
### Patch Changes
- Improve warning messages surrounding Elysia ([#14272](https://github.com/vercel/vercel/pull/14272))
## 13.0.1
### Patch Changes
- Revert "Remove getSpawnOptions" ([#14261](https://github.com/vercel/vercel/pull/14261))
## 13.0.0
### Major Changes
- Remove getSpawnOptions ([#14176](https://github.com/vercel/vercel/pull/14176))
## 12.2.4
### Patch Changes
- Add helper for detecting backend builders ([#14182](https://github.com/vercel/vercel/pull/14182))
## 12.2.3
### Patch Changes
- Add Elysia framework ([#14164](https://github.com/vercel/vercel/pull/14164))
## 12.2.2
### Patch Changes
- Allow Node.js 24 behind env var feature flag ([#14160](https://github.com/vercel/vercel/pull/14160))
## 12.2.1
### Patch Changes
- Add backend util helpers ([#14152](https://github.com/vercel/vercel/pull/14152))
## 12.2.0
### Minor Changes
- Add support for Bun through a vercel.json property ([#14130](https://github.com/vercel/vercel/pull/14130))
## 12.1.3
### Patch Changes
- Revert the prebuilt archive split from 20MB back to 100MB ([#14103](https://github.com/vercel/vercel/pull/14103))
## 12.1.2
### Patch Changes
- Reuse duplicated node builder logic ([#14031](https://github.com/vercel/vercel/pull/14031))
## 12.1.1
### Patch Changes
- Change archive split from 100MB -> 20MB ([#14046](https://github.com/vercel/vercel/pull/14046))
## 12.1.0
### Minor Changes
- Support turbo.jsonc ([#13792](https://github.com/vercel/vercel/pull/13792))
## 12.0.0
### Major Changes
- Drop Node.js 18, bump minimum to Node.js 20 ([#13856](https://github.com/vercel/vercel/pull/13856))
## 11.0.2
### Patch Changes
- Add support for the supportsCancellation function flag ([#13807](https://github.com/vercel/vercel/pull/13807))
## 11.0.1
### Patch Changes
- Fix 404 status for /api routes when using Hono with the vercel dev server ([#13706](https://github.com/vercel/vercel/pull/13706))
## 11.0.0
### Major Changes
- Add support for vlt as a package manager ([#13591](https://github.com/vercel/vercel/pull/13591))
## 10.6.7
### Patch Changes
- Reverting support for `preferredRegion` ([#13566](https://github.com/vercel/vercel/pull/13566))
## 10.6.6
### Patch Changes
- Deprecate Node.js 18.x with warning ([#13549](https://github.com/vercel/vercel/pull/13549))
## 10.6.5
### Patch Changes
- rename experimental maxAttempts to maxDeliveries ([#13534](https://github.com/vercel/vercel/pull/13534))
## 10.6.4
### Patch Changes
- simplify experimental triggers ([#13527](https://github.com/vercel/vercel/pull/13527))
## 10.6.3
### Patch Changes
- make POST method required ([#13518](https://github.com/vercel/vercel/pull/13518))
- Update more handling for experimentalTriggers ([#13517](https://github.com/vercel/vercel/pull/13517))
## 10.6.2
### Patch Changes
- Add CloudEventTrigger support for Lambda functions ([#13503](https://github.com/vercel/vercel/pull/13503))
## 10.6.1
### Patch Changes
- next package uses @vercel/routing-utils HasField rather than redefining & stricter validation. ([#13409](https://github.com/vercel/vercel/pull/13409))
- Make architecture a defined property on Lambda classes to apply when creating ([#13398](https://github.com/vercel/vercel/pull/13398))
- [env-vars] expose VERCEL_PROJECT_ID as NEXT_PUBLIC_VERCEL_PROJECT_ID ([#13431](https://github.com/vercel/vercel/pull/13431))
## 10.6.0
### Minor Changes
- provide a more verbose error when package.json is not valid ([#13346](https://github.com/vercel/vercel/pull/13346))
- Allow configuring functions `architecture` via the `vercel.json` configuration ([#13344](https://github.com/vercel/vercel/pull/13344))
## 10.5.1
### Patch Changes
- Display warning when yarn dynamic require error may happen ([#13143](https://github.com/vercel/vercel/pull/13143))
- [build-utils] increase max memory limit ([#13162](https://github.com/vercel/vercel/pull/13162))
## 10.5.0
### Minor Changes
- Disable yarn global cache before installs so build cache caches deps ([#13144](https://github.com/vercel/vercel/pull/13144))
## 10.4.0
### Minor Changes
- Expose pnpm6 within the detected package manager path for future versions of the build container ([#13132](https://github.com/vercel/vercel/pull/13132))
## 10.3.2
### Patch Changes
- Add support for expire values in Next.js prerender manifest ([#13087](https://github.com/vercel/vercel/pull/13087))
- Detect yarn version from lockfile version ([#13118](https://github.com/vercel/vercel/pull/13118))
## 10.3.1
### Patch Changes
- Parse yarn.lock file version ([#13114](https://github.com/vercel/vercel/pull/13114))
- [env-vars] expose VERCEL_DEPLOYMENT_ID as NEXT_PUBLIC_VERCEL_DEPLOYMENT_ID ([#13115](https://github.com/vercel/vercel/pull/13115))
- Fix vitest-e2e glob to include integration.test.ts ([#13097](https://github.com/vercel/vercel/pull/13097))
## 10.3.0
### Minor Changes
- Delay pnpm@10 preferred date ([#13100](https://github.com/vercel/vercel/pull/13100))
### Patch Changes
- Type-check tests ([#13096](https://github.com/vercel/vercel/pull/13096))
## 10.2.0
### Minor Changes
- Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](https://github.com/vercel/vercel/pull/13072))
### Patch Changes
- Improve build log messages surrounding pnpm 10 ([#13088](https://github.com/vercel/vercel/pull/13088))
- [build-utils] extract checkIfAlreadyInstalled helper to clarify intent ([#13060](https://github.com/vercel/vercel/pull/13060))
- Allow pnpm 10 to use package.json#packageManager without an engines error ([#13083](https://github.com/vercel/vercel/pull/13083))
## 10.1.0
### Minor Changes
- [envs] add `VERCEL_TARGET_ENV` to prefixed env vars ([#13069](https://github.com/vercel/vercel/pull/13069))
## 10.0.1
### Patch Changes
- [build-utils] Move `runNpmInstallSema` closer to where it's used ([#13061](https://github.com/vercel/vercel/pull/13061))
- [build-utils] extract getInstallCommandForPackageManager to module scope ([#13058](https://github.com/vercel/vercel/pull/13058))
- [build-utils] remove redundant sema release ([#13059](https://github.com/vercel/vercel/pull/13059))
- Revert support pnpm 10 ([#13064](https://github.com/vercel/vercel/pull/13064))
## 10.0.0
### Major Changes
- Detect v9 pnpm lockfiles as pnpm 10 generated ([#12852](https://github.com/vercel/vercel/pull/12852))
## 9.3.1
### Patch Changes
- [build-utils] extract install command specific logic into helper ([#13049](https://github.com/vercel/vercel/pull/13049))
- [build-utils] remove dead node 16 check ([#13047](https://github.com/vercel/vercel/pull/13047))
## 9.3.0
### Minor Changes
- Support process tracing ([#12894](https://github.com/vercel/vercel/pull/12894))
## 9.2.1
### Patch Changes
- Add tracer utility to @vercel/build-utils ([#13013](https://github.com/vercel/vercel/pull/13013))
## 9.2.0
### Minor Changes
- Add .yarn/cache to build cache ([#12961](https://github.com/vercel/vercel/pull/12961))
## 9.1.1
### Patch Changes
- [cli] shift node 16 deprecation date to 2025-02-03 ([#12981](https://github.com/vercel/vercel/pull/12981))
## 9.1.0
### Minor Changes
- Add `useWebApi` property to `NodejsLambda` class ([#12873](https://github.com/vercel/vercel/pull/12873))
- [build-utils] convert NodeVersion to class and add state getter ([#12883](https://github.com/vercel/vercel/pull/12883))
[ruby] convert RubyVersion to class and add state getter
## 9.0.1
### Patch Changes
- Revert build utils refactor ([#12818](https://github.com/vercel/vercel/pull/12818))
## 9.0.0
### Major Changes
- Change getPathOverrideForPackageManager() to use detectedLockfile argument ([#12813](https://github.com/vercel/vercel/pull/12813))
### Patch Changes
- Refactor build-util usage to reuse detected lockfile ([#12813](https://github.com/vercel/vercel/pull/12813))
- add support for `images.qualities` ([#12813](https://github.com/vercel/vercel/pull/12813))
## 8.8.0
### Minor Changes
- Add bun detection using bun.lock ([#12740](https://github.com/vercel/vercel/pull/12740))
## 8.7.0
### Minor Changes
- Support splitting archive deployments in parts. ([#12671](https://github.com/vercel/vercel/pull/12671))
## 8.6.0
### Minor Changes
- Add support for `NOW_EPHEMERAL_FILES_S3_URL`, `NOW_FILES_CLOUDFRONT_URL` and `NOW_FILES_S3_URL` environment variables ([#12643](https://github.com/vercel/vercel/pull/12643))
## 8.5.0
### Minor Changes
- Remove `VERCEL_ALLOW_NODEJS22` env var check ([#12614](https://github.com/vercel/vercel/pull/12614))
## 8.4.12
### Patch Changes
- Support allowHeader from Next.js for filtering request headers during revalidation ([#12420](https://github.com/vercel/vercel/pull/12420))
## 8.4.11
### Patch Changes
- Improve parsing of `turbo.json` ([#12266](https://github.com/vercel/vercel/pull/12266))
- Fix corepack `packageManager` detection on monorepos ([#12258](https://github.com/vercel/vercel/pull/12258))
## 8.4.10
### Patch Changes
- Parse `turbo.json` as json5 ([#12259](https://github.com/vercel/vercel/pull/12259))
## 8.4.9
### Patch Changes
- Fix special version specifier handling for `turbo` ([#12249](https://github.com/vercel/vercel/pull/12249))
## 8.4.8
### Patch Changes
- Revert "[build-utils] Fix corepack `packageManager` detection on monorepos" ([#12242](https://github.com/vercel/vercel/pull/12242))
## 8.4.7
### Patch Changes
- Disable corepack when Turborepo does not support `COREPACK_HOME` ([#12211](https://github.com/vercel/vercel/pull/12211))
- Fix corepack `packageManager` detection on monorepos ([#12219](https://github.com/vercel/vercel/pull/12219))
## 8.4.6
### Patch Changes
- add support for `images.localPatterns` ([#12195](https://github.com/vercel/vercel/pull/12195))
## 8.4.5
### Patch Changes
- [build-utils] add types for `images.remotePatterns.search` to vercel.json ([#12158](https://github.com/vercel/vercel/pull/12158))
## 8.4.4
### Patch Changes
- Allow Node.js v22 behind env var feature flag ([#12159](https://github.com/vercel/vercel/pull/12159))
## 8.4.3
### Patch Changes
- Introduce new chain configuration types for Partial Prerendering ([#12063](https://github.com/vercel/vercel/pull/12063))
## 8.4.2
### Patch Changes
- Revert "Revert "Revert "Fix corepack `packageManager` detection on monorepos""" ([#12099](https://github.com/vercel/vercel/pull/12099))
## 8.4.1
### Patch Changes
- Revert "Revert "Fix corepack `packageManager` detection on monorepos"" ([#11871](https://github.com/vercel/vercel/pull/11871))
## 8.4.0
### Minor Changes
- Change warnings to errors in invalid corepack package manager states ([#12062](https://github.com/vercel/vercel/pull/12062))
## 8.3.9
### Patch Changes
- Provide help when users get ERR_PNPM_UNSUPPORTED_ENGINE errors without corepack ([#12034](https://github.com/vercel/vercel/pull/12034))
- Fix package-manager-warning-1 to happen only happen in correct cases ([#12050](https://github.com/vercel/vercel/pull/12050))
## 8.3.8
### Patch Changes
- Limit `package.json#packageManager` parsing to concrete versions ([#12025](https://github.com/vercel/vercel/pull/12025))
- Catch PNPM_UNSUPPORTED_ENGINE when corepack is enabled and throw a more helpful error ([#12017](https://github.com/vercel/vercel/pull/12017))
## 8.3.7
### Patch Changes
- Revert "Revert "warn on mismatched corepack and detected package managers"" ([#11887](https://github.com/vercel/vercel/pull/11887))
## 8.3.6
### Patch Changes
- Remove implicit reliance on `@types/glob` for downstream consumers ([#11914](https://github.com/vercel/vercel/pull/11914))
## 8.3.5
### Patch Changes
- Revert "warn on mismatched corepack and detected package managers" ([#11879](https://github.com/vercel/vercel/pull/11879))
## 8.3.4
### Patch Changes
- Revert "Fix corepack `packageManager` detection on monorepos" ([#11865](https://github.com/vercel/vercel/pull/11865))
## 8.3.3
### Patch Changes
- Fix corepack `packageManager` detection on monorepos ([#11811](https://github.com/vercel/vercel/pull/11811))
## 8.3.2
### Patch Changes
- reject mismatched corepack and detected package managers ([#11603](https://github.com/vercel/vercel/pull/11603))
## 8.3.1
### Patch Changes
- Add build callback handling ([#11807](https://github.com/vercel/vercel/pull/11807))
## 8.3.0
### Minor Changes
- Adds the ability for builders to define a `diagnostics` step that is called after the build operation is done. ([#11653](https://github.com/vercel/vercel/pull/11653))
Implements the diagnostics step in the `next` builder.
### Patch Changes
- Add resolved node version range to warning message ([#11742](https://github.com/vercel/vercel/pull/11742))
## 8.2.2
### Patch Changes
- Change node 16.x EOL for Vercel ([#11704](https://github.com/vercel/vercel/pull/11704))
- Improve error message and refactor ([#11706](https://github.com/vercel/vercel/pull/11706))
- [built-utils] Handle case of not having lockfile when corepack is enabled ([#11697](https://github.com/vercel/vercel/pull/11697))
## 8.2.1
### Patch Changes
- [node] update node@16 deprecation day ([#11671](https://github.com/vercel/vercel/pull/11671))
## 8.2.0
### Minor Changes
- fix corepack detection for package manager version determination ([#11596](https://github.com/vercel/vercel/pull/11596))
### Patch Changes
- Fix triggering of ignored project settings node version warning ([#11550](https://github.com/vercel/vercel/pull/11550))
## 8.1.3
### Patch Changes
- [build-utils] log more around package manager detection ([#11594](https://github.com/vercel/vercel/pull/11594))
## 8.1.2
### Patch Changes
- add log to package manager version detection ([#11592](https://github.com/vercel/vercel/pull/11592))
## 8.1.1
### Patch Changes
- [build-utils] pnpm lockfile testing and fixing ([#11591](https://github.com/vercel/vercel/pull/11591))
## 8.1.0
### Minor Changes
- Update pnpm version detection logic ([#11445](https://github.com/vercel/vercel/pull/11445))
Add support for pnpm 9
## 8.0.0
### Major Changes
- Remove legacy `avoidTopLevelInstall` logic ([#11513](https://github.com/vercel/vercel/pull/11513))
### Patch Changes
- [build-utils] Add `VERCEL_PROJECT_PRODUCTION_URL` framework env var prefix ([#11506](https://github.com/vercel/vercel/pull/11506))
## 7.12.0
### Minor Changes
- Trigger release ([#11465](https://github.com/vercel/vercel/pull/11465))
## 7.11.0
### Minor Changes
- Add `getOsRelease()` and `getProvidedRuntime()` functions ([#11370](https://github.com/vercel/vercel/pull/11370))
## 7.10.0
### Minor Changes
- Allow environment variables to be specified for `EdgeFunction` ([#11029](https://github.com/vercel/vercel/pull/11029))
## 7.9.1
### Patch Changes
- Export `getSupportedNodeVersion` ([#11277](https://github.com/vercel/vercel/pull/11277))
## 7.9.0
### Minor Changes
- Add `base` parameter to `scanParentDirs()` ([#11261](https://github.com/vercel/vercel/pull/11261))
## 7.8.0
### Minor Changes
- Remove `VERCEL_ENABLE_NPM_DEFAULT` env var check ([#11242](https://github.com/vercel/vercel/pull/11242))
### Patch Changes
- Rename variants to flags and remove legacy flags ([#11121](https://github.com/vercel/vercel/pull/11121))
## 7.7.1
### Patch Changes
- [build-utils] increase max memory limit ([#11209](https://github.com/vercel/vercel/pull/11209))
## 7.7.0
### Minor Changes
- Revert "Revert "Default ruby to only currently supported version (3.2.0)"" ([#11137](https://github.com/vercel/vercel/pull/11137))
## 7.6.0
### Minor Changes
- Revert "Default ruby to only currently supported version (3.2.0)" ([#11135](https://github.com/vercel/vercel/pull/11135))
- Mark `flags` as deprecated and replace them with `variants` ([#11098](https://github.com/vercel/vercel/pull/11098))
- [build-utils] change default package manager when no lockfile detected from `yarn` to `npm` (gated behind feature flag) ([#11131](https://github.com/vercel/vercel/pull/11131))
### Patch Changes
- Update internal type for variants ([#11111](https://github.com/vercel/vercel/pull/11111))
## 7.5.1
### Patch Changes
- Add experimental field to Lambda and size to FileFsRef output ([#11059](https://github.com/vercel/vercel/pull/11059))
## 7.5.0
### Minor Changes
- Deprecate `EdgeFunction#name` property ([#11010](https://github.com/vercel/vercel/pull/11010))
## 7.4.1
### Patch Changes
- Extend Node v16 discontinue date to 2024-06-15 ([#10967](https://github.com/vercel/vercel/pull/10967))
## 7.4.0
### Minor Changes
- Adds new helper `getPathForPackageManager()` ([#10918](https://github.com/vercel/vercel/pull/10918))
## 7.3.0
### Minor Changes
- [cli] add `--deprecated` option to `vc project ls` command ([#10919](https://github.com/vercel/vercel/pull/10919))
## 7.2.5
### Patch Changes
- Remove Node.js v20 env var check ([#10834](https://github.com/vercel/vercel/pull/10834))
## 7.2.4
### Patch Changes
- Select Node.js version based on what's available in build-container ([#10822](https://github.com/vercel/vercel/pull/10822))
## 7.2.3
### Patch Changes
- Add experimental flag to allow Node.js v20 ([#10802](https://github.com/vercel/vercel/pull/10802))
## 7.2.2
### Patch Changes
- [cli] Update bun detection and add tests for projects with both bunlock binary and yarn.lock text files ([#10583](https://github.com/vercel/vercel/pull/10583))
## 7.2.1
### Patch Changes
- Internal variants ([#10549](https://github.com/vercel/vercel/pull/10549))
## 7.2.0
### Minor Changes
- Add new optional prerender field: experimentalStreamingLambdaPath ([#10476](https://github.com/vercel/vercel/pull/10476))
- [build-utils] Add zero config detection for bun package manager ([#10486](https://github.com/vercel/vercel/pull/10486))
### Patch Changes
- add `experimentalBypassFor` field to Prerender ([#10481](https://github.com/vercel/vercel/pull/10481))
## 7.1.1
### Patch Changes
- add descriptions to NodeVersion properties ([#10403](https://github.com/vercel/vercel/pull/10403))
- Updated semver dependency ([#10411](https://github.com/vercel/vercel/pull/10411))
## 7.1.0
### Minor Changes
- Support serverless function architecture ([#10392](https://github.com/vercel/vercel/pull/10392))
## 7.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))
## 6.8.3
### Patch Changes
- Fix `getPrefixedEnvVars()` to handle `VERCEL_BRANCH_URL` ([#10315](https://github.com/vercel/vercel/pull/10315))
## 6.8.2
### Patch Changes
- Push back `nodejs16.x` discontinue date to `2024-02-06` ([#10209](https://github.com/vercel/vercel/pull/10209))
## 6.8.1
### Patch Changes
- Revert "[build-utils] Allow file-ref sema to be controlled through env flag" ([#10167](https://github.com/vercel/vercel/pull/10167))
## 6.8.0
### Minor Changes
- Add `getNodeBinPaths()` and `traverseUpDirectories()` functions ([#10150](https://github.com/vercel/vercel/pull/10150))
## 6.7.5
### Patch Changes
- Publish missing build-utils ([`cd35071f6`](https://github.com/vercel/vercel/commit/cd35071f609d615d47bc04634c123b33768436cb))
## 6.7.4
### Patch Changes
- Remove usage of `env` from Edge Functions and Middleware ([#10018](https://github.com/vercel/vercel/pull/10018))
## 6.7.3
### Patch Changes
- Deprecate Node.js 14.x and 16.x with warning ([#9976](https://github.com/vercel/vercel/pull/9976))

202
node_modules/@vercel/build-utils/LICENSE generated vendored Normal file
View file

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 Vercel, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

3
node_modules/@vercel/build-utils/build.mjs generated vendored Normal file
View file

@ -0,0 +1,3 @@
import { tsc, esbuild } from '../../utils/build.mjs';
await Promise.all([tsc(), esbuild().then(() => esbuild({ bundle: true }))]);

10
node_modules/@vercel/build-utils/dist/clone-env.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
import type { Env } from './types';
/**
* Clones zero or more objects into a single new object while ensuring that the
* `PATH` environment variable is defined when the `PATH` or `Path` environment
* variables are defined.
*
* @param {Object} [...envs] Objects and/or `process.env` to clone and merge
* @returns {Object} The new object
*/
export declare function cloneEnv(...envs: (Env | undefined)[]): Env;

43
node_modules/@vercel/build-utils/dist/clone-env.js generated vendored Normal file
View file

@ -0,0 +1,43 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var clone_env_exports = {};
__export(clone_env_exports, {
cloneEnv: () => cloneEnv
});
module.exports = __toCommonJS(clone_env_exports);
const { hasOwnProperty } = Object.prototype;
function cloneEnv(...envs) {
return envs.reduce((obj, env) => {
if (env === void 0 || env === null) {
return obj;
}
obj = Object.assign(obj, env);
if (hasOwnProperty.call(env, "Path")) {
if (obj.Path !== void 0) {
obj.PATH = obj.Path;
}
delete obj.Path;
}
return obj;
}, {});
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
cloneEnv
});

1
node_modules/@vercel/build-utils/dist/debug.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export default function debug(message: string, ...additional: any[]): void;

31
node_modules/@vercel/build-utils/dist/debug.js generated vendored Normal file
View file

@ -0,0 +1,31 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var debug_exports = {};
__export(debug_exports, {
default: () => debug
});
module.exports = __toCommonJS(debug_exports);
var import_get_platform_env = require("./get-platform-env");
function debug(message, ...additional) {
if ((0, import_get_platform_env.getPlatformEnv)("BUILDER_DEBUG")) {
console.log(message, ...additional);
} else if (process.env.VERCEL_DEBUG_PREFIX) {
console.log(`${process.env.VERCEL_DEBUG_PREFIX}${message}`, ...additional);
}
}

View file

@ -0,0 +1 @@
export declare const defaultCachePathGlob = "**/{node_modules,.yarn/cache}/**";

View file

@ -0,0 +1,28 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var default_cache_path_glob_exports = {};
__export(default_cache_path_glob_exports, {
defaultCachePathGlob: () => defaultCachePathGlob
});
module.exports = __toCommonJS(default_cache_path_glob_exports);
const defaultCachePathGlob = "**/{node_modules,.yarn/cache}/**";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
defaultCachePathGlob
});

View file

@ -0,0 +1,41 @@
import type { Env, Files, FunctionFramework } from './types';
/**
* An Edge Functions output
*/
export declare class EdgeFunction {
type: 'EdgeFunction';
/**
* A display name for the edge function.
* @deprecated This property should no longer be used. The name is inferred from the URL path of the function.
*/
name?: string;
/**
* The deployment target.
* Only `v8-worker` is currently supported.
*/
deploymentTarget: 'v8-worker';
/**
* The entrypoint for the edge function.
*/
entrypoint: string;
/**
* Environment variables for the edge function to use at runtime.
*/
environment?: Env;
/**
* The list of files to be included in the edge function bundle.
*/
files: Files;
/**
* Extra binary files to be included in the edge function
*/
assets?: {
name: string;
path: string;
}[];
/** The regions where the edge function will be executed on */
regions?: string | string[];
/** The framework */
framework?: FunctionFramework;
constructor(params: Omit<EdgeFunction, 'type'>);
}

40
node_modules/@vercel/build-utils/dist/edge-function.js generated vendored Normal file
View file

@ -0,0 +1,40 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var edge_function_exports = {};
__export(edge_function_exports, {
EdgeFunction: () => EdgeFunction
});
module.exports = __toCommonJS(edge_function_exports);
class EdgeFunction {
constructor(params) {
this.type = "EdgeFunction";
this.name = params.name;
this.deploymentTarget = params.deploymentTarget;
this.entrypoint = params.entrypoint;
this.files = params.files;
this.assets = params.assets;
this.regions = params.regions;
this.framework = params.framework;
this.environment = params.environment;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
EdgeFunction
});

39
node_modules/@vercel/build-utils/dist/errors.d.ts generated vendored Normal file
View file

@ -0,0 +1,39 @@
/**
* This error should be thrown from a Builder in
* order to stop the build and print a message.
* This is necessary to avoid printing a stack trace.
*/
export declare class NowBuildError extends Error {
hideStackTrace: boolean;
code: string;
link?: string;
action?: string;
constructor({ message, code, link, action }: Props);
}
interface Props {
/**
* The error message to display to the end-user.
* Should be short yet descriptive of what they did wrong.
*/
message: string;
/**
* A unique error code for this particular error.
* Should start with the builder name such as `NODE_`.
*/
code: string;
/**
* Optional hyperlink starting with https://vercel.com to
* link to more information about this error.
*/
link?: string;
/**
* Optional "action" to display before the `link`, such as "Learn More".
*/
action?: string;
}
export declare function getPrettyError(obj: {
dataPath?: string;
message?: string;
params: any;
}): NowBuildError;
export {};

95
node_modules/@vercel/build-utils/dist/errors.js generated vendored Normal file
View file

@ -0,0 +1,95 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var errors_exports = {};
__export(errors_exports, {
NowBuildError: () => NowBuildError,
getPrettyError: () => getPrettyError
});
module.exports = __toCommonJS(errors_exports);
class NowBuildError extends Error {
constructor({ message, code, link, action }) {
super(message);
this.hideStackTrace = true;
this.code = code;
this.link = link;
this.action = action;
}
}
function getPrettyError(obj) {
const docsUrl = "https://vercel.com/docs/concepts/projects/project-configuration";
try {
const { dataPath, params, message: ajvMessage } = obj;
const prop = getTopLevelPropertyName(dataPath);
let message = dataPath && dataPath.startsWith(".") ? `\`${dataPath.slice(1)}\` ` : "";
if (params && typeof params.additionalProperty === "string") {
const suggestion = getSuggestion(prop, params.additionalProperty);
message += `should NOT have additional property \`${params.additionalProperty}\`. ${suggestion}`;
} else if (params && typeof params.missingProperty === "string") {
message += `missing required property \`${params.missingProperty}\`.`;
} else {
message += `${ajvMessage}.`;
}
return new NowBuildError({
code: "INVALID_VERCEL_CONFIG",
message,
link: prop ? `${docsUrl}#${prop.toLowerCase()}` : docsUrl,
action: "View Documentation"
});
} catch (e) {
return new NowBuildError({
code: "INVALID_VERCEL_CONFIG",
message: `Failed to validate configuration.`,
link: docsUrl,
action: "View Documentation"
});
}
}
function getTopLevelPropertyName(dataPath) {
if (dataPath && dataPath.startsWith(".")) {
const lastIndex = dataPath.indexOf("[");
return lastIndex > -1 ? dataPath.slice(1, lastIndex) : dataPath.slice(1);
}
return "";
}
const mapTypoToSuggestion = {
"": {
builder: "builds",
"build.env": '{ "build": { "env": {"name": "value"} } }',
"builds.env": '{ "build": { "env": {"name": "value"} } }'
},
rewrites: { src: "source", dest: "destination" },
redirects: { src: "source", dest: "destination", status: "statusCode" },
headers: { src: "source", header: "headers" },
routes: {
source: "src",
destination: "dest",
header: "headers",
method: "methods"
}
};
function getSuggestion(topLevelProp, additionalProperty) {
const choices = mapTypoToSuggestion[topLevelProp];
const choice = choices ? choices[additionalProperty] : void 0;
return choice ? `Did you mean \`${choice}\`?` : "Please remove it.";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
NowBuildError,
getPrettyError
});

24
node_modules/@vercel/build-utils/dist/file-blob.d.ts generated vendored Normal file
View file

@ -0,0 +1,24 @@
/// <reference types="node" />
/// <reference types="node" />
import { FileBase } from './types';
interface FileBlobOptions {
mode?: number;
contentType?: string;
data: string | Buffer;
}
interface FromStreamOptions {
mode?: number;
contentType?: string;
stream: NodeJS.ReadableStream;
}
export default class FileBlob implements FileBase {
type: 'FileBlob';
mode: number;
data: string | Buffer;
contentType: string | undefined;
constructor({ mode, contentType, data }: FileBlobOptions);
static fromStream({ mode, contentType, stream, }: FromStreamOptions): Promise<FileBlob>;
toStreamAsync(): Promise<NodeJS.ReadableStream>;
toStream(): NodeJS.ReadableStream;
}
export {};

67
node_modules/@vercel/build-utils/dist/file-blob.js generated vendored Normal file
View file

@ -0,0 +1,67 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var file_blob_exports = {};
__export(file_blob_exports, {
default: () => FileBlob
});
module.exports = __toCommonJS(file_blob_exports);
var import_assert = __toESM(require("assert"));
var import_into_stream = __toESM(require("into-stream"));
class FileBlob {
constructor({ mode = 33188, contentType, data }) {
(0, import_assert.default)(typeof mode === "number");
(0, import_assert.default)(typeof data === "string" || Buffer.isBuffer(data));
this.type = "FileBlob";
this.mode = mode;
this.contentType = contentType;
this.data = data;
}
static async fromStream({
mode = 33188,
contentType,
stream
}) {
(0, import_assert.default)(typeof mode === "number");
(0, import_assert.default)(typeof stream.pipe === "function");
const chunks = [];
await new Promise((resolve, reject) => {
stream.on("data", (chunk) => chunks.push(Buffer.from(chunk)));
stream.on("error", (error) => reject(error));
stream.on("end", () => resolve());
});
const data = Buffer.concat(chunks);
return new FileBlob({ mode, contentType, data });
}
async toStreamAsync() {
return this.toStream();
}
toStream() {
return (0, import_into_stream.default)(this.data);
}
}

27
node_modules/@vercel/build-utils/dist/file-fs-ref.d.ts generated vendored Normal file
View file

@ -0,0 +1,27 @@
/// <reference types="node" />
import { FileBase } from './types';
interface FileFsRefOptions {
mode?: number;
contentType?: string;
fsPath: string;
size?: number;
}
interface FromStreamOptions {
mode: number;
contentType?: string;
stream: NodeJS.ReadableStream;
fsPath: string;
}
declare class FileFsRef implements FileBase {
type: 'FileFsRef';
mode: number;
fsPath: string;
size?: number;
contentType: string | undefined;
constructor({ mode, contentType, fsPath, size, }: FileFsRefOptions);
static fromFsPath({ mode, contentType, fsPath, size, }: FileFsRefOptions): Promise<FileFsRef>;
static fromStream({ mode, contentType, stream, fsPath, }: FromStreamOptions): Promise<FileFsRef>;
toStreamAsync(): Promise<NodeJS.ReadableStream>;
toStream(): NodeJS.ReadableStream;
}
export default FileFsRef;

113
node_modules/@vercel/build-utils/dist/file-fs-ref.js generated vendored Normal file
View file

@ -0,0 +1,113 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var file_fs_ref_exports = {};
__export(file_fs_ref_exports, {
default: () => file_fs_ref_default
});
module.exports = __toCommonJS(file_fs_ref_exports);
var import_assert = __toESM(require("assert"));
var import_fs_extra = __toESM(require("fs-extra"));
var import_multistream = __toESM(require("multistream"));
var import_path = __toESM(require("path"));
var import_async_sema = __toESM(require("async-sema"));
const semaToPreventEMFILE = new import_async_sema.default(20);
class FileFsRef {
constructor({
mode = 33188,
contentType,
fsPath,
size
}) {
(0, import_assert.default)(typeof mode === "number");
(0, import_assert.default)(typeof fsPath === "string");
this.type = "FileFsRef";
this.mode = mode;
this.contentType = contentType;
this.fsPath = fsPath;
this.size = size;
}
static async fromFsPath({
mode,
contentType,
fsPath,
size
}) {
let m = mode;
let s = size;
if (!m || typeof s === "undefined") {
const stat = await import_fs_extra.default.lstat(fsPath);
m = stat.mode;
s = stat.size;
}
return new FileFsRef({ mode: m, contentType, fsPath, size: s });
}
static async fromStream({
mode = 33188,
contentType,
stream,
fsPath
}) {
(0, import_assert.default)(typeof mode === "number");
(0, import_assert.default)(typeof stream.pipe === "function");
(0, import_assert.default)(typeof fsPath === "string");
await import_fs_extra.default.mkdirp(import_path.default.dirname(fsPath));
await new Promise((resolve, reject) => {
const dest = import_fs_extra.default.createWriteStream(fsPath, {
mode: mode & 511
});
stream.pipe(dest);
stream.on("error", reject);
dest.on("finish", resolve);
dest.on("error", reject);
});
return FileFsRef.fromFsPath({ mode, contentType, fsPath });
}
async toStreamAsync() {
await semaToPreventEMFILE.acquire();
const release = () => semaToPreventEMFILE.release();
const stream = import_fs_extra.default.createReadStream(this.fsPath);
stream.on("close", release);
stream.on("error", release);
return stream;
}
toStream() {
let flag = false;
return (0, import_multistream.default)((cb) => {
if (flag)
return cb(null, null);
flag = true;
this.toStreamAsync().then((stream) => {
cb(null, stream);
}).catch((error) => {
cb(error, null);
});
});
}
}
var file_fs_ref_default = FileFsRef;

38
node_modules/@vercel/build-utils/dist/file-ref.d.ts generated vendored Normal file
View file

@ -0,0 +1,38 @@
/// <reference types="node" />
import { FileBase } from './types';
interface FileRefOptions {
mode?: number;
digest: string;
contentType?: string;
mutable?: boolean;
}
export default class FileRef implements FileBase {
type: 'FileRef';
mode: number;
digest: string;
contentType: string | undefined;
private mutable;
constructor({ mode, digest, contentType, mutable, }: FileRefOptions);
/**
* Retrieves the URL of the CloudFront distribution for the S3
* bucket represented by {@link getNowFilesS3Url}.
*
* @returns The URL of the CloudFront distribution
*/
private getNowFilesCloudfrontUrl;
/**
* Retrieves the URL of the S3 bucket for storing ephemeral files.
*
* @returns The URL of the S3 bucket
*/
private getNowEphemeralFilesS3Url;
/**
* Retrieves the URL of the S3 bucket for storing files.
*
* @returns The URL of the S3 bucket
*/
private getNowFilesS3Url;
toStreamAsync(): Promise<NodeJS.ReadableStream>;
toStream(): NodeJS.ReadableStream;
}
export {};

147
node_modules/@vercel/build-utils/dist/file-ref.js generated vendored Normal file
View file

@ -0,0 +1,147 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var file_ref_exports = {};
__export(file_ref_exports, {
default: () => FileRef
});
module.exports = __toCommonJS(file_ref_exports);
var import_assert = __toESM(require("assert"));
var import_node_fetch = __toESM(require("node-fetch"));
var import_multistream = __toESM(require("multistream"));
var import_async_retry = __toESM(require("async-retry"));
var import_async_sema = __toESM(require("async-sema"));
const semaToDownloadFromS3 = new import_async_sema.default(5);
class BailableError extends Error {
constructor(...args) {
super(...args);
this.bail = false;
}
}
class FileRef {
constructor({
mode = 33188,
digest,
contentType,
mutable = false
}) {
(0, import_assert.default)(typeof mode === "number");
(0, import_assert.default)(typeof digest === "string");
this.type = "FileRef";
this.mode = mode;
this.digest = digest;
this.contentType = contentType;
this.mutable = mutable;
}
/**
* Retrieves the URL of the CloudFront distribution for the S3
* bucket represented by {@link getNowFilesS3Url}.
*
* @returns The URL of the CloudFront distribution
*/
getNowFilesCloudfrontUrl() {
return getEnvAsUrlOrThrow("NOW_FILES_CLOUDFRONT_URL") || "https://dmmcy0pwk6bqi.cloudfront.net";
}
/**
* Retrieves the URL of the S3 bucket for storing ephemeral files.
*
* @returns The URL of the S3 bucket
*/
getNowEphemeralFilesS3Url() {
return getEnvAsUrlOrThrow("NOW_EPHEMERAL_FILES_S3_URL") || "https://now-ephemeral-files.s3.amazonaws.com";
}
/**
* Retrieves the URL of the S3 bucket for storing files.
*
* @returns The URL of the S3 bucket
*/
getNowFilesS3Url() {
return getEnvAsUrlOrThrow("NOW_FILES_S3_URL") || "https://now-files.s3.amazonaws.com";
}
async toStreamAsync() {
let url = "";
const [digestType, digestHash] = this.digest.split(":");
if (digestType === "sha") {
url = this.mutable ? `${this.getNowFilesS3Url()}/${digestHash}` : `${this.getNowFilesCloudfrontUrl()}/${digestHash}`;
} else if (digestType === "sha+ephemeral") {
url = `${this.getNowEphemeralFilesS3Url()}/${digestHash}`;
} else {
throw new Error("Expected digest to be sha");
}
await semaToDownloadFromS3.acquire();
try {
return await (0, import_async_retry.default)(
async () => {
const resp = await (0, import_node_fetch.default)(url);
if (!resp.ok) {
const error = new BailableError(
`download: ${resp.status} ${resp.statusText} for ${url}`
);
if (resp.status === 403)
error.bail = true;
throw error;
}
return resp.body;
},
{ factor: 1, retries: 3 }
);
} finally {
semaToDownloadFromS3.release();
}
}
toStream() {
let flag = false;
return (0, import_multistream.default)((cb) => {
if (flag)
return cb(null, null);
flag = true;
this.toStreamAsync().then((stream) => {
cb(null, stream);
}).catch((error) => {
cb(error, null);
});
});
}
}
function getEnvAsUrlOrThrow(key) {
const value = process.env[key];
if (value === void 0)
return void 0;
try {
new URL(value);
return value;
} catch (e) {
if (e instanceof TypeError && "code" in e && e.code === "ERR_INVALID_URL") {
throw new Error(
`A non-URL value was supplied to the ${key} environment variable`
);
} else {
throw e;
}
}
}

View file

@ -0,0 +1,22 @@
import { Builder } from '.';
/**
* List of backend frameworks supported by the experimental backends feature
*/
export declare const BACKEND_FRAMEWORKS: readonly ["express", "hono", "h3", "koa", "nestjs", "fastify", "elysia"];
export declare const PYTHON_FRAMEWORKS: readonly ["fastapi", "flask", "python"];
export declare const RUNTIME_FRAMEWORKS: readonly ["python"];
export declare const BACKEND_BUILDERS: readonly ["@vercel/express", "@vercel/hono", "@vercel/h3", "@vercel/koa", "@vercel/nestjs", "@vercel/fastify", "@vercel/elysia"];
export type BackendFramework = (typeof BACKEND_FRAMEWORKS)[number];
export type PythonFramework = (typeof PYTHON_FRAMEWORKS)[number];
/**
* Checks if the given framework is a backend framework
*/
export declare function isBackendFramework(framework: string | null | undefined): framework is BackendFramework;
export declare function isPythonFramework(framework: string | null | undefined): framework is (typeof PYTHON_FRAMEWORKS)[number];
export declare function isExperimentalBackendsWithoutIntrospectionEnabled(): boolean;
export declare function isExperimentalBackendsEnabled(): boolean;
export declare function isBackendBuilder(builder: Builder | null | undefined): boolean;
/**
* Checks if experimental backends are enabled AND the framework is a backend framework
*/
export declare function shouldUseExperimentalBackends(framework: string | null | undefined): boolean;

View file

@ -0,0 +1,96 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var framework_helpers_exports = {};
__export(framework_helpers_exports, {
BACKEND_BUILDERS: () => BACKEND_BUILDERS,
BACKEND_FRAMEWORKS: () => BACKEND_FRAMEWORKS,
PYTHON_FRAMEWORKS: () => PYTHON_FRAMEWORKS,
RUNTIME_FRAMEWORKS: () => RUNTIME_FRAMEWORKS,
isBackendBuilder: () => isBackendBuilder,
isBackendFramework: () => isBackendFramework,
isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled,
isExperimentalBackendsWithoutIntrospectionEnabled: () => isExperimentalBackendsWithoutIntrospectionEnabled,
isPythonFramework: () => isPythonFramework,
shouldUseExperimentalBackends: () => shouldUseExperimentalBackends
});
module.exports = __toCommonJS(framework_helpers_exports);
const BACKEND_FRAMEWORKS = [
"express",
"hono",
"h3",
"koa",
"nestjs",
"fastify",
"elysia"
];
const PYTHON_FRAMEWORKS = [
"fastapi",
"flask",
"python"
// Generic Python framework preset
];
const RUNTIME_FRAMEWORKS = ["python"];
const BACKEND_BUILDERS = [
"@vercel/express",
"@vercel/hono",
"@vercel/h3",
"@vercel/koa",
"@vercel/nestjs",
"@vercel/fastify",
"@vercel/elysia"
];
function isBackendFramework(framework) {
if (!framework)
return false;
return BACKEND_FRAMEWORKS.includes(framework);
}
function isPythonFramework(framework) {
if (!framework)
return false;
return PYTHON_FRAMEWORKS.includes(framework);
}
function isExperimentalBackendsWithoutIntrospectionEnabled() {
return process.env.VERCEL_BACKENDS_BUILDS === "1";
}
function isExperimentalBackendsEnabled() {
return isExperimentalBackendsWithoutIntrospectionEnabled() || process.env.VERCEL_EXPERIMENTAL_BACKENDS === "1" || // Previously used for experimental express and hono builds
process.env.VERCEL_EXPERIMENTAL_EXPRESS_BUILD === "1" || process.env.VERCEL_EXPERIMENTAL_HONO_BUILD === "1";
}
function isBackendBuilder(builder) {
if (!builder)
return false;
const use = builder.use;
return BACKEND_BUILDERS.includes(use);
}
function shouldUseExperimentalBackends(framework) {
return isExperimentalBackendsEnabled() && isBackendFramework(framework);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BACKEND_BUILDERS,
BACKEND_FRAMEWORKS,
PYTHON_FRAMEWORKS,
RUNTIME_FRAMEWORKS,
isBackendBuilder,
isBackendFramework,
isExperimentalBackendsEnabled,
isExperimentalBackendsWithoutIntrospectionEnabled,
isPythonFramework,
shouldUseExperimentalBackends
});

View file

@ -0,0 +1,9 @@
import FileFsRef from '../file-fs-ref';
import { File, Files, Meta } from '../types';
export interface DownloadedFiles {
[filePath: string]: FileFsRef;
}
export declare function isDirectory(mode: number): boolean;
export declare function isSymbolicLink(mode: number): boolean;
export declare function downloadFile(file: File, fsPath: string): Promise<FileFsRef>;
export default function download(files: Files, basePath: string, meta?: Meta): Promise<DownloadedFiles>;

136
node_modules/@vercel/build-utils/dist/fs/download.js generated vendored Normal file
View file

@ -0,0 +1,136 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var download_exports = {};
__export(download_exports, {
default: () => download,
downloadFile: () => downloadFile,
isDirectory: () => isDirectory,
isSymbolicLink: () => isSymbolicLink
});
module.exports = __toCommonJS(download_exports);
var import_path = __toESM(require("path"));
var import_debug = __toESM(require("../debug"));
var import_file_fs_ref = __toESM(require("../file-fs-ref"));
var import_fs_extra = require("fs-extra");
var import_stream_to_buffer = __toESM(require("./stream-to-buffer"));
const S_IFDIR = 16384;
const S_IFLNK = 40960;
const S_IFMT = 61440;
function isDirectory(mode) {
return (mode & S_IFMT) === S_IFDIR;
}
function isSymbolicLink(mode) {
return (mode & S_IFMT) === S_IFLNK;
}
async function prepareSymlinkTarget(file, fsPath) {
const mkdirPromise = (0, import_fs_extra.mkdirp)(import_path.default.dirname(fsPath));
if (file.type === "FileFsRef") {
const [target] = await Promise.all([(0, import_fs_extra.readlink)(file.fsPath), mkdirPromise]);
return target;
}
if (file.type === "FileRef" || file.type === "FileBlob") {
const targetPathBufferPromise = (0, import_stream_to_buffer.default)(await file.toStreamAsync());
const [targetPathBuffer] = await Promise.all([
targetPathBufferPromise,
mkdirPromise
]);
return targetPathBuffer.toString("utf8");
}
throw new Error(
`file.type "${file.type}" not supported for symlink`
);
}
async function downloadFile(file, fsPath) {
const { mode } = file;
if (isDirectory(mode)) {
await (0, import_fs_extra.mkdirp)(fsPath);
await (0, import_fs_extra.chmod)(fsPath, mode);
return import_file_fs_ref.default.fromFsPath({ mode, fsPath });
}
if (isSymbolicLink(mode)) {
const target = await prepareSymlinkTarget(file, fsPath);
await (0, import_fs_extra.symlink)(target, fsPath);
return import_file_fs_ref.default.fromFsPath({ mode, fsPath });
}
const stream = file.toStream();
return import_file_fs_ref.default.fromStream({ mode, stream, fsPath });
}
async function removeFile(basePath, fileMatched) {
const file = import_path.default.join(basePath, fileMatched);
await (0, import_fs_extra.remove)(file);
}
async function download(files, basePath, meta) {
const {
isDev = false,
skipDownload = false,
filesChanged = null,
filesRemoved = null
} = meta || {};
if (isDev || skipDownload) {
return files;
}
(0, import_debug.default)("Downloading deployment source files...");
const start = Date.now();
const files2 = {};
const filenames = Object.keys(files);
await Promise.all(
filenames.map(async (name) => {
if (Array.isArray(filesRemoved) && filesRemoved.includes(name)) {
await removeFile(basePath, name);
return;
}
if (Array.isArray(filesChanged) && !filesChanged.includes(name)) {
return;
}
const parts = name.split("/");
for (let i = 1; i < parts.length; i++) {
const dir = parts.slice(0, i).join("/");
const parent = files[dir];
if (parent && isSymbolicLink(parent.mode)) {
console.warn(
`Warning: file "${name}" is within a symlinked directory "${dir}" and will be ignored`
);
return;
}
}
const file = files[name];
const fsPath = import_path.default.join(basePath, name);
files2[name] = await downloadFile(file, fsPath);
})
);
const duration = Date.now() - start;
(0, import_debug.default)(`Downloaded ${filenames.length} source files: ${duration}ms`);
return files2;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
downloadFile,
isDirectory,
isSymbolicLink
});

View file

@ -0,0 +1 @@
export default function getWritableDirectory(): Promise<string>;

View file

@ -0,0 +1,32 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var get_writable_directory_exports = {};
__export(get_writable_directory_exports, {
default: () => getWritableDirectory
});
module.exports = __toCommonJS(get_writable_directory_exports);
var import_path = require("path");
var import_os = require("os");
var import_fs_extra = require("fs-extra");
async function getWritableDirectory() {
const name = Math.floor(Math.random() * 2147483647).toString(16);
const directory = (0, import_path.join)((0, import_os.tmpdir)(), name);
await (0, import_fs_extra.mkdirp)(directory);
return directory;
}

10
node_modules/@vercel/build-utils/dist/fs/glob.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
import FileFsRef from '../file-fs-ref';
export interface GlobOptions {
cwd?: string;
dot?: boolean;
follow?: boolean;
ignore?: string | ReadonlyArray<string>;
includeDirectories?: boolean;
nodir?: boolean;
}
export default function glob(pattern: string, opts: GlobOptions | string, mountpoint?: string): Promise<Record<string, FileFsRef>>;

111
node_modules/@vercel/build-utils/dist/fs/glob.js generated vendored Normal file
View file

@ -0,0 +1,111 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var glob_exports = {};
__export(glob_exports, {
default: () => glob
});
module.exports = __toCommonJS(glob_exports);
var import_path = __toESM(require("path"));
var import_assert = __toESM(require("assert"));
var import_glob = __toESM(require("glob"));
var import_util = require("util");
var import_fs_extra = require("fs-extra");
var import_normalize_path = require("./normalize-path");
var import_file_fs_ref = __toESM(require("../file-fs-ref"));
const vanillaGlob = (0, import_util.promisify)(import_glob.default);
async function glob(pattern, opts, mountpoint) {
const options = typeof opts === "string" ? { cwd: opts } : opts;
if (!options.cwd) {
throw new Error(
"Second argument (basePath) must be specified for names of resulting files"
);
}
if (!import_path.default.isAbsolute(options.cwd)) {
throw new Error(`basePath/cwd must be an absolute path (${options.cwd})`);
}
const results = {};
const statCache = {};
const symlinks = {};
const files = await vanillaGlob(pattern, {
...options,
symlinks,
statCache,
stat: true,
dot: true
});
const dirs = /* @__PURE__ */ new Set();
const dirsWithEntries = /* @__PURE__ */ new Set();
for (const relativePath of files) {
const absPath = import_path.default.join(options.cwd, relativePath);
const fsPath = (0, import_normalize_path.normalizePath)(absPath);
let stat = statCache[fsPath];
(0, import_assert.default)(
stat,
`statCache does not contain value for ${relativePath} (resolved to ${fsPath})`
);
const isSymlink = symlinks[fsPath];
if (options.follow && (isSymlink || (await (0, import_fs_extra.lstat)(fsPath)).isSymbolicLink())) {
const target = await (0, import_fs_extra.readlink)(absPath);
const absTarget = import_path.default.resolve(import_path.default.dirname(absPath), target);
if (import_path.default.relative(options.cwd, absTarget).startsWith(`..${import_path.default.sep}`)) {
continue;
}
}
if (isSymlink || stat.isFile() || stat.isDirectory()) {
if (isSymlink) {
stat = await (0, import_fs_extra.lstat)(absPath);
}
const dirname = import_path.default.dirname(relativePath);
dirsWithEntries.add(dirname);
if (stat.isDirectory()) {
dirs.add(relativePath);
continue;
}
let finalPath = relativePath;
if (mountpoint) {
finalPath = import_path.default.join(mountpoint, finalPath);
}
results[finalPath] = new import_file_fs_ref.default({ mode: stat.mode, fsPath });
}
}
if (options.includeDirectories) {
for (const relativePath of dirs) {
if (dirsWithEntries.has(relativePath))
continue;
let finalPath = relativePath;
if (mountpoint) {
finalPath = import_path.default.join(mountpoint, finalPath);
}
const fsPath = (0, import_normalize_path.normalizePath)(import_path.default.join(options.cwd, relativePath));
const stat = statCache[fsPath];
results[finalPath] = new import_file_fs_ref.default({ mode: stat.mode, fsPath });
}
}
return results;
}

View file

@ -0,0 +1,13 @@
import { BunVersion, NodeVersion, Version } from '../types';
export type NodeVersionMajor = ReturnType<typeof getOptions>[number]['major'];
export declare const NODE_VERSIONS: NodeVersion[];
export declare const BUN_VERSIONS: BunVersion[];
export declare function getNodeVersionByMajor(major: number): NodeVersion | undefined;
declare function getOptions(): NodeVersion[];
export declare function getAvailableNodeVersions(): NodeVersionMajor[];
export declare function getLatestNodeVersion(availableVersions?: NodeVersionMajor[]): NodeVersion;
export declare function getDiscontinuedNodeVersions(): NodeVersion[];
export declare function getSupportedNodeVersion(engineRange: string | undefined, isAuto?: boolean, availableVersions?: NodeVersionMajor[]): Promise<NodeVersion>;
export declare function getSupportedBunVersion(engineRange: string): BunVersion;
export declare function isBunVersion(version: Version): boolean;
export {};

View file

@ -0,0 +1,222 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var node_version_exports = {};
__export(node_version_exports, {
BUN_VERSIONS: () => BUN_VERSIONS,
NODE_VERSIONS: () => NODE_VERSIONS,
getAvailableNodeVersions: () => getAvailableNodeVersions,
getDiscontinuedNodeVersions: () => getDiscontinuedNodeVersions,
getLatestNodeVersion: () => getLatestNodeVersion,
getNodeVersionByMajor: () => getNodeVersionByMajor,
getSupportedBunVersion: () => getSupportedBunVersion,
getSupportedNodeVersion: () => getSupportedNodeVersion,
isBunVersion: () => isBunVersion
});
module.exports = __toCommonJS(node_version_exports);
var import_fs = require("fs");
var import_semver = require("semver");
var import_types = require("../types");
var import_errors = require("../errors");
var import_debug = __toESM(require("../debug"));
const NODE_VERSIONS = [
new import_types.NodeVersion({
major: 24,
range: "24.x",
runtime: "nodejs24.x"
}),
new import_types.NodeVersion({
major: 22,
range: "22.x",
runtime: "nodejs22.x"
}),
new import_types.NodeVersion({
major: 20,
range: "20.x",
runtime: "nodejs20.x"
}),
new import_types.NodeVersion({
major: 18,
range: "18.x",
runtime: "nodejs18.x",
discontinueDate: /* @__PURE__ */ new Date("2025-09-01")
}),
new import_types.NodeVersion({
major: 16,
range: "16.x",
runtime: "nodejs16.x",
discontinueDate: /* @__PURE__ */ new Date("2025-02-03")
}),
new import_types.NodeVersion({
major: 14,
range: "14.x",
runtime: "nodejs14.x",
discontinueDate: /* @__PURE__ */ new Date("2023-08-15")
}),
new import_types.NodeVersion({
major: 12,
range: "12.x",
runtime: "nodejs12.x",
discontinueDate: /* @__PURE__ */ new Date("2022-10-03")
}),
new import_types.NodeVersion({
major: 10,
range: "10.x",
runtime: "nodejs10.x",
discontinueDate: /* @__PURE__ */ new Date("2021-04-20")
}),
new import_types.NodeVersion({
major: 8,
range: "8.10.x",
runtime: "nodejs8.10",
discontinueDate: /* @__PURE__ */ new Date("2020-01-06")
})
];
const BUN_VERSIONS = [
new import_types.BunVersion({
major: 1,
range: "1.x",
runtime: "bun1.x"
})
];
function getNodeVersionByMajor(major) {
return getOptions().find((v) => v.major === major);
}
function getOptions() {
return NODE_VERSIONS;
}
function isNodeVersionAvailable(version) {
const stat = (0, import_fs.statSync)(`/node${version.major}`, { throwIfNoEntry: false });
return stat?.isDirectory() ?? false;
}
function getAvailableNodeVersions() {
return getOptions().filter((v) => v.major >= 18).filter(isNodeVersionAvailable).map((n) => n.major);
}
function getHint(isAuto = false, availableVersions) {
const { major, range } = getLatestNodeVersion(availableVersions);
return isAuto ? `Please set Node.js Version to ${range} in your Project Settings to use Node.js ${major}.` : `Please set "engines": { "node": "${range}" } in your \`package.json\` file to use Node.js ${major}.`;
}
function getLatestNodeVersion(availableVersions) {
const all = getOptions();
if (availableVersions) {
for (const version of all) {
for (const major of availableVersions) {
if (version.major === major) {
return version;
}
}
}
}
return all[0];
}
function getDiscontinuedNodeVersions() {
return getOptions().filter((version) => {
return version.state === "discontinued";
});
}
async function getSupportedNodeVersion(engineRange, isAuto = false, availableVersions) {
let selection;
if (engineRange) {
const found = (0, import_semver.validRange)(engineRange) && getOptions().some((o) => {
selection = o;
return (0, import_semver.intersects)(o.range, engineRange) && (availableVersions?.length ? availableVersions.includes(o.major) : true);
});
if (!found) {
throw new import_errors.NowBuildError({
code: "BUILD_UTILS_NODE_VERSION_INVALID",
link: "https://vercel.link/node-version",
message: `Found invalid or discontinued Node.js Version: "${engineRange}". ${getHint(
isAuto,
availableVersions
)}`
});
}
}
if (!selection) {
selection = getLatestNodeVersion(availableVersions);
}
if (selection.state === "discontinued") {
const intro = `Node.js Version "${selection.range}" is discontinued and must be upgraded.`;
throw new import_errors.NowBuildError({
code: "BUILD_UTILS_NODE_VERSION_DISCONTINUED",
link: "https://vercel.link/node-version",
message: `${intro} ${getHint(isAuto)}`
});
}
(0, import_debug.default)(`Selected Node.js ${selection.range}`);
if (selection.state === "deprecated") {
const d = selection.formattedDate;
if (d) {
console.warn(
`Error: Node.js version ${selection.range} is deprecated. Deployments created on or after ${d} will fail to build. ${getHint(
isAuto
)}`
);
} else {
console.warn(
`Error: Node.js version ${selection.range} is deprecated. ${getHint(
isAuto
)}`
);
}
}
return selection;
}
function getSupportedBunVersion(engineRange) {
if ((0, import_semver.validRange)(engineRange)) {
const selected = BUN_VERSIONS.find((version) => {
return (0, import_semver.intersects)(version.range, engineRange);
});
if (selected) {
return new import_types.BunVersion({
major: selected.major,
range: selected.range,
runtime: selected.runtime
});
}
}
throw new import_errors.NowBuildError({
message: `Found invalid Bun Version: "${engineRange}".`,
code: "BUILD_UTILS_BUN_VERSION_INVALID"
});
}
function isBunVersion(version) {
return version.runtime.startsWith("bun");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BUN_VERSIONS,
NODE_VERSIONS,
getAvailableNodeVersions,
getDiscontinuedNodeVersions,
getLatestNodeVersion,
getNodeVersionByMajor,
getSupportedBunVersion,
getSupportedNodeVersion,
isBunVersion
});

View file

@ -0,0 +1,4 @@
/**
* Convert Windows separators to Unix separators.
*/
export declare function normalizePath(p: string): string;

View file

@ -0,0 +1,31 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var normalize_path_exports = {};
__export(normalize_path_exports, {
normalizePath: () => normalizePath
});
module.exports = __toCommonJS(normalize_path_exports);
const isWin = process.platform === "win32";
function normalizePath(p) {
return isWin ? p.replace(/\\/g, "/") : p;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
normalizePath
});

View file

@ -0,0 +1,7 @@
import type { PackageJson } from '../types';
export declare function readConfigFile<T>(files: string | string[]): Promise<T | null>;
/**
* Reads and parses the package.json file from a directory.
* Returns an empty object if the file doesn't exist or can't be parsed.
*/
export declare function getPackageJson(dir: string): Promise<PackageJson>;

View file

@ -0,0 +1,87 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var read_config_file_exports = {};
__export(read_config_file_exports, {
getPackageJson: () => getPackageJson,
readConfigFile: () => readConfigFile
});
module.exports = __toCommonJS(read_config_file_exports);
var import_js_yaml = __toESM(require("js-yaml"));
var import_toml = __toESM(require("@iarna/toml"));
var import_fs_extra = require("fs-extra");
var import_error_utils = require("@vercel/error-utils");
var import_path = require("path");
async function readFileOrNull(file) {
try {
const data = await (0, import_fs_extra.readFile)(file);
return data;
} catch (error) {
if (!(0, import_error_utils.isErrnoException)(error)) {
throw error;
}
if (error.code !== "ENOENT") {
throw error;
}
}
return null;
}
async function readConfigFile(files) {
files = Array.isArray(files) ? files : [files];
for (const name of files) {
const data = await readFileOrNull(name);
if (data) {
const str = data.toString("utf8");
try {
if (name.endsWith(".json")) {
return JSON.parse(str);
} else if (name.endsWith(".toml")) {
return import_toml.default.parse(str);
} else if (name.endsWith(".yaml") || name.endsWith(".yml")) {
return import_js_yaml.default.safeLoad(str, { filename: name });
}
} catch (error) {
console.log(`Error while parsing config file: "${name}"`);
}
}
}
return null;
}
async function getPackageJson(dir) {
const packagePath = (0, import_path.join)(dir, "package.json");
try {
return JSON.parse(await (0, import_fs_extra.readFile)(packagePath, "utf8"));
} catch (err) {
return {};
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getPackageJson,
readConfigFile
});

11
node_modules/@vercel/build-utils/dist/fs/rename.d.ts generated vendored Normal file
View file

@ -0,0 +1,11 @@
import { Files } from '../types';
type Delegate = (name: string) => string;
/**
* Renames the keys of a `Files` map.
*
* @param files A map of filenames to `File` instances
* @param delegate A function that returns the new filename
* @returns A new file map with the renamed filenames
*/
export default function rename(files: Files, delegate: Delegate): Files;
export {};

30
node_modules/@vercel/build-utils/dist/fs/rename.js generated vendored Normal file
View file

@ -0,0 +1,30 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var rename_exports = {};
__export(rename_exports, {
default: () => rename
});
module.exports = __toCommonJS(rename_exports);
function rename(files, delegate) {
const result = {};
for (const [name, file] of Object.entries(files)) {
result[delegate(name)] = file;
}
return result;
}

View file

@ -0,0 +1,230 @@
/// <reference types="node" />
import { SpawnOptions } from 'child_process';
import { Meta, PackageJson, NodeVersion, Config, BunVersion } from '../types';
export type CliType = 'yarn' | 'npm' | 'pnpm' | 'bun' | 'vlt';
export interface FindPackageJsonResult {
/**
* The file path of found `package.json` file, or `undefined` if not found.
*/
packageJsonPath?: string;
/**
* The contents of found `package.json` file, when the `readPackageJson`
* option is enabled.
*/
packageJson?: PackageJson;
}
export interface ScanParentDirsResult extends FindPackageJsonResult {
/**
* "yarn", "npm", or "pnpm" depending on the presence of lockfiles.
*/
cliType: CliType;
/**
* The file path of the lockfile (`yarn.lock`, `package-lock.json`, or `pnpm-lock.yaml`)
* or `undefined` if not found.
*/
lockfilePath?: string;
/**
* The `lockfileVersion` number from lockfile (`package-lock.json` or `pnpm-lock.yaml`),
* or `undefined` if not found.
*/
lockfileVersion?: number;
/**
* The contents of the `packageManager` field from `package.json` if found.
* The value may come from a different `package.json` file than the one
* specified by `packageJsonPath`, in the case of a monorepo.
*/
packageJsonPackageManager?: string;
/**
* Whether Turborepo supports the `COREPACK_HOME` environment variable.
* `undefined` if not a Turborepo project.
*/
turboSupportsCorepackHome?: boolean;
}
export interface TraverseUpDirectoriesProps {
/**
* The directory to start iterating from, typically the same directory of the entrypoint.
*/
start: string;
/**
* The highest directory, typically the workPath root of the project.
*/
base?: string;
}
export interface WalkParentDirsProps extends Required<TraverseUpDirectoriesProps> {
/**
* The name of the file to search for, typically `package.json` or `Gemfile`.
*/
filename: string;
}
export interface WalkParentDirsMultiProps extends Required<TraverseUpDirectoriesProps> {
/**
* The name of the file to search for, typically `package.json` or `Gemfile`.
*/
filenames: string[];
}
export interface SpawnOptionsExtended extends SpawnOptions {
/**
* Pretty formatted command that is being spawned for logging purposes.
*/
prettyCommand?: string;
/**
* Returns instead of throwing an error when the process exits with a
* non-0 exit code. When relevant, the returned object will include
* the error code, stdout and stderr.
*/
ignoreNon0Exit?: boolean;
}
export declare function spawnAsync(command: string, args: string[], opts?: SpawnOptionsExtended): Promise<void>;
export declare function spawnCommand(command: string, options?: SpawnOptions): import("child_process").ChildProcess;
export declare function execCommand(command: string, options?: SpawnOptions): Promise<boolean>;
export declare function traverseUpDirectories({ start, base, }: TraverseUpDirectoriesProps): Generator<string, void, unknown>;
/**
* @deprecated Use `getNodeBinPaths()` instead.
*/
export declare function getNodeBinPath({ cwd, }: {
cwd: string;
}): Promise<string>;
export declare function getNodeBinPaths({ start, base, }: TraverseUpDirectoriesProps): string[];
export declare function runShellScript(fsPath: string, args?: string[], spawnOpts?: SpawnOptions): Promise<boolean>;
/**
* @deprecated Don't use this function directly.
*
* Use getEnvForPackageManager() instead when within a builder.
*/
export declare function getSpawnOptions(meta: Meta, nodeVersion: NodeVersion): SpawnOptions;
export declare function getNodeVersion(destPath: string, fallbackVersion?: string | undefined, config?: Config, meta?: Meta, availableVersions?: number[]): Promise<NodeVersion | BunVersion>;
/**
* Traverses up directories to find and optionally read package.json.
* This is a lightweight alternative to `scanParentDirs` when only
* package.json information is needed (without lockfile detection).
*/
export declare function findPackageJson(destPath: string, readPackageJson?: boolean, base?: string): Promise<FindPackageJsonResult>;
export declare function scanParentDirs(destPath: string, readPackageJson?: boolean, base?: string): Promise<ScanParentDirsResult>;
export declare function turboVersionSpecifierSupportsCorepack(turboVersionSpecifier: string): boolean;
export declare function usingCorepack(env: {
[x: string]: string | undefined;
}, packageJsonPackageManager: string | undefined, turboSupportsCorepackHome: boolean | undefined): boolean;
export declare function walkParentDirs({ base, start, filename, }: WalkParentDirsProps): Promise<string | null>;
/**
* Reset the customInstallCommandSet. This should be called at the start of each build
* to prevent custom install commands from being skipped due to the set persisting
* across multiple builds in the same Node process (e.g., in unit tests).
*/
export declare function resetCustomInstallCommandSet(): void;
export declare function runNpmInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta, projectCreatedAt?: number): Promise<boolean>;
/**
* Prepares the input environment based on the used package manager and lockfile
* versions.
*/
export declare function getEnvForPackageManager({ cliType, lockfileVersion, packageJsonPackageManager, env, packageJsonEngines, turboSupportsCorepackHome, projectCreatedAt, }: {
cliType: CliType;
lockfileVersion: number | undefined;
packageJsonPackageManager?: string | undefined;
env: {
[x: string]: string | undefined;
};
packageJsonEngines?: PackageJson.Engines;
turboSupportsCorepackHome?: boolean | undefined;
projectCreatedAt?: number | undefined;
}): {
[x: string]: string | undefined;
};
export declare const PNPM_10_PREFERRED_AT: Date;
/**
* Helper to get the binary paths that link to the used package manager.
* Note: Make sure it doesn't contain any `console.log` calls.
*/
export declare function getPathOverrideForPackageManager({ cliType, lockfileVersion, corepackPackageManager, corepackEnabled, packageJsonEngines, projectCreatedAt, }: {
cliType: CliType;
lockfileVersion: number | undefined;
corepackPackageManager: string | undefined;
corepackEnabled?: boolean;
packageJsonEngines?: PackageJson.Engines;
projectCreatedAt?: number;
}): {
/**
* Which lockfile was detected.
*/
detectedLockfile: string | undefined;
/**
* Detected package manager that generated the found lockfile.
*/
detectedPackageManager: string | undefined;
/**
* Value of $PATH that includes the binaries for the detected package manager.
* Undefined if no $PATH are necessary.
*/
path: string | undefined;
};
export declare function detectPackageManager(cliType: CliType, lockfileVersion: number | undefined, projectCreatedAt?: number): {
path: string;
detectedLockfile: string;
detectedPackageManager: string;
pnpmVersionRange: string;
} | {
path: string;
detectedLockfile: string;
detectedPackageManager: string;
pnpmVersionRange?: undefined;
} | {
path: undefined;
detectedLockfile: string;
detectedPackageManager: string;
pnpmVersionRange?: undefined;
} | undefined;
/**
* Helper to get the binary paths that link to the used package manager.
* Note: Make sure it doesn't contain any `console.log` calls.
* @deprecated use `getEnvForPackageManager` instead
*/
export declare function getPathForPackageManager({ cliType, lockfileVersion, env, }: {
cliType: CliType;
lockfileVersion: number | undefined;
env: {
[x: string]: string | undefined;
};
}): {
/**
* Which lockfile was detected.
*/
detectedLockfile: string | undefined;
/**
* Detected package manager that generated the found lockfile.
*/
detectedPackageManager: string | undefined;
/**
* Value of $PATH that includes the binaries for the detected package manager.
* Undefined if no $PATH are necessary.
*/
path: string | undefined;
/**
* Set if yarn was identified as package manager and `YARN_NODE_LINKER`
* environment variable was not found on the input environment.
*/
yarnNodeLinker: string | undefined;
};
export declare function runCustomInstallCommand({ destPath, installCommand, spawnOpts, projectCreatedAt, }: {
destPath: string;
installCommand: string;
spawnOpts?: SpawnOptions;
projectCreatedAt?: number;
}): Promise<boolean>;
export declare function runPackageJsonScript(destPath: string, scriptNames: string | Iterable<string>, spawnOpts?: SpawnOptions, projectCreatedAt?: number): Promise<boolean>;
export declare function runBundleInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta): Promise<void>;
export type PipInstallResult = {
installed: false;
} | {
installed: true;
/**
* The directory where packages were installed.
* Add this to PYTHONPATH when running Python commands.
*/
targetDir: string;
};
export declare function runPipInstall(destPath: string, args?: string[], spawnOpts?: SpawnOptions, meta?: Meta): Promise<PipInstallResult>;
export declare function getScriptName(pkg: Pick<PackageJson, 'scripts'> | null | undefined, possibleNames: Iterable<string>): string | undefined;
/**
* @deprecate installDependencies() is deprecated.
* Please use runNpmInstall() instead.
*/
export declare const installDependencies: typeof runNpmInstall;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
/// <reference types="node" />
/// <reference types="node" />
export default function streamToBuffer(stream: NodeJS.ReadableStream): Promise<Buffer>;
export declare function streamToBufferChunks(stream: NodeJS.ReadableStream, chunkSize?: number): Promise<Buffer[]>;

View file

@ -0,0 +1,87 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stream_to_buffer_exports = {};
__export(stream_to_buffer_exports, {
default: () => streamToBuffer,
streamToBufferChunks: () => streamToBufferChunks
});
module.exports = __toCommonJS(stream_to_buffer_exports);
var import_end_of_stream = __toESM(require("end-of-stream"));
function streamToBuffer(stream) {
return new Promise((resolve, reject) => {
const buffers = [];
stream.on("data", buffers.push.bind(buffers));
(0, import_end_of_stream.default)(stream, (err) => {
if (err) {
reject(err);
return;
}
switch (buffers.length) {
case 0:
resolve(Buffer.allocUnsafe(0));
break;
case 1:
resolve(buffers[0]);
break;
default:
resolve(Buffer.concat(buffers));
}
});
});
}
const MB = 1024 * 1024;
async function streamToBufferChunks(stream, chunkSize = 100 * MB) {
const chunks = [];
let currentChunk = [];
let currentSize = 0;
for await (const chunk of stream) {
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
let offset = 0;
while (offset < buffer.length) {
const remainingSpace = chunkSize - currentSize;
const sliceSize = Math.min(remainingSpace, buffer.length - offset);
currentChunk.push(buffer.slice(offset, offset + sliceSize));
currentSize += sliceSize;
offset += sliceSize;
if (currentSize >= chunkSize) {
chunks.push(Buffer.concat(currentChunk));
currentChunk = [];
currentSize = 0;
}
}
}
if (currentChunk.length > 0) {
chunks.push(Buffer.concat(currentChunk));
}
return chunks;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
streamToBufferChunks
});

View file

@ -0,0 +1,17 @@
import { BuildV3, Config } from './types';
import type FileFsRef from './file-fs-ref';
export declare function generateNodeBuilderFunctions(frameworkName: string, regex: RegExp, validFilenames: string[], validExtensions: string[], nodeBuild: any, // necessary to avoid circular dependency
opts?: {
checks?: (info: {
config: Config;
isBun: boolean;
}) => void;
}): {
require_: NodeRequire;
findEntrypoint: (files: Record<string, FileFsRef>) => {
entrypoint: string;
entrypointsNotMatchingRegex: string[];
};
build: BuildV3;
entrypointCallback: (args: Parameters<BuildV3>[0]) => Promise<string>;
};

View file

@ -0,0 +1,198 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var generate_node_builder_functions_exports = {};
__export(generate_node_builder_functions_exports, {
generateNodeBuilderFunctions: () => generateNodeBuilderFunctions
});
module.exports = __toCommonJS(generate_node_builder_functions_exports);
var import_glob = __toESM(require("./fs/glob"));
var import_node_path = require("node:path");
var import_node_fs = __toESM(require("node:fs"));
var import_node_module = require("node:module");
function generateNodeBuilderFunctions(frameworkName, regex, validFilenames, validExtensions, nodeBuild, opts) {
const entrypointsForMessage = validFilenames.map((filename) => `- ${filename}.{${validExtensions.join(",")}}`).join("\n");
const require_ = (0, import_node_module.createRequire)(__filename);
const build = async (args) => {
process.env.EXPERIMENTAL_NODE_TYPESCRIPT_ERRORS = "1";
const includeFiles = ["views/**/*"];
const includeFilesFromConfig = args.config.includeFiles;
if (includeFilesFromConfig) {
includeFiles.push(...includeFilesFromConfig);
}
const res = await nodeBuild({
...args,
config: {
...args.config,
includeFiles
},
// this is package.json, but we'll replace it with the return value of the entrypointCallback
// after install and build scripts have had a chance to run
entrypoint: "package.json",
considerBuildCommand: true,
entrypointCallback: async () => {
return entrypointCallback(args);
},
checks: opts?.checks ?? (() => {
})
});
let version = void 0;
try {
const resolved = require_.resolve(`${frameworkName}/package.json`, {
paths: [args.workPath]
});
const frameworkVersion = require_(resolved).version;
if (frameworkVersion) {
version = frameworkVersion;
}
} catch (e) {
}
res.output.framework = {
slug: frameworkName,
version
};
return res;
};
const entrypointCallback = async (args) => {
const mainPackageEntrypoint = findMainPackageEntrypoint(args.files);
const entrypointGlob = `{${validFilenames.map((entrypoint) => `${entrypoint}`).join(",")}}.{${validExtensions.join(",")}}`;
const dir = args.config.projectSettings?.outputDirectory?.replace(
/^\/+|\/+$/g,
""
);
if (dir) {
const {
entrypoint: entrypointFromOutputDir,
entrypointsNotMatchingRegex: entrypointsNotMatchingRegex2
} = findEntrypoint(await (0, import_glob.default)(entrypointGlob, (0, import_node_path.join)(args.workPath, dir)));
if (entrypointFromOutputDir) {
return (0, import_node_path.join)(dir, entrypointFromOutputDir);
}
if (entrypointsNotMatchingRegex2.length > 0) {
throw new Error(
`No entrypoint found which imports ${frameworkName}. Found possible ${pluralize("entrypoint", entrypointsNotMatchingRegex2.length)}: ${entrypointsNotMatchingRegex2.join(", ")}`
);
}
throw new Error(
`No entrypoint found in output directory: "${dir}". Searched for:
${entrypointsForMessage}`
);
}
const files = await (0, import_glob.default)(entrypointGlob, args.workPath);
const { entrypoint: entrypointFromRoot, entrypointsNotMatchingRegex } = findEntrypoint(files);
if (entrypointFromRoot) {
return entrypointFromRoot;
}
if (mainPackageEntrypoint) {
const entrypointFromPackageJson = await (0, import_glob.default)(
mainPackageEntrypoint,
args.workPath
);
if (entrypointFromPackageJson[mainPackageEntrypoint]) {
if (checkMatchesRegex(entrypointFromPackageJson[mainPackageEntrypoint])) {
return mainPackageEntrypoint;
}
}
}
if (entrypointsNotMatchingRegex.length > 0) {
throw new Error(
`No entrypoint found which imports ${frameworkName}. Found possible ${pluralize("entrypoint", entrypointsNotMatchingRegex.length)}: ${entrypointsNotMatchingRegex.join(", ")}`
);
}
throw new Error(
`No entrypoint found. Searched for:
${entrypointsForMessage}`
);
};
function pluralize(word, count) {
return count === 1 ? word : `${word}s`;
}
const findEntrypoint = (files) => {
const allEntrypoints = validFilenames.flatMap(
(filename) => validExtensions.map((extension) => `${filename}.${extension}`)
);
const possibleEntrypointsInFiles = allEntrypoints.filter((entrypoint2) => {
return files[entrypoint2] !== void 0;
});
const entrypointsMatchingRegex = possibleEntrypointsInFiles.filter(
(entrypoint2) => {
const file = files[entrypoint2];
return checkMatchesRegex(file);
}
);
const entrypointsNotMatchingRegex = possibleEntrypointsInFiles.filter(
(entrypoint2) => {
const file = files[entrypoint2];
return !checkMatchesRegex(file);
}
);
const entrypoint = entrypointsMatchingRegex[0];
if (entrypointsMatchingRegex.length > 1) {
console.warn(
`Multiple entrypoints found: ${entrypointsMatchingRegex.join(", ")}. Using ${entrypoint}.`
);
}
return {
entrypoint,
entrypointsNotMatchingRegex
};
};
const checkMatchesRegex = (file) => {
const content = import_node_fs.default.readFileSync(file.fsPath, "utf-8");
const matchesContent = content.match(regex);
return matchesContent !== null;
};
const findMainPackageEntrypoint = (files) => {
const packageJson = files["package.json"];
if (packageJson) {
if (packageJson.type === "FileFsRef") {
const packageJsonContent = import_node_fs.default.readFileSync(packageJson.fsPath, "utf-8");
let packageJsonJson;
try {
packageJsonJson = JSON.parse(packageJsonContent);
} catch (_e) {
packageJsonJson = {};
}
if ("main" in packageJsonJson && typeof packageJsonJson.main === "string") {
return packageJsonJson.main;
}
}
}
return null;
};
return {
require_,
findEntrypoint,
build,
entrypointCallback
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
generateNodeBuilderFunctions
});

View file

@ -0,0 +1 @@
export default function (downloadPath: string, rootDirectory?: string | undefined): Promise<(p: string) => any>;

View file

@ -0,0 +1,90 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var get_ignore_filter_exports = {};
__export(get_ignore_filter_exports, {
default: () => get_ignore_filter_default
});
module.exports = __toCommonJS(get_ignore_filter_exports);
var import_path = __toESM(require("path"));
var import_fs_extra = __toESM(require("fs-extra"));
var import_ignore = __toESM(require("ignore"));
function isCodedError(error) {
return error !== null && error !== void 0 && error.code !== void 0;
}
function clearRelative(s) {
return s.replace(/(\n|^)\.\//g, "$1");
}
async function get_ignore_filter_default(downloadPath, rootDirectory) {
const readFile = async (p) => {
try {
return await import_fs_extra.default.readFile(p, "utf8");
} catch (error) {
if (error.code === "ENOENT" || error instanceof Error && error.message.includes("ENOENT")) {
return void 0;
}
throw error;
}
};
const vercelIgnorePath = import_path.default.join(
downloadPath,
rootDirectory || "",
".vercelignore"
);
const nowIgnorePath = import_path.default.join(
downloadPath,
rootDirectory || "",
".nowignore"
);
const ignoreContents = [];
try {
ignoreContents.push(
...(await Promise.all([readFile(vercelIgnorePath), readFile(nowIgnorePath)])).filter(Boolean)
);
} catch (error) {
if (isCodedError(error) && error.code === "ENOTDIR") {
console.log(`Warning: Cannot read ignore file from ${vercelIgnorePath}`);
} else {
throw error;
}
}
if (ignoreContents.length === 2) {
throw new Error(
"Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file."
);
}
if (ignoreContents.length === 0) {
return () => false;
}
const ignoreFilter = (0, import_ignore.default)().add(clearRelative(ignoreContents[0]));
return function(p) {
if (p === "now.json" || p === "vercel.json")
return false;
return ignoreFilter.test(p).ignored;
};
}

View file

@ -0,0 +1 @@
export declare function getInstalledPackageVersion(packageName: string, path?: string | string[]): Promise<string | undefined>;

View file

@ -0,0 +1,53 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var get_installed_package_version_exports = {};
__export(get_installed_package_version_exports, {
getInstalledPackageVersion: () => getInstalledPackageVersion
});
module.exports = __toCommonJS(get_installed_package_version_exports);
var import_debug = __toESM(require("./debug"));
async function getInstalledPackageVersion(packageName, path) {
try {
const resolved = require.resolve(`${packageName}/package.json`, {
paths: path ? Array.isArray(path) ? path : [path] : [process.cwd()]
});
const version = require(resolved).version;
return version;
} catch (err) {
(0, import_debug.default)(
`Could not resolve package "${packageName}". Package is not installed.`,
err
);
return void 0;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getInstalledPackageVersion
});

View file

@ -0,0 +1,5 @@
/**
* Helper function to support both `VERCEL_` and legacy `NOW_` env vars.
* Throws an error if *both* env vars are defined.
*/
export declare const getPlatformEnv: (name: string) => string | undefined;

View file

@ -0,0 +1,45 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var get_platform_env_exports = {};
__export(get_platform_env_exports, {
getPlatformEnv: () => getPlatformEnv
});
module.exports = __toCommonJS(get_platform_env_exports);
var import_errors = require("./errors");
const getPlatformEnv = (name) => {
const vName = `VERCEL_${name}`;
const nName = `NOW_${name}`;
const v = process.env[vName];
const n = process.env[nName];
if (typeof v === "string") {
if (typeof n === "string") {
throw new import_errors.NowBuildError({
code: "CONFLICTING_ENV_VAR_NAMES",
message: `Both "${vName}" and "${nName}" env vars are defined. Please only define the "${vName}" env var.`,
link: "https://vercel.link/combining-old-and-new-config"
});
}
return v;
}
return n;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getPlatformEnv
});

View file

@ -0,0 +1,14 @@
type Envs = {
[key: string]: string | undefined;
};
/**
* Get the framework-specific prefixed System Environment Variables.
* See https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables
* @param envPrefix - Prefix, typically from `@vercel/frameworks`
* @param envs - Environment Variables, typically from `process.env`
*/
export declare function getPrefixedEnvVars({ envPrefix, envs, }: {
envPrefix: string | undefined;
envs: Envs;
}): Envs;
export {};

View file

@ -0,0 +1,54 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var get_prefixed_env_vars_exports = {};
__export(get_prefixed_env_vars_exports, {
getPrefixedEnvVars: () => getPrefixedEnvVars
});
module.exports = __toCommonJS(get_prefixed_env_vars_exports);
function getPrefixedEnvVars({
envPrefix,
envs
}) {
const vercelSystemEnvPrefix = "VERCEL_";
const allowed = [
"VERCEL_URL",
"VERCEL_ENV",
"VERCEL_TARGET_ENV",
"VERCEL_REGION",
"VERCEL_BRANCH_URL",
"VERCEL_PROJECT_PRODUCTION_URL",
"VERCEL_DEPLOYMENT_ID",
"VERCEL_PROJECT_ID"
];
const newEnvs = {};
if (envPrefix && envs.VERCEL_URL) {
Object.keys(envs).filter((key) => allowed.includes(key) || key.startsWith("VERCEL_GIT_")).forEach((key) => {
const newKey = `${envPrefix}${key}`;
if (!(newKey in envs)) {
newEnvs[newKey] = envs[key];
}
});
newEnvs.TURBO_CI_VENDOR_ENV_KEY = `${envPrefix}${vercelSystemEnvPrefix}`;
}
return newEnvs;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getPrefixedEnvVars
});

View file

@ -0,0 +1 @@
export declare function hardLinkDir(src: string, destDirs: string[]): Promise<void>;

104
node_modules/@vercel/build-utils/dist/hard-link-dir.js generated vendored Normal file
View file

@ -0,0 +1,104 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var hard_link_dir_exports = {};
__export(hard_link_dir_exports, {
hardLinkDir: () => hardLinkDir
});
module.exports = __toCommonJS(hard_link_dir_exports);
var import_path = __toESM(require("path"));
var import_fs = require("fs");
async function hardLinkDir(src, destDirs) {
if (destDirs.length === 0)
return;
destDirs = destDirs.filter((destDir) => import_path.default.relative(destDir, src) !== "");
const files = await import_fs.promises.readdir(src);
await Promise.all(
files.map(async (file) => {
if (file === "node_modules")
return;
const srcFile = import_path.default.join(src, file);
if ((await import_fs.promises.lstat(srcFile)).isDirectory()) {
const destSubdirs = await Promise.all(
destDirs.map(async (destDir) => {
const destSubdir = import_path.default.join(destDir, file);
try {
await import_fs.promises.mkdir(destSubdir, { recursive: true });
} catch (err) {
if (err.code !== "EEXIST")
throw err;
}
return destSubdir;
})
);
await hardLinkDir(srcFile, destSubdirs);
return;
}
await Promise.all(
destDirs.map(async (destDir) => {
const destFile = import_path.default.join(destDir, file);
try {
await linkOrCopyFile(srcFile, destFile);
} catch (err) {
if (err.code === "ENOENT") {
return;
}
throw err;
}
})
);
})
);
}
async function linkOrCopyFile(srcFile, destFile) {
try {
await linkOrCopy(srcFile, destFile);
} catch (err) {
if (err.code === "ENOENT") {
await import_fs.promises.mkdir(import_path.default.dirname(destFile), { recursive: true });
await linkOrCopy(srcFile, destFile);
return;
}
if (err.code !== "EEXIST") {
throw err;
}
}
}
async function linkOrCopy(srcFile, destFile) {
try {
await import_fs.promises.link(srcFile, destFile);
} catch (err) {
if (err.code !== "EXDEV")
throw err;
await import_fs.promises.copyFile(srcFile, destFile);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
hardLinkDir
});

36
node_modules/@vercel/build-utils/dist/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,36 @@
import FileBlob from './file-blob';
import FileFsRef from './file-fs-ref';
import FileRef from './file-ref';
import { Lambda, createLambda, getLambdaOptionsFromFunction } from './lambda';
import { NodejsLambda } from './nodejs-lambda';
import { Prerender } from './prerender';
import download, { downloadFile, DownloadedFiles, isSymbolicLink, isDirectory } from './fs/download';
import getWriteableDirectory from './fs/get-writable-directory';
import glob, { GlobOptions } from './fs/glob';
import rename from './fs/rename';
import { spawnAsync, execCommand, spawnCommand, walkParentDirs, getScriptName, installDependencies, runPackageJsonScript, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, resetCustomInstallCommandSet, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, detectPackageManager, getSpawnOptions, getNodeBinPath, getNodeBinPaths, scanParentDirs, findPackageJson, traverseUpDirectories, PipInstallResult } from './fs/run-user-scripts';
import { getLatestNodeVersion, getDiscontinuedNodeVersions, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion } from './fs/node-version';
import streamToBuffer, { streamToBufferChunks } from './fs/stream-to-buffer';
import debug from './debug';
import getIgnoreFilter from './get-ignore-filter';
import { getPlatformEnv } from './get-platform-env';
import { getPrefixedEnvVars } from './get-prefixed-env-vars';
import { cloneEnv } from './clone-env';
import { hardLinkDir } from './hard-link-dir';
import { validateNpmrc } from './validate-npmrc';
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, detectPackageManager, runNpmInstall, runBundleInstall, runPipInstall, PipInstallResult, runShellScript, runCustomInstallCommand, resetCustomInstallCommandSet, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, streamToBufferChunks, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, scanParentDirs, findPackageJson, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, };
export { EdgeFunction } from './edge-function';
export { readConfigFile, getPackageJson } from './fs/read-config-file';
export { normalizePath } from './fs/normalize-path';
export { getOsRelease, getProvidedRuntime } from './os';
export * from './should-serve';
export * from './schemas';
export * from './types';
export * from './errors';
export * from './trace';
export { NODE_VERSIONS } from './fs/node-version';
export { getInstalledPackageVersion } from './get-installed-package-version';
export { defaultCachePathGlob } from './default-cache-path-glob';
export { generateNodeBuilderFunctions } from './generate-node-builder-functions';
export { BACKEND_FRAMEWORKS, BackendFramework, isBackendFramework, isBackendBuilder, isExperimentalBackendsEnabled, isExperimentalBackendsWithoutIntrospectionEnabled, shouldUseExperimentalBackends, PYTHON_FRAMEWORKS, PythonFramework, isPythonFramework, } from './framework-helpers';
export * from './python';

26940
node_modules/@vercel/build-utils/dist/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

138
node_modules/@vercel/build-utils/dist/lambda.d.ts generated vendored Normal file
View file

@ -0,0 +1,138 @@
/// <reference types="node" />
import type { Config, Env, Files, FunctionFramework, TriggerEvent } from './types';
export type { TriggerEvent };
export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
export type LambdaExecutableRuntimeLanguages = 'rust' | 'go';
export type LambdaArchitecture = 'x86_64' | 'arm64';
export interface LambdaOptionsBase {
handler: string;
runtime: string;
runtimeLanguage?: LambdaExecutableRuntimeLanguages;
architecture?: LambdaArchitecture;
memory?: number;
maxDuration?: number;
environment?: Env;
allowQuery?: string[];
regions?: string[];
supportsMultiPayloads?: boolean;
supportsWrapper?: boolean;
supportsResponseStreaming?: boolean;
/**
* @deprecated Use the `supportsResponseStreaming` property instead.
*/
experimentalResponseStreaming?: boolean;
operationType?: string;
framework?: FunctionFramework;
/**
* Experimental trigger event definitions that this Lambda can receive.
* Defines what types of trigger events this Lambda can handle as an HTTP endpoint.
* Currently supports queue triggers for Vercel's queue system.
*
* The delivery configuration provides HINTS to the system about preferred
* execution behavior (concurrency, retries) but these are NOT guarantees.
* The system may disregard these hints based on resource constraints.
*
* IMPORTANT: HTTP request-response semantics remain synchronous regardless
* of delivery configuration. Callers receive immediate responses.
*
* @experimental This feature is experimental and may change.
*/
experimentalTriggers?: TriggerEvent[];
/**
* Whether this Lambda supports cancellation.
* When true, the Lambda runtime can be terminated mid-execution if the request is cancelled.
*/
supportsCancellation?: boolean;
/**
* Whether to disable automatic fetch instrumentation.
* When true, the Function runtime will not automatically instrument fetch calls.
*/
shouldDisableAutomaticFetchInstrumentation?: boolean;
}
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
files: Files;
experimentalAllowBundling?: boolean;
}
/**
* @deprecated Use `LambdaOptionsWithFiles` instead.
*/
export interface LambdaOptionsWithZipBuffer extends LambdaOptionsBase {
/**
* @deprecated Use `files` property instead.
*/
zipBuffer: Buffer;
}
interface GetLambdaOptionsFromFunctionOptions {
sourceFile: string;
config?: Pick<Config, 'functions'>;
}
export declare class Lambda {
type: 'Lambda';
/**
* This is a label for the type of Lambda a framework is producing.
* The value can be any string that makes sense for a given framework.
* Examples: "API", "ISR", "SSR", "SSG", "Render", "Resource"
*/
operationType?: string;
files?: Files;
handler: string;
runtime: string;
/**
* When using a generic runtime such as "executable" or "provided" (custom runtimes),
* this field can be used to specify the language the executable was compiled with.
*/
runtimeLanguage?: LambdaExecutableRuntimeLanguages;
architecture: LambdaArchitecture;
memory?: number;
maxDuration?: number;
environment: Env;
allowQuery?: string[];
regions?: string[];
/**
* @deprecated Use `await lambda.createZip()` instead.
*/
zipBuffer?: Buffer;
supportsMultiPayloads?: boolean;
supportsWrapper?: boolean;
supportsResponseStreaming?: boolean;
framework?: FunctionFramework;
experimentalAllowBundling?: boolean;
/**
* Experimental trigger event definitions that this Lambda can receive.
* Defines what types of trigger events this Lambda can handle as an HTTP endpoint.
* Currently supports queue triggers for Vercel's queue system.
*
* The delivery configuration provides HINTS to the system about preferred
* execution behavior (concurrency, retries) but these are NOT guarantees.
* The system may disregard these hints based on resource constraints.
*
* IMPORTANT: HTTP request-response semantics remain synchronous regardless
* of delivery configuration. Callers receive immediate responses.
*
* @experimental This feature is experimental and may change.
*/
experimentalTriggers?: TriggerEvent[];
/**
* Whether this Lambda supports cancellation.
* When true, the Lambda runtime can be terminated mid-execution if the request is cancelled.
*/
supportsCancellation?: boolean;
/**
* Whether to disable automatic fetch instrumentation.
* When true, the Function runtime will not automatically instrument fetch calls.
*/
shouldDisableAutomaticFetchInstrumentation?: boolean;
constructor(opts: LambdaOptions);
createZip(): Promise<Buffer>;
/**
* @deprecated Use the `supportsResponseStreaming` property instead.
*/
get experimentalResponseStreaming(): boolean | undefined;
set experimentalResponseStreaming(v: boolean | undefined);
}
/**
* @deprecated Use `new Lambda()` instead.
*/
export declare function createLambda(opts: LambdaOptions): Promise<Lambda>;
export declare function createZip(files: Files): Promise<Buffer>;
export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'architecture' | 'memory' | 'maxDuration' | 'experimentalTriggers' | 'supportsCancellation'>>;

339
node_modules/@vercel/build-utils/dist/lambda.js generated vendored Normal file
View file

@ -0,0 +1,339 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var lambda_exports = {};
__export(lambda_exports, {
Lambda: () => Lambda,
createLambda: () => createLambda,
createZip: () => createZip,
getLambdaOptionsFromFunction: () => getLambdaOptionsFromFunction
});
module.exports = __toCommonJS(lambda_exports);
var import_assert = __toESM(require("assert"));
var import_async_sema = __toESM(require("async-sema"));
var import_yazl = require("yazl");
var import_minimatch = __toESM(require("minimatch"));
var import_fs_extra = require("fs-extra");
var import_download = require("./fs/download");
var import_stream_to_buffer = __toESM(require("./fs/stream-to-buffer"));
function getDefaultLambdaArchitecture(architecture) {
if (architecture) {
return architecture;
}
switch (process.arch) {
case "arm":
case "arm64": {
return "arm64";
}
default: {
return "x86_64";
}
}
}
class Lambda {
constructor(opts) {
const {
handler,
runtime,
runtimeLanguage,
maxDuration,
architecture,
memory,
environment = {},
allowQuery,
regions,
supportsMultiPayloads,
supportsWrapper,
supportsResponseStreaming,
experimentalResponseStreaming,
operationType,
framework,
experimentalTriggers,
supportsCancellation,
shouldDisableAutomaticFetchInstrumentation
} = opts;
if ("files" in opts) {
(0, import_assert.default)(typeof opts.files === "object", '"files" must be an object');
}
if ("zipBuffer" in opts) {
(0, import_assert.default)(Buffer.isBuffer(opts.zipBuffer), '"zipBuffer" must be a Buffer');
}
(0, import_assert.default)(typeof handler === "string", '"handler" is not a string');
(0, import_assert.default)(typeof runtime === "string", '"runtime" is not a string');
(0, import_assert.default)(typeof environment === "object", '"environment" is not an object');
if (architecture !== void 0) {
(0, import_assert.default)(
architecture === "x86_64" || architecture === "arm64",
'"architecture" must be either "x86_64" or "arm64"'
);
}
if (runtimeLanguage !== void 0) {
(0, import_assert.default)(
runtimeLanguage === "rust" || runtimeLanguage === "go",
'"runtimeLanguage" is invalid. Valid options: "rust", "go"'
);
}
if ("experimentalAllowBundling" in opts && opts.experimentalAllowBundling !== void 0) {
(0, import_assert.default)(
typeof opts.experimentalAllowBundling === "boolean",
'"experimentalAllowBundling" is not a boolean'
);
}
if (memory !== void 0) {
(0, import_assert.default)(typeof memory === "number", '"memory" is not a number');
}
if (maxDuration !== void 0) {
(0, import_assert.default)(typeof maxDuration === "number", '"maxDuration" is not a number');
}
if (allowQuery !== void 0) {
(0, import_assert.default)(Array.isArray(allowQuery), '"allowQuery" is not an Array');
(0, import_assert.default)(
allowQuery.every((q) => typeof q === "string"),
'"allowQuery" is not a string Array'
);
}
if (supportsMultiPayloads !== void 0) {
(0, import_assert.default)(
typeof supportsMultiPayloads === "boolean",
'"supportsMultiPayloads" is not a boolean'
);
}
if (supportsWrapper !== void 0) {
(0, import_assert.default)(
typeof supportsWrapper === "boolean",
'"supportsWrapper" is not a boolean'
);
}
if (regions !== void 0) {
(0, import_assert.default)(Array.isArray(regions), '"regions" is not an Array');
(0, import_assert.default)(
regions.every((r) => typeof r === "string"),
'"regions" is not a string Array'
);
}
if (framework !== void 0) {
(0, import_assert.default)(typeof framework === "object", '"framework" is not an object');
(0, import_assert.default)(
typeof framework.slug === "string",
'"framework.slug" is not a string'
);
if (framework.version !== void 0) {
(0, import_assert.default)(
typeof framework.version === "string",
'"framework.version" is not a string'
);
}
}
if (experimentalTriggers !== void 0) {
(0, import_assert.default)(
Array.isArray(experimentalTriggers),
'"experimentalTriggers" is not an Array'
);
for (let i = 0; i < experimentalTriggers.length; i++) {
const trigger = experimentalTriggers[i];
const prefix = `"experimentalTriggers[${i}]"`;
(0, import_assert.default)(
typeof trigger === "object" && trigger !== null,
`${prefix} is not an object`
);
(0, import_assert.default)(
trigger.type === "queue/v1beta",
`${prefix}.type must be "queue/v1beta"`
);
(0, import_assert.default)(
typeof trigger.topic === "string",
`${prefix}.topic is required and must be a string`
);
(0, import_assert.default)(trigger.topic.length > 0, `${prefix}.topic cannot be empty`);
(0, import_assert.default)(
typeof trigger.consumer === "string",
`${prefix}.consumer is required and must be a string`
);
(0, import_assert.default)(
trigger.consumer.length > 0,
`${prefix}.consumer cannot be empty`
);
if (trigger.maxDeliveries !== void 0) {
(0, import_assert.default)(
typeof trigger.maxDeliveries === "number",
`${prefix}.maxDeliveries must be a number`
);
(0, import_assert.default)(
Number.isInteger(trigger.maxDeliveries) && trigger.maxDeliveries >= 1,
`${prefix}.maxDeliveries must be at least 1`
);
}
if (trigger.retryAfterSeconds !== void 0) {
(0, import_assert.default)(
typeof trigger.retryAfterSeconds === "number",
`${prefix}.retryAfterSeconds must be a number`
);
(0, import_assert.default)(
trigger.retryAfterSeconds > 0,
`${prefix}.retryAfterSeconds must be a positive number`
);
}
if (trigger.initialDelaySeconds !== void 0) {
(0, import_assert.default)(
typeof trigger.initialDelaySeconds === "number",
`${prefix}.initialDelaySeconds must be a number`
);
(0, import_assert.default)(
trigger.initialDelaySeconds >= 0,
`${prefix}.initialDelaySeconds must be a non-negative number`
);
}
if (trigger.maxConcurrency !== void 0) {
(0, import_assert.default)(
typeof trigger.maxConcurrency === "number",
`${prefix}.maxConcurrency must be a number`
);
(0, import_assert.default)(
Number.isInteger(trigger.maxConcurrency) && trigger.maxConcurrency >= 1,
`${prefix}.maxConcurrency must be at least 1`
);
}
}
}
if (supportsCancellation !== void 0) {
(0, import_assert.default)(
typeof supportsCancellation === "boolean",
'"supportsCancellation" is not a boolean'
);
}
this.type = "Lambda";
this.operationType = operationType;
this.files = "files" in opts ? opts.files : void 0;
this.handler = handler;
this.runtime = runtime;
this.runtimeLanguage = runtimeLanguage;
this.architecture = getDefaultLambdaArchitecture(architecture);
this.memory = memory;
this.maxDuration = maxDuration;
this.environment = environment;
this.allowQuery = allowQuery;
this.regions = regions;
this.zipBuffer = "zipBuffer" in opts ? opts.zipBuffer : void 0;
this.supportsMultiPayloads = supportsMultiPayloads;
this.supportsWrapper = supportsWrapper;
this.supportsResponseStreaming = supportsResponseStreaming ?? experimentalResponseStreaming;
this.framework = framework;
this.experimentalAllowBundling = "experimentalAllowBundling" in opts ? opts.experimentalAllowBundling : void 0;
this.experimentalTriggers = experimentalTriggers;
this.supportsCancellation = supportsCancellation;
this.shouldDisableAutomaticFetchInstrumentation = shouldDisableAutomaticFetchInstrumentation;
}
async createZip() {
let { zipBuffer } = this;
if (!zipBuffer) {
if (!this.files) {
throw new Error("`files` is not defined");
}
await sema.acquire();
try {
zipBuffer = await createZip(this.files);
} finally {
sema.release();
}
}
return zipBuffer;
}
/**
* @deprecated Use the `supportsResponseStreaming` property instead.
*/
get experimentalResponseStreaming() {
return this.supportsResponseStreaming;
}
set experimentalResponseStreaming(v) {
this.supportsResponseStreaming = v;
}
}
const sema = new import_async_sema.default(10);
const mtime = /* @__PURE__ */ new Date(154e10);
async function createLambda(opts) {
const lambda = new Lambda(opts);
lambda.zipBuffer = await lambda.createZip();
return lambda;
}
async function createZip(files) {
const names = Object.keys(files).sort();
const symlinkTargets = /* @__PURE__ */ new Map();
for (const name of names) {
const file = files[name];
if (file.mode && (0, import_download.isSymbolicLink)(file.mode) && file.type === "FileFsRef") {
const symlinkTarget = await (0, import_fs_extra.readlink)(file.fsPath);
symlinkTargets.set(name, symlinkTarget);
}
}
const zipFile = new import_yazl.ZipFile();
const zipBuffer = await new Promise((resolve, reject) => {
for (const name of names) {
const file = files[name];
const opts = { mode: file.mode, mtime };
const symlinkTarget = symlinkTargets.get(name);
if (typeof symlinkTarget === "string") {
zipFile.addBuffer(Buffer.from(symlinkTarget, "utf8"), name, opts);
} else if (file.mode && (0, import_download.isDirectory)(file.mode)) {
zipFile.addEmptyDirectory(name, opts);
} else {
const stream = file.toStream();
stream.on("error", reject);
zipFile.addReadStream(stream, name, opts);
}
}
zipFile.end();
(0, import_stream_to_buffer.default)(zipFile.outputStream).then(resolve).catch(reject);
});
return zipBuffer;
}
async function getLambdaOptionsFromFunction({
sourceFile,
config
}) {
if (config?.functions) {
for (const [pattern, fn] of Object.entries(config.functions)) {
if (sourceFile === pattern || (0, import_minimatch.default)(sourceFile, pattern)) {
return {
architecture: fn.architecture,
memory: fn.memory,
maxDuration: fn.maxDuration,
experimentalTriggers: fn.experimentalTriggers,
supportsCancellation: fn.supportsCancellation
};
}
}
}
return {};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Lambda,
createLambda,
createZip,
getLambdaOptionsFromFunction
});

View file

@ -0,0 +1,16 @@
import { Lambda, LambdaOptionsWithFiles } from './lambda';
interface NodejsLambdaOptions extends LambdaOptionsWithFiles {
shouldAddHelpers: boolean;
shouldAddSourcemapSupport: boolean;
awsLambdaHandler?: string;
useWebApi?: boolean;
}
export declare class NodejsLambda extends Lambda {
launcherType: 'Nodejs';
shouldAddHelpers: boolean;
shouldAddSourcemapSupport: boolean;
awsLambdaHandler?: string;
useWebApi?: boolean;
constructor({ shouldAddHelpers, shouldAddSourcemapSupport, awsLambdaHandler, useWebApi, ...opts }: NodejsLambdaOptions);
}
export {};

44
node_modules/@vercel/build-utils/dist/nodejs-lambda.js generated vendored Normal file
View file

@ -0,0 +1,44 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var nodejs_lambda_exports = {};
__export(nodejs_lambda_exports, {
NodejsLambda: () => NodejsLambda
});
module.exports = __toCommonJS(nodejs_lambda_exports);
var import_lambda = require("./lambda");
class NodejsLambda extends import_lambda.Lambda {
constructor({
shouldAddHelpers,
shouldAddSourcemapSupport,
awsLambdaHandler,
useWebApi,
...opts
}) {
super(opts);
this.launcherType = "Nodejs";
this.shouldAddHelpers = shouldAddHelpers;
this.shouldAddSourcemapSupport = shouldAddSourcemapSupport;
this.awsLambdaHandler = awsLambdaHandler;
this.useWebApi = useWebApi;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
NodejsLambda
});

3
node_modules/@vercel/build-utils/dist/os.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
export declare function getOsRelease(): Promise<Record<string, string> | null>;
export declare function parseOsRelease(data: string): Promise<Record<string, string>>;
export declare function getProvidedRuntime(): Promise<"provided.al2023" | "provided.al2">;

62
node_modules/@vercel/build-utils/dist/os.js generated vendored Normal file
View file

@ -0,0 +1,62 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var os_exports = {};
__export(os_exports, {
getOsRelease: () => getOsRelease,
getProvidedRuntime: () => getProvidedRuntime,
parseOsRelease: () => parseOsRelease
});
module.exports = __toCommonJS(os_exports);
var import_fs_extra = require("fs-extra");
var import_error_utils = require("@vercel/error-utils");
async function getOsRelease() {
try {
const data = await (0, import_fs_extra.readFile)("/etc/os-release", "utf8");
return await parseOsRelease(data);
} catch (err) {
if ((0, import_error_utils.isErrnoException)(err) && err.code === "ENOENT") {
return null;
}
throw err;
}
}
async function parseOsRelease(data) {
const obj = {};
for (const line of data.trim().split("\n")) {
const m = /(?<key>.*)="(?<value>.*)"/.exec(line);
if (!m?.groups) {
continue;
}
obj[m.groups.key] = m.groups.value;
}
return obj;
}
async function getProvidedRuntime() {
const os = await getOsRelease();
if (!os) {
return "provided.al2023";
}
return os.PRETTY_NAME === "Amazon Linux 2" ? "provided.al2" : "provided.al2023";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getOsRelease,
getProvidedRuntime,
parseOsRelease
});

48
node_modules/@vercel/build-utils/dist/prerender.d.ts generated vendored Normal file
View file

@ -0,0 +1,48 @@
import type { File, HasField, Chain } from './types';
import { Lambda } from './lambda';
interface PrerenderOptions {
expiration: number | false;
staleExpiration?: number;
lambda?: Lambda;
fallback: File | null;
group?: number;
bypassToken?: string | null;
allowQuery?: string[];
allowHeader?: string[];
initialHeaders?: Record<string, string>;
initialStatus?: number;
passQuery?: boolean;
sourcePath?: string;
experimentalBypassFor?: HasField;
experimentalStreamingLambdaPath?: string;
chain?: Chain;
}
export declare class Prerender {
type: 'Prerender';
/**
* `expiration` is `revalidate` in Next.js terms, and `s-maxage` in
* `cache-control` terms.
*/
expiration: number | false;
/**
* `staleExpiration` is `expire` in Next.js terms, and
* `stale-while-revalidate` + `s-maxage` in `cache-control` terms. It's
* expected to be undefined if `expiration` is `false`.
*/
staleExpiration?: number;
lambda?: Lambda;
fallback: File | null;
group?: number;
bypassToken: string | null;
allowQuery?: string[];
allowHeader?: string[];
initialHeaders?: Record<string, string>;
initialStatus?: number;
passQuery?: boolean;
sourcePath?: string;
experimentalBypassFor?: HasField;
experimentalStreamingLambdaPath?: string;
chain?: Chain;
constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, }: PrerenderOptions);
}
export {};

170
node_modules/@vercel/build-utils/dist/prerender.js generated vendored Normal file
View file

@ -0,0 +1,170 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var prerender_exports = {};
__export(prerender_exports, {
Prerender: () => Prerender
});
module.exports = __toCommonJS(prerender_exports);
class Prerender {
constructor({
expiration,
staleExpiration,
lambda,
fallback,
group,
bypassToken,
allowQuery,
allowHeader,
initialHeaders,
initialStatus,
passQuery,
sourcePath,
experimentalBypassFor,
experimentalStreamingLambdaPath,
chain
}) {
this.type = "Prerender";
this.expiration = expiration;
this.staleExpiration = staleExpiration;
this.sourcePath = sourcePath;
this.lambda = lambda;
if (this.lambda) {
this.lambda.operationType = this.lambda.operationType || "ISR";
}
if (typeof group !== "undefined" && (group <= 0 || !Number.isInteger(group))) {
throw new Error(
"The `group` argument for `Prerender` needs to be a natural number."
);
}
this.group = group;
if (passQuery === true) {
this.passQuery = true;
} else if (typeof passQuery !== "boolean" && typeof passQuery !== "undefined") {
throw new Error(
`The \`passQuery\` argument for \`Prerender\` must be a boolean.`
);
}
if (bypassToken == null) {
this.bypassToken = null;
} else if (typeof bypassToken === "string") {
if (bypassToken.length < 32) {
throw new Error(
"The `bypassToken` argument for `Prerender` must be 32 characters or more."
);
}
this.bypassToken = bypassToken;
} else {
throw new Error(
"The `bypassToken` argument for `Prerender` must be a `string`."
);
}
if (experimentalBypassFor !== void 0) {
if (!Array.isArray(experimentalBypassFor) || experimentalBypassFor.some(
(field) => typeof field !== "object" || typeof field.type !== "string" || field.type === "host" && "key" in field || field.type !== "host" && typeof field.key !== "string" || field.value !== void 0 && typeof field.value !== "string" && (typeof field.value !== "object" || field.value === null || Array.isArray(field.value))
)) {
throw new Error(
"The `experimentalBypassFor` argument for `Prerender` must be Array of objects with fields `type`, `key` and optionally `value`."
);
}
this.experimentalBypassFor = experimentalBypassFor;
}
if (typeof fallback === "undefined") {
throw new Error(
"The `fallback` argument for `Prerender` needs to be a `FileBlob`, `FileFsRef`, `FileRef`, or null."
);
}
this.fallback = fallback;
if (initialHeaders !== void 0) {
if (!initialHeaders || typeof initialHeaders !== "object" || Object.entries(initialHeaders).some(
([key, value]) => typeof key !== "string" || typeof value !== "string"
)) {
throw new Error(
`The \`initialHeaders\` argument for \`Prerender\` must be an object with string key/values`
);
}
this.initialHeaders = initialHeaders;
}
if (initialStatus !== void 0) {
if (initialStatus <= 0 || !Number.isInteger(initialStatus)) {
throw new Error(
`The \`initialStatus\` argument for \`Prerender\` must be a natural number.`
);
}
this.initialStatus = initialStatus;
}
if (allowQuery !== void 0) {
if (!Array.isArray(allowQuery)) {
throw new Error(
"The `allowQuery` argument for `Prerender` must be Array."
);
}
if (!allowQuery.every((q) => typeof q === "string")) {
throw new Error(
"The `allowQuery` argument for `Prerender` must be Array of strings."
);
}
this.allowQuery = allowQuery;
}
if (allowHeader !== void 0) {
if (!Array.isArray(allowHeader)) {
throw new Error(
"The `allowHeader` argument for `Prerender` must be Array."
);
}
if (!allowHeader.every((q) => typeof q === "string")) {
throw new Error(
"The `allowHeader` argument for `Prerender` must be Array of strings."
);
}
this.allowHeader = allowHeader;
}
if (experimentalStreamingLambdaPath !== void 0) {
if (typeof experimentalStreamingLambdaPath !== "string") {
throw new Error(
"The `experimentalStreamingLambdaPath` argument for `Prerender` must be a string."
);
}
this.experimentalStreamingLambdaPath = experimentalStreamingLambdaPath;
}
if (chain !== void 0) {
if (typeof chain !== "object") {
throw new Error(
"The `chain` argument for `Prerender` must be an object."
);
}
if (!chain.headers || typeof chain.headers !== "object" || Object.entries(chain.headers).some(
([key, value]) => typeof key !== "string" || typeof value !== "string"
)) {
throw new Error(
`The \`chain.headers\` argument for \`Prerender\` must be an object with string key/values`
);
}
if (!chain.outputPath || typeof chain.outputPath !== "string") {
throw new Error(
"The `chain.outputPath` argument for `Prerender` must be a string."
);
}
this.chain = chain;
}
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Prerender
});

22
node_modules/@vercel/build-utils/dist/python.d.ts generated vendored Normal file
View file

@ -0,0 +1,22 @@
import FileFsRef from './file-fs-ref';
/**
* Run a Python script that only uses the standard library.
*/
export declare function runStdlibPyScript(options: {
scriptName: string;
pythonPath?: string;
args?: string[];
cwd?: string;
}): Promise<{
exitCode: number;
stdout: string;
stderr: string;
}>;
/**
* Check if a Python file is a valid entrypoint by detecting:
* - A top-level 'app' callable (Flask, FastAPI, Sanic, WSGI/ASGI, etc.)
* - A top-level 'handler' class (BaseHTTPRequestHandler subclass)
*/
export declare function isPythonEntrypoint(file: FileFsRef | {
fsPath?: string;
}): Promise<boolean>;

85
node_modules/@vercel/build-utils/dist/python.js generated vendored Normal file
View file

@ -0,0 +1,85 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var python_exports = {};
__export(python_exports, {
isPythonEntrypoint: () => isPythonEntrypoint,
runStdlibPyScript: () => runStdlibPyScript
});
module.exports = __toCommonJS(python_exports);
var import_fs = __toESM(require("fs"));
var import_path = require("path");
var import_execa = __toESM(require("execa"));
var import_debug = __toESM(require("./debug"));
const isWin = process.platform === "win32";
async function runStdlibPyScript(options) {
const { scriptName, pythonPath, args = [], cwd } = options;
const scriptPath = (0, import_path.join)(__dirname, "..", "lib", "python", `${scriptName}.py`);
if (!import_fs.default.existsSync(scriptPath)) {
throw new Error(`Python script not found: ${scriptPath}`);
}
const pythonCmd = pythonPath ?? (isWin ? "python" : "python3");
(0, import_debug.default)(
`Running stdlib Python script: ${pythonCmd} ${scriptPath} ${args.join(" ")}`
);
try {
const result = await (0, import_execa.default)(pythonCmd, [scriptPath, ...args], { cwd });
return { exitCode: 0, stdout: result.stdout, stderr: result.stderr };
} catch (err) {
const execaErr = err;
return {
exitCode: execaErr.exitCode ?? 1,
stdout: execaErr.stdout ?? "",
stderr: execaErr.stderr ?? ""
};
}
}
async function isPythonEntrypoint(file) {
try {
const fsPath = file.fsPath;
if (!fsPath)
return false;
const content = await import_fs.default.promises.readFile(fsPath, "utf-8");
if (!content.includes("app") && !content.includes("handler") && !content.includes("Handler")) {
return false;
}
const result = await runStdlibPyScript({
scriptName: "ast_parser",
args: [fsPath]
});
return result.exitCode === 0;
} catch (err) {
(0, import_debug.default)(`Failed to check Python entrypoint: ${err}`);
return false;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
isPythonEntrypoint,
runStdlibPyScript
});

105
node_modules/@vercel/build-utils/dist/schemas.d.ts generated vendored Normal file
View file

@ -0,0 +1,105 @@
export declare const functionsSchema: {
type: string;
minProperties: number;
maxProperties: number;
additionalProperties: boolean;
patternProperties: {
'^.{1,256}$': {
type: string;
additionalProperties: boolean;
properties: {
architecture: {
type: string;
enum: string[];
};
runtime: {
type: string;
maxLength: number;
};
memory: {
minimum: number;
maximum: number;
};
maxDuration: {
type: string;
minimum: number;
maximum: number;
};
includeFiles: {
type: string;
maxLength: number;
};
excludeFiles: {
type: string;
maxLength: number;
};
experimentalTriggers: {
type: string;
items: {
type: string;
properties: {
type: {
type: string;
const: string;
};
topic: {
type: string;
minLength: number;
};
consumer: {
type: string;
minLength: number;
};
maxDeliveries: {
type: string;
minimum: number;
};
retryAfterSeconds: {
type: string;
exclusiveMinimum: number;
};
initialDelaySeconds: {
type: string;
minimum: number;
};
maxConcurrency: {
type: string;
minimum: number;
};
};
required: string[];
additionalProperties: boolean;
};
};
supportsCancellation: {
type: string;
};
};
};
};
};
export declare const buildsSchema: {
type: string;
minItems: number;
maxItems: number;
items: {
type: string;
additionalProperties: boolean;
required: string[];
properties: {
src: {
type: string;
minLength: number;
maxLength: number;
};
use: {
type: string;
minLength: number;
maxLength: number;
};
config: {
type: string;
};
};
};
};

133
node_modules/@vercel/build-utils/dist/schemas.js generated vendored Normal file
View file

@ -0,0 +1,133 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var schemas_exports = {};
__export(schemas_exports, {
buildsSchema: () => buildsSchema,
functionsSchema: () => functionsSchema
});
module.exports = __toCommonJS(schemas_exports);
const triggerEventSchema = {
type: "object",
properties: {
type: {
type: "string",
const: "queue/v1beta"
},
topic: {
type: "string",
minLength: 1
},
consumer: {
type: "string",
minLength: 1
},
maxDeliveries: {
type: "number",
minimum: 1
},
retryAfterSeconds: {
type: "number",
exclusiveMinimum: 0
},
initialDelaySeconds: {
type: "number",
minimum: 0
},
maxConcurrency: {
type: "number",
minimum: 1
}
},
required: ["type", "topic", "consumer"],
additionalProperties: false
};
const functionsSchema = {
type: "object",
minProperties: 1,
maxProperties: 50,
additionalProperties: false,
patternProperties: {
"^.{1,256}$": {
type: "object",
additionalProperties: false,
properties: {
architecture: {
type: "string",
enum: ["x86_64", "arm64"]
},
runtime: {
type: "string",
maxLength: 256
},
memory: {
minimum: 128,
maximum: 10240
},
maxDuration: {
type: "number",
minimum: 1,
maximum: 900
},
includeFiles: {
type: "string",
maxLength: 256
},
excludeFiles: {
type: "string",
maxLength: 256
},
experimentalTriggers: {
type: "array",
items: triggerEventSchema
},
supportsCancellation: {
type: "boolean"
}
}
}
}
};
const buildsSchema = {
type: "array",
minItems: 0,
maxItems: 128,
items: {
type: "object",
additionalProperties: false,
required: ["use"],
properties: {
src: {
type: "string",
minLength: 1,
maxLength: 4096
},
use: {
type: "string",
minLength: 3,
maxLength: 256
},
config: { type: "object" }
}
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
buildsSchema,
functionsSchema
});

View file

@ -0,0 +1,2 @@
import type { ShouldServe } from './types';
export declare const shouldServe: ShouldServe;

47
node_modules/@vercel/build-utils/dist/should-serve.js generated vendored Normal file
View file

@ -0,0 +1,47 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var should_serve_exports = {};
__export(should_serve_exports, {
shouldServe: () => shouldServe
});
module.exports = __toCommonJS(should_serve_exports);
var import_path = require("path");
const shouldServe = ({
entrypoint,
files,
requestPath
}) => {
requestPath = requestPath.replace(/\/$/, "");
entrypoint = entrypoint.replace(/\\/, "/");
if (entrypoint === requestPath && hasProp(files, entrypoint)) {
return true;
}
const { dir, name } = (0, import_path.parse)(entrypoint);
if (name === "index" && dir === requestPath && hasProp(files, entrypoint)) {
return true;
}
return false;
};
function hasProp(obj, key) {
return Object.hasOwnProperty.call(obj, key);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
shouldServe
});

View file

@ -0,0 +1,2 @@
export declare const BUILDER_INSTALLER_STEP = "vc.builder.install";
export declare const BUILDER_COMPILE_STEP = "vc.builder.build";

View file

@ -0,0 +1,31 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var constants_exports = {};
__export(constants_exports, {
BUILDER_COMPILE_STEP: () => BUILDER_COMPILE_STEP,
BUILDER_INSTALLER_STEP: () => BUILDER_INSTALLER_STEP
});
module.exports = __toCommonJS(constants_exports);
const BUILDER_INSTALLER_STEP = "vc.builder.install";
const BUILDER_COMPILE_STEP = "vc.builder.build";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BUILDER_COMPILE_STEP,
BUILDER_INSTALLER_STEP
});

View file

@ -0,0 +1,3 @@
export { Span } from './trace';
export { BUILDER_COMPILE_STEP, BUILDER_INSTALLER_STEP } from './constants';
export type { SpanId, TraceEvent, Reporter } from './trace';

33
node_modules/@vercel/build-utils/dist/trace/index.js generated vendored Normal file
View file

@ -0,0 +1,33 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var trace_exports = {};
__export(trace_exports, {
BUILDER_COMPILE_STEP: () => import_constants.BUILDER_COMPILE_STEP,
BUILDER_INSTALLER_STEP: () => import_constants.BUILDER_INSTALLER_STEP,
Span: () => import_trace.Span
});
module.exports = __toCommonJS(trace_exports);
var import_trace = require("./trace");
var import_constants = require("./constants");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BUILDER_COMPILE_STEP,
BUILDER_INSTALLER_STEP,
Span
});

37
node_modules/@vercel/build-utils/dist/trace/trace.d.ts generated vendored Normal file
View file

@ -0,0 +1,37 @@
export type SpanId = string;
export type TraceEvent = {
parentId?: SpanId;
name: string;
id: SpanId;
timestamp: number;
duration: number;
tags: Record<string, string>;
startTime: number;
};
export type Reporter = {
report: (event: TraceEvent) => void;
};
interface Attributes {
[key: string]: string | undefined;
}
export declare class Span {
private name;
private id;
private parentId?;
private attrs;
private status;
private _start;
private now;
private _reporter;
constructor({ name, parentId, attrs, reporter, }: {
name: string;
parentId?: SpanId;
attrs?: Attributes;
reporter?: Reporter;
});
stop(): void;
setAttributes(attrs: Attributes): void;
child(name: string, attrs?: Attributes): Span;
trace<T>(fn: (span: Span) => T | Promise<T>): Promise<T>;
}
export {};

92
node_modules/@vercel/build-utils/dist/trace/trace.js generated vendored Normal file
View file

@ -0,0 +1,92 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var trace_exports = {};
__export(trace_exports, {
Span: () => Span
});
module.exports = __toCommonJS(trace_exports);
var import_node_crypto = require("node:crypto");
const NUM_OF_MICROSEC_IN_NANOSEC = BigInt("1000");
function mapUndefinedAttributes(attrs) {
return Object.fromEntries(
Object.entries(attrs ?? {}).filter(
(attr) => !!attr[1]
)
);
}
class Span {
constructor({
name,
parentId,
attrs,
reporter
}) {
this.name = name;
this.parentId = parentId;
this.attrs = mapUndefinedAttributes(attrs);
this.status = "started";
this.id = (0, import_node_crypto.randomUUID)();
this._reporter = reporter;
this.now = Date.now();
this._start = process.hrtime.bigint();
}
stop() {
if (this.status === "stopped") {
throw new Error(`Cannot stop a span which is already stopped`);
}
this.status = "stopped";
const end = process.hrtime.bigint();
const duration = Number((end - this._start) / NUM_OF_MICROSEC_IN_NANOSEC);
const timestamp = Number(this._start / NUM_OF_MICROSEC_IN_NANOSEC);
const traceEvent = {
name: this.name,
duration,
timestamp,
id: this.id,
parentId: this.parentId,
tags: this.attrs,
startTime: this.now
};
if (this._reporter) {
this._reporter.report(traceEvent);
}
}
setAttributes(attrs) {
Object.assign(this.attrs, mapUndefinedAttributes(attrs));
}
child(name, attrs) {
return new Span({
name,
parentId: this.id,
attrs,
reporter: this._reporter
});
}
async trace(fn) {
try {
return await fn(this);
} finally {
this.stop();
}
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Span
});

611
node_modules/@vercel/build-utils/dist/types.d.ts generated vendored Normal file
View file

@ -0,0 +1,611 @@
/// <reference types="node" />
import type FileRef from './file-ref';
import type FileFsRef from './file-fs-ref';
import type FileBlob from './file-blob';
import type { Lambda, LambdaArchitecture } from './lambda';
import type { Prerender } from './prerender';
import type { EdgeFunction } from './edge-function';
import type { Span } from './trace';
import type { HasField } from '@vercel/routing-utils';
export interface Env {
[name: string]: string | undefined;
}
export type File = FileRef | FileFsRef | FileBlob;
export interface FileBase {
type: string;
mode: number;
contentType?: string;
toStream: () => NodeJS.ReadableStream;
toStreamAsync?: () => Promise<NodeJS.ReadableStream>;
}
export interface Files {
[filePath: string]: File;
}
export interface Config {
bunVersion?: string;
maxLambdaSize?: string;
includeFiles?: string | string[];
excludeFiles?: string | string[];
bundle?: boolean;
ldsflags?: string;
helpers?: boolean;
rust?: string;
debug?: boolean;
zeroConfig?: boolean;
import?: {
[key: string]: string;
};
functions?: BuilderFunctions;
projectSettings?: ProjectSettings;
outputDirectory?: string;
installCommand?: string;
buildCommand?: string;
devCommand?: string;
framework?: string | null;
nodeVersion?: string;
middleware?: boolean;
[key: string]: unknown;
}
export type { HasField };
export interface Meta {
isDev?: boolean;
devCacheDir?: string;
skipDownload?: boolean;
requestPath?: string | null;
filesChanged?: string[];
filesRemoved?: string[];
env?: Env;
buildEnv?: Env;
[key: string]: unknown;
}
export interface BuildOptions {
/**
* All source files of the project
*/
files: Files;
/**
* Name of entrypoint file for this particular build job. Value
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
* `entrypoint` is always a discrete file and never a glob, since globs are
* expanded into separate builds at deployment time.
*/
entrypoint: string;
/**
* A writable temporary directory where you are encouraged to perform your
* build process. This directory will be populated with the restored cache.
*/
workPath: string;
/**
* The "Root Directory" is assigned to the `workPath` so the `repoRootPath`
* is the Git Repository Root. This is only relevant for Monorepos.
* See https://vercel.com/blog/monorepos
*/
repoRootPath: string;
/**
* An arbitrary object passed by the user in the build definition defined
* in `vercel.json`.
*/
config: Config;
/**
* Metadata related to the invoker of the builder, used by `vercel dev`.
* Builders may use the properties on this object to change behavior based
* on the build environment.
*/
meta?: Meta;
/**
* A callback to be invoked by a builder after a project's
* build command has been run but before the outputs have been
* fully processed
*/
buildCallback?: (opts: Omit<BuildOptions, 'buildCallback'>) => Promise<void>;
/**
* The current trace state from the internal vc tracing
*/
span?: Span;
}
export interface PrepareCacheOptions {
/**
* All source files of the project
*/
files: Files;
/**
* Name of entrypoint file for this particular build job. Value
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
* `entrypoint` is always a discrete file and never a glob, since globs are
* expanded into separate builds at deployment time.
*/
entrypoint: string;
/**
* A writable temporary directory where you are encouraged to perform your
* build process.
*/
workPath: string;
/**
* The "Root Directory" is assigned to the `workPath` so the `repoRootPath`
* is the Git Repository Root. This is only relevant for Monorepos.
* See https://vercel.com/blog/monorepos
*/
repoRootPath: string;
/**
* An arbitrary object passed by the user in the build definition defined
* in `vercel.json`.
*/
config: Config;
}
export interface ShouldServeOptions {
/**
* A path string from a request.
*/
requestPath: string;
/**
* Name of entrypoint file for this particular build job. Value
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
* `entrypoint` is always a discrete file and never a glob, since globs are
* expanded into separate builds at deployment time.
*/
entrypoint: string;
/**
* All source files of the project
*/
files: {
[path: string]: FileFsRef;
};
/**
* A writable temporary directory where you are encouraged to perform your
* build process. This directory will be populated with the restored cache.
*/
workPath: string;
/**
* An arbitrary object passed by the user in the build definition defined
* in `vercel.json`.
*/
config: Config;
/**
* Whether another builder has already matched the given request.
*/
hasMatched?: boolean;
}
/**
* `startDevServer()` is given the same parameters as `build()`.
*/
export type StartDevServerOptions = BuildOptions & {
/**
* Directory to serve static files from in dev mode
*/
publicDir?: string;
};
export interface StartDevServerSuccess {
/**
* Port number where the dev server can be connected to, assumed to be running
* on `localhost`.
*/
port: number;
/**
* Process ID number of the dev server. Useful for the `vercel dev` server to
* shut down the dev server once an HTTP request has been fulfilled.
*/
pid: number;
/**
* An optional function to shut down the dev server. If not provided, the
* dev server will forcefully be killed.
*/
shutdown?: () => Promise<void>;
}
/**
* `startDevServer()` may return `null` to opt-out of spawning a dev server for
* a given `entrypoint`.
*/
export type StartDevServerResult = StartDevServerSuccess | null;
/**
* Credit to Iain Reid, MIT license.
* Source: https://gist.github.com/iainreid820/5c1cc527fe6b5b7dba41fec7fe54bf6e
*/
export declare namespace PackageJson {
/**
* An author or contributor
*/
interface Author {
name: string;
email?: string;
homepage?: string;
}
/**
* A map of exposed bin commands
*/
interface BinMap {
[commandName: string]: string;
}
/**
* A bugs link
*/
interface Bugs {
email: string;
url: string;
}
interface Config {
name?: string;
config?: unknown;
}
/**
* A map of dependencies
*/
interface DependencyMap {
[dependencyName: string]: string;
}
/**
* CommonJS package structure
*/
interface Directories {
lib?: string;
bin?: string;
man?: string;
doc?: string;
example?: string;
}
interface Engines {
node?: string;
npm?: string;
pnpm?: string;
}
interface PublishConfig {
registry?: string;
}
/**
* A project repository
*/
interface Repository {
type: string;
url: string;
}
interface ScriptsMap {
[scriptName: string]: string;
}
}
export interface PackageJson {
readonly name?: string;
readonly version?: string;
readonly description?: string;
readonly keywords?: string[];
readonly homepage?: string;
readonly bugs?: string | PackageJson.Bugs;
readonly license?: string;
readonly author?: string | PackageJson.Author;
readonly contributors?: string[] | PackageJson.Author[];
readonly files?: string[];
readonly main?: string;
readonly bin?: string | PackageJson.BinMap;
readonly man?: string | string[];
readonly directories?: PackageJson.Directories;
readonly repository?: string | PackageJson.Repository;
readonly scripts?: PackageJson.ScriptsMap;
readonly config?: PackageJson.Config;
readonly dependencies?: PackageJson.DependencyMap;
readonly devDependencies?: PackageJson.DependencyMap;
readonly peerDependencies?: PackageJson.DependencyMap;
readonly optionalDependencies?: PackageJson.DependencyMap;
readonly bundledDependencies?: string[];
readonly engines?: PackageJson.Engines;
readonly os?: string[];
readonly cpu?: string[];
readonly preferGlobal?: boolean;
readonly private?: boolean;
readonly publishConfig?: PackageJson.PublishConfig;
readonly packageManager?: string;
readonly type?: string;
}
export interface ConstructorVersion {
/** major version number: 18 */
major: number;
/** minor version number: 18 */
minor?: number;
/** major version range: "18.x" */
range: string;
/** runtime descriptor: "nodejs18.x" */
runtime: string;
discontinueDate?: Date;
}
interface BaseVersion extends ConstructorVersion {
state: 'active' | 'deprecated' | 'discontinued';
}
export declare class Version implements BaseVersion {
major: number;
minor?: number;
range: string;
runtime: string;
discontinueDate?: Date;
constructor(version: ConstructorVersion);
get state(): "active" | "deprecated" | "discontinued";
get formattedDate(): string | undefined;
}
export declare class NodeVersion extends Version {
}
export declare class BunVersion extends Version {
}
export interface Builder {
use: string;
src?: string;
config?: Config;
}
export interface BuilderFunctions {
[key: string]: {
architecture?: LambdaArchitecture;
memory?: number;
maxDuration?: number;
runtime?: string;
includeFiles?: string;
excludeFiles?: string;
experimentalTriggers?: TriggerEvent[];
supportsCancellation?: boolean;
};
}
export interface ProjectSettings {
framework?: string | null;
devCommand?: string | null;
installCommand?: string | null;
buildCommand?: string | null;
outputDirectory?: string | null;
rootDirectory?: string | null;
nodeVersion?: string;
monorepoManager?: string | null;
createdAt?: number;
autoExposeSystemEnvs?: boolean;
sourceFilesOutsideRootDirectory?: boolean;
directoryListing?: boolean;
gitForkProtection?: boolean;
commandForIgnoringBuildStep?: string | null;
}
export interface BuilderV2 {
version: 2;
build: BuildV2;
diagnostics?: Diagnostics;
prepareCache?: PrepareCache;
shouldServe?: ShouldServe;
}
export interface BuilderV3 {
version: 3;
build: BuildV3;
diagnostics?: Diagnostics;
prepareCache?: PrepareCache;
shouldServe?: ShouldServe;
startDevServer?: StartDevServer;
}
type ImageFormat = 'image/avif' | 'image/webp';
type ImageContentDispositionType = 'inline' | 'attachment';
export type RemotePattern = {
/**
* Must be `http` or `https`.
*/
protocol?: 'http' | 'https';
/**
* Can be literal or wildcard.
* Single `*` matches a single subdomain.
* Double `**` matches any number of subdomains.
*/
hostname: string;
/**
* Can be literal port such as `8080` or empty string
* meaning no port.
*/
port?: string;
/**
* Can be literal or wildcard.
* Single `*` matches a single path segment.
* Double `**` matches any number of path segments.
*/
pathname?: string;
/**
* Can be literal query string such as `?v=1` or
* empty string meaning no query string.
*/
search?: string;
};
export interface LocalPattern {
/**
* Can be literal or wildcard.
* Single `*` matches a single path segment.
* Double `**` matches any number of path segments.
*/
pathname?: string;
/**
* Can be literal query string such as `?v=1` or
* empty string meaning no query string.
*/
search?: string;
}
export interface Images {
domains: string[];
remotePatterns?: RemotePattern[];
localPatterns?: LocalPattern[];
qualities?: number[];
sizes: number[];
minimumCacheTTL?: number;
formats?: ImageFormat[];
dangerouslyAllowSVG?: boolean;
contentSecurityPolicy?: string;
contentDispositionType?: ImageContentDispositionType;
}
/**
* If a Builder ends up creating filesystem outputs conforming to
* the Build Output API, then the Builder should return this type.
*/
export interface BuildResultBuildOutput {
/**
* Version number of the Build Output API that was created.
* Currently only `3` is a valid value.
* @example 3
*/
buildOutputVersion: 3;
/**
* Filesystem path to the Build Output directory.
* @example "/path/to/.vercel/output"
*/
buildOutputPath: string;
}
export interface Cron {
path: string;
schedule: string;
}
/** The framework which created the function */
export interface FunctionFramework {
slug: string;
version?: string;
}
/**
* When a Builder implements `version: 2`, the `build()` function is expected
* to return this type.
*/
export interface BuildResultV2Typical {
routes?: any[];
images?: Images;
output: {
[key: string]: File | Lambda | Prerender | EdgeFunction;
};
wildcard?: Array<{
domain: string;
value: string;
}>;
framework?: {
version: string;
};
flags?: {
definitions: FlagDefinitions;
};
/**
* User-configured deployment ID for skew protection.
* This allows users to specify a custom deployment identifier
* in their next.config.js that will be used for version skew protection
* with pre-built deployments.
* @example "abc123"
*/
deploymentId?: string;
}
export type BuildResultV2 = BuildResultV2Typical | BuildResultBuildOutput;
export interface BuildResultV3 {
routes?: any[];
output: Lambda | EdgeFunction;
}
export type BuildV2 = (options: BuildOptions) => Promise<BuildResultV2>;
export type BuildV3 = (options: BuildOptions) => Promise<BuildResultV3>;
export type PrepareCache = (options: PrepareCacheOptions) => Promise<Files>;
export type Diagnostics = (options: BuildOptions) => Promise<Files>;
export type ShouldServe = (options: ShouldServeOptions) => boolean | Promise<boolean>;
export type StartDevServer = (options: StartDevServerOptions) => Promise<StartDevServerResult>;
/**
* TODO: The following types will eventually be exported by a more
* relevant package.
*/
type FlagJSONArray = ReadonlyArray<FlagJSONValue>;
type FlagJSONValue = string | boolean | number | null | FlagJSONArray | {
[key: string]: FlagJSONValue;
};
type FlagOption = {
value: FlagJSONValue;
label?: string;
};
export interface FlagDefinition {
options?: FlagOption[];
origin?: string;
description?: string;
}
export type FlagDefinitions = Record<string, FlagDefinition>;
export interface Chain {
/**
* The build output to use that references the lambda that will be used to
* append to the response.
*/
outputPath: string;
/**
* The headers to send when making the request to append to the response.
*/
headers: Record<string, string>;
}
/**
* Queue trigger event for Vercel's queue system.
* Handles "queue/v1beta" events with queue-specific configuration.
*/
export interface TriggerEvent {
/** Event type - must be "queue/v1beta" (REQUIRED) */
type: 'queue/v1beta';
/** Name of the queue topic to consume from (REQUIRED) */
topic: string;
/** Name of the consumer group for this trigger (REQUIRED) */
consumer: string;
/**
* Maximum number of delivery attempts for message processing (OPTIONAL)
* This represents the total number of times a message can be delivered,
* not the number of retries. Must be at least 1 if specified.
* Behavior when not specified depends on the server's default configuration.
*/
maxDeliveries?: number;
/**
* Delay in seconds before retrying failed executions (OPTIONAL)
* Behavior when not specified depends on the server's default configuration.
*/
retryAfterSeconds?: number;
/**
* Initial delay in seconds before first execution attempt (OPTIONAL)
* Must be 0 or greater. Use 0 for no initial delay.
* Behavior when not specified depends on the server's default configuration.
*/
initialDelaySeconds?: number;
/**
* Maximum number of concurrent executions for this consumer (OPTIONAL)
* Must be at least 1 if specified.
* Behavior when not specified depends on the server's default configuration.
*/
maxConcurrency?: number;
}
export type ServiceRuntime = 'node' | 'python' | 'go' | 'rust' | 'ruby';
export type ServiceType = 'web' | 'cron' | 'worker';
/**
* Configuration for a service in vercel.json.
* @experimental This feature is experimental and may change.
*/
export interface ExperimentalServiceConfig {
type?: ServiceType;
/**
* Entry file for the service, relative to the workspace directory.
* @example "src/index.ts", "main.py", "api/server.go"
*/
entrypoint?: string;
/**
* Path to the directory containing the service's manifest file
* (package.json, pyproject.toml, etc.).
* Defaults to "." (project root) if not specified.
*/
workspace?: string;
/** Framework to use */
framework?: string;
/** Builder to use, e.g. @vercel/node, @vercel/python */
builder?: string;
/** Specific lambda runtime to use, e.g. nodejs24.x, python3.14 */
runtime?: string;
buildCommand?: string;
installCommand?: string;
/** Lambda config */
memory?: number;
maxDuration?: number;
includeFiles?: string | string[];
excludeFiles?: string | string[];
/** URL prefix for routing */
routePrefix?: string;
/** Cron schedule expression (e.g., "0 0 * * *") */
schedule?: string;
topic?: string;
consumer?: string;
}
/**
* Map of service name to service configuration.
* @experimental This feature is experimental and may change.
*/
export type ExperimentalServices = Record<string, ExperimentalServiceConfig>;
/**
* Map of service group name to array of service names belonging to that group.
* @experimental This feature is experimental and may change.
* @example
* {
* "app": ["site", "backend"],
* "admin": ["admin", "backend"]
* }
*/
export type ExperimentalServiceGroups = Record<string, string[]>;

55
node_modules/@vercel/build-utils/dist/types.js generated vendored Normal file
View file

@ -0,0 +1,55 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var types_exports = {};
__export(types_exports, {
BunVersion: () => BunVersion,
NodeVersion: () => NodeVersion,
Version: () => Version
});
module.exports = __toCommonJS(types_exports);
class Version {
constructor(version) {
this.major = version.major;
this.minor = version.minor;
this.range = version.range;
this.runtime = version.runtime;
this.discontinueDate = version.discontinueDate;
}
get state() {
if (this.discontinueDate && this.discontinueDate.getTime() <= Date.now()) {
return "discontinued";
} else if (this.discontinueDate) {
return "deprecated";
}
return "active";
}
get formattedDate() {
return this.discontinueDate && this.discontinueDate.toISOString().split("T")[0];
}
}
class NodeVersion extends Version {
}
class BunVersion extends Version {
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BunVersion,
NodeVersion,
Version
});

View file

@ -0,0 +1,12 @@
/**
* Checks if there is a `.npmrc` in the cwd (project root) and makes sure it
* doesn't contain a `use-node-version`. This config setting is not supported
* since it causes the package manager to install the Node.js version which in
* the case of newer Node.js versions is not compatible with AWS due to
* outdated GLIBC binaries.
*
* @see https://pnpm.io/npmrc#use-node-version
*
* @param cwd The current working directory (e.g. project root);
*/
export declare function validateNpmrc(cwd: string): Promise<void>;

View file

@ -0,0 +1,41 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var validate_npmrc_exports = {};
__export(validate_npmrc_exports, {
validateNpmrc: () => validateNpmrc
});
module.exports = __toCommonJS(validate_npmrc_exports);
var import_path = require("path");
var import_promises = require("fs/promises");
async function validateNpmrc(cwd) {
const npmrc = await (0, import_promises.readFile)((0, import_path.join)(cwd, ".npmrc"), "utf-8").catch((err) => {
if (err.code !== "ENOENT")
throw err;
});
const nodeRegExp = /(?<!#.*)use-node-version/;
if (npmrc?.match(nodeRegExp)) {
throw new Error(
'Detected unsupported "use-node-version" in your ".npmrc". Please use "engines" in your "package.json" instead.'
);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
validateNpmrc
});

1
node_modules/@vercel/build-utils/file-blob.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('./dist/index').FileBlob;

1
node_modules/@vercel/build-utils/file-fs-ref.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('./dist/index').FileFsRef;

1
node_modules/@vercel/build-utils/file-ref.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('./dist/index').FileRef;

1
node_modules/@vercel/build-utils/fs/download.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('../dist/index').download;

View file

@ -0,0 +1 @@
module.exports = require('../dist/index').getWriteableDirectory;

1
node_modules/@vercel/build-utils/fs/glob.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('../dist/index').glob;

1
node_modules/@vercel/build-utils/fs/rename.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('../dist/index').rename;

View file

@ -0,0 +1 @@
module.exports = require('../dist/index');

View file

@ -0,0 +1 @@
module.exports = require('../dist/index').streamToBuffer;

1
node_modules/@vercel/build-utils/lambda.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('./dist/index');

View file

@ -0,0 +1,72 @@
import sys
import ast
def contains_app_or_handler(file_path: str) -> bool:
"""
Check if a Python file contains or exports:
- A top-level 'app' callable (e.g., Flask, FastAPI, Sanic apps)
- A top-level 'handler' class (e.g., BaseHTTPRequestHandler subclass)
"""
with open(file_path, "r") as file:
code = file.read()
try:
tree = ast.parse(code)
except SyntaxError:
return False
for node in ast.iter_child_nodes(tree):
# Check for top-level assignment to 'app'
# e.g., app = Sanic() or app = Flask(__name__) or app = create_app()
if isinstance(node, ast.Assign):
for target in node.targets:
if isinstance(target, ast.Name) and target.id == "app":
return True
# Check for annotated assignment to 'app'
# e.g., app: Sanic = Sanic()
if isinstance(node, ast.AnnAssign):
if isinstance(node.target, ast.Name) and node.target.id == "app":
return True
# Check for function named 'app'
# e.g., def app(environ, start_response): ...
if isinstance(node, ast.FunctionDef) and node.name == "app":
return True
# Check for async function named 'app'
# e.g., async def app(scope, receive, send): ...
if isinstance(node, ast.AsyncFunctionDef) and node.name == "app":
return True
# Check for import of 'app'
# e.g., from server import app
# e.g., from server import application as app
if isinstance(node, ast.ImportFrom):
for alias in node.names:
# alias.asname is the 'as' name, alias.name is the original name
# If aliased, check asname; otherwise check the original name
imported_as = alias.asname if alias.asname else alias.name
if imported_as == "app":
return True
# Check for top-level class named 'handler'
# e.g., class handler(BaseHTTPRequestHandler):
if isinstance(node, ast.ClassDef) and node.name.lower() == "handler":
return True
return False
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python ast_parser.py <file_path>")
sys.exit(1)
file_path = sys.argv[1]
result = contains_app_or_handler(file_path)
# Exit with 0 if found, 1 if not found
sys.exit(0 if result else 1)

View file

@ -0,0 +1,72 @@
import unittest
import tempfile
import os
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
from ast_parser import contains_app_or_handler
class TestContainsAppOrHandler(unittest.TestCase):
def _check(self, code: str) -> bool:
"""Helper to test code snippets without needing fixture files."""
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f:
f.write(code)
f.flush()
try:
return contains_app_or_handler(f.name)
finally:
os.unlink(f.name)
def test_flask_app(self):
self.assertTrue(self._check("from flask import Flask\napp = Flask(__name__)"))
def test_fastapi_app(self):
self.assertTrue(self._check("from fastapi import FastAPI\napp = FastAPI()"))
def test_sanic_app(self):
self.assertTrue(self._check("from sanic import Sanic\napp = Sanic('app')"))
def test_annotated_app(self):
self.assertTrue(self._check("from fastapi import FastAPI\napp: FastAPI = FastAPI()"))
def test_wsgi_function(self):
self.assertTrue(self._check("def app(environ, start_response):\n pass"))
def test_asgi_function(self):
self.assertTrue(self._check("async def app(scope, receive, send):\n pass"))
def test_imported_app(self):
self.assertTrue(self._check("from server import app"))
def test_imported_app_aliased(self):
self.assertTrue(self._check("from server import application as app"))
def test_handler_class(self):
self.assertTrue(self._check("class Handler:\n pass"))
def test_handler_class_lowercase(self):
self.assertTrue(self._check("class handler:\n pass"))
def test_no_app_or_handler(self):
self.assertFalse(self._check("def hello():\n return 'world'"))
def test_app_in_function_not_toplevel(self):
# app defined inside a function should NOT match
self.assertFalse(self._check("def create():\n app = Flask(__name__)\n return app"))
def test_syntax_error(self):
self.assertFalse(self._check("def broken("))
def test_empty_file(self):
self.assertFalse(self._check(""))
def test_only_comments(self):
self.assertFalse(self._check("# just a comment\n# another comment"))
if __name__ == "__main__":
unittest.main()

61
node_modules/@vercel/build-utils/package.json generated vendored Normal file
View file

@ -0,0 +1,61 @@
{
"name": "@vercel/build-utils",
"version": "13.2.16",
"license": "Apache-2.0",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"homepage": "https://github.com/vercel/vercel/blob/main/DEVELOPING_A_RUNTIME.md",
"repository": {
"type": "git",
"url": "https://github.com/vercel/vercel.git",
"directory": "packages/now-build-utils"
},
"devDependencies": {
"@iarna/toml": "2.2.3",
"@types/async-retry": "^1.2.1",
"@types/cross-spawn": "6.0.0",
"@types/end-of-stream": "^1.4.0",
"@types/fs-extra": "9.0.13",
"@types/glob": "7.2.0",
"@types/jest": "27.4.1",
"@types/js-yaml": "3.12.1",
"@types/minimatch": "^5.1.2",
"@types/ms": "0.7.31",
"@types/multistream": "2.1.1",
"@types/node": "20.11.0",
"@types/node-fetch": "^2.1.6",
"@types/semver": "6.0.0",
"@types/yazl": "2.4.2",
"aggregate-error": "3.0.1",
"async-retry": "1.2.3",
"async-sema": "2.1.4",
"cross-spawn": "6.0.5",
"end-of-stream": "1.4.1",
"execa": "3.2.0",
"fs-extra": "10.0.0",
"glob": "8.0.3",
"ignore": "4.0.6",
"into-stream": "5.0.0",
"jest-junit": "16.0.0",
"js-yaml": "3.13.1",
"minimatch": "3.1.2",
"ms": "2.1.3",
"multistream": "2.1.1",
"node-fetch": "2.6.7",
"semver": "6.3.1",
"typescript": "4.9.5",
"yazl": "2.5.1",
"vitest": "2.0.1",
"json5": "2.2.3",
"@vercel/error-utils": "2.0.3",
"@vercel/routing-utils": "5.3.2"
},
"scripts": {
"build": "node build.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand",
"vitest-run": "vitest -c ../../vitest.config.mts",
"vitest-unit": "glob --absolute 'test/unit.*test.ts'",
"vitest-e2e": "glob --absolute 'test/integration*.test.ts'",
"type-check": "tsc --noEmit"
}
}