Compare commits

...

12 Commits

Author SHA1 Message Date
Vercel Release Bot
9d6088e0b5 Version Packages (#11693)
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@8.2.2

### Patch Changes

- Change node 16.x EOL for Vercel
([#11704](https://github.com/vercel/vercel/pull/11704))

- Improve error message and refactor
([#11706](https://github.com/vercel/vercel/pull/11706))

- [built-utils] Handle case of not having lockfile when corepack is
enabled ([#11697](https://github.com/vercel/vercel/pull/11697))

## vercel@34.2.6

### Patch Changes

- [built-utils] Handle case of not having lockfile when corepack is
enabled ([#11697](https://github.com/vercel/vercel/pull/11697))

- Updated dependencies
\[[`5c12ed695`](5c12ed6950),
[`21444a38e`](21444a38e5),
[`fa9789a93`](fa9789a93e),
[`c925dc4a1`](c925dc4a1b),
[`06d2d860e`](06d2d860e4),
[`b735f37fd`](b735f37fd9)]:
    -   @vercel/build-utils@8.2.2
    -   @vercel/next@4.2.16
    -   @vercel/redwood@2.0.10
    -   @vercel/remix-builder@2.1.7
    -   @vercel/node@3.1.7
    -   @vercel/static-build@2.5.11

## @vercel/client@13.2.9

### Patch Changes

- Updated dependencies
\[[`5c12ed695`](5c12ed6950),
[`21444a38e`](21444a38e5),
[`06d2d860e`](06d2d860e4)]:
    -   @vercel/build-utils@8.2.2

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

### Patch Changes

- Updated dependencies
\[[`5c12ed695`](5c12ed6950),
[`21444a38e`](21444a38e5),
[`06d2d860e`](06d2d860e4)]:
    -   @vercel/build-utils@8.2.2

## @vercel/next@4.2.16

### Patch Changes

- prevent /index from being incorrectly normalized in rewrites
([#11707](https://github.com/vercel/vercel/pull/11707))

- Upgrade to @vercel/nft 0.27.2 with browser remapping support
([#11700](https://github.com/vercel/vercel/pull/11700))

- ensure unmatched rsc rewrites are routed to correct handler
([#11688](https://github.com/vercel/vercel/pull/11688))

## @vercel/node@3.1.7

### Patch Changes

- Upgrade to @vercel/nft 0.27.2 with browser remapping support
([#11700](https://github.com/vercel/vercel/pull/11700))

- Updated dependencies
\[[`5c12ed695`](5c12ed6950),
[`21444a38e`](21444a38e5),
[`06d2d860e`](06d2d860e4)]:
    -   @vercel/build-utils@8.2.2

## @vercel/redwood@2.0.10

### Patch Changes

- Upgrade to @vercel/nft 0.27.2 with browser remapping support
([#11700](https://github.com/vercel/vercel/pull/11700))

## @vercel/remix-builder@2.1.7

### Patch Changes

- Upgrade to @vercel/nft 0.27.2 with browser remapping support
([#11700](https://github.com/vercel/vercel/pull/11700))

## @vercel/static-build@2.5.11

### Patch Changes

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

## @vercel-internals/types@1.0.38

### Patch Changes

- Updated dependencies
\[[`5c12ed695`](5c12ed6950),
[`21444a38e`](21444a38e5),
[`06d2d860e`](06d2d860e4)]:
    -   @vercel/build-utils@8.2.2

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-07 10:40:38 -05:00
Dima Voytenko
c925dc4a1b Upgrade to @vercel/nft 0.27.2 with browser remapping support (#11700)
See https://github.com/vercel/nft/pull/424 for more details.
2024-06-06 23:45:45 +00:00
Austin Merrick
21444a38e5 [build-utils] Improve no lockfile detection logic (#11706)
Two minor improvements missed from the review of https://github.com/vercel/vercel/pull/11697:

- [Include supported package manager names in error message](https://github.com/vercel/vercel/pull/11697#discussion_r1628382867)
- [Avoid `as` to improve type safety](https://github.com/vercel/vercel/pull/11697#discussion_r1628384789)
2024-06-06 23:20:23 +00:00
Zack Tanner
fa9789a93e [next]: fix issues with rewrite normalization of index routes (#11707)
The Next.js builder currently normalizes user rewrites to ensure the internal `.rsc` / `.action` rewrites are still handled even after following the rewrite.

However we have special rewrites: `/index.rsc` and `/index.action`. When those routes pass through the normalization logic, a request routed to a catch-all route (e.g. `[[...param]]`) will go from `/` -> `/index.rsc` -> `<someRewriteString>?param=index`. This is inconsistent `next start` or other spots where the param should be an empty string.

Similarly, if a user rewrites their entire app to a subdirectory (eg `/:path*` -> `/base/:path*`, a route will go from `/` -> `/index.rsc` -> `/base/index.rsc` which won't exist, causing a 404. 

The solution here is to return the `index.rsc` / `index.action` routes back to `/` so they can be handled by user rewrites, if necessary. 

This also disables the `hasActionOutputSupport` flag if `routesManifest.i18n` is detected as they are not compatible.
2024-06-06 23:15:47 +00:00
Trek Glowacki
5c12ed6950 Change node 16.x EOL for Vercel (#11704)
https://github.com/vercel/vercel/pull/11671 changed the EOL date for
node 16.x to be AWS's final date. We want ours to be ~ a month earlier.
2024-06-06 14:54:22 -05:00
Austin Merrick
06d2d860e4 [build-utils] Handle case of not having lockfile (#11697)
In the scenario where we don't have a lockfile, cliType was detected by build utils as npm regardless of what's set in corepack. This fixes that.
2024-06-05 20:23:39 +00:00
Zack Tanner
b735f37fd9 [next]: ensure unmatched rsc rewrites are routed to correct handler (#11688)
Same reasoning as:

- https://github.com/vercel/vercel/pull/11686

Split this into a separate PR so it can be tested/released separately.
2024-06-04 18:52:44 +00:00
Vercel Release Bot
d91f3afcbf Version Packages (#11689)
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@34.2.5

### Patch Changes

- Adds a route for the `.rsc` pathname as well when app has ppr enabled
but not all routes.
([#11681](https://github.com/vercel/vercel/pull/11681))

- Updated dependencies
\[[`7457767a7`](7457767a77),
[`4337ea065`](4337ea0654)]:
    -   @vercel/next@4.2.15

## @vercel/fs-detectors@5.2.4

### Patch Changes

- Add support for detecting Turborepo 2
([#11680](https://github.com/vercel/vercel/pull/11680))

## @vercel/next@4.2.15

### Patch Changes

- ensure unmatched action rewrites are routed to correct handler
([#11686](https://github.com/vercel/vercel/pull/11686))

- Adds a route for the `.rsc` pathname as well when app has ppr enabled
but not all routes.
([#11681](https://github.com/vercel/vercel/pull/11681))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-04 11:29:56 -07:00
Lee Robinson
58d9789e60 examples: Update Astro template. (#11687) 2024-06-04 18:28:11 +00:00
Zack Tanner
7457767a77 [next]: ensure unmatched action rewrites are routed to correct handler (#11686)
User defined rewrites are "normalized" so that our internal rewrites are still properly handled. Before normalizing these rewrites, the Next.js builder will attempt to match server action requests to a`.action` variant. Then the user-defined rewrites flow through the afterFiles normalization ([this part](https://github.com/vercel/vercel/blob/fix/unmatched-action-rewrites/packages/next/src/server-build.ts#L254-L279)) so that when we add `.action` in the builder, we don't drop the suffix. 

But this normalization can lead to a malformed `dest`. e.g., if I had rewrite like this:

```js
{
  source: '/greedy-rewrite/static/:path*',
  destination: '/static/:path*',
}
```

The builder would go through this flow on an action request to `/greedy-rewrite/static`:

1. It'll attempt to match it to a `.action` output, so `/greedy-rewrite/static` -> `/greedy-rewrite/static.action`
2. The afterFiles normalization will take place, so the original `dest` of `/static/$1` will become `/static/$1$rscsuff`
3. $1 will be an empty string, because it doesn't match the existing capture group. So now `/greedy-rewrite/static.action` -> `/greedy-rewrite/static/.action`
4. `static/.action` is not a valid output, so it'll 404 and the action will break. 

Existing handling exists for `.rsc` outputs for a similar reason, but only on the index route. I added a similar fix for this in #11688.
2024-06-04 18:05:11 +00:00
Chris Olszewski
5dedc7b2ce feat(turbo): add support for turbo 2 configuration (#11680)
With the release of Turborepo 2 we're renaming `pipeline` to `tasks`. 

This PR updates the default settings logic to look in `tasks` for a
`build` task definition in addition to looking at `pipeline`. It also
updates the message to no longer mention Turbo configuration in
`package.json` as this is fully ignored in Turborepo 2.

Added a quick unit test to verify `build` task definitions are found in
the `tasks` section of `turbo.json`.

Please let me know if there are other tests/places I should update.
2024-06-04 10:36:35 -07:00
Wyatt Johnson
4337ea0654 [ppr] Add missng .rsc route for non-ppr enabled pages (#11681)
When deploying partial prerendering (PPR), there may some pages that are
not enabled for PPR but still appear in the `prerender-manifest.json`.
Due to the branching of the client router, these routes also have to
have a `.rsc` as well as a `.prefetch.rsc` variants in order to prevent
404's. This change adds support for adding the extra route to the
prerender for pages that have PPR disabled.
2024-06-03 17:52:30 -07:00
72 changed files with 891 additions and 152 deletions

View File

@@ -4,6 +4,12 @@
### Patch Changes
- examples: Update Astro template. ([#11687](https://github.com/vercel/vercel/pull/11687))
## null
### Patch Changes
- chore: update Nuxt example ([#10869](https://github.com/vercel/vercel/pull/10869))
## null

View File

@@ -1,3 +1,6 @@
# astro
.astro
# build output
dist/
.output/
@@ -11,7 +14,6 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production

View File

@@ -3,10 +3,9 @@
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)
- `/ssr` - A page that uses server-side rendering (through [Vercel Edge Functions](https://vercel.com/docs/functions/edge-functions))
- `/ssr` - A page that uses server-side rendering (through [Vercel Functions](https://vercel.com/docs/functions))
- `/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
- `/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)
- `/image` - Astro [Asset](https://docs.astro.build/en/guides/images/) using Vercel [Image Optimization](https://vercel.com/docs/image-optimization)
Learn more about [Astro on Vercel](https://vercel.com/docs/frameworks/astro).

View File

@@ -1,17 +0,0 @@
import { defineConfig } from 'astro/config';
// Use Vercel Edge Functions (Recommended)
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({
output: 'server',
experimental: {
assets: true
},
adapter: vercel({
imageService: true,
}),
});

View File

@@ -0,0 +1,9 @@
import { defineConfig } from 'astro/config';
import vercelServerless from '@astrojs/vercel/serverless';
export default defineConfig({
output: 'server',
adapter: vercelServerless({
imageService: true,
}),
});

View File

@@ -8,9 +8,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/vercel": "3.8.2",
"astro": "^2.10.14",
"react": "18.2.0",
"web-vitals": "^3.3.1"
"@astrojs/vercel": "7.6.0",
"astro": "^4.9.2",
"react": "18.3.1",
"web-vitals": "^4.0.1"
}
}

View File

@@ -1,9 +0,0 @@
export async function get() {
return new Response(JSON.stringify({ time: new Date() }), {
status: 200,
headers: {
'Content-Type': 'application/json',
'Cache-Control': 's-maxage=10, stale-while-revalidate',
},
});
}

View File

@@ -9,7 +9,7 @@
},
"devDependencies": {
"@types/jest": "27.4.1",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/frameworks": "3.0.2"
},
"version": null

View File

@@ -1,5 +1,12 @@
# @vercel-internals/types
## 1.0.38
### Patch Changes
- Updated dependencies [[`5c12ed695`](https://github.com/vercel/vercel/commit/5c12ed69500ceff6a9dc544eab0acd7af64c044a), [`21444a38e`](https://github.com/vercel/vercel/commit/21444a38e50ed680c91b0e3955f15e378eeda64b), [`06d2d860e`](https://github.com/vercel/vercel/commit/06d2d860e47aed792247bf929805b180ed6e2dab)]:
- @vercel/build-utils@8.2.2
## 1.0.37
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "@vercel-internals/types",
"version": "1.0.37",
"version": "1.0.38",
"types": "index.d.ts",
"main": "index.d.ts",
"files": [
@@ -10,7 +10,7 @@
"dependencies": {
"@types/node": "14.14.31",
"@vercel-internals/constants": "1.0.4",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/routing-utils": "3.1.0"
},
"devDependencies": {

View File

@@ -1,5 +1,15 @@
# @vercel/build-utils
## 8.2.2
### Patch Changes
- Change node 16.x EOL for Vercel ([#11704](https://github.com/vercel/vercel/pull/11704))
- Improve error message and refactor ([#11706](https://github.com/vercel/vercel/pull/11706))
- [built-utils] Handle case of not having lockfile when corepack is enabled ([#11697](https://github.com/vercel/vercel/pull/11697))
## 8.2.1
### Patch Changes

View File

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

View File

@@ -13,7 +13,7 @@ export const NODE_VERSIONS: NodeVersion[] = [
major: 16,
range: '16.x',
runtime: 'nodejs16.x',
discontinueDate: new Date('2025-02-28'),
discontinueDate: new Date('2025-01-31'),
},
{
major: 14,

View File

@@ -353,7 +353,9 @@ export async function scanParentDirs(
// TODO: read "bun-lockfile-format-v0"
lockfileVersion = 0;
} else {
cliType = 'npm';
cliType = packageJson
? detectPackageManagerNameWithoutLockfile(packageJson)
: 'npm';
}
const packageJsonPath = pkgJsonPath || undefined;
@@ -366,6 +368,37 @@ export async function scanParentDirs(
};
}
function detectPackageManagerNameWithoutLockfile(packageJson: PackageJson) {
const packageJsonPackageManager = packageJson.packageManager;
if (usingCorepack(process.env, packageJsonPackageManager)) {
const corepackPackageManager = validateVersionSpecifier(
packageJsonPackageManager
);
switch (corepackPackageManager?.packageName) {
case 'npm':
case 'pnpm':
case 'yarn':
case 'bun':
return corepackPackageManager.packageName;
case undefined:
return 'npm';
default:
throw new Error(
`Unknown package manager "${corepackPackageManager?.packageName}". Change your package.json "packageManager" field to a known package manager: npm, pnpm, yarn, bun.`
);
}
}
return 'npm';
}
function usingCorepack(
env: { [x: string]: string | undefined },
packageJsonPackageManager: string | undefined
) {
const corepackFlagged = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
return corepackFlagged && Boolean(packageJsonPackageManager);
}
export async function walkParentDirs({
base,
start,
@@ -557,8 +590,7 @@ export function getEnvForPackageManager({
nodeVersion: NodeVersion | undefined;
env: { [x: string]: string | undefined };
}) {
const corepackFlagged = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
const corepackEnabled = corepackFlagged && Boolean(packageJsonPackageManager);
const corepackEnabled = usingCorepack(env, packageJsonPackageManager);
const {
detectedLockfile,
@@ -753,6 +785,39 @@ export function getPathOverrideForPackageManager({
}
}
function validateVersionSpecifier(version?: string) {
if (!version) {
return undefined;
}
const [before, after, ...extra] = version.split('@');
if (extra.length) {
// should not have more than one `@`
return undefined;
}
if (!before) {
// should have a package before the `@`
return undefined;
}
if (!after) {
// should have a version after the `@`
return undefined;
}
if (!validRange(after)) {
// the version after the `@` should be a valid semver value
return undefined;
}
return {
packageName: before,
packageVersionRange: after,
};
}
/**
* Helper to get the binary paths that link to the used package manager.
* Note: Make sure it doesn't contain any `console.log` calls.

View File

@@ -356,8 +356,8 @@ it('should warn for deprecated versions, soon to be discontinued', async () => {
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.',
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2025-02-28 will fail to build. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.',
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2025-02-28 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2025-01-31 will fail to build. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.',
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2025-01-31 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
]);
} finally {
global.Date.now = realDateNow;

View File

@@ -1,5 +1,28 @@
# vercel
## 34.2.6
### Patch Changes
- [built-utils] Handle case of not having lockfile when corepack is enabled ([#11697](https://github.com/vercel/vercel/pull/11697))
- Updated dependencies [[`5c12ed695`](https://github.com/vercel/vercel/commit/5c12ed69500ceff6a9dc544eab0acd7af64c044a), [`21444a38e`](https://github.com/vercel/vercel/commit/21444a38e50ed680c91b0e3955f15e378eeda64b), [`fa9789a93`](https://github.com/vercel/vercel/commit/fa9789a93ebe64c4246f441590cb695d296af336), [`c925dc4a1`](https://github.com/vercel/vercel/commit/c925dc4a1bf3a47b684b5f7fd788ddd24ba1ed1e), [`06d2d860e`](https://github.com/vercel/vercel/commit/06d2d860e47aed792247bf929805b180ed6e2dab), [`b735f37fd`](https://github.com/vercel/vercel/commit/b735f37fd92c707040e72084b0fdb4f8fd01dd51)]:
- @vercel/build-utils@8.2.2
- @vercel/next@4.2.16
- @vercel/redwood@2.0.10
- @vercel/remix-builder@2.1.7
- @vercel/node@3.1.7
- @vercel/static-build@2.5.11
## 34.2.5
### Patch Changes
- Adds a route for the `.rsc` pathname as well when app has ppr enabled but not all routes. ([#11681](https://github.com/vercel/vercel/pull/11681))
- Updated dependencies [[`7457767a7`](https://github.com/vercel/vercel/commit/7457767a77b03662c103a658273a46cf78359068), [`4337ea065`](https://github.com/vercel/vercel/commit/4337ea0654c4ee2c91c4464540f879d43da6696f)]:
- @vercel/next@4.2.15
## 34.2.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "34.2.4",
"version": "34.2.6",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -32,17 +32,17 @@
"node": ">= 16"
},
"dependencies": {
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/fun": "1.1.0",
"@vercel/go": "3.1.1",
"@vercel/hydrogen": "1.0.2",
"@vercel/next": "4.2.14",
"@vercel/node": "3.1.6",
"@vercel/next": "4.2.16",
"@vercel/node": "3.1.7",
"@vercel/python": "4.3.0",
"@vercel/redwood": "2.0.9",
"@vercel/remix-builder": "2.1.6",
"@vercel/redwood": "2.0.10",
"@vercel/remix-builder": "2.1.7",
"@vercel/ruby": "2.1.0",
"@vercel/static-build": "2.5.10",
"@vercel/static-build": "2.5.11",
"chokidar": "3.3.1"
},
"devDependencies": {
@@ -92,11 +92,11 @@
"@types/yauzl-promise": "2.1.0",
"@vercel-internals/constants": "1.0.4",
"@vercel-internals/get-package-json": "1.0.0",
"@vercel-internals/types": "1.0.37",
"@vercel/client": "13.2.8",
"@vercel-internals/types": "1.0.38",
"@vercel/client": "13.2.9",
"@vercel/error-utils": "2.0.2",
"@vercel/frameworks": "3.0.2",
"@vercel/fs-detectors": "5.2.3",
"@vercel/fs-detectors": "5.2.4",
"@vercel/routing-utils": "3.1.0",
"@vitest/expect": "1.4.0",
"ajv": "6.12.2",

View File

@@ -263,6 +263,7 @@ test('[vc build] should build project with corepack and select pnpm@7.1.0', asyn
path.join(directory, '.vercel/cache/corepack')
);
expect(contents).toEqual(['home', 'shim']);
expect(output.stdout).toMatch(/Running "pnpm run build"/gm);
} finally {
delete process.env.ENABLE_EXPERIMENTAL_COREPACK;
}
@@ -291,6 +292,7 @@ test('[vc build] should build project with corepack and select yarn@2.4.3', asyn
path.join(directory, '.vercel/cache/corepack')
);
expect(contents).toEqual(['home', 'shim']);
expect(output.stdout).toMatch(/Running "yarn run build"/gm);
} finally {
delete process.env.ENABLE_EXPERIMENTAL_COREPACK;
}

View File

@@ -1,5 +1,12 @@
# @vercel/client
## 13.2.9
### Patch Changes
- Updated dependencies [[`5c12ed695`](https://github.com/vercel/vercel/commit/5c12ed69500ceff6a9dc544eab0acd7af64c044a), [`21444a38e`](https://github.com/vercel/vercel/commit/21444a38e50ed680c91b0e3955f15e378eeda64b), [`06d2d860e`](https://github.com/vercel/vercel/commit/06d2d860e47aed792247bf929805b180ed6e2dab)]:
- @vercel/build-utils@8.2.2
## 13.2.8
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "13.2.8",
"version": "13.2.9",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -37,7 +37,7 @@
"typescript": "4.9.5"
},
"dependencies": {
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/error-utils": "2.0.2",
"@vercel/routing-utils": "3.1.0",
"@zeit/fetch": "5.2.0",

View File

@@ -1,5 +1,11 @@
# @vercel/fs-detectors
## 5.2.4
### Patch Changes
- Add support for detecting Turborepo 2 ([#11680](https://github.com/vercel/vercel/pull/11680))
## 5.2.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "5.2.3",
"version": "5.2.4",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -37,7 +37,7 @@
"@types/minimatch": "3.0.5",
"@types/node": "14.18.33",
"@types/semver": "7.3.10",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"jest-junit": "16.0.0",
"typescript": "4.9.5"
}

View File

@@ -7,10 +7,11 @@ import JSON5 from 'json5';
import semver from 'semver';
export class MissingBuildPipeline extends Error {
constructor() {
super(
'Missing required `build` pipeline in turbo.json or package.json Turbo configuration.'
);
constructor(usesTasks: boolean) {
const message = usesTasks
? 'Missing required `build` task in turbo.json.'
: 'Missing required `build` pipeline in turbo.json or package.json Turbo configuration.';
super(message);
}
}
@@ -65,12 +66,15 @@ export async function getMonorepoDefaultSettings(
]);
let hasBuildPipeline = false;
let hasTurboTasks = false;
let turboSemVer = null;
if (turboJSONBuf !== null) {
const turboJSON = JSON5.parse(turboJSONBuf.toString('utf-8'));
if (turboJSON?.pipeline?.build) {
hasTurboTasks = 'tasks' in (turboJSON || {});
if (turboJSON?.pipeline?.build || turboJSON?.tasks?.build) {
hasBuildPipeline = true;
}
}
@@ -89,7 +93,7 @@ export async function getMonorepoDefaultSettings(
}
if (!hasBuildPipeline) {
throw new MissingBuildPipeline();
throw new MissingBuildPipeline(hasTurboTasks);
}
if (projectPath === '/') {

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"turbo": "latest"
}
}

View File

@@ -0,0 +1,5 @@
{
"name": "app-14",
"version": "0.0.1",
"main": "index.js"
}

View File

@@ -0,0 +1,2 @@
// TEST COMMENT TO VERIFY JSON5 SUPPORT
{ "tasks": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] } } }

View File

@@ -17,11 +17,17 @@ describe('getMonorepoDefaultSettings', () => {
);
});
test('MissingBuildPipeline is an error', () => {
const missingBuildPipeline = new MissingBuildPipeline();
const missingBuildPipeline = new MissingBuildPipeline(false);
expect(missingBuildPipeline).toBeInstanceOf(Error);
expect(missingBuildPipeline.message).toBe(
'Missing required `build` pipeline in turbo.json or package.json Turbo configuration.'
);
const missingBuildTask = new MissingBuildPipeline(true);
expect(missingBuildTask).toBeInstanceOf(Error);
expect(missingBuildTask.message).toBe(
'Missing required `build` task in turbo.json.'
);
});
test.each([
@@ -31,6 +37,7 @@ describe('getMonorepoDefaultSettings', () => {
['turbo-npm', 'turbo', true, 'app-15', false, false],
['turbo-npm-root-proj', 'turbo', true, 'app-root-proj', true, false],
['turbo-latest', 'turbo', false, 'app-14', false, false],
['turbo-2', 'turbo', false, 'app-14', false, false],
['nx', 'nx', false, 'app-12', false, false],
['nx-package-config', 'nx', false, 'app-11', false, false],
['nx-project-and-package-config-1', 'nx', false, 'app-10', false, false],

View File

@@ -1,5 +1,12 @@
# @vercel/gatsby-plugin-vercel-builder
## 2.0.33
### Patch Changes
- Updated dependencies [[`5c12ed695`](https://github.com/vercel/vercel/commit/5c12ed69500ceff6a9dc544eab0acd7af64c044a), [`21444a38e`](https://github.com/vercel/vercel/commit/21444a38e50ed680c91b0e3955f15e378eeda64b), [`06d2d860e`](https://github.com/vercel/vercel/commit/06d2d860e47aed792247bf929805b180ed6e2dab)]:
- @vercel/build-utils@8.2.2
## 2.0.32
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-builder",
"version": "2.0.32",
"version": "2.0.33",
"main": "dist/index.js",
"files": [
"dist",
@@ -20,7 +20,7 @@
},
"dependencies": {
"@sinclair/typebox": "0.25.24",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/routing-utils": "3.1.0",
"esbuild": "0.14.47",
"etag": "1.8.1",

View File

@@ -29,7 +29,7 @@
"@types/node-fetch": "^2.3.0",
"@types/tar": "6.1.5",
"@types/yauzl-promise": "2.1.0",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"async-retry": "1.3.3",
"execa": "^1.0.0",
"fs-extra": "^7.0.0",

View File

@@ -26,7 +26,7 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "14.18.33",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"execa": "3.2.0",
"fs-extra": "11.1.0",
"jest-junit": "16.0.0"

View File

@@ -1,5 +1,23 @@
# @vercel/next
## 4.2.16
### Patch Changes
- prevent /index from being incorrectly normalized in rewrites ([#11707](https://github.com/vercel/vercel/pull/11707))
- Upgrade to @vercel/nft 0.27.2 with browser remapping support ([#11700](https://github.com/vercel/vercel/pull/11700))
- ensure unmatched rsc rewrites are routed to correct handler ([#11688](https://github.com/vercel/vercel/pull/11688))
## 4.2.15
### Patch Changes
- ensure unmatched action rewrites are routed to correct handler ([#11686](https://github.com/vercel/vercel/pull/11686))
- Adds a route for the `.rsc` pathname as well when app has ppr enabled but not all routes. ([#11681](https://github.com/vercel/vercel/pull/11681))
## 4.2.14
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "4.2.14",
"version": "4.2.16",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -23,7 +23,7 @@
"dist"
],
"dependencies": {
"@vercel/nft": "0.27.0"
"@vercel/nft": "0.27.2"
},
"devDependencies": {
"@types/aws-lambda": "8.10.19",
@@ -40,7 +40,7 @@
"@types/semver": "6.0.0",
"@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/routing-utils": "3.1.0",
"async-sema": "3.0.1",
"buffer-crc32": "0.2.13",

View File

@@ -212,7 +212,8 @@ export async function serverBuild({
);
const hasActionOutputSupport =
semver.gte(nextVersion, ACTION_OUTPUT_SUPPORT_VERSION) &&
Boolean(process.env.NEXT_EXPERIMENTAL_STREAMING_ACTIONS);
Boolean(process.env.NEXT_EXPERIMENTAL_STREAMING_ACTIONS) &&
!routesManifest.i18n;
const projectDir = requiredServerFilesManifest.relativeAppDir
? path.join(baseDir, requiredServerFilesManifest.relativeAppDir)
: requiredServerFilesManifest.appDir || entryPath;
@@ -2085,10 +2086,45 @@ export async function serverBuild({
]
: []),
// before processing rewrites, remove any special `/index` routes that were added
// as these won't be properly normalized by `afterFilesRewrites` / `dynamicRoutes`
...(appPathRoutesManifest
? [
{
src: path.posix.join(
'/',
entryDirectory,
'/index(\\.action|\\.rsc)'
),
dest: path.posix.join('/', entryDirectory),
continue: true,
},
]
: []),
// These need to come before handle: miss or else they are grouped
// with that routing section
...afterFilesRewrites,
// Ensure that after we normalize `afterFilesRewrites`, unmatched actions are routed to the correct handler
// e.g. /foo/.action -> /foo.action. This should only ever match in cases where we're routing to an action handler
// and the rewrite normalization led to something like /foo/$1$rscsuff, and $1 had no match.
// This is meant to have parity with the .rsc handling below.
...(hasActionOutputSupport
? [
{
src: `${path.posix.join('/', entryDirectory, '/\\.action$')}`,
dest: `${path.posix.join('/', entryDirectory, '/index.action')}`,
check: true,
},
{
src: `${path.posix.join('/', entryDirectory, '(.+)/\\.action$')}`,
dest: `${path.posix.join('/', entryDirectory, '$1.action')}`,
check: true,
},
]
: []),
// ensure non-normalized /.rsc from rewrites is handled
...(appPathRoutesManifest
? [
@@ -2101,11 +2137,29 @@ export async function serverBuild({
),
check: true,
},
{
src: path.posix.join(
'/',
entryDirectory,
'(.+)/\\.prefetch\\.rsc$'
),
dest: path.posix.join(
'/',
entryDirectory,
`$1${RSC_PREFETCH_SUFFIX}`
),
check: true,
},
{
src: path.posix.join('/', entryDirectory, '/\\.rsc$'),
dest: path.posix.join('/', entryDirectory, `/index.rsc`),
check: true,
},
{
src: path.posix.join('/', entryDirectory, '(.+)/\\.rsc$'),
dest: path.posix.join('/', entryDirectory, '$1.rsc'),
check: true,
},
]
: []),

View File

@@ -2110,14 +2110,14 @@ export const onPrerenderRoute =
// If enabled, try to get the postponed route information from the file
// system and use it to assemble the prerender.
let prerender: string | undefined;
let postponedPrerender: string | undefined;
if (experimentalPPR && appDir) {
const htmlPath = path.join(appDir, `${routeFileNoExt}.html`);
const metaPath = path.join(appDir, `${routeFileNoExt}.meta`);
if (fs.existsSync(htmlPath) && fs.existsSync(metaPath)) {
const meta = JSON.parse(await fs.readFile(metaPath, 'utf8'));
if ('postponed' in meta && typeof meta.postponed === 'string') {
prerender = meta.postponed;
postponedPrerender = meta.postponed;
// Assign the headers Content-Type header to the prerendered type.
initialHeaders ??= {};
@@ -2127,7 +2127,7 @@ export const onPrerenderRoute =
// Read the HTML file and append it to the prerendered content.
const html = await fs.readFileSync(htmlPath, 'utf8');
prerender += html;
postponedPrerender += html;
}
}
@@ -2144,14 +2144,14 @@ export const onPrerenderRoute =
}
}
if (prerender) {
if (postponedPrerender) {
const contentType = initialHeaders?.['content-type'];
if (!contentType) {
throw new Error("Invariant: contentType can't be undefined");
}
// Assemble the prerendered file.
htmlFsRef = new FileBlob({ contentType, data: prerender });
htmlFsRef = new FileBlob({ contentType, data: postponedPrerender });
} else if (
appDir &&
!dataRoute &&
@@ -2215,7 +2215,14 @@ export const onPrerenderRoute =
? addLocaleOrDefault('/404.html', routesManifest, locale)
: '/404.html'
: isAppPathRoute
? prefetchDataRoute || dataRoute
? // When experimental PPR is enabled, we expect that the data
// that should be served as a part of the prerender should
// be from the prefetch data route. If this isn't enabled
// for ppr, the only way to get the data is from the data
// route.
experimentalPPR
? prefetchDataRoute
: dataRoute
: routeFileNoExt + '.json'
}`
),
@@ -2272,10 +2279,6 @@ export const onPrerenderRoute =
throw new Error('Invariant: expected to find prefetch data route PPR');
}
// When the prefetch data path is available, use it for the prerender,
// otherwise use the data path.
const outputPrerenderPathData = outputPathPrefetchData || outputPathData;
if (isSharedLambdas) {
const outputSrcPathPage = normalizeIndexOutput(
path.join(
@@ -2328,8 +2331,14 @@ export const onPrerenderRoute =
htmlFsRef.contentType = htmlContentType;
prerenders[outputPathPage] = htmlFsRef;
if (outputPrerenderPathData) {
prerenders[outputPrerenderPathData] = jsonFsRef;
if (outputPathPrefetchData) {
prerenders[outputPathPrefetchData] = jsonFsRef;
}
// If experimental ppr is not enabled for this route, then add the data
// route as a target for the prerender as well.
if (outputPathData && !experimentalPPR) {
prerenders[outputPathData] = jsonFsRef;
}
}
}
@@ -2465,21 +2474,20 @@ export const onPrerenderRoute =
: {}),
});
if (outputPrerenderPathData) {
let normalizedPathData = outputPrerenderPathData;
const normalizePathData = (pathData: string) => {
if (
(srcRoute === '/' || srcRoute == '/index') &&
outputPrerenderPathData.endsWith(RSC_PREFETCH_SUFFIX)
pathData.endsWith(RSC_PREFETCH_SUFFIX)
) {
delete lambdas[normalizedPathData];
normalizedPathData = normalizedPathData.replace(
/([^/]+\.prefetch\.rsc)$/,
'__$1'
);
delete lambdas[pathData];
return pathData.replace(/([^/]+\.prefetch\.rsc)$/, '__$1');
}
prerenders[normalizedPathData] = new Prerender({
return pathData;
};
if (outputPathData || outputPathPrefetchData) {
const prerender = new Prerender({
expiration: initialRevalidate,
lambda,
allowQuery,
@@ -2500,21 +2508,30 @@ export const onPrerenderRoute =
...initialHeaders,
'content-type': rscContentTypeHeader,
vary: rscVaryHeader,
// If it contains a pre-render, then it was postponed.
...(prerender && rscDidPostponeHeader
...(postponedPrerender && rscDidPostponeHeader
? { [rscDidPostponeHeader]: '1' }
: {}),
},
}
: {}),
});
if (outputPathPrefetchData) {
prerenders[normalizePathData(outputPathPrefetchData)] = prerender;
}
// If experimental ppr is not enabled for this route, then add the data
// route as a target for the prerender as well.
if (outputPathData && !experimentalPPR) {
prerenders[normalizePathData(outputPathData)] = prerender;
}
}
// we need to ensure all prerenders have a matching .rsc output
// otherwise routing could fall through unexpectedly for the
// fallback: false case as it doesn't have a dynamic route
// to catch the `.rsc` request for app -> pages routing
if (outputPrerenderPathData?.endsWith('.json') && appDir) {
if (outputPathData?.endsWith('.json') && appDir) {
const dummyOutput = new FileBlob({
data: '{}',
contentType: 'application/json',

View File

@@ -0,0 +1,6 @@
'use server';
export async function increment(value) {
await new Promise(resolve => setTimeout(resolve, 500));
return value + 1;
}

View File

@@ -0,0 +1,10 @@
export default function Root({ children }) {
return (
<html>
<head>
<title>Hello World</title>
</head>
<body>{children}</body>
</html>
);
}

View File

@@ -0,0 +1,25 @@
"use client";
import { useState } from "react";
import { increment } from "../actions";
export default function Home() {
const [count, setCount] = useState(0);
return (
<div>
{count}
<button
onClick={async () => {
const actionResult = await increment(count);
// @ts-ignore
setCount(actionResult);
console.log(actionResult);
}}
>
Trigger
</button>
Static
</div>
);
}

View File

@@ -0,0 +1,55 @@
/* eslint-env jest */
const path = require('path');
const { deployAndTest } = require('../../utils');
const fetch = require('../../../../../test/lib/deployment/fetch-retry');
const ctx = {};
function findActionId(page, runtime) {
page = `app${page}/page`; // add /app prefix and /page suffix
for (const [actionId, details] of Object.entries(
ctx.actionManifest[runtime]
)) {
if (details.workers[page]) {
return actionId;
}
}
throw new Error("Couldn't find action ID");
}
describe(`${__dirname.split(path.sep).pop()}`, () => {
beforeAll(async () => {
const info = await deployAndTest(__dirname);
const actionManifest = await fetch(
`${info.deploymentUrl}/server-reference-manifest.json`
).then(res => res.json());
ctx.actionManifest = actionManifest;
Object.assign(ctx, info);
});
it('should work when there is a rewrite targeting the root page', async () => {
const actionId = findActionId('/static', 'node');
const res = await fetch(ctx.deploymentUrl, {
method: 'POST',
body: JSON.stringify([1337]),
headers: {
'Content-Type': 'text/plain;charset=UTF-8',
'Next-Action': actionId,
},
});
expect(res.status).toEqual(200);
expect(res.headers.get('x-matched-path')).toBe('/static/');
expect(res.headers.get('x-vercel-cache')).toBe('BYPASS');
const body = await res.text();
// The action incremented the provided count by 1
expect(body).toContain('1338');
});
});

View File

@@ -0,0 +1,10 @@
module.exports = {
rewrites() {
return [
{
source: '/:path*',
destination: '/static/:path*',
},
];
},
};

View File

@@ -0,0 +1,9 @@
{
"dependencies": {
"next": "canary"
},
"scripts": {
"build": "next build && cp .next/server/server-reference-manifest.json public/"
},
"ignoreNextjsUpdates": true
}

View File

@@ -0,0 +1,14 @@
{
"builds": [
{
"src": "package.json",
"use": "@vercel/next"
}
],
"build": {
"env": {
"NEXT_EXPERIMENTAL_STREAMING_ACTIONS": "1"
}
},
"probes": []
}

View File

@@ -0,0 +1,25 @@
"use client";
import { useState } from "react";
import { increment } from "../../actions";
export default function Home() {
const [count, setCount] = useState(0);
return (
<div>
{count}
<button
onClick={async () => {
const actionResult = await increment(count);
// @ts-ignore
setCount(actionResult);
console.log(actionResult);
}}
>
Trigger
</button>
Static
</div>
);
}

View File

@@ -0,0 +1,25 @@
"use client";
import { useState } from "react";
import { increment } from "./actions";
export default function Home() {
const [count, setCount] = useState(0);
return (
<div>
{count}
<button
onClick={async () => {
const actionResult = await increment(count);
// @ts-ignore
setCount(actionResult);
console.log(actionResult);
}}
>
Trigger
</button>
Static
</div>
);
}

View File

@@ -0,0 +1,25 @@
"use client";
import { useState } from "react";
import { increment } from "../actions";
export default function Home() {
const [count, setCount] = useState(0);
return (
<div>
{count}
<button
onClick={async () => {
const actionResult = await increment(count);
// @ts-ignore
setCount(actionResult);
console.log(actionResult);
}}
>
Trigger
</button>
Static
</div>
);
}

View File

@@ -15,7 +15,8 @@ function findActionId(page, runtime) {
return actionId;
}
}
return null;
throw new Error("Couldn't find action ID");
}
function generateFormDataPayload(actionId) {
@@ -293,6 +294,80 @@ describe(`${__dirname.split(path.sep).pop()}`, () => {
expect(res.headers.get('x-edge-runtime')).toBe('1');
}
});
it('should work when a rewrite greedy matches an action rewrite', async () => {
const targetPath = `${basePath}/static`;
const canonicalPath = `/greedy-rewrite/${basePath}/static`;
const actionId = findActionId(targetPath, runtime);
const res = await fetch(
`${ctx.deploymentUrl}${canonicalPath}`,
generateFormDataPayload(actionId)
);
expect(res.status).toEqual(200);
expect(res.headers.get('x-matched-path')).toBe(targetPath + '.action');
expect(res.headers.get('content-type')).toBe('text/x-component');
if (runtime === 'node') {
expect(res.headers.get('x-vercel-cache')).toBe('MISS');
} else {
expect(res.headers.get('x-edge-runtime')).toBe('1');
}
});
it('should work on the index route', async () => {
const canonicalPath = '/';
const actionId = findActionId('', 'node');
const res = await fetch(
`${ctx.deploymentUrl}${canonicalPath}`,
generateFormDataPayload(actionId)
);
expect(res.status).toEqual(200);
expect(res.headers.get('x-matched-path')).toBe('/index.action');
expect(res.headers.get('content-type')).toBe('text/x-component');
expect(res.headers.get('x-vercel-cache')).toBe('MISS');
});
});
describe('rewrite to index', () => {
it('should work when user has a rewrite to the index route', async () => {
const canonicalPath = '/rewritten-to-index';
const actionId = findActionId('', 'node');
const res = await fetch(
`${ctx.deploymentUrl}${canonicalPath}`,
generateFormDataPayload(actionId)
);
expect(res.status).toEqual(200);
expect(res.headers.get('x-matched-path')).toBe('/index.action');
expect(res.headers.get('content-type')).toBe('text/x-component');
expect(res.headers.get('x-vercel-cache')).toBe('MISS');
});
it('should work when entire path is rewritten', async () => {
const actionId = findActionId('/static', 'node');
const res = await fetch(ctx.deploymentUrl, {
method: 'POST',
body: JSON.stringify([1337]),
headers: {
'Content-Type': 'text/plain;charset=UTF-8',
'Next-Action': actionId,
'x-rewrite-me': '1',
},
});
expect(res.status).toEqual(200);
expect(res.headers.get('x-matched-path')).toBe('/index.action');
expect(res.headers.get('x-vercel-cache')).toBe('MISS');
const body = await res.text();
// The action incremented the provided count by 1
expect(body).toContain('1338');
});
});
describe('pages', () => {

View File

@@ -9,6 +9,28 @@ module.exports = {
source: '/rewrite/edge/rsc/static',
destination: '/edge/rsc/static',
},
{
source: '/greedy-rewrite/static/:path*',
destination: '/static/:path*',
},
{
source: '/greedy-rewrite/edge/static/:path*',
destination: '/edge/static/:path*',
},
{
source: '/rewritten-to-index',
destination: '/?fromRewrite=1',
},
{
source: '/:path*',
destination: '/static/:path*',
has: [
{
type: 'header',
key: 'x-rewrite-me',
},
],
},
];
},
};

View File

@@ -0,0 +1,14 @@
import Link from 'next/link';
const Page = ({ params }) => {
return (
<div>
<div id="page-param">page-param-{params.slug?.[0] ?? ''}</div>
<Link href="/">Home</Link>
<Link href="/foo">Foo</Link>
<Link href="/bar">Bar</Link>
</div>
);
};
export default Page;

View File

@@ -0,0 +1,10 @@
export default function Root({ children }) {
return (
<html>
<head>
<title>Hello World</title>
</head>
<body>{children}</body>
</html>
);
}

View File

@@ -0,0 +1,12 @@
/* eslint-env jest */
const path = require('path');
const { deployAndTest } = require('../../utils');
const ctx = {};
describe(`${__dirname.split(path.sep).pop()}`, () => {
it('should deploy and pass probe checks', async () => {
const info = await deployAndTest(__dirname);
Object.assign(ctx, info);
});
});

View File

@@ -0,0 +1 @@
module.exports = {};

View File

@@ -0,0 +1,8 @@
{
"dependencies": {
"next": "canary",
"react": "19.0.0-rc-f994737d14-20240522",
"react-dom": "19.0.0-rc-f994737d14-20240522"
},
"ignoreNextjsUpdates": true
}

View File

@@ -0,0 +1,27 @@
{
"builds": [
{
"src": "package.json",
"use": "@vercel/next"
}
],
"probes": [
{
"path": "/",
"status": 200,
"mustContain": "\"page-param-\",\"\"",
"mustNotContain": "\"page-param-\",\"index\"",
"headers": {
"RSC": "1"
}
},
{
"path": "/foo",
"status": 200,
"mustContain": "\"page-param-\",\"foo\"",
"headers": {
"RSC": "1"
}
}
]
}

View File

@@ -4,8 +4,7 @@ const { deployAndTest } = require('../../utils');
const ctx = {};
// TODO: investigate invariant
describe.skip(`${__dirname.split(path.sep).pop()}`, () => {
describe(`${__dirname.split(path.sep).pop()}`, () => {
it('should deploy and pass probe checks', async () => {
const info = await deployAndTest(__dirname);
Object.assign(ctx, info);

View File

@@ -61,6 +61,23 @@
"status": 200,
"mustContain": "sentinel:static"
},
{
"path": "/static",
"status": 200,
"mustContain": "sentinel:static",
"headers": {
"RSC": "1"
}
},
{
"path": "/static",
"status": 200,
"mustContain": "sentinel:static",
"headers": {
"RSC": "1",
"Next-Router-Prefetch": "1"
}
},
{
"path": "/disabled",
"headers": {
@@ -68,7 +85,7 @@
"Next-Router-Prefetch": "1"
},
"status": 200,
"mustContain": "sentinel:dynamic"
"mustNotContain": "sentinel:dynamic"
},
{
"path": "/disabled",

View File

@@ -17,6 +17,10 @@ module.exports = {
source: '/to-product/:productId.html',
destination: '/products/:productId',
},
{
source: '/greedy-rewrite/test-page/:path*',
destination: '/test-page/:path*',
}
];
},
};

View File

@@ -429,6 +429,31 @@
},
"mustContain": ":{",
"mustNotContain": "<html"
},
{
"path": "/greedy-rewrite/test-page",
"status": 200,
"mustContain": ":{",
"mustNotContain": "<html",
"responseHeaders": {
"x-matched-path": "/test-page.rsc"
},
"headers": {
"RSC": "1"
}
},
{
"path": "/greedy-rewrite/test-page",
"status": 200,
"mustContain": ":{",
"mustNotContain": "<html",
"responseHeaders": {
"x-matched-path": "/test-page.rsc"
},
"headers": {
"RSC": "1",
"Next-Router-Prefetch": "1"
}
}
]
}

View File

@@ -0,0 +1,3 @@
export default function Page() {
return <p>static page</p>;
}

View File

@@ -14,6 +14,10 @@ module.exports = {
source: '/rewritten-to-index',
destination: '/?fromRewrite=1',
},
{
source: '/greedy-rewrite/test-page/:path*',
destination: '/test-page/:path*',
}
];
},
};

View File

@@ -349,6 +349,55 @@
"path": "/api/pages-headers",
"status": 200,
"mustContain": "{\"port\":\"443\"}"
},
{
"path": "/greedy-rewrite/test-page",
"status": 200,
"mustContain": ":{",
"mustNotContain": "<html",
"responseHeaders": {
"x-matched-path": "/test-page.rsc"
},
"headers": {
"RSC": 1
}
},
{
"path": "/greedy-rewrite/test-page",
"status": 200,
"mustContain": ":{",
"mustNotContain": "<html",
"responseHeaders": {
"x-matched-path": "/test-page.prefetch.rsc"
},
"headers": {
"RSC": "1",
"Next-Router-Prefetch": "1"
}
},
{
"path": "/static",
"status": 200,
"mustContain": "static page"
},
{
"path": "/static",
"status": 200,
"headers": {
"RSC": "1"
},
"mustContain": ":{",
"mustNotContain": "<html"
},
{
"path": "/static",
"status": 200,
"headers": {
"RSC": "1",
"Next-Router-Prefetch": "1"
},
"mustContain": ":{",
"mustNotContain": "<html"
}
]
}

View File

@@ -1,5 +1,14 @@
# @vercel/node
## 3.1.7
### Patch Changes
- Upgrade to @vercel/nft 0.27.2 with browser remapping support ([#11700](https://github.com/vercel/vercel/pull/11700))
- Updated dependencies [[`5c12ed695`](https://github.com/vercel/vercel/commit/5c12ed69500ceff6a9dc544eab0acd7af64c044a), [`21444a38e`](https://github.com/vercel/vercel/commit/21444a38e50ed680c91b0e3955f15e378eeda64b), [`06d2d860e`](https://github.com/vercel/vercel/commit/06d2d860e47aed792247bf929805b180ed6e2dab)]:
- @vercel/build-utils@8.2.2
## 3.1.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "3.1.6",
"version": "3.1.7",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -25,9 +25,9 @@
"@edge-runtime/primitives": "4.1.0",
"@edge-runtime/vm": "3.2.0",
"@types/node": "16.18.11",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/error-utils": "2.0.2",
"@vercel/nft": "0.27.0",
"@vercel/nft": "0.27.2",
"@vercel/static-config": "3.0.0",
"async-listen": "3.0.0",
"cjs-module-lexer": "1.2.3",

View File

@@ -26,7 +26,7 @@
"@types/jest": "27.4.1",
"@types/node": "14.18.33",
"@types/which": "3.0.0",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"execa": "^1.0.0",
"fs-extra": "11.1.1",
"jest-junit": "16.0.0",

View File

@@ -1,5 +1,11 @@
# @vercel/redwood
## 2.0.10
### Patch Changes
- Upgrade to @vercel/nft 0.27.2 with browser remapping support ([#11700](https://github.com/vercel/vercel/pull/11700))
## 2.0.9
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/redwood",
"version": "2.0.9",
"version": "2.0.10",
"main": "./dist/index.js",
"license": "Apache-2.0",
"homepage": "https://vercel.com/docs",
@@ -20,7 +20,7 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@vercel/nft": "0.27.0",
"@vercel/nft": "0.27.2",
"@vercel/routing-utils": "3.1.0",
"semver": "6.3.1"
},
@@ -28,7 +28,7 @@
"@types/aws-lambda": "8.10.19",
"@types/node": "14.18.33",
"@types/semver": "6.0.0",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"execa": "3.2.0",
"fs-extra": "11.1.0",
"jest-junit": "16.0.0"

View File

@@ -1,5 +1,11 @@
# @vercel/remix-builder
## 2.1.7
### Patch Changes
- Upgrade to @vercel/nft 0.27.2 with browser remapping support ([#11700](https://github.com/vercel/vercel/pull/11700))
## 2.1.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix-builder",
"version": "2.1.6",
"version": "2.1.7",
"license": "Apache-2.0",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -24,7 +24,7 @@
],
"dependencies": {
"@vercel/error-utils": "2.0.2",
"@vercel/nft": "0.27.0",
"@vercel/nft": "0.27.2",
"@vercel/static-config": "3.0.0",
"ts-morph": "12.0.0"
},
@@ -33,7 +33,7 @@
"@types/jest": "27.5.1",
"@types/node": "14.18.33",
"@types/semver": "7.3.13",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"glob": "10.3.16",
"jest-junit": "16.0.0",
"path-to-regexp": "6.2.1",

View File

@@ -24,7 +24,7 @@
"@types/fs-extra": "8.0.0",
"@types/semver": "6.0.0",
"@types/which": "3.0.0",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"execa": "2.0.4",
"fs-extra": "^7.0.1",
"jest-junit": "16.0.0",

View File

@@ -1,5 +1,12 @@
# @vercel/static-build
## 2.5.11
### Patch Changes
- Updated dependencies []:
- @vercel/gatsby-plugin-vercel-builder@2.0.33
## 2.5.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "2.5.10",
"version": "2.5.11",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -21,7 +21,7 @@
},
"dependencies": {
"@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
"@vercel/gatsby-plugin-vercel-builder": "2.0.32",
"@vercel/gatsby-plugin-vercel-builder": "2.0.33",
"@vercel/static-config": "3.0.0",
"ts-morph": "12.0.0"
},
@@ -35,10 +35,10 @@
"@types/node-fetch": "2.5.4",
"@types/promise-timeout": "1.3.0",
"@types/semver": "7.3.13",
"@vercel/build-utils": "8.2.1",
"@vercel/build-utils": "8.2.2",
"@vercel/error-utils": "2.0.2",
"@vercel/frameworks": "3.0.2",
"@vercel/fs-detectors": "5.2.3",
"@vercel/fs-detectors": "5.2.4",
"@vercel/routing-utils": "3.1.0",
"execa": "3.2.0",
"fs-extra": "10.0.0",

74
pnpm-lock.yaml generated
View File

@@ -132,7 +132,7 @@ importers:
specifier: 27.4.1
version: 27.4.1
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../packages/build-utils
'@vercel/frameworks':
specifier: 3.0.2
@@ -189,7 +189,7 @@ importers:
specifier: 1.0.4
version: link:../constants
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../../packages/build-utils
'@vercel/routing-utils':
specifier: 3.1.0
@@ -313,7 +313,7 @@ importers:
packages/cli:
dependencies:
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
'@vercel/fun':
specifier: 1.1.0
@@ -325,25 +325,25 @@ importers:
specifier: 1.0.2
version: link:../hydrogen
'@vercel/next':
specifier: 4.2.14
specifier: 4.2.16
version: link:../next
'@vercel/node':
specifier: 3.1.6
specifier: 3.1.7
version: link:../node
'@vercel/python':
specifier: 4.3.0
version: link:../python
'@vercel/redwood':
specifier: 2.0.9
specifier: 2.0.10
version: link:../redwood
'@vercel/remix-builder':
specifier: 2.1.6
specifier: 2.1.7
version: link:../remix
'@vercel/ruby':
specifier: 2.1.0
version: link:../ruby
'@vercel/static-build':
specifier: 2.5.10
specifier: 2.5.11
version: link:../static-build
chokidar:
specifier: 3.3.1
@@ -488,10 +488,10 @@ importers:
specifier: 1.0.0
version: link:../../internals/get-package-json
'@vercel-internals/types':
specifier: 1.0.37
specifier: 1.0.38
version: link:../../internals/types
'@vercel/client':
specifier: 13.2.8
specifier: 13.2.9
version: link:../client
'@vercel/error-utils':
specifier: 2.0.2
@@ -500,7 +500,7 @@ importers:
specifier: 3.0.2
version: link:../frameworks
'@vercel/fs-detectors':
specifier: 5.2.3
specifier: 5.2.4
version: link:../fs-detectors
'@vercel/routing-utils':
specifier: 3.1.0
@@ -737,7 +737,7 @@ importers:
packages/client:
dependencies:
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
'@vercel/error-utils':
specifier: 2.0.2
@@ -941,7 +941,7 @@ importers:
specifier: 7.3.10
version: 7.3.10
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
jest-junit:
specifier: 16.0.0
@@ -972,7 +972,7 @@ importers:
specifier: 0.25.24
version: 0.25.24
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
'@vercel/routing-utils':
specifier: 3.1.0
@@ -1039,7 +1039,7 @@ importers:
specifier: 2.1.0
version: 2.1.0
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
async-retry:
specifier: 1.3.3
@@ -1088,7 +1088,7 @@ importers:
specifier: 14.18.33
version: 14.18.33
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
execa:
specifier: 3.2.0
@@ -1103,8 +1103,8 @@ importers:
packages/next:
dependencies:
'@vercel/nft':
specifier: 0.27.0
version: 0.27.0
specifier: 0.27.2
version: 0.27.2
devDependencies:
'@types/aws-lambda':
specifier: 8.10.19
@@ -1149,7 +1149,7 @@ importers:
specifier: 3.2.0
version: 3.2.0
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
'@vercel/routing-utils':
specifier: 3.1.0
@@ -1236,14 +1236,14 @@ importers:
specifier: 16.18.11
version: 16.18.11
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
'@vercel/error-utils':
specifier: 2.0.2
version: link:../error-utils
'@vercel/nft':
specifier: 0.27.0
version: 0.27.0
specifier: 0.27.2
version: 0.27.2
'@vercel/static-config':
specifier: 3.0.0
version: link:../static-config
@@ -1366,7 +1366,7 @@ importers:
specifier: 3.0.0
version: 3.0.0
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
execa:
specifier: ^1.0.0
@@ -1384,8 +1384,8 @@ importers:
packages/redwood:
dependencies:
'@vercel/nft':
specifier: 0.27.0
version: 0.27.0
specifier: 0.27.2
version: 0.27.2
'@vercel/routing-utils':
specifier: 3.1.0
version: link:../routing-utils
@@ -1403,7 +1403,7 @@ importers:
specifier: 6.0.0
version: 6.0.0
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
execa:
specifier: 3.2.0
@@ -1421,8 +1421,8 @@ importers:
specifier: 2.0.2
version: link:../error-utils
'@vercel/nft':
specifier: 0.27.0
version: 0.27.0
specifier: 0.27.2
version: 0.27.2
'@vercel/static-config':
specifier: 3.0.0
version: link:../static-config
@@ -1443,7 +1443,7 @@ importers:
specifier: 7.3.13
version: 7.3.13
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
glob:
specifier: 10.3.16
@@ -1496,7 +1496,7 @@ importers:
specifier: 3.0.0
version: 3.0.0
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
execa:
specifier: 2.0.4
@@ -1520,7 +1520,7 @@ importers:
specifier: 1.0.11
version: link:../gatsby-plugin-vercel-analytics
'@vercel/gatsby-plugin-vercel-builder':
specifier: 2.0.32
specifier: 2.0.33
version: link:../gatsby-plugin-vercel-builder
'@vercel/static-config':
specifier: 3.0.0
@@ -1557,7 +1557,7 @@ importers:
specifier: 7.3.13
version: 7.3.13
'@vercel/build-utils':
specifier: 8.2.1
specifier: 8.2.2
version: link:../build-utils
'@vercel/error-utils':
specifier: 2.0.2
@@ -1566,7 +1566,7 @@ importers:
specifier: 3.0.2
version: link:../frameworks
'@vercel/fs-detectors':
specifier: 5.2.3
specifier: 5.2.4
version: link:../fs-detectors
'@vercel/routing-utils':
specifier: 3.1.0
@@ -5529,8 +5529,8 @@ packages:
- supports-color
dev: false
/@vercel/nft@0.27.0:
resolution: {integrity: sha512-W5pValyhToK9hbgEUAM6sLRUIl1I++RsFnXKHXtND50P1+vZ+OYPCzq1OOz0Ok6ghK6aOwae8G/rEAXkLedC+w==}
/@vercel/nft@0.27.2:
resolution: {integrity: sha512-7LeioS1yE5hwPpQfD3DdH04tuugKjo5KrJk3yK5kAI3Lh76iSsK/ezoFQfzuT08X3ZASQOd1y9ePjLNI9+TxTQ==}
engines: {node: '>=16'}
hasBin: true
dependencies:
@@ -6098,6 +6098,7 @@ packages:
/are-we-there-yet@2.0.0:
resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==}
engines: {node: '>=10'}
deprecated: This package is no longer supported.
dependencies:
delegates: 1.0.0
readable-stream: 3.6.2
@@ -9252,6 +9253,7 @@ packages:
/gauge@3.0.2:
resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==}
engines: {node: '>=10'}
deprecated: This package is no longer supported.
dependencies:
aproba: 2.0.0
color-support: 1.1.3
@@ -9437,6 +9439,7 @@ packages:
/glob@7.1.6:
resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==}
deprecated: Glob versions prior to v9 are no longer supported
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
@@ -12540,6 +12543,7 @@ packages:
/npmlog@5.0.1:
resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==}
deprecated: This package is no longer supported.
dependencies:
are-we-there-yet: 2.0.0
console-control-strings: 1.1.0