Compare commits

...

15 Commits

Author SHA1 Message Date
Vercel Release Bot
bcebab7517 Version Packages (#10478)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/build-utils@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))

## vercel@32.2.1

### Patch Changes

- Update @vercel/fun@1.1.0
([#10477](https://github.com/vercel/vercel/pull/10477))

- [node] upgrade edge-runtime
([#10451](https://github.com/vercel/vercel/pull/10451))

- Updated dependencies
\[[`6784e7751`](6784e77516),
[`a8ad17626`](a8ad176262),
[`0ee089a50`](0ee089a501),
[`f15cba614`](f15cba6148),
[`b265e13d4`](b265e13d40),
[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`a732d30c8`](a732d30c84),
[`9d64312aa`](9d64312aaa),
[`6baefc825`](6baefc825a),
[`989f0d813`](989f0d8139),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/go@3.0.1
    -   @vercel/redwood@2.0.2
    -   @vercel/remix-builder@2.0.4
    -   @vercel/hydrogen@1.0.1
    -   @vercel/static-build@2.0.5
    -   @vercel/build-utils@7.2.0
    -   @vercel/next@4.0.3
    -   @vercel/node@3.0.5
    -   @vercel/python@4.0.1
    -   @vercel/ruby@2.0.2

## @vercel/client@13.0.3

### Patch Changes

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0

## @vercel/edge@1.0.2

### Patch Changes

- [node] upgrade edge-runtime
([#10451](https://github.com/vercel/vercel/pull/10451))

## @vercel/gatsby-plugin-vercel-builder@2.0.5

### Patch Changes

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`9d64312aa`](9d64312aaa),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0
    -   @vercel/node@3.0.5

## @vercel/go@3.0.1

### Patch Changes

- Update to esbuild script
([#10468](https://github.com/vercel/vercel/pull/10468))

## @vercel/hydrogen@1.0.1

### Patch Changes

- Use `build-builder.mjs` script to bundle, and remove types and source
maps ([#10480](https://github.com/vercel/vercel/pull/10480))

## @vercel/next@4.0.3

### Patch Changes

- fix content-type for RSC prefetches
([#10487](https://github.com/vercel/vercel/pull/10487))

## @vercel/node@3.0.5

### Patch Changes

- [node] upgrade edge-runtime
([#10451](https://github.com/vercel/vercel/pull/10451))

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0

## @vercel/python@4.0.1

### Patch Changes

- Update to esbuild script
([#10470](https://github.com/vercel/vercel/pull/10470))

## @vercel/redwood@2.0.2

### Patch Changes

- Update to esbuild script
([#10471](https://github.com/vercel/vercel/pull/10471))

## @vercel/remix-builder@2.0.4

### Patch Changes

- Use `build-builder.mjs` script to bundle, and remove types and source
maps ([#10479](https://github.com/vercel/vercel/pull/10479))

## @vercel/ruby@2.0.2

### Patch Changes

- Update to esbuild script
([#10472](https://github.com/vercel/vercel/pull/10472))

## @vercel/static-build@2.0.5

### Patch Changes

- Build package using "esbuild"
([#10462](https://github.com/vercel/vercel/pull/10462))

-   Updated dependencies \[]:
    -   @vercel/gatsby-plugin-vercel-builder@2.0.5

## @vercel-internals/types@1.0.10

### Patch Changes

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-11 17:30:02 -04:00
Steven
45b73c7e86 [build-utils] Add zero config detection for bun package manager (#10486)
> [!IMPORTANT]  
> This PR will only support Bun as a package manager at build time. 
> Bun will **not** work at runtime with Serverless Functions or Edge
Functions at this time.

- Depends on https://github.com/vercel/api/pull/21869
- Fixes https://github.com/orgs/vercel/discussions/2021
- Closes https://github.com/vercel/vercel/pull/10244
- Related https://github.com/nodejs/corepack/issues/295
- Docs https://bun.sh/docs/install
2023-09-11 17:26:34 -04:00
Zack Tanner
a732d30c84 [next] fix content-type for RSC prefetches (#10487)
This ensures that the `.prefetch.rsc` requests respond with the correct `content-type` since this is used by Next.js to determine if a request is valid or not (and in the case it's invalid, an mpa navigation will occur)

Fixes: https://github.com/vercel/next.js/issues/54934
2023-09-11 19:04:16 +00:00
Lee Robinson
8504735808 [examples] Update Astro starter (#10397)
Deployed https://astro.vercel.app/image.
2023-09-11 16:29:54 +00:00
Kiko Beats
9d64312aaa [node] upgrade edge-runtime (#10451) 2023-09-10 13:14:43 +00:00
Chris Barber
a8ad176262 [redwood] Use new esbuild script (#10471) 2023-09-09 01:48:54 +00:00
Nathan Rajlich
0ee089a501 [remix] Bundle, remove types and source maps (#10479)
For consistency with other Builders.
2023-09-09 00:35:56 +00:00
Zack Tanner
d8bc570f60 [build-utils] add experimentalBypassFor field to Prerender (#10481)
This adds an experimental flag to `Prerender` outputs as a way to programmatically bypass the cache and hit the lambda directly, using a similar interface to `has`. 

(Note: I copied over `HasField` from `@vercel/router-utils` since it wasn't available for import in `build-utils`, but can add it as a dep if that's preferred)

The specific use-case being targeted here relates to https://github.com/vercel/next.js/pull/51534 -- a Next.js page marked static should still be able to initiate server actions.
2023-09-08 23:33:59 +00:00
Nathan Rajlich
f15cba6148 [hydrogen] Bundle, remove types and source maps (#10480)
Similar to #10479, but for `@vercel/hydrogen`.
2023-09-08 22:55:03 +00:00
Chris Barber
989f0d8139 [ruby] Use new esbuild script (#10472) 2023-09-08 17:27:17 -05:00
Chris Barber
6784e77516 [go] Update to esbuild script (#10468)
Co-authored-by: Nathan Rajlich <n@n8.io>
2023-09-08 17:00:40 -05:00
Chris Barber
6baefc825a [python] Update to esbuild script (#10470)
Co-authored-by: Steven <steven@ceriously.com>
2023-09-08 16:23:23 -05:00
Chris Barber
0a08e4b23e [cli] Update @vercel/fun@1.1.0 (#10477) 2023-09-08 15:39:13 -05:00
Nathan Rajlich
b265e13d40 [static-build] Use esbuild (#10462)
Switch to using esbuild to compile + bundle `@vercel/static-build`.
2023-09-08 19:39:12 +00:00
Nabeel Sulieman
50e04dd858 Add optional experimentalStreamingLambda field for prerender (#10476)
This adds a new `experimentalStreamingLambda` field to Prerender
outputs, allowing references to an optional streaming lambda path.
2023-09-08 11:42:06 -07:00
71 changed files with 654 additions and 373 deletions

View File

@@ -3,9 +3,10 @@
This directory is a brief example of an [Astro](https://astro.build/) site that can be deployed to Vercel with zero configuration. This demo showcases: This directory is a brief example of an [Astro](https://astro.build/) site that can be deployed to Vercel with zero configuration. This demo showcases:
- `/` - A static page (pre-rendered) - `/` - A static page (pre-rendered)
- `/ssr` - A page that uses server-side rendering (through Vercel Edge Functions) - `/ssr` - A page that uses server-side rendering (through [Vercel Edge Functions](https://vercel.com/docs/functions/edge-functions))
- `/ssr-with-swr-caching` - Similar to the previous page, but also caches the response on the Vercel Edge Network using `cache-control` headers - `/ssr-with-swr-caching` - Similar to the previous page, but also caches the response on the [Vercel Edge Network](https://vercel.com/docs/edge-network/overview) using `cache-control` headers
- `/edge.json` - An Astro API Endpoint that returns JSON data using Vercel Edge Functions - `/image` - Astro [Asset](https://docs.astro.build/en/guides/assets/) using Vercel [Image Optimization](https://vercel.com/docs/image-optimization)
- `/edge.json` - An Astro API Endpoint that returns JSON data using [Vercel Edge Functions](https://vercel.com/docs/functions/edge-functions)
Learn more about [Astro on Vercel](https://vercel.com/docs/frameworks/astro). Learn more about [Astro on Vercel](https://vercel.com/docs/frameworks/astro).

View File

@@ -1,7 +1,17 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
// Use Vercel Edge Functions (Recommended)
import vercel from '@astrojs/vercel/edge'; import vercel from '@astrojs/vercel/edge';
// Can also use Serverless Functions
// import vercel from '@astrojs/vercel/serverless';
// Or a completely static build
// import vercel from '@astrojs/vercel/static';
export default defineConfig({ export default defineConfig({
output: 'server', output: 'server',
adapter: vercel(), experimental: {
assets: true
},
adapter: vercel({
imageService: true,
}),
}); });

View File

@@ -8,8 +8,8 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astrojs/vercel": "3.2.2", "@astrojs/vercel": "3.8.2",
"astro": "^2.2.1", "astro": "^2.10.14",
"react": "18.2.0", "react": "18.2.0",
"web-vitals": "^3.3.1" "web-vitals": "^3.3.1"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -1,4 +1,4 @@
/// <reference types="astro/client" /> /// <reference types="astro/client-image" />
interface ImportMetaEnv { interface ImportMetaEnv {
readonly PUBLIC_VERCEL_ANALYTICS_ID: string; readonly PUBLIC_VERCEL_ANALYTICS_ID: string;

View File

@@ -0,0 +1,6 @@
---
import { Image } from 'astro:assets';
import astroLogo from '../assets/logo.png';
---
<Image src={astroLogo} alt="Astro Logo" width={50} quality={75} />

View File

@@ -1,5 +1,12 @@
# @vercel-internals/types # @vercel-internals/types
## 1.0.10
### Patch Changes
- Updated dependencies [[`50e04dd85`](https://github.com/vercel/vercel/commit/50e04dd8584664c842a86c15d92d654f4ea8dcbb), [`45b73c7e8`](https://github.com/vercel/vercel/commit/45b73c7e86458564dc0bab007f6f6365c4c4ab5d), [`d8bc570f6`](https://github.com/vercel/vercel/commit/d8bc570f604950d97156d4f33c8accecf3b3b28f)]:
- @vercel/build-utils@7.2.0
## 1.0.9 ## 1.0.9
### Patch Changes ### Patch Changes

View File

@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "@vercel-internals/types", "name": "@vercel-internals/types",
"version": "1.0.9", "version": "1.0.10",
"types": "index.d.ts", "types": "index.d.ts",
"main": "index.d.ts", "main": "index.d.ts",
"files": [ "files": [
@@ -10,7 +10,7 @@
"dependencies": { "dependencies": {
"@types/node": "14.14.31", "@types/node": "14.14.31",
"@vercel-internals/constants": "1.0.4", "@vercel-internals/constants": "1.0.4",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/routing-utils": "3.0.0" "@vercel/routing-utils": "3.0.0"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -1,5 +1,17 @@
# @vercel/build-utils # @vercel/build-utils
## 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 ## 7.1.1
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/build-utils", "name": "@vercel/build-utils",
"version": "7.1.1", "version": "7.2.0",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.js", "types": "./dist/index.d.js",

View File

@@ -16,7 +16,7 @@ import { cloneEnv } from '../clone-env';
// Only allow one `runNpmInstall()` invocation to run concurrently // Only allow one `runNpmInstall()` invocation to run concurrently
const runNpmInstallSema = new Sema(1); const runNpmInstallSema = new Sema(1);
export type CliType = 'yarn' | 'npm' | 'pnpm'; export type CliType = 'yarn' | 'npm' | 'pnpm' | 'bun';
export interface ScanParentDirsResult { export interface ScanParentDirsResult {
/** /**
@@ -284,26 +284,34 @@ export async function scanParentDirs(
readPackageJson && pkgJsonPath readPackageJson && pkgJsonPath
? JSON.parse(await fs.readFile(pkgJsonPath, 'utf8')) ? JSON.parse(await fs.readFile(pkgJsonPath, 'utf8'))
: undefined; : undefined;
const [yarnLockPath, npmLockPath, pnpmLockPath] = await walkParentDirsMulti({ const [yarnLockPath, npmLockPath, pnpmLockPath, bunLockPath] =
base: '/', await walkParentDirsMulti({
start: destPath, base: '/',
filenames: ['yarn.lock', 'package-lock.json', 'pnpm-lock.yaml'], start: destPath,
}); filenames: [
'yarn.lock',
'package-lock.json',
'pnpm-lock.yaml',
'bun.lockb',
],
});
let lockfilePath: string | undefined; let lockfilePath: string | undefined;
let lockfileVersion: number | undefined; let lockfileVersion: number | undefined;
let cliType: CliType = 'yarn'; let cliType: CliType = 'yarn';
const [hasYarnLock, packageLockJson, pnpmLockYaml] = await Promise.all([ const [hasYarnLock, packageLockJson, pnpmLockYaml, bunLockBin] =
Boolean(yarnLockPath), await Promise.all([
npmLockPath Boolean(yarnLockPath),
? readConfigFile<{ lockfileVersion: number }>(npmLockPath) npmLockPath
: null, ? readConfigFile<{ lockfileVersion: number }>(npmLockPath)
pnpmLockPath : null,
? readConfigFile<{ lockfileVersion: number }>(pnpmLockPath) pnpmLockPath
: null, ? readConfigFile<{ lockfileVersion: number }>(pnpmLockPath)
]); : null,
bunLockPath ? fs.readFile(bunLockPath, 'utf8') : null,
]);
// Priority order is Yarn > pnpm > npm // Priority order is Yarn > pnpm > npm > bun
if (hasYarnLock) { if (hasYarnLock) {
cliType = 'yarn'; cliType = 'yarn';
lockfilePath = yarnLockPath; lockfilePath = yarnLockPath;
@@ -315,6 +323,11 @@ export async function scanParentDirs(
cliType = 'npm'; cliType = 'npm';
lockfilePath = npmLockPath; lockfilePath = npmLockPath;
lockfileVersion = packageLockJson.lockfileVersion; lockfileVersion = packageLockJson.lockfileVersion;
} else if (bunLockBin) {
cliType = 'bun';
lockfilePath = bunLockPath;
// TODO: read "bun-lockfile-format-v0"
lockfileVersion = 0;
} }
const packageJsonPath = pkgJsonPath || undefined; const packageJsonPath = pkgJsonPath || undefined;
@@ -451,6 +464,10 @@ export async function runNpmInstall(
commandArgs = args commandArgs = args
.filter(a => a !== '--prefer-offline') .filter(a => a !== '--prefer-offline')
.concat(['install', '--unsafe-perm']); .concat(['install', '--unsafe-perm']);
} else if (cliType === 'bun') {
// @see options https://bun.sh/docs/cli/install
opts.prettyCommand = 'bun install';
commandArgs = ['install', ...args];
} else { } else {
opts.prettyCommand = 'yarn install'; opts.prettyCommand = 'yarn install';
commandArgs = ['install', ...args]; commandArgs = ['install', ...args];
@@ -505,6 +522,7 @@ export function getEnvForPackageManager({
const npm7 = '/node16/bin-npm7'; const npm7 = '/node16/bin-npm7';
const pnpm7 = '/pnpm7/node_modules/.bin'; const pnpm7 = '/pnpm7/node_modules/.bin';
const pnpm8 = '/pnpm8/node_modules/.bin'; const pnpm8 = '/pnpm8/node_modules/.bin';
const bun1 = '/bun1';
const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === '1'; const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
if (cliType === 'npm') { if (cliType === 'npm') {
if ( if (
@@ -516,7 +534,7 @@ export function getEnvForPackageManager({
) { ) {
// Ensure that npm 7 is at the beginning of the `$PATH` // Ensure that npm 7 is at the beginning of the `$PATH`
newEnv.PATH = `${npm7}${path.delimiter}${oldPath}`; newEnv.PATH = `${npm7}${path.delimiter}${oldPath}`;
console.log('Detected `package-lock.json` generated by npm 7+...'); console.log('Detected `package-lock.json` generated by npm 7+');
} }
} else if (cliType === 'pnpm') { } else if (cliType === 'pnpm') {
if ( if (
@@ -528,7 +546,7 @@ export function getEnvForPackageManager({
// Ensure that pnpm 7 is at the beginning of the `$PATH` // Ensure that pnpm 7 is at the beginning of the `$PATH`
newEnv.PATH = `${pnpm7}${path.delimiter}${oldPath}`; newEnv.PATH = `${pnpm7}${path.delimiter}${oldPath}`;
console.log( console.log(
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7...` `Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7`
); );
} else if ( } else if (
typeof lockfileVersion === 'number' && typeof lockfileVersion === 'number' &&
@@ -539,7 +557,16 @@ export function getEnvForPackageManager({
// Ensure that pnpm 8 is at the beginning of the `$PATH` // Ensure that pnpm 8 is at the beginning of the `$PATH`
newEnv.PATH = `${pnpm8}${path.delimiter}${oldPath}`; newEnv.PATH = `${pnpm8}${path.delimiter}${oldPath}`;
console.log( console.log(
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8...` `Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8`
);
}
} else if (cliType === 'bun') {
if (!oldPath.includes(bun1) && !corepackEnabled) {
// Ensure that Bun 1 is at the beginning of the `$PATH`
newEnv.PATH = `${bun1}${path.delimiter}${oldPath}`;
console.log('Detected `bun.lockb` generated by Bun');
console.warn(
'Warning: Bun is used as a package manager at build time only, not at runtime with Functions'
); );
} }
} else { } else {
@@ -548,7 +575,6 @@ export function getEnvForPackageManager({
newEnv.YARN_NODE_LINKER = 'node-modules'; newEnv.YARN_NODE_LINKER = 'node-modules';
} }
} }
return newEnv; return newEnv;
} }
@@ -614,6 +640,8 @@ export async function runPackageJsonScript(
opts.prettyCommand = `npm run ${scriptName}`; opts.prettyCommand = `npm run ${scriptName}`;
} else if (cliType === 'pnpm') { } else if (cliType === 'pnpm') {
opts.prettyCommand = `pnpm run ${scriptName}`; opts.prettyCommand = `pnpm run ${scriptName}`;
} else if (cliType === 'bun') {
opts.prettyCommand = `bun run ${scriptName}`;
} else { } else {
opts.prettyCommand = `yarn run ${scriptName}`; opts.prettyCommand = `yarn run ${scriptName}`;
} }

View File

@@ -1,4 +1,4 @@
import { File } from './types'; import type { File, HasField } from './types';
import { Lambda } from './lambda'; import { Lambda } from './lambda';
interface PrerenderOptions { interface PrerenderOptions {
@@ -12,6 +12,8 @@ interface PrerenderOptions {
initialStatus?: number; initialStatus?: number;
passQuery?: boolean; passQuery?: boolean;
sourcePath?: string; sourcePath?: string;
experimentalBypassFor?: HasField;
experimentalStreamingLambdaPath?: string;
} }
export class Prerender { export class Prerender {
@@ -26,6 +28,8 @@ export class Prerender {
public initialStatus?: number; public initialStatus?: number;
public passQuery?: boolean; public passQuery?: boolean;
public sourcePath?: string; public sourcePath?: string;
public experimentalBypassFor?: HasField;
public experimentalStreamingLambdaPath?: string;
constructor({ constructor({
expiration, expiration,
@@ -38,6 +42,8 @@ export class Prerender {
initialStatus, initialStatus,
passQuery, passQuery,
sourcePath, sourcePath,
experimentalBypassFor,
experimentalStreamingLambdaPath,
}: PrerenderOptions) { }: PrerenderOptions) {
this.type = 'Prerender'; this.type = 'Prerender';
this.expiration = expiration; this.expiration = expiration;
@@ -86,6 +92,26 @@ export class Prerender {
); );
} }
if (experimentalBypassFor !== undefined) {
if (
!Array.isArray(experimentalBypassFor) ||
experimentalBypassFor.some(
field =>
typeof field !== 'object' ||
// host doesn't need a key
(field.type !== 'host' && typeof field.key !== 'string') ||
typeof field.type !== 'string' ||
(field.value !== undefined && typeof field.value !== 'string')
)
) {
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') { if (typeof fallback === 'undefined') {
throw new Error( throw new Error(
'The `fallback` argument for `Prerender` needs to be a `FileBlob`, `FileFsRef`, `FileRef`, or null.' 'The `fallback` argument for `Prerender` needs to be a `FileBlob`, `FileFsRef`, `FileRef`, or null.'
@@ -130,5 +156,14 @@ export class Prerender {
} }
this.allowQuery = allowQuery; this.allowQuery = allowQuery;
} }
if (experimentalStreamingLambdaPath !== undefined) {
if (typeof experimentalStreamingLambdaPath !== 'string') {
throw new Error(
'The `experimentalStreamingLambdaPath` argument for `Prerender` must be a string.'
);
}
this.experimentalStreamingLambdaPath = experimentalStreamingLambdaPath;
}
} }
} }

View File

@@ -45,6 +45,18 @@ export interface Config {
[key: string]: unknown; [key: string]: unknown;
} }
export type HasField = Array<
| {
type: 'host';
value: string;
}
| {
type: 'header' | 'cookie' | 'query';
key: string;
value?: string;
}
>;
export interface Meta { export interface Meta {
isDev?: boolean; isDev?: boolean;
devCacheDir?: string; devCacheDir?: string;

View File

@@ -0,0 +1,2 @@
.vercel
public

View File

@@ -0,0 +1,8 @@
import { mkdir, rm, writeFile } from 'node:fs/promises'
import { say } from 'cowsay'
const text = say({ text: `bun version: ${process.versions.bun}` })
const content = say({ text })
await rm('./public', { recursive: true, force: true })
await mkdir('./public', { recursive: true })
await writeFile('./public/index.txt', content)

Binary file not shown.

View File

@@ -0,0 +1,9 @@
{
"private": true,
"scripts": {
"build": "bun build.js"
},
"dependencies": {
"cowsay": "1.5.0"
}
}

View File

@@ -0,0 +1,8 @@
{
"probes": [
{
"path": "/",
"mustContain": "bun version: 1"
}
]
}

View File

@@ -133,6 +133,22 @@ describe('Test `getEnvForPackageManager()`', () => {
PATH: `/pnpm7/node_modules/.bin${delimiter}foo`, PATH: `/pnpm7/node_modules/.bin${delimiter}foo`,
}, },
}, },
{
name: 'should set path if bun v1 is detected',
args: {
cliType: 'bun',
nodeVersion: { major: 18, range: '18.x', runtime: 'nodejs18.x' },
lockfileVersion: 0,
env: {
FOO: 'bar',
PATH: '/usr/local/bin',
},
},
want: {
FOO: 'bar',
PATH: `/bun1${delimiter}/usr/local/bin`,
},
},
{ {
name: 'should not set pnpm path if corepack is enabled', name: 'should not set pnpm path if corepack is enabled',
args: { args: {

View File

@@ -344,6 +344,70 @@ it('should support initialHeaders and initialStatus correctly', async () => {
}); });
}); });
it('should support experimentalBypassFor correctly', async () => {
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
experimentalBypassFor: [{ type: 'header', key: 'Next-Action' }],
});
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
experimentalBypassFor: [
{ type: 'header', key: 'Next-Action' },
{
type: 'cookie',
key: '__prerender_bypass',
value: 'some-long-bypass-token-to-make-it-work',
},
],
});
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
experimentalBypassFor: [{ type: 'query', key: 'bypass', value: '1' }],
});
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
experimentalBypassFor: [{ type: 'host', value: 'vercel.com' }],
});
expect(() => {
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
// @ts-expect-error: testing invalid args
experimentalBypassFor: 'foo',
});
}).toThrowError(
'The `experimentalBypassFor` argument for `Prerender` must be Array of objects with fields `type`, `key` and optionally `value`.'
);
expect(() => {
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
// @ts-expect-error: testing invalid args
experimentalBypassFor: [{ type: 'header', value: { foo: 'bar' } }],
});
}).toThrowError(
'The `experimentalBypassFor` argument for `Prerender` must be Array of objects with fields `type`, `key` and optionally `value`.'
);
});
it('should support passQuery correctly', async () => { it('should support passQuery correctly', async () => {
new Prerender({ new Prerender({
expiration: 1, expiration: 1,
@@ -387,6 +451,42 @@ it('should support passQuery correctly', async () => {
); );
}); });
it('should support experimentalStreamingLambdaPath correctly', async () => {
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
experimentalStreamingLambdaPath: undefined,
});
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
experimentalStreamingLambdaPath: '/some/path/to/lambda',
});
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
});
expect(() => {
new Prerender({
expiration: 1,
fallback: null,
group: 1,
bypassToken: 'some-long-bypass-token-to-make-it-work',
// @ts-expect-error testing invalid field
experimentalStreamingLambdaPath: 1,
});
}).toThrowError(
`The \`experimentalStreamingLambdaPath\` argument for \`Prerender\` must be a string.`
);
});
it('should support require by path for legacy builders', () => { it('should support require by path for legacy builders', () => {
const index = require('../'); const index = require('../');
@@ -440,6 +540,15 @@ it(
ms('1m') ms('1m')
); );
it('should return cliType bun and correct lock file for bun v1', async () => {
const fixture = path.join(__dirname, 'fixtures', '30-bun-v1');
const result = await scanParentDirs(fixture);
expect(result.cliType).toEqual('bun');
expect(result.lockfileVersion).toEqual(0);
expect(result.lockfilePath).toEqual(path.join(fixture, 'bun.lockb'));
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
});
it('should return lockfileVersion 2 with npm7', async () => { it('should return lockfileVersion 2 with npm7', async () => {
const fixture = path.join(__dirname, 'fixtures', '20-npm-7'); const fixture = path.join(__dirname, 'fixtures', '20-npm-7');
const result = await scanParentDirs(fixture); const result = await scanParentDirs(fixture);

View File

@@ -1,5 +1,25 @@
# vercel # vercel
## 32.2.1
### Patch Changes
- Update @vercel/fun@1.1.0 ([#10477](https://github.com/vercel/vercel/pull/10477))
- [node] upgrade edge-runtime ([#10451](https://github.com/vercel/vercel/pull/10451))
- Updated dependencies [[`6784e7751`](https://github.com/vercel/vercel/commit/6784e77516ba180a691e3c48323b32bb4506d7b6), [`a8ad17626`](https://github.com/vercel/vercel/commit/a8ad176262ef822860ce338927e6f959961d2d32), [`0ee089a50`](https://github.com/vercel/vercel/commit/0ee089a501ebb78901c4afe1658e794917998f8f), [`f15cba614`](https://github.com/vercel/vercel/commit/f15cba6148a0cdb6975db7724775c35ab7d929b2), [`b265e13d4`](https://github.com/vercel/vercel/commit/b265e13d40d541b77148fa79ac60b4c4dd10974c), [`50e04dd85`](https://github.com/vercel/vercel/commit/50e04dd8584664c842a86c15d92d654f4ea8dcbb), [`45b73c7e8`](https://github.com/vercel/vercel/commit/45b73c7e86458564dc0bab007f6f6365c4c4ab5d), [`a732d30c8`](https://github.com/vercel/vercel/commit/a732d30c8409f96f59ea5406e974a6c4186cc130), [`9d64312aa`](https://github.com/vercel/vercel/commit/9d64312aaaa875a4e193b7602c50e5dc68979aad), [`6baefc825`](https://github.com/vercel/vercel/commit/6baefc825ad7cfc3a5edce31cb4244721452f753), [`989f0d813`](https://github.com/vercel/vercel/commit/989f0d813910d8d67ed355de93018f1dcd91b6ba), [`d8bc570f6`](https://github.com/vercel/vercel/commit/d8bc570f604950d97156d4f33c8accecf3b3b28f)]:
- @vercel/go@3.0.1
- @vercel/redwood@2.0.2
- @vercel/remix-builder@2.0.4
- @vercel/hydrogen@1.0.1
- @vercel/static-build@2.0.5
- @vercel/build-utils@7.2.0
- @vercel/next@4.0.3
- @vercel/node@3.0.5
- @vercel/python@4.0.1
- @vercel/ruby@2.0.2
## 32.2.0 ## 32.2.0
### Minor Changes ### Minor Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "vercel", "name": "vercel",
"version": "32.2.0", "version": "32.2.1",
"preferGlobal": true, "preferGlobal": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"description": "The command-line interface for Vercel", "description": "The command-line interface for Vercel",
@@ -31,20 +31,20 @@
"node": ">= 16" "node": ">= 16"
}, },
"dependencies": { "dependencies": {
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/go": "3.0.0", "@vercel/go": "3.0.1",
"@vercel/hydrogen": "1.0.0", "@vercel/hydrogen": "1.0.1",
"@vercel/next": "4.0.2", "@vercel/next": "4.0.3",
"@vercel/node": "3.0.4", "@vercel/node": "3.0.5",
"@vercel/python": "4.0.0", "@vercel/python": "4.0.1",
"@vercel/redwood": "2.0.1", "@vercel/redwood": "2.0.2",
"@vercel/remix-builder": "2.0.3", "@vercel/remix-builder": "2.0.4",
"@vercel/ruby": "2.0.1", "@vercel/ruby": "2.0.2",
"@vercel/static-build": "2.0.4" "@vercel/static-build": "2.0.5"
}, },
"devDependencies": { "devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5", "@alex_neo/jest-expect-message": "1.0.5",
"@edge-runtime/node-utils": "2.2.0", "@edge-runtime/node-utils": "2.2.1",
"@next/env": "11.1.2", "@next/env": "11.1.2",
"@sentry/node": "5.5.0", "@sentry/node": "5.5.0",
"@sindresorhus/slugify": "0.11.0", "@sindresorhus/slugify": "0.11.0",
@@ -86,12 +86,12 @@
"@types/yauzl-promise": "2.1.0", "@types/yauzl-promise": "2.1.0",
"@vercel-internals/constants": "1.0.4", "@vercel-internals/constants": "1.0.4",
"@vercel-internals/get-package-json": "1.0.0", "@vercel-internals/get-package-json": "1.0.0",
"@vercel-internals/types": "1.0.9", "@vercel-internals/types": "1.0.10",
"@vercel/client": "13.0.2", "@vercel/client": "13.0.3",
"@vercel/error-utils": "2.0.1", "@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.1", "@vercel/frameworks": "2.0.1",
"@vercel/fs-detectors": "5.0.2", "@vercel/fs-detectors": "5.0.2",
"@vercel/fun": "1.0.4", "@vercel/fun": "1.1.0",
"@vercel/ncc": "0.24.0", "@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "3.0.0", "@vercel/routing-utils": "3.0.0",
"@zeit/source-map-support": "0.6.2", "@zeit/source-map-support": "0.6.2",

View File

@@ -1,5 +1,12 @@
# @vercel/client # @vercel/client
## 13.0.3
### Patch Changes
- Updated dependencies [[`50e04dd85`](https://github.com/vercel/vercel/commit/50e04dd8584664c842a86c15d92d654f4ea8dcbb), [`45b73c7e8`](https://github.com/vercel/vercel/commit/45b73c7e86458564dc0bab007f6f6365c4c4ab5d), [`d8bc570f6`](https://github.com/vercel/vercel/commit/d8bc570f604950d97156d4f33c8accecf3b3b28f)]:
- @vercel/build-utils@7.2.0
## 13.0.2 ## 13.0.2
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/client", "name": "@vercel/client",
"version": "13.0.2", "version": "13.0.3",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
"homepage": "https://vercel.com", "homepage": "https://vercel.com",
@@ -36,7 +36,7 @@
"typescript": "4.9.5" "typescript": "4.9.5"
}, },
"dependencies": { "dependencies": {
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/routing-utils": "3.0.0", "@vercel/routing-utils": "3.0.0",
"@zeit/fetch": "5.2.0", "@zeit/fetch": "5.2.0",
"async-retry": "1.2.3", "async-retry": "1.2.3",

View File

@@ -1,5 +1,11 @@
# @vercel/edge # @vercel/edge
## 1.0.2
### Patch Changes
- [node] upgrade edge-runtime ([#10451](https://github.com/vercel/vercel/pull/10451))
## 1.0.1 ## 1.0.1
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/edge", "name": "@vercel/edge",
"version": "1.0.1", "version": "1.0.2",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/index.mjs", "module": "dist/index.mjs",
@@ -21,7 +21,7 @@
"build:docs": "typedoc && node scripts/fix-links.js && prettier --write docs/**/*.md docs/*.md" "build:docs": "typedoc && node scripts/fix-links.js && prettier --write docs/**/*.md docs/*.md"
}, },
"devDependencies": { "devDependencies": {
"@edge-runtime/jest-environment": "2.3.0", "@edge-runtime/jest-environment": "2.3.1",
"@types/jest": "27.4.1", "@types/jest": "27.4.1",
"jest-junit": "16.0.0", "jest-junit": "16.0.0",
"ts-node": "8.9.1", "ts-node": "8.9.1",

View File

@@ -36,7 +36,7 @@
"@types/minimatch": "3.0.5", "@types/minimatch": "3.0.5",
"@types/node": "14.18.33", "@types/node": "14.18.33",
"@types/semver": "7.3.10", "@types/semver": "7.3.10",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"jest-junit": "16.0.0", "jest-junit": "16.0.0",
"typescript": "4.9.5" "typescript": "4.9.5"
} }

View File

@@ -1,5 +1,13 @@
# @vercel/gatsby-plugin-vercel-builder # @vercel/gatsby-plugin-vercel-builder
## 2.0.5
### Patch Changes
- Updated dependencies [[`50e04dd85`](https://github.com/vercel/vercel/commit/50e04dd8584664c842a86c15d92d654f4ea8dcbb), [`45b73c7e8`](https://github.com/vercel/vercel/commit/45b73c7e86458564dc0bab007f6f6365c4c4ab5d), [`9d64312aa`](https://github.com/vercel/vercel/commit/9d64312aaaa875a4e193b7602c50e5dc68979aad), [`d8bc570f6`](https://github.com/vercel/vercel/commit/d8bc570f604950d97156d4f33c8accecf3b3b28f)]:
- @vercel/build-utils@7.2.0
- @vercel/node@3.0.5
## 2.0.4 ## 2.0.4
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/gatsby-plugin-vercel-builder", "name": "@vercel/gatsby-plugin-vercel-builder",
"version": "2.0.4", "version": "2.0.5",
"main": "dist/index.js", "main": "dist/index.js",
"files": [ "files": [
"dist", "dist",
@@ -20,8 +20,8 @@
}, },
"dependencies": { "dependencies": {
"@sinclair/typebox": "0.25.24", "@sinclair/typebox": "0.25.24",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/node": "3.0.4", "@vercel/node": "3.0.5",
"@vercel/routing-utils": "3.0.0", "@vercel/routing-utils": "3.0.0",
"esbuild": "0.14.47", "esbuild": "0.14.47",
"etag": "1.8.1", "etag": "1.8.1",

View File

@@ -1,5 +1,11 @@
# @vercel/go # @vercel/go
## 3.0.1
### Patch Changes
- Update to esbuild script ([#10468](https://github.com/vercel/vercel/pull/10468))
## 3.0.0 ## 3.0.0
### Major Changes ### Major Changes

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env node
const fs = require('fs-extra');
const execa = require('execa');
const { join } = require('path');
async function main() {
const outDir = join(__dirname, 'dist');
// Start fresh
await fs.remove(outDir);
// Build with `ncc`
await execa(
'ncc',
['build', 'index.ts', '-e', '@vercel/build-utils', '-o', outDir],
{
stdio: 'inherit',
}
);
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/go", "name": "@vercel/go",
"version": "3.0.0", "version": "3.0.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index", "main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go", "homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
@@ -10,32 +10,33 @@
"directory": "packages/go" "directory": "packages/go"
}, },
"scripts": { "scripts": {
"build": "node build", "build": "node ../../utils/build-builder.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail", "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-e2e": "pnpm test" "test-e2e": "pnpm test"
}, },
"files": [ "files": [
"dist" "dist",
"*.go"
], ],
"devDependencies": { "devDependencies": {
"@tootallnate/once": "1.1.2", "@tootallnate/once": "1.1.2",
"@types/async-retry": "1.4.2", "@types/async-retry": "1.4.5",
"@types/execa": "^0.9.0", "@types/execa": "^0.9.0",
"@types/fs-extra": "^5.0.5", "@types/fs-extra": "^5.0.5",
"@types/jest": "28.1.6", "@types/jest": "28.1.6",
"@types/node": "14.18.33", "@types/node": "14.18.33",
"@types/node-fetch": "^2.3.0", "@types/node-fetch": "^2.3.0",
"@types/tar": "^4.0.0", "@types/tar": "6.1.5",
"@types/yauzl-promise": "2.1.0", "@types/yauzl-promise": "2.1.0",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/ncc": "0.24.0", "@vercel/ncc": "0.24.0",
"async-retry": "1.3.1", "async-retry": "1.3.3",
"execa": "^1.0.0", "execa": "^1.0.0",
"fs-extra": "^7.0.0", "fs-extra": "^7.0.0",
"jest-junit": "16.0.0", "jest-junit": "16.0.0",
"node-fetch": "^2.2.1", "node-fetch": "^2.2.1",
"string-argv": "0.3.1", "string-argv": "0.3.1",
"tar": "4.4.6", "tar": "6.2.0",
"typescript": "4.3.4", "typescript": "4.3.4",
"xdg-app-paths": "5.1.0", "xdg-app-paths": "5.1.0",
"yauzl-promise": "2.1.3" "yauzl-promise": "2.1.3"

View File

@@ -108,7 +108,7 @@ export async function getAnalyzedEntrypoint({
const isAnalyzeExist = await pathExists(bin); const isAnalyzeExist = await pathExists(bin);
if (!isAnalyzeExist) { if (!isAnalyzeExist) {
debug(`Building analyze bin: ${bin}`); debug(`Building analyze bin: ${bin}`);
const src = join(__dirname, 'util', 'analyze.go'); const src = join(__dirname, '../analyze.go');
let go; let go;
const createOpts = { const createOpts = {
modulePath, modulePath,

View File

@@ -621,7 +621,7 @@ async function copyDevServer(
functionName: string, functionName: string,
dest: string dest: string
): Promise<void> { ): Promise<void> {
const data = await readFile(join(__dirname, 'dev-server.go'), 'utf8'); const data = await readFile(join(__dirname, '../dev-server.go'), 'utf8');
// Populate the handler function name // Populate the handler function name
const patched = data.replace('__HANDLER_FUNC_NAME', functionName); const patched = data.replace('__HANDLER_FUNC_NAME', functionName);
@@ -634,7 +634,10 @@ async function writeEntrypoint(
goPackageName: string, goPackageName: string,
goFuncName: string goFuncName: string
) { ) {
const modMainGoContents = await readFile(join(__dirname, 'main.go'), 'utf8'); const modMainGoContents = await readFile(
join(__dirname, '../main.go'),
'utf8'
);
const mainModGoContents = modMainGoContents const mainModGoContents = modMainGoContents
.replace('__VC_HANDLER_PACKAGE_NAME', goPackageName) .replace('__VC_HANDLER_PACKAGE_NAME', goPackageName)
.replace('__VC_HANDLER_FUNC_NAME', goFuncName); .replace('__VC_HANDLER_FUNC_NAME', goFuncName);

View File

@@ -1,4 +1,4 @@
import { getNewHandlerFunctionName } from '../index'; import { getNewHandlerFunctionName } from '../src/index';
describe('getNewHandlerFunctionName', function () { describe('getNewHandlerFunctionName', function () {
it('does nothing with empty original function name', async () => { it('does nothing with empty original function name', async () => {

View File

@@ -11,8 +11,10 @@
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noImplicitThis": false, "noImplicitThis": false,
"outDir": "./dist",
"types": ["node", "jest"], "types": ["node", "jest"],
"strict": true, "strict": true,
"target": "ES2021" "target": "ES2021"
} },
"include": ["src/**/*"]
} }

View File

@@ -1,5 +1,11 @@
# @vercel/hydrogen # @vercel/hydrogen
## 1.0.1
### Patch Changes
- Use `build-builder.mjs` script to bundle, and remove types and source maps ([#10480](https://github.com/vercel/vercel/pull/10480))
## 1.0.0 ## 1.0.0
### Major Changes ### Major Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/hydrogen", "name": "@vercel/hydrogen",
"version": "1.0.0", "version": "1.0.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index.js", "main": "./dist/index.js",
"homepage": "https://vercel.com/docs", "homepage": "https://vercel.com/docs",
@@ -10,7 +10,7 @@
"directory": "packages/hydrogen" "directory": "packages/hydrogen"
}, },
"scripts": { "scripts": {
"build": "node ../../utils/build.mjs", "build": "node ../../utils/build-builder.mjs",
"test-e2e": "pnpm test test/test.js", "test-e2e": "pnpm test test/test.js",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand" "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand"
}, },
@@ -18,14 +18,16 @@
"dist", "dist",
"edge-entry.js" "edge-entry.js"
], ],
"dependencies": {
"@vercel/static-config": "3.0.0",
"ts-morph": "12.0.0"
},
"devDependencies": { "devDependencies": {
"@types/jest": "27.5.1", "@types/jest": "27.5.1",
"@types/node": "14.18.33", "@types/node": "14.18.33",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/static-config": "3.0.0",
"execa": "3.2.0", "execa": "3.2.0",
"fs-extra": "11.1.0", "fs-extra": "11.1.0",
"jest-junit": "16.0.0", "jest-junit": "16.0.0"
"ts-morph": "12.0.0"
} }
} }

View File

@@ -1,7 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": true, "declaration": false,
"emitDeclarationOnly": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["ES2021"], "lib": ["ES2021"],
"module": "commonjs", "module": "commonjs",
@@ -14,8 +13,7 @@
"outDir": "./dist", "outDir": "./dist",
"types": ["node", "jest"], "types": ["node", "jest"],
"strict": true, "strict": true,
"target": "ES2021", "target": "ES2021"
"sourceMap": true
}, },
"include": ["src/**/*"], "include": ["src/**/*"],
"exclude": ["node_modules"] "exclude": ["node_modules"]

View File

@@ -1,5 +1,11 @@
# @vercel/next # @vercel/next
## 4.0.3
### Patch Changes
- fix content-type for RSC prefetches ([#10487](https://github.com/vercel/vercel/pull/10487))
## 4.0.2 ## 4.0.2
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/next", "name": "@vercel/next",
"version": "4.0.2", "version": "4.0.3",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index", "main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js", "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -35,7 +35,7 @@
"@types/semver": "6.0.0", "@types/semver": "6.0.0",
"@types/text-table": "0.2.1", "@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0", "@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/nft": "0.22.5", "@vercel/nft": "0.22.5",
"@vercel/routing-utils": "3.0.0", "@vercel/routing-utils": "3.0.0",
"async-sema": "3.0.1", "async-sema": "3.0.1",

View File

@@ -45,6 +45,8 @@ import {
UnwrapPromise, UnwrapPromise,
getOperationType, getOperationType,
FunctionsConfigManifestV1, FunctionsConfigManifestV1,
RSC_CONTENT_TYPE,
RSC_PREFETCH_SUFFIX,
} from './utils'; } from './utils';
import { import {
nodeFileTrace, nodeFileTrace,
@@ -168,7 +170,6 @@ export async function serverBuild({
} }
} }
const APP_PREFETCH_SUFFIX = '.prefetch.rsc';
let appRscPrefetches: UnwrapPromise<ReturnType<typeof glob>> = {}; let appRscPrefetches: UnwrapPromise<ReturnType<typeof glob>> = {};
let appBuildTraces: UnwrapPromise<ReturnType<typeof glob>> = {}; let appBuildTraces: UnwrapPromise<ReturnType<typeof glob>> = {};
let appDir: string | null = null; let appDir: string | null = null;
@@ -176,7 +177,18 @@ export async function serverBuild({
if (appPathRoutesManifest) { if (appPathRoutesManifest) {
appDir = path.join(pagesDir, '../app'); appDir = path.join(pagesDir, '../app');
appBuildTraces = await glob('**/*.js.nft.json', appDir); appBuildTraces = await glob('**/*.js.nft.json', appDir);
appRscPrefetches = await glob(`**/*${APP_PREFETCH_SUFFIX}`, appDir); appRscPrefetches = await glob(`**/*${RSC_PREFETCH_SUFFIX}`, appDir);
const rscContentTypeHeader =
routesManifest?.rsc?.contentTypeHeader || RSC_CONTENT_TYPE;
// ensure all appRscPrefetches have a contentType since this is used by Next.js
// to determine if it's a valid response
for (const value of Object.values(appRscPrefetches)) {
if (!value.contentType) {
value.contentType = rscContentTypeHeader;
}
}
} }
const isCorrectNotFoundRoutes = semver.gte( const isCorrectNotFoundRoutes = semver.gte(
@@ -1526,7 +1538,7 @@ export async function serverBuild({
dest: path.posix.join( dest: path.posix.join(
'/', '/',
entryDirectory, entryDirectory,
'/index.prefetch.rsc' `/index${RSC_PREFETCH_SUFFIX}`
), ),
headers: { vary: rscVaryHeader }, headers: { vary: rscVaryHeader },
continue: true, continue: true,
@@ -1547,7 +1559,7 @@ export async function serverBuild({
dest: path.posix.join( dest: path.posix.join(
'/', '/',
entryDirectory, entryDirectory,
`/$1${APP_PREFETCH_SUFFIX}` `/$1${RSC_PREFETCH_SUFFIX}`
), ),
headers: { vary: rscVaryHeader }, headers: { vary: rscVaryHeader },
continue: true, continue: true,
@@ -1626,7 +1638,7 @@ export async function serverBuild({
src: path.posix.join( src: path.posix.join(
'/', '/',
entryDirectory, entryDirectory,
`/index${APP_PREFETCH_SUFFIX}` `/index${RSC_PREFETCH_SUFFIX}`
), ),
dest: path.posix.join('/', entryDirectory, '/index.rsc'), dest: path.posix.join('/', entryDirectory, '/index.rsc'),
has: [ has: [
@@ -1642,7 +1654,7 @@ export async function serverBuild({
src: `^${path.posix.join( src: `^${path.posix.join(
'/', '/',
entryDirectory, entryDirectory,
`/(.+?)${APP_PREFETCH_SUFFIX}(?:/)?$` `/(.+?)${RSC_PREFETCH_SUFFIX}(?:/)?$`
)}`, )}`,
dest: path.posix.join('/', entryDirectory, '/$1.rsc'), dest: path.posix.join('/', entryDirectory, '/$1.rsc'),
has: [ has: [

View File

@@ -48,6 +48,9 @@ export const MIB = 1024 * KIB;
export const prettyBytes = (n: number) => bytes(n, { unitSeparator: ' ' }); export const prettyBytes = (n: number) => bytes(n, { unitSeparator: ' ' });
export const RSC_CONTENT_TYPE = 'x-component';
export const RSC_PREFETCH_SUFFIX = '.prefetch.rsc';
// Identify /[param]/ in route string // Identify /[param]/ in route string
// eslint-disable-next-line no-useless-escape // eslint-disable-next-line no-useless-escape
const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/; const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/;
@@ -2158,7 +2161,7 @@ export const onPrerenderRoute =
routesManifest?.rsc?.varyHeader || routesManifest?.rsc?.varyHeader ||
'RSC, Next-Router-State-Tree, Next-Router-Prefetch'; 'RSC, Next-Router-State-Tree, Next-Router-Prefetch';
const rscContentTypeHeader = const rscContentTypeHeader =
routesManifest?.rsc?.contentTypeHeader || 'text/x-component'; routesManifest?.rsc?.contentTypeHeader || RSC_CONTENT_TYPE;
let sourcePath: string | undefined; let sourcePath: string | undefined;
if (`/${outputPathPage}` !== srcRoute && srcRoute) { if (`/${outputPathPage}` !== srcRoute && srcRoute) {

View File

@@ -44,6 +44,9 @@
"RSC": "1", "RSC": "1",
"Next-Router-Prefetch": "1" "Next-Router-Prefetch": "1"
}, },
"responseHeaders": {
"content-type":"text/x-component"
},
"mustContain": ":", "mustContain": ":",
"mustNotContain": "<html" "mustNotContain": "<html"
}, },
@@ -72,6 +75,9 @@
"headers": { "headers": {
"Next-Router-Prefetch": "1", "Next-Router-Prefetch": "1",
"RSC": "1" "RSC": "1"
},
"responseHeaders": {
"content-type":"text/x-component"
} }
}, },
{ {
@@ -99,7 +105,8 @@
"path": "/ssg", "path": "/ssg",
"status": 200, "status": 200,
"responseHeaders": { "responseHeaders": {
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url" "vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url",
"content-type":"text/x-component"
}, },
"headers": { "headers": {
"RSC": "1", "RSC": "1",

View File

@@ -1,5 +1,14 @@
# @vercel/node # @vercel/node
## 3.0.5
### Patch Changes
- [node] upgrade edge-runtime ([#10451](https://github.com/vercel/vercel/pull/10451))
- Updated dependencies [[`50e04dd85`](https://github.com/vercel/vercel/commit/50e04dd8584664c842a86c15d92d654f4ea8dcbb), [`45b73c7e8`](https://github.com/vercel/vercel/commit/45b73c7e86458564dc0bab007f6f6365c4c4ab5d), [`d8bc570f6`](https://github.com/vercel/vercel/commit/d8bc570f604950d97156d4f33c8accecf3b3b28f)]:
- @vercel/build-utils@7.2.0
## 3.0.4 ## 3.0.4
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/node", "name": "@vercel/node",
"version": "3.0.4", "version": "3.0.5",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index", "main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js", "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -19,16 +19,16 @@
"dist" "dist"
], ],
"dependencies": { "dependencies": {
"@edge-runtime/node-utils": "2.2.0", "@edge-runtime/node-utils": "2.2.1",
"@edge-runtime/primitives": "3.1.0", "@edge-runtime/primitives": "3.1.1",
"@edge-runtime/vm": "3.1.0", "@edge-runtime/vm": "3.1.1",
"@types/node": "14.18.33", "@types/node": "14.18.33",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/error-utils": "2.0.1", "@vercel/error-utils": "2.0.1",
"@vercel/static-config": "3.0.0", "@vercel/static-config": "3.0.0",
"async-listen": "3.0.0", "async-listen": "3.0.0",
"content-type": "1.0.5", "content-type": "1.0.5",
"edge-runtime": "2.5.0", "edge-runtime": "2.5.1",
"esbuild": "0.14.47", "esbuild": "0.14.47",
"exit-hook": "2.2.1", "exit-hook": "2.2.1",
"node-fetch": "2.6.9", "node-fetch": "2.6.9",

View File

@@ -1,5 +1,11 @@
# @vercel/python # @vercel/python
## 4.0.1
### Patch Changes
- Update to esbuild script ([#10470](https://github.com/vercel/vercel/pull/10470))
## 4.0.0 ## 4.0.0
### Major Changes ### Major Changes

View File

@@ -1,29 +0,0 @@
#!/usr/bin/env node
const fs = require('fs-extra');
const execa = require('execa');
const { join } = require('path');
async function main() {
const outDir = join(__dirname, 'dist');
// Start fresh
await fs.remove(outDir);
await execa(
'ncc',
[
'build',
join(__dirname, 'src/index.ts'),
'-e',
'@vercel/build-utils',
'-o',
outDir,
],
{ stdio: 'inherit' }
);
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/python", "name": "@vercel/python",
"version": "4.0.0", "version": "4.0.1",
"main": "./dist/index.js", "main": "./dist/index.js",
"license": "Apache-2.0", "license": "Apache-2.0",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python", "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -14,7 +14,7 @@
"directory": "packages/python" "directory": "packages/python"
}, },
"scripts": { "scripts": {
"build": "node build", "build": "node ../../utils/build-builder.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail", "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test test/unit.test.ts", "test-unit": "pnpm test test/unit.test.ts",
"test-e2e": "pnpm test test/integration-*" "test-e2e": "pnpm test test/integration-*"
@@ -23,7 +23,7 @@
"@types/execa": "^0.9.0", "@types/execa": "^0.9.0",
"@types/jest": "27.4.1", "@types/jest": "27.4.1",
"@types/node": "14.18.33", "@types/node": "14.18.33",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/ncc": "0.24.0", "@vercel/ncc": "0.24.0",
"execa": "^1.0.0", "execa": "^1.0.0",
"jest-junit": "16.0.0" "jest-junit": "16.0.0"

View File

@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": true, "declaration": false,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["ES2021"], "lib": ["ES2021"],
"module": "commonjs", "module": "commonjs",
@@ -15,6 +15,5 @@
"strict": true, "strict": true,
"target": "ES2021" "target": "ES2021"
}, },
"include": ["src/**/*"], "include": ["src/**/*"]
"exclude": ["node_modules"]
} }

View File

@@ -1,5 +1,11 @@
# @vercel/redwood # @vercel/redwood
## 2.0.2
### Patch Changes
- Update to esbuild script ([#10471](https://github.com/vercel/vercel/pull/10471))
## 2.0.1 ## 2.0.1
### Patch Changes ### Patch Changes

View File

@@ -1,12 +0,0 @@
const execa = require('execa');
const { remove } = require('fs-extra');
async function main() {
await remove('dist');
await execa('tsc', [], { stdio: 'inherit' });
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/redwood", "name": "@vercel/redwood",
"version": "2.0.1", "version": "2.0.2",
"main": "./dist/index.js", "main": "./dist/index.js",
"license": "Apache-2.0", "license": "Apache-2.0",
"homepage": "https://vercel.com/docs", "homepage": "https://vercel.com/docs",
@@ -13,7 +13,7 @@
"directory": "packages/redwood" "directory": "packages/redwood"
}, },
"scripts": { "scripts": {
"build": "node build.js", "build": "node ../../utils/build-builder.mjs",
"test-e2e": "pnpm test test/test.js", "test-e2e": "pnpm test test/test.js",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand", "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand",
"test-unit": "pnpm test test/prepare-cache.test.js" "test-unit": "pnpm test test/prepare-cache.test.js"
@@ -27,7 +27,7 @@
"@types/aws-lambda": "8.10.19", "@types/aws-lambda": "8.10.19",
"@types/node": "14.18.33", "@types/node": "14.18.33",
"@types/semver": "6.0.0", "@types/semver": "6.0.0",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"execa": "3.2.0", "execa": "3.2.0",
"fs-extra": "11.1.0", "fs-extra": "11.1.0",
"jest-junit": "16.0.0" "jest-junit": "16.0.0"

View File

@@ -1,5 +1,11 @@
# @vercel/remix-builder # @vercel/remix-builder
## 2.0.4
### Patch Changes
- Use `build-builder.mjs` script to bundle, and remove types and source maps ([#10479](https://github.com/vercel/vercel/pull/10479))
## 2.0.3 ## 2.0.3
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/remix-builder", "name": "@vercel/remix-builder",
"version": "2.0.3", "version": "2.0.4",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index.js", "main": "./dist/index.js",
"homepage": "https://vercel.com/docs", "homepage": "https://vercel.com/docs",
@@ -10,7 +10,7 @@
"directory": "packages/remix" "directory": "packages/remix"
}, },
"scripts": { "scripts": {
"build": "node ../../utils/build.mjs", "build": "node ../../utils/build-builder.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand", "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand",
"test-unit": "pnpm test test/unit.*test.*", "test-unit": "pnpm test test/unit.*test.*",
"test-e2e": "pnpm test test/integration.test.ts" "test-e2e": "pnpm test test/integration.test.ts"
@@ -20,11 +20,8 @@
"defaults" "defaults"
], ],
"dependencies": { "dependencies": {
"@vercel/build-utils": "7.1.1",
"@vercel/nft": "0.22.5", "@vercel/nft": "0.22.5",
"@vercel/static-config": "3.0.0", "@vercel/static-config": "3.0.0",
"path-to-regexp": "6.2.1",
"semver": "7.5.2",
"ts-morph": "12.0.0" "ts-morph": "12.0.0"
}, },
"devDependencies": { "devDependencies": {
@@ -32,6 +29,9 @@
"@types/jest": "27.5.1", "@types/jest": "27.5.1",
"@types/node": "14.18.33", "@types/node": "14.18.33",
"@types/semver": "7.3.13", "@types/semver": "7.3.13",
"jest-junit": "16.0.0" "@vercel/build-utils": "7.2.0",
"jest-junit": "16.0.0",
"path-to-regexp": "6.2.1",
"semver": "7.5.2"
} }
} }

View File

@@ -1,6 +1,6 @@
import { glob } from '@vercel/build-utils'; import { glob } from '@vercel/build-utils';
import { dirname, join, relative } from 'path'; import { dirname, join, relative } from 'path';
import { _require, chdirAndReadConfig } from './utils'; import { require_, chdirAndReadConfig } from './utils';
import type { PrepareCache } from '@vercel/build-utils'; import type { PrepareCache } from '@vercel/build-utils';
export const prepareCache: PrepareCache = async ({ export const prepareCache: PrepareCache = async ({
@@ -13,7 +13,7 @@ export const prepareCache: PrepareCache = async ({
const entrypointFsDirname = join(workPath, mountpoint); const entrypointFsDirname = join(workPath, mountpoint);
const packageJsonPath = join(entrypointFsDirname, 'package.json'); const packageJsonPath = join(entrypointFsDirname, 'package.json');
const remixRunDevPath = dirname( const remixRunDevPath = dirname(
_require.resolve('@remix-run/dev/package.json', { require_.resolve('@remix-run/dev/package.json', {
paths: [entrypointFsDirname], paths: [entrypointFsDirname],
}) })
); );

View File

@@ -5,6 +5,7 @@ import { basename, dirname, join, relative, resolve, sep } from 'path';
import { pathToRegexp, Key } from 'path-to-regexp'; import { pathToRegexp, Key } from 'path-to-regexp';
import { debug, spawnAsync } from '@vercel/build-utils'; import { debug, spawnAsync } from '@vercel/build-utils';
import { walkParentDirs } from '@vercel/build-utils'; import { walkParentDirs } from '@vercel/build-utils';
import { createRequire } from 'module';
import type { import type {
ConfigRoute, ConfigRoute,
RouteManifest, RouteManifest,
@@ -16,7 +17,7 @@ import type {
SpawnOptionsExtended, SpawnOptionsExtended,
} from '@vercel/build-utils/dist/fs/run-user-scripts'; } from '@vercel/build-utils/dist/fs/run-user-scripts';
export const _require: typeof require = eval('require'); export const require_ = createRequire(__filename);
export interface ResolvedNodeRouteConfig { export interface ResolvedNodeRouteConfig {
runtime: 'nodejs'; runtime: 'nodejs';
@@ -321,7 +322,7 @@ export async function ensureResolvable(
pkgName: string pkgName: string
): Promise<string> { ): Promise<string> {
try { try {
const resolvedPkgPath = _require.resolve(`${pkgName}/package.json`, { const resolvedPkgPath = require_.resolve(`${pkgName}/package.json`, {
paths: [start], paths: [start],
}); });
const resolvedPath = dirname(resolvedPkgPath); const resolvedPath = dirname(resolvedPkgPath);
@@ -412,7 +413,7 @@ export function isESM(path: string): boolean {
// Figure out if the `remix.config` file is using ESM syntax // Figure out if the `remix.config` file is using ESM syntax
let isESM = false; let isESM = false;
try { try {
_require(path); require_(path);
} catch (err: any) { } catch (err: any) {
isESM = err.code === 'ERR_REQUIRE_ESM'; isESM = err.code === 'ERR_REQUIRE_ESM';
} }

View File

@@ -1,7 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": true, "declaration": false,
"emitDeclarationOnly": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["ES2021"], "lib": ["ES2021"],
"module": "commonjs", "module": "commonjs",
@@ -15,8 +14,7 @@
"types": ["node", "jest"], "types": ["node", "jest"],
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
"target": "ES2021", "target": "ES2021"
"sourceMap": true
}, },
"include": ["src/**/*"], "include": ["src/**/*"],
"exclude": ["node_modules"] "exclude": ["node_modules"]

View File

@@ -1,5 +1,11 @@
# @vercel/ruby # @vercel/ruby
## 2.0.2
### Patch Changes
- Update to esbuild script ([#10472](https://github.com/vercel/vercel/pull/10472))
## 2.0.1 ## 2.0.1
### Patch Changes ### Patch Changes

View File

@@ -1,29 +0,0 @@
#!/usr/bin/env node
const fs = require('fs-extra');
const execa = require('execa');
const { join } = require('path');
async function main() {
const outDir = join(__dirname, 'dist');
// Start fresh
await fs.remove(outDir);
await execa(
'ncc',
[
'build',
join(__dirname, 'index.ts'),
'-e',
'@vercel/build-utils',
'-o',
outDir,
],
{ stdio: 'inherit' }
);
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -1,7 +1,7 @@
{ {
"name": "@vercel/ruby", "name": "@vercel/ruby",
"author": "Nathan Cahill <nathan@nathancahill.com>", "author": "Nathan Cahill <nathan@nathancahill.com>",
"version": "2.0.1", "version": "2.0.2",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index", "main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby", "homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
@@ -15,14 +15,14 @@
"directory": "packages/ruby" "directory": "packages/ruby"
}, },
"scripts": { "scripts": {
"build": "node build", "build": "node ../../utils/build-builder.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail", "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-e2e": "pnpm test" "test-e2e": "pnpm test"
}, },
"devDependencies": { "devDependencies": {
"@types/fs-extra": "8.0.0", "@types/fs-extra": "8.0.0",
"@types/semver": "6.0.0", "@types/semver": "6.0.0",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/ncc": "0.24.0", "@vercel/ncc": "0.24.0",
"execa": "2.0.4", "execa": "2.0.4",
"fs-extra": "^7.0.1", "fs-extra": "^7.0.1",

View File

@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": true, "declaration": false,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["ES2021"], "lib": ["ES2021"],
"module": "commonjs", "module": "commonjs",
@@ -13,5 +13,6 @@
"outDir": "dist", "outDir": "dist",
"strict": true, "strict": true,
"target": "ES2021" "target": "ES2021"
} },
"include": ["src/**/*"]
} }

View File

@@ -1,5 +1,14 @@
# @vercel/static-build # @vercel/static-build
## 2.0.5
### Patch Changes
- Build package using "esbuild" ([#10462](https://github.com/vercel/vercel/pull/10462))
- Updated dependencies []:
- @vercel/gatsby-plugin-vercel-builder@2.0.5
## 2.0.4 ## 2.0.4
### Patch Changes ### Patch Changes

View File

@@ -1,19 +0,0 @@
const execa = require('execa');
const { remove } = require('fs-extra');
async function main() {
await remove('dist');
await execa('tsc', [], { stdio: 'inherit' });
await execa(
'ncc',
['build', 'src/index.ts', '-e', '@vercel/build-utils', '-o', 'dist'],
{ stdio: 'inherit' }
);
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/static-build", "name": "@vercel/static-build",
"version": "2.0.4", "version": "2.0.5",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./dist/index", "main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step", "homepage": "https://vercel.com/docs/build-step",
@@ -13,14 +13,14 @@
"directory": "packages/static-build" "directory": "packages/static-build"
}, },
"scripts": { "scripts": {
"build": "node build", "build": "node ../../utils/build-builder.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand", "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand",
"test-unit": "pnpm test test/build.test.ts test/gatsby.test.ts test/prepare-cache.test.ts", "test-unit": "pnpm test test/build.test.ts test/gatsby.test.ts test/prepare-cache.test.ts",
"test-e2e": "pnpm test test/integration-*.test.js" "test-e2e": "pnpm test test/integration-*.test.js"
}, },
"dependencies": { "dependencies": {
"@vercel/gatsby-plugin-vercel-analytics": "1.0.10", "@vercel/gatsby-plugin-vercel-analytics": "1.0.10",
"@vercel/gatsby-plugin-vercel-builder": "2.0.4" "@vercel/gatsby-plugin-vercel-builder": "2.0.5"
}, },
"devDependencies": { "devDependencies": {
"@types/aws-lambda": "8.10.64", "@types/aws-lambda": "8.10.64",
@@ -32,7 +32,7 @@
"@types/node-fetch": "2.5.4", "@types/node-fetch": "2.5.4",
"@types/promise-timeout": "1.3.0", "@types/promise-timeout": "1.3.0",
"@types/semver": "7.3.13", "@types/semver": "7.3.13",
"@vercel/build-utils": "7.1.1", "@vercel/build-utils": "7.2.0",
"@vercel/error-utils": "2.0.1", "@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.1", "@vercel/frameworks": "2.0.1",
"@vercel/fs-detectors": "5.0.2", "@vercel/fs-detectors": "5.0.2",

View File

@@ -2,6 +2,7 @@ import { isErrnoException } from '@vercel/error-utils';
import fs from 'fs-extra'; import fs from 'fs-extra';
import * as path from 'path'; import * as path from 'path';
import semver from 'semver'; import semver from 'semver';
import { createRequire } from 'module';
import { fileExists } from './_shared'; import { fileExists } from './_shared';
const PLUGINS = [ const PLUGINS = [
@@ -13,14 +14,14 @@ type PluginName = typeof PLUGINS[number];
const GATSBY_CONFIG_FILE = 'gatsby-config'; const GATSBY_CONFIG_FILE = 'gatsby-config';
const GATSBY_NODE_FILE = 'gatsby-node'; const GATSBY_NODE_FILE = 'gatsby-node';
const require_ = createRequire(__filename);
const PLUGIN_PATHS: Record<PluginName, string> = { const PLUGIN_PATHS: Record<PluginName, string> = {
'@vercel/gatsby-plugin-vercel-analytics': path.dirname( '@vercel/gatsby-plugin-vercel-analytics': path.dirname(
eval('require').resolve( require_.resolve(`@vercel/gatsby-plugin-vercel-analytics/package.json`)
`@vercel/gatsby-plugin-vercel-analytics/package.json`
)
), ),
'@vercel/gatsby-plugin-vercel-builder': path.dirname( '@vercel/gatsby-plugin-vercel-builder': path.dirname(
eval('require').resolve(`@vercel/gatsby-plugin-vercel-builder/package.json`) require_.resolve(`@vercel/gatsby-plugin-vercel-builder/package.json`)
), ),
}; };

241
pnpm-lock.yaml generated
View File

@@ -186,7 +186,7 @@ importers:
specifier: 1.0.4 specifier: 1.0.4
version: link:../constants version: link:../constants
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../../packages/build-utils version: link:../../packages/build-utils
'@vercel/routing-utils': '@vercel/routing-utils':
specifier: 3.0.0 specifier: 3.0.0
@@ -313,42 +313,42 @@ importers:
packages/cli: packages/cli:
dependencies: dependencies:
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/go': '@vercel/go':
specifier: 3.0.0 specifier: 3.0.1
version: link:../go version: link:../go
'@vercel/hydrogen': '@vercel/hydrogen':
specifier: 1.0.0 specifier: 1.0.1
version: link:../hydrogen version: link:../hydrogen
'@vercel/next': '@vercel/next':
specifier: 4.0.2 specifier: 4.0.3
version: link:../next version: link:../next
'@vercel/node': '@vercel/node':
specifier: 3.0.4 specifier: 3.0.5
version: link:../node version: link:../node
'@vercel/python': '@vercel/python':
specifier: 4.0.0 specifier: 4.0.1
version: link:../python version: link:../python
'@vercel/redwood': '@vercel/redwood':
specifier: 2.0.1 specifier: 2.0.2
version: link:../redwood version: link:../redwood
'@vercel/remix-builder': '@vercel/remix-builder':
specifier: 2.0.3 specifier: 2.0.4
version: link:../remix version: link:../remix
'@vercel/ruby': '@vercel/ruby':
specifier: 2.0.1 specifier: 2.0.2
version: link:../ruby version: link:../ruby
'@vercel/static-build': '@vercel/static-build':
specifier: 2.0.4 specifier: 2.0.5
version: link:../static-build version: link:../static-build
devDependencies: devDependencies:
'@alex_neo/jest-expect-message': '@alex_neo/jest-expect-message':
specifier: 1.0.5 specifier: 1.0.5
version: 1.0.5 version: 1.0.5
'@edge-runtime/node-utils': '@edge-runtime/node-utils':
specifier: 2.2.0 specifier: 2.2.1
version: 2.2.0 version: 2.2.1
'@next/env': '@next/env':
specifier: 11.1.2 specifier: 11.1.2
version: 11.1.2 version: 11.1.2
@@ -473,10 +473,10 @@ importers:
specifier: 1.0.0 specifier: 1.0.0
version: link:../../internals/get-package-json version: link:../../internals/get-package-json
'@vercel-internals/types': '@vercel-internals/types':
specifier: 1.0.9 specifier: 1.0.10
version: link:../../internals/types version: link:../../internals/types
'@vercel/client': '@vercel/client':
specifier: 13.0.2 specifier: 13.0.3
version: link:../client version: link:../client
'@vercel/error-utils': '@vercel/error-utils':
specifier: 2.0.1 specifier: 2.0.1
@@ -488,8 +488,8 @@ importers:
specifier: 5.0.2 specifier: 5.0.2
version: link:../fs-detectors version: link:../fs-detectors
'@vercel/fun': '@vercel/fun':
specifier: 1.0.4 specifier: 1.1.0
version: 1.0.4 version: 1.1.0
'@vercel/ncc': '@vercel/ncc':
specifier: 0.24.0 specifier: 0.24.0
version: 0.24.0 version: 0.24.0
@@ -737,7 +737,7 @@ importers:
packages/client: packages/client:
dependencies: dependencies:
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/routing-utils': '@vercel/routing-utils':
specifier: 3.0.0 specifier: 3.0.0
@@ -813,8 +813,8 @@ importers:
packages/edge: packages/edge:
devDependencies: devDependencies:
'@edge-runtime/jest-environment': '@edge-runtime/jest-environment':
specifier: 2.3.0 specifier: 2.3.1
version: 2.3.0 version: 2.3.1
'@types/jest': '@types/jest':
specifier: 27.4.1 specifier: 27.4.1
version: 27.4.1 version: 27.4.1
@@ -938,7 +938,7 @@ importers:
specifier: 7.3.10 specifier: 7.3.10
version: 7.3.10 version: 7.3.10
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
jest-junit: jest-junit:
specifier: 16.0.0 specifier: 16.0.0
@@ -972,10 +972,10 @@ importers:
specifier: 0.25.24 specifier: 0.25.24
version: 0.25.24 version: 0.25.24
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/node': '@vercel/node':
specifier: 3.0.4 specifier: 3.0.5
version: link:../node version: link:../node
'@vercel/routing-utils': '@vercel/routing-utils':
specifier: 3.0.0 specifier: 3.0.0
@@ -1015,8 +1015,8 @@ importers:
specifier: 1.1.2 specifier: 1.1.2
version: 1.1.2 version: 1.1.2
'@types/async-retry': '@types/async-retry':
specifier: 1.4.2 specifier: 1.4.5
version: 1.4.2 version: 1.4.5
'@types/execa': '@types/execa':
specifier: ^0.9.0 specifier: ^0.9.0
version: 0.9.0 version: 0.9.0
@@ -1033,20 +1033,20 @@ importers:
specifier: ^2.3.0 specifier: ^2.3.0
version: 2.6.2 version: 2.6.2
'@types/tar': '@types/tar':
specifier: ^4.0.0 specifier: 6.1.5
version: 4.0.5 version: 6.1.5
'@types/yauzl-promise': '@types/yauzl-promise':
specifier: 2.1.0 specifier: 2.1.0
version: 2.1.0 version: 2.1.0
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/ncc': '@vercel/ncc':
specifier: 0.24.0 specifier: 0.24.0
version: 0.24.0 version: 0.24.0
async-retry: async-retry:
specifier: 1.3.1 specifier: 1.3.3
version: 1.3.1 version: 1.3.3
execa: execa:
specifier: ^1.0.0 specifier: ^1.0.0
version: 1.0.0 version: 1.0.0
@@ -1063,8 +1063,8 @@ importers:
specifier: 0.3.1 specifier: 0.3.1
version: 0.3.1 version: 0.3.1
tar: tar:
specifier: 4.4.6 specifier: 6.2.0
version: 4.4.6 version: 6.2.0
typescript: typescript:
specifier: 4.3.4 specifier: 4.3.4
version: 4.3.4 version: 4.3.4
@@ -1076,6 +1076,13 @@ importers:
version: 2.1.3 version: 2.1.3
packages/hydrogen: packages/hydrogen:
dependencies:
'@vercel/static-config':
specifier: 3.0.0
version: link:../static-config
ts-morph:
specifier: 12.0.0
version: 12.0.0
devDependencies: devDependencies:
'@types/jest': '@types/jest':
specifier: 27.5.1 specifier: 27.5.1
@@ -1084,11 +1091,8 @@ importers:
specifier: 14.18.33 specifier: 14.18.33
version: 14.18.33 version: 14.18.33
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/static-config':
specifier: 3.0.0
version: link:../static-config
execa: execa:
specifier: 3.2.0 specifier: 3.2.0
version: 3.2.0 version: 3.2.0
@@ -1098,9 +1102,6 @@ importers:
jest-junit: jest-junit:
specifier: 16.0.0 specifier: 16.0.0
version: 16.0.0 version: 16.0.0
ts-morph:
specifier: 12.0.0
version: 12.0.0
packages/next: packages/next:
devDependencies: devDependencies:
@@ -1144,7 +1145,7 @@ importers:
specifier: 3.2.0 specifier: 3.2.0
version: 3.2.0 version: 3.2.0
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/nft': '@vercel/nft':
specifier: 0.22.5 specifier: 0.22.5
@@ -1222,19 +1223,19 @@ importers:
packages/node: packages/node:
dependencies: dependencies:
'@edge-runtime/node-utils': '@edge-runtime/node-utils':
specifier: 2.2.0 specifier: 2.2.1
version: 2.2.0 version: 2.2.1
'@edge-runtime/primitives': '@edge-runtime/primitives':
specifier: 3.1.0 specifier: 3.1.1
version: 3.1.0 version: 3.1.1
'@edge-runtime/vm': '@edge-runtime/vm':
specifier: 3.1.0 specifier: 3.1.1
version: 3.1.0 version: 3.1.1
'@types/node': '@types/node':
specifier: 14.18.33 specifier: 14.18.33
version: 14.18.33 version: 14.18.33
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/error-utils': '@vercel/error-utils':
specifier: 2.0.1 specifier: 2.0.1
@@ -1249,8 +1250,8 @@ importers:
specifier: 1.0.5 specifier: 1.0.5
version: 1.0.5 version: 1.0.5
edge-runtime: edge-runtime:
specifier: 2.5.0 specifier: 2.5.1
version: 2.5.0 version: 2.5.1
esbuild: esbuild:
specifier: 0.14.47 specifier: 0.14.47
version: 0.14.47 version: 0.14.47
@@ -1346,7 +1347,7 @@ importers:
specifier: 14.18.33 specifier: 14.18.33
version: 14.18.33 version: 14.18.33
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/ncc': '@vercel/ncc':
specifier: 0.24.0 specifier: 0.24.0
@@ -1380,7 +1381,7 @@ importers:
specifier: 6.0.0 specifier: 6.0.0
version: 6.0.0 version: 6.0.0
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
execa: execa:
specifier: 3.2.0 specifier: 3.2.0
@@ -1394,21 +1395,12 @@ importers:
packages/remix: packages/remix:
dependencies: dependencies:
'@vercel/build-utils':
specifier: 7.1.1
version: link:../build-utils
'@vercel/nft': '@vercel/nft':
specifier: 0.22.5 specifier: 0.22.5
version: 0.22.5 version: 0.22.5
'@vercel/static-config': '@vercel/static-config':
specifier: 3.0.0 specifier: 3.0.0
version: link:../static-config version: link:../static-config
path-to-regexp:
specifier: 6.2.1
version: 6.2.1
semver:
specifier: 7.5.2
version: 7.5.2
ts-morph: ts-morph:
specifier: 12.0.0 specifier: 12.0.0
version: 12.0.0 version: 12.0.0
@@ -1425,9 +1417,18 @@ importers:
'@types/semver': '@types/semver':
specifier: 7.3.13 specifier: 7.3.13
version: 7.3.13 version: 7.3.13
'@vercel/build-utils':
specifier: 7.2.0
version: link:../build-utils
jest-junit: jest-junit:
specifier: 16.0.0 specifier: 16.0.0
version: 16.0.0 version: 16.0.0
path-to-regexp:
specifier: 6.2.1
version: 6.2.1
semver:
specifier: 7.5.2
version: 7.5.2
packages/routing-utils: packages/routing-utils:
dependencies: dependencies:
@@ -1461,7 +1462,7 @@ importers:
specifier: 6.0.0 specifier: 6.0.0
version: 6.0.0 version: 6.0.0
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/ncc': '@vercel/ncc':
specifier: 0.24.0 specifier: 0.24.0
@@ -1485,7 +1486,7 @@ importers:
specifier: 1.0.10 specifier: 1.0.10
version: link:../gatsby-plugin-vercel-analytics version: link:../gatsby-plugin-vercel-analytics
'@vercel/gatsby-plugin-vercel-builder': '@vercel/gatsby-plugin-vercel-builder':
specifier: 2.0.4 specifier: 2.0.5
version: link:../gatsby-plugin-vercel-builder version: link:../gatsby-plugin-vercel-builder
devDependencies: devDependencies:
'@types/aws-lambda': '@types/aws-lambda':
@@ -1516,7 +1517,7 @@ importers:
specifier: 7.3.13 specifier: 7.3.13
version: 7.3.13 version: 7.3.13
'@vercel/build-utils': '@vercel/build-utils':
specifier: 7.1.1 specifier: 7.2.0
version: link:../build-utils version: link:../build-utils
'@vercel/error-utils': '@vercel/error-utils':
specifier: 2.0.1 specifier: 2.0.1
@@ -3251,8 +3252,8 @@ packages:
dependencies: dependencies:
'@jridgewell/trace-mapping': 0.3.9 '@jridgewell/trace-mapping': 0.3.9
/@edge-runtime/cookies@3.4.0: /@edge-runtime/cookies@3.4.1:
resolution: {integrity: sha512-rhkTN7D8YO78lf76gdmK4FYc4Z5zQMGPABFLCWiJzeHmHgaCievF/lHEf1WO1OGZVxe1V34NYxsNTZsXwLht3Q==} resolution: {integrity: sha512-z27BvgPxI73CgSlxU/NAUf1Q/shnqi6cobHEowf6VuLdSjGR3NjI2Y5dZUIBbK2zOJVZbXcHsVzJjz8LklteFQ==}
engines: {node: '>=16'} engines: {node: '>=16'}
/@edge-runtime/format@2.2.0: /@edge-runtime/format@2.2.0:
@@ -3260,32 +3261,32 @@ packages:
engines: {node: '>=16'} engines: {node: '>=16'}
dev: false dev: false
/@edge-runtime/jest-environment@2.3.0: /@edge-runtime/jest-environment@2.3.1:
resolution: {integrity: sha512-ecjoJ6Ai/Cr/QOFpLC9nu5WC8LHnyFrnbkd8/L53q7sSmeWPKkzvjeFnaS1GLbYHPKZ1GidTsCquw6IPL1xlxA==} resolution: {integrity: sha512-ll0uJZxLO/+QwXpUAQc92lIiZEYa1fpzfjJXFmPpsvreK8bapH2IMCeThL3ilYy1QGbwUWO0WLmq6cOXiPwepA==}
engines: {node: '>=16'} engines: {node: '>=16'}
dependencies: dependencies:
'@edge-runtime/vm': 3.1.0 '@edge-runtime/vm': 3.1.1
'@jest/environment': 29.5.0 '@jest/environment': 29.5.0
'@jest/fake-timers': 29.5.0 '@jest/fake-timers': 29.5.0
jest-mock: 29.5.0 jest-mock: 29.5.0
jest-util: 29.5.0 jest-util: 29.5.0
dev: true dev: true
/@edge-runtime/node-utils@2.2.0: /@edge-runtime/node-utils@2.2.1:
resolution: {integrity: sha512-eRM3d/zwF+VczI9+YY9j0b5s/NQ6Cj6y6XY1Fb3HHdu8rCphH8Z41qjTYt4S315FUXo78GcDgnYv7GUvqQ0a8A==} resolution: {integrity: sha512-RUl/439BHKshkhSGFRlZ1kzy68wL4mn8VNKDSZr3p0tciyZ33Mjfpl+vofqnHqXRmDI6nLnZpfJvhY3D88o0pA==}
engines: {node: '>=16'} engines: {node: '>=16'}
dependencies: dependencies:
'@edge-runtime/cookies': 3.4.0 '@edge-runtime/cookies': 3.4.1
/@edge-runtime/primitives@3.1.0: /@edge-runtime/primitives@3.1.1:
resolution: {integrity: sha512-yxr1QM/lC8nrU38zxePeDqVeIjwsJ83gKGTH8YJ4CoHTv3q+6xEeqRIT+/9IPX/FApWYtnxHauhNqr6CHRj5YA==} resolution: {integrity: sha512-ROO22py+KdAfzqWZu6CtVMC4qV6mS0W1jPI51jGXE+uenyBUN7cQTWB9ReQc8Bm4cnjqmhajvpqEx3j7Y9iSOg==}
engines: {node: '>=16'} engines: {node: '>=16'}
/@edge-runtime/vm@3.1.0: /@edge-runtime/vm@3.1.1:
resolution: {integrity: sha512-Y2JZgJP+4byI17SiDeEZhvBUvJ+om7E5ll/jrS7aGRpet5qKnJSsGep6xxhMjqT/j8ulFvTMN/kdlMMy5pEKBQ==} resolution: {integrity: sha512-6NJRRG04/91qnWLZj+wZm27q6fJkTbkZdIJdo/Ig++GTxkAv8Wh/45nIcz9Xg7AzIAMpAkflFdiCrCoZ3hp1Iw==}
engines: {node: '>=16'} engines: {node: '>=16'}
dependencies: dependencies:
'@edge-runtime/primitives': 3.1.0 '@edge-runtime/primitives': 3.1.1
/@emotion/hash@0.9.0: /@emotion/hash@0.9.0:
resolution: {integrity: sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==} resolution: {integrity: sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==}
@@ -4312,7 +4313,7 @@ packages:
npmlog: 5.0.1 npmlog: 5.0.1
rimraf: 3.0.2 rimraf: 3.0.2
semver: 7.5.2 semver: 7.5.2
tar: 6.1.13 tar: 6.2.0
transitivePeerDependencies: transitivePeerDependencies:
- encoding - encoding
- supports-color - supports-color
@@ -4967,12 +4968,6 @@ packages:
/@types/async-retry@1.2.1: /@types/async-retry@1.2.1:
resolution: {integrity: sha512-yMQ6CVgICWtyFNBqJT3zqOc+TnqqEPLo4nKJNPFwcialiylil38Ie6q1ENeFTjvaLOkVim9K5LisHgAKJWidGQ==} resolution: {integrity: sha512-yMQ6CVgICWtyFNBqJT3zqOc+TnqqEPLo4nKJNPFwcialiylil38Ie6q1ENeFTjvaLOkVim9K5LisHgAKJWidGQ==}
/@types/async-retry@1.4.2:
resolution: {integrity: sha512-GUDuJURF0YiJZ+CBjNQA0+vbP/VHlJbB0sFqkzsV7EcOPRfurVonXpXKAt3w8qIjM1TEzpz6hc6POocPvHOS3w==}
dependencies:
'@types/retry': 0.12.2
dev: true
/@types/async-retry@1.4.5: /@types/async-retry@1.4.5:
resolution: {integrity: sha512-YrdjSD+yQv7h6d5Ip+PMxh3H6ZxKyQk0Ts+PvaNRInxneG9PFVZjFg77ILAN+N6qYf7g4giSJ1l+ZjQ1zeegvA==} resolution: {integrity: sha512-YrdjSD+yQv7h6d5Ip+PMxh3H6ZxKyQk0Ts+PvaNRInxneG9PFVZjFg77ILAN+N6qYf7g4giSJ1l+ZjQ1zeegvA==}
dependencies: dependencies:
@@ -5042,7 +5037,7 @@ packages:
dependencies: dependencies:
'@types/http-cache-semantics': 4.0.1 '@types/http-cache-semantics': 4.0.1
'@types/keyv': 3.1.4 '@types/keyv': 3.1.4
'@types/node': 16.18.11 '@types/node': 14.18.33
'@types/responselike': 1.0.0 '@types/responselike': 1.0.0
/@types/chance@1.1.3: /@types/chance@1.1.3:
@@ -5212,7 +5207,7 @@ packages:
resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==}
dependencies: dependencies:
'@types/minimatch': 5.1.2 '@types/minimatch': 5.1.2
'@types/node': 16.18.11 '@types/node': 14.18.33
dev: true dev: true
/@types/graceful-fs@4.1.6: /@types/graceful-fs@4.1.6:
@@ -5339,7 +5334,7 @@ packages:
/@types/keyv@3.1.4: /@types/keyv@3.1.4:
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
dependencies: dependencies:
'@types/node': 16.18.11 '@types/node': 14.18.33
/@types/load-json-file@2.0.7: /@types/load-json-file@2.0.7:
resolution: {integrity: sha512-NrH6jPlV77QCVPhAHofWeiOr77TgpKt82c2RVxSBChWBJqyY/u4ngl3CA4mcsAg/w7rNLrkR7dkObMV0ihLLXw==} resolution: {integrity: sha512-NrH6jPlV77QCVPhAHofWeiOr77TgpKt82c2RVxSBChWBJqyY/u4ngl3CA4mcsAg/w7rNLrkR7dkObMV0ihLLXw==}
@@ -5383,12 +5378,6 @@ packages:
resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
dev: true dev: true
/@types/minipass@3.3.5:
resolution: {integrity: sha512-M2BLHQdEmDmH671h0GIlOQQJrgezd1vNqq7PVj1VOsHZ2uQQb4iPiQIl0SlMdhxZPUsLIfEklmeEHXg8DJRewA==}
dependencies:
minipass: 5.0.0
dev: true
/@types/ms@0.7.30: /@types/ms@0.7.30:
resolution: {integrity: sha512-OftRLCgAzJP7vmKn9by/GVjnf4hloz/pXNOwPo0vKGAfXI7GqWXJi9N2kRar4cP5s1dGwuwcagWqO6iHBTq1Mg==} resolution: {integrity: sha512-OftRLCgAzJP7vmKn9by/GVjnf4hloz/pXNOwPo0vKGAfXI7GqWXJi9N2kRar4cP5s1dGwuwcagWqO6iHBTq1Mg==}
dev: true dev: true
@@ -5520,7 +5509,7 @@ packages:
/@types/responselike@1.0.0: /@types/responselike@1.0.0:
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
dependencies: dependencies:
'@types/node': 16.18.11 '@types/node': 14.18.33
/@types/retry@0.12.2: /@types/retry@0.12.2:
resolution: {integrity: sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==} resolution: {integrity: sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==}
@@ -5571,11 +5560,11 @@ packages:
'@types/node': 16.18.11 '@types/node': 16.18.11
dev: true dev: true
/@types/tar@4.0.5: /@types/tar@6.1.5:
resolution: {integrity: sha512-cgwPhNEabHaZcYIy5xeMtux2EmYBitfqEceBUi2t5+ETy4dW6kswt6WX4+HqLeiiKOo42EXbGiDmVJ2x+vi37Q==} resolution: {integrity: sha512-qm2I/RlZij5RofuY7vohTpYNaYcrSQlN2MyjucQc7ZweDwaEWkdN/EeNh6e9zjK6uEm6PwjdMXkcj05BxZdX1Q==}
dependencies: dependencies:
'@types/minipass': 3.3.5
'@types/node': 16.18.11 '@types/node': 16.18.11
minipass: 4.2.8
dev: true dev: true
/@types/test-listen@1.1.0: /@types/test-listen@1.1.0:
@@ -6161,8 +6150,8 @@ packages:
resolution: {integrity: sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ==} resolution: {integrity: sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ==}
dev: true dev: true
/@vercel/fun@1.0.4: /@vercel/fun@1.1.0:
resolution: {integrity: sha512-zLY2d1U9JJm3CorfEcuZ7307fo77/Z/mU12LDJpSGtdpjzxgpxMlU5NPq8whz8hIZhIMkBJv0DqZ5bgenktQnw==} resolution: {integrity: sha512-SpuPAo+MlAYMtcMcC0plx7Tv4Mp7SQhJJj1iIENlOnABL24kxHpL09XLQMGzZIzIW7upR8c3edwgfpRtp+dhVw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
dependencies: dependencies:
'@tootallnate/once': 2.0.0 '@tootallnate/once': 2.0.0
@@ -6412,7 +6401,7 @@ packages:
peerDependencies: peerDependencies:
node-fetch: '*' node-fetch: '*'
dependencies: dependencies:
async-retry: 1.3.1 async-retry: 1.3.3
debug: 3.1.0 debug: 3.1.0
node-fetch: 2.6.7 node-fetch: 2.6.7
transitivePeerDependencies: transitivePeerDependencies:
@@ -6872,10 +6861,10 @@ packages:
dependencies: dependencies:
retry: 0.12.0 retry: 0.12.0
/async-retry@1.3.1: /async-retry@1.3.3:
resolution: {integrity: sha512-aiieFW/7h3hY0Bq5d+ktDBejxuwR78vRu9hDUdR8rNhSaQ29VzPL4AoIRG7D/c7tdenwOcKvgPM6tIxB3cB6HA==} resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==}
dependencies: dependencies:
retry: 0.12.0 retry: 0.13.1
/async-sema@2.1.4: /async-sema@2.1.4:
resolution: {integrity: sha512-NKdMgXT9RfmkscybzytzK/6uGF4cL8Mt3PSeO9QHXYKs3oFWkUwIepnAkzLWkqttOdDDFoED3c8kriS8RzP+ow==} resolution: {integrity: sha512-NKdMgXT9RfmkscybzytzK/6uGF4cL8Mt3PSeO9QHXYKs3oFWkUwIepnAkzLWkqttOdDDFoED3c8kriS8RzP+ow==}
@@ -7332,7 +7321,7 @@ packages:
promise-inflight: 1.0.1 promise-inflight: 1.0.1
rimraf: 3.0.2 rimraf: 3.0.2
ssri: 8.0.1 ssri: 8.0.1
tar: 6.1.13 tar: 6.2.0
unique-filename: 1.1.1 unique-filename: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- bluebird - bluebird
@@ -8085,6 +8074,7 @@ packages:
/debug@4.1.1: /debug@4.1.1:
resolution: {integrity: sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==} resolution: {integrity: sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==}
deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
peerDependencies: peerDependencies:
supports-color: '*' supports-color: '*'
peerDependenciesMeta: peerDependenciesMeta:
@@ -8436,13 +8426,13 @@ packages:
safer-buffer: 2.1.2 safer-buffer: 2.1.2
dev: true dev: true
/edge-runtime@2.5.0: /edge-runtime@2.5.1:
resolution: {integrity: sha512-QgDNX6R+RPwhY3+vqHpvYE4XUoB/cFG60nGBKu9pmPOJxQleeTCj2F5CHimIpNqex9h1Cy2Y3tuQ+Vq2GzmZIA==} resolution: {integrity: sha512-E0kY1Dqvwvk9yh7dvR56KnCjXf/dlbrrGjO5Sjnz9Ja3WqYT3csv2B8O4erxJiOWfWy9NTukBk4Kb3yrR66gBw==}
engines: {node: '>=16'} engines: {node: '>=16'}
hasBin: true hasBin: true
dependencies: dependencies:
'@edge-runtime/format': 2.2.0 '@edge-runtime/format': 2.2.0
'@edge-runtime/vm': 3.1.0 '@edge-runtime/vm': 3.1.1
async-listen: 3.0.1 async-listen: 3.0.1
mri: 1.2.0 mri: 1.2.0
picocolors: 1.0.0 picocolors: 1.0.0
@@ -10035,7 +10025,7 @@ packages:
resolution: {integrity: sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==} resolution: {integrity: sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==}
engines: {node: '>=12'} engines: {node: '>=12'}
dependencies: dependencies:
graceful-fs: 4.2.10 graceful-fs: 4.2.11
jsonfile: 6.1.0 jsonfile: 6.1.0
universalify: 2.0.0 universalify: 2.0.0
dev: true dev: true
@@ -12181,6 +12171,7 @@ packages:
/js-yaml@4.1.0: /js-yaml@4.1.0:
resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
hasBin: true
dependencies: dependencies:
argparse: 2.0.1 argparse: 2.0.1
@@ -12879,6 +12870,7 @@ packages:
/micro@9.3.5-canary.3: /micro@9.3.5-canary.3:
resolution: {integrity: sha512-viYIo9PefV+w9dvoIBh1gI44Mvx1BOk67B4BpC2QK77qdY0xZF0Q+vWLt/BII6cLkIc8rLmSIcJaB/OrXXKe1g==} resolution: {integrity: sha512-viYIo9PefV+w9dvoIBh1gI44Mvx1BOk67B4BpC2QK77qdY0xZF0Q+vWLt/BII6cLkIc8rLmSIcJaB/OrXXKe1g==}
engines: {node: '>= 8.0.0'} engines: {node: '>= 8.0.0'}
hasBin: true
dependencies: dependencies:
arg: 4.1.0 arg: 4.1.0
content-type: 1.0.4 content-type: 1.0.4
@@ -13328,16 +13320,14 @@ packages:
dependencies: dependencies:
yallist: 4.0.0 yallist: 4.0.0
/minipass@4.0.0: /minipass@4.2.8:
resolution: {integrity: sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==} resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
dependencies: dev: true
yallist: 4.0.0
/minipass@5.0.0: /minipass@5.0.0:
resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
dev: true
/minizlib@1.3.3: /minizlib@1.3.3:
resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==} resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==}
@@ -13430,6 +13420,7 @@ packages:
/nanoid@3.3.4: /nanoid@3.3.4:
resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
dev: true dev: true
/nanomatch@1.2.13: /nanomatch@1.2.13:
@@ -14080,7 +14071,6 @@ packages:
/path-to-regexp@6.2.1: /path-to-regexp@6.2.1:
resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==} resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==}
dev: false
/path-type@3.0.0: /path-type@3.0.0:
resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==}
@@ -14978,6 +14968,10 @@ packages:
resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==}
engines: {node: '>= 4'} engines: {node: '>= 4'}
/retry@0.13.1:
resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==}
engines: {node: '>= 4'}
/reusify@1.0.4: /reusify@1.0.4:
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'} engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
@@ -15867,26 +15861,13 @@ packages:
yallist: 3.1.1 yallist: 3.1.1
dev: true dev: true
/tar@4.4.6: /tar@6.2.0:
resolution: {integrity: sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==} resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==}
engines: {node: '>=4.5'}
dependencies:
chownr: 1.1.4
fs-minipass: 1.2.7
minipass: 2.9.0
minizlib: 1.3.3
mkdirp: 0.5.6
safe-buffer: 5.2.1
yallist: 3.1.1
dev: true
/tar@6.1.13:
resolution: {integrity: sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==}
engines: {node: '>=10'} engines: {node: '>=10'}
dependencies: dependencies:
chownr: 2.0.0 chownr: 2.0.0
fs-minipass: 2.1.0 fs-minipass: 2.1.0
minipass: 4.0.0 minipass: 5.0.0
minizlib: 2.1.2 minizlib: 2.1.2
mkdirp: 1.0.4 mkdirp: 1.0.4
yallist: 4.0.0 yallist: 4.0.0
@@ -16743,6 +16724,8 @@ packages:
/uuid@3.3.2: /uuid@3.3.2:
resolution: {integrity: sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==} resolution: {integrity: sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==}
deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
hasBin: true
dev: true dev: true
/uuid@3.4.0: /uuid@3.4.0:

20
utils/build-builder.mjs vendored Normal file
View File

@@ -0,0 +1,20 @@
/**
* This script is the build configuration common to all our Builder packages.
* We bundle the output using `esbuild`, and do not publish type definitions.
*
* `@vercel/build-utils` is marked as external because it's always an implicit
* dependency when the Builder is invoked by `vercel build`.
*/
import { join } from 'node:path';
import { readFileSync } from 'node:fs';
import { esbuild } from './build.mjs';
const pkgPath = join(process.cwd(), 'package.json');
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
const externals = Object.keys(pkg.dependencies || {});
await esbuild({
bundle: true,
external: ['@vercel/build-utils', ...externals],
});