Compare commits

..

5 Commits

Author SHA1 Message Date
Steven
a825bc9540 Publish Stable
- @vercel/build-utils@5.5.0
 - vercel@28.4.2
 - @vercel/client@12.2.7
 - @vercel/go@2.2.8
 - @vercel/hydrogen@0.0.21
 - @vercel/next@3.1.29
 - @vercel/node@2.5.18
 - @vercel/python@3.1.17
 - @vercel/redwood@1.0.26
 - @vercel/remix@1.0.27
 - @vercel/ruby@1.3.34
 - @vercel/static-build@1.0.26
2022-09-22 16:50:27 -04:00
JJ Kasper
f5486a8297 [next] Update to route app rsc paths correctly (#8611)
### Related Issues

x-ref: [slack thread](https://vercel.slack.com/archives/C035J346QQL/p1663799417151099)

Failing probes are unrelated, more info can be seen in [this thread](https://vercel.slack.com/archives/C035J346QQL/p1663820032810519?thread_ts=1663775935.504379&cid=C035J346QQL)
2022-09-22 20:44:40 +00:00
Mark Glagola
225e0a4de3 [tests] Use new VERCEL_TEST_TOKEN for tests (#8614)
Use `VERCEL_TEST_TOKEN` for tests
2022-09-22 16:07:43 -04:00
Steven
0ecfdc1325 [tests] Add timeout for broken actions/setup-node@v3 (#8613)
This PR will make sure that CI fails fast if there is a network issue when restoring the cache.

This has been a known issue for 3 months and no resolution:

- https://github.com/actions/cache/issues/810
2022-09-22 14:42:48 +00:00
Gal Schlezinger
628409d233 [build-utils] support providing execution regions in Edge Functions (#8612) 2022-09-22 14:38:33 +03:00
22 changed files with 118 additions and 55 deletions

View File

@@ -37,6 +37,8 @@ jobs:
- name: Setup Node
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/setup-node@v3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: 5 # https://github.com/actions/cache/issues/810
with:
node-version: 14
cache: 'yarn'

View File

@@ -31,6 +31,8 @@ jobs:
with:
go-version: '1.13.15'
- uses: actions/setup-node@v3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: 5 # https://github.com/actions/cache/issues/810
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
@@ -38,5 +40,5 @@ jobs:
- run: yarn run build
- run: yarn test-integration-cli
env:
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}

View File

@@ -31,6 +31,8 @@ jobs:
with:
fetch-depth: 2
- uses: actions/setup-node@v3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: 5 # https://github.com/actions/cache/issues/810
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

View File

@@ -29,6 +29,8 @@ jobs:
with:
go-version: '1.13.15'
- uses: actions/setup-node@v3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: 5 # https://github.com/actions/cache/issues/810
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
@@ -65,6 +67,8 @@ jobs:
with:
go-version: '1.13.15'
- uses: actions/setup-node@v3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: 5 # https://github.com/actions/cache/issues/810
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
@@ -84,8 +88,8 @@ jobs:
shell: bash
env:
VERCEL_CLI_VERSION: ${{ needs.setup.outputs.dplUrl }}/tarballs/vercel.tgz
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
conclusion:

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "5.4.4",
"version": "5.5.0",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",

View File

@@ -38,6 +38,9 @@ export class EdgeFunction {
*/
assets?: { name: string; path: string }[];
/** The regions where the edge function will be executed on */
regions?: 'auto' | string[] | 'all' | 'default';
constructor(params: Omit<EdgeFunction, 'type'>) {
this.type = 'EdgeFunction';
this.name = params.name;
@@ -46,5 +49,6 @@ export class EdgeFunction {
this.files = params.files;
this.envVarsInUse = params.envVarsInUse;
this.assets = params.assets;
this.regions = params.regions;
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.4.1",
"version": "28.4.2",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -41,16 +41,16 @@
"node": ">= 14"
},
"dependencies": {
"@vercel/build-utils": "5.4.4",
"@vercel/go": "2.2.7",
"@vercel/hydrogen": "0.0.20",
"@vercel/next": "3.1.28",
"@vercel/node": "2.5.17",
"@vercel/python": "3.1.16",
"@vercel/redwood": "1.0.25",
"@vercel/remix": "1.0.26",
"@vercel/ruby": "1.3.33",
"@vercel/static-build": "1.0.25",
"@vercel/build-utils": "5.5.0",
"@vercel/go": "2.2.8",
"@vercel/hydrogen": "0.0.21",
"@vercel/next": "3.1.29",
"@vercel/node": "2.5.18",
"@vercel/python": "3.1.17",
"@vercel/redwood": "1.0.26",
"@vercel/remix": "1.0.27",
"@vercel/ruby": "1.3.34",
"@vercel/static-build": "1.0.26",
"update-notifier": "5.1.0"
},
"devDependencies": {
@@ -95,7 +95,7 @@
"@types/which": "1.3.2",
"@types/write-json-file": "2.2.1",
"@types/yauzl-promise": "2.1.0",
"@vercel/client": "12.2.6",
"@vercel/client": "12.2.7",
"@vercel/frameworks": "1.1.6",
"@vercel/fs-detectors": "3.4.0",
"@vercel/fun": "1.0.4",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "12.2.6",
"version": "12.2.7",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -43,7 +43,7 @@
]
},
"dependencies": {
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"@vercel/routing-utils": "2.0.2",
"@zeit/fetch": "5.2.0",
"async-retry": "1.2.3",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/go",
"version": "2.2.7",
"version": "2.2.8",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
@@ -35,7 +35,7 @@
"@types/jest": "28.1.6",
"@types/node-fetch": "^2.3.0",
"@types/tar": "^4.0.0",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"@vercel/ncc": "0.24.0",
"async-retry": "1.3.1",
"execa": "^1.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/hydrogen",
"version": "0.0.20",
"version": "0.0.21",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -21,7 +21,7 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "*",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"typescript": "4.6.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.1.28",
"version": "3.1.29",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -44,7 +44,7 @@
"@types/semver": "6.0.0",
"@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"@vercel/nft": "0.22.1",
"@vercel/routing-utils": "2.0.2",
"async-sema": "3.0.1",

View File

@@ -1131,6 +1131,23 @@ export async function serverBuild({
});
}
if (appPathRoutesManifest) {
// create .rsc variant for app lambdas and edge functions
// to match prerenders so we can route the same when the
// __flight__ header is present
const edgeFunctions = middleware.edgeFunctions;
for (let route of Object.values(appPathRoutesManifest)) {
route = path.posix.join('./', route === '/' ? '/index' : route);
if (lambdas[route]) {
lambdas[`${route}.rsc`] = lambdas[route];
} else if (edgeFunctions[route]) {
edgeFunctions[`${route}.rsc`] = edgeFunctions[route];
}
}
}
return {
wildcard: wildcardConfig,
images:
@@ -1369,6 +1386,22 @@ export async function serverBuild({
// to prevent a local/deploy mismatch
...(!isCorrectMiddlewareOrder ? middleware.staticRoutes : []),
...(appDir
? [
{
src: `^${path.posix.join('/', entryDirectory, '/(.*)$')}`,
has: [
{
type: 'header',
key: '__flight__',
},
],
dest: path.posix.join('/', entryDirectory, '/$1.rsc'),
check: true,
},
]
: []),
// Next.js page lambdas, `static/` folder, reserved assets, and `public/`
// folder
{ handle: 'filesystem' },

View File

@@ -2229,7 +2229,11 @@ export async function getMiddlewareBundle({
prerenderBypassToken: string;
routesManifest: RoutesManifest;
isCorrectMiddlewareOrder: boolean;
}) {
}): Promise<{
staticRoutes: Route[];
dynamicRouteMap: Map<string, RouteWithSrc>;
edgeFunctions: Record<string, EdgeFunction>;
}> {
const middlewareManifest = await getMiddlewareManifest(
entryPath,
outputDirectory
@@ -2420,7 +2424,6 @@ export async function getMiddlewareBundle({
}
}
}
return source;
}

View File

@@ -11,16 +11,27 @@
"status": 200,
"mustContain": "hello from app/dashboard"
},
{
"path": "/dashboard",
"status": 200,
"headers": {
"__flight__": "1"
},
"mustContain": "M1:{",
"mustNotContain": "<html"
},
{
"path": "/dashboard/another",
"status": 200,
"mustContain": "hello from newroot/dashboard/another"
},
{
"path": "/dashboard/deployments/123",
"status": 200,
"mustContain": "hello from app/dashboard/deployments/[id]. ID is: <!-- -->123"
},
// TODO: uncomment after this is fixed upstream
// x-ref: https://vercel.slack.com/archives/C035J346QQL/p1663820032810519?thread_ts=1663775935.504379&cid=C035J346QQL
// {
// "path": "/dashboard/deployments/123",
// "status": 200,
// "mustContain": "hello from app/dashboard/deployments/[id]. ID is: <!-- -->123"
// },
{
"path": "/",
"status": 200,
@@ -31,11 +42,12 @@
"status": 200,
"mustContain": "hello from pages/blog/[slug]"
},
{
"path": "/dynamic/category-1/id-1",
"status": 200,
"mustContain": "{&quot;category&quot;:&quot;category-1&quot;,&quot;id&quot;:&quot;id-1&quot;}"
},
// TODO: uncomment after this is fixed upstream
// {
// "path": "/dynamic/category-1/id-1",
// "status": 200,
// "mustContain": "{&quot;category&quot;:&quot;category-1&quot;,&quot;id&quot;:&quot;id-1&quot;}"
// },
{
"path": "/dashboard/changelog",
"status": 200,

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.5.17",
"version": "2.5.18",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -31,7 +31,7 @@
"dependencies": {
"@edge-runtime/vm": "1.1.0-beta.32",
"@types/node": "*",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"@vercel/node-bridge": "3.0.0",
"@vercel/static-config": "2.0.3",
"edge-runtime": "1.1.0-beta.32",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/python",
"version": "3.1.16",
"version": "3.1.17",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -22,7 +22,7 @@
"devDependencies": {
"@types/execa": "^0.9.0",
"@types/jest": "27.4.1",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"@vercel/ncc": "0.24.0",
"execa": "^1.0.0",
"typescript": "4.3.4"

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/redwood",
"version": "1.0.25",
"version": "1.0.26",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs",
@@ -27,6 +27,6 @@
"@types/aws-lambda": "8.10.19",
"@types/node": "*",
"@types/semver": "6.0.0",
"@vercel/build-utils": "5.4.4"
"@vercel/build-utils": "5.5.0"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix",
"version": "1.0.26",
"version": "1.0.27",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -25,7 +25,7 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "*",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"typescript": "4.6.4"
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "@vercel/ruby",
"author": "Nathan Cahill <nathan@nathancahill.com>",
"version": "1.3.33",
"version": "1.3.34",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
@@ -22,7 +22,7 @@
"devDependencies": {
"@types/fs-extra": "8.0.0",
"@types/semver": "6.0.0",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"@vercel/ncc": "0.24.0",
"execa": "2.0.4",
"fs-extra": "^7.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "1.0.25",
"version": "1.0.26",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -36,7 +36,7 @@
"@types/ms": "0.7.31",
"@types/node-fetch": "2.5.4",
"@types/promise-timeout": "1.3.0",
"@vercel/build-utils": "5.4.4",
"@vercel/build-utils": "5.5.0",
"@vercel/frameworks": "1.1.6",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.0.2",

View File

@@ -200,8 +200,8 @@ async function fetchTokenWithRetry(retries = 5) {
NOW_TOKEN,
TEMP_TOKEN,
VERCEL_TOKEN,
VERCEL_TEAM_TOKEN,
VERCEL_REGISTRATION_URL,
VERCEL_TEST_TOKEN,
VERCEL_TEST_REGISTRATION_URL,
} = process.env;
if (VERCEL_TOKEN || NOW_TOKEN || TEMP_TOKEN) {
if (!TEMP_TOKEN) {
@@ -211,7 +211,7 @@ async function fetchTokenWithRetry(retries = 5) {
}
return VERCEL_TOKEN || NOW_TOKEN || TEMP_TOKEN;
}
if (!VERCEL_TEAM_TOKEN || !VERCEL_REGISTRATION_URL) {
if (!VERCEL_TEST_TOKEN || !VERCEL_TEST_REGISTRATION_URL) {
throw new Error(
process.env.CI
? 'Failed to create test deployment. This is expected for 3rd-party Pull Requests. Please run tests locally.'
@@ -219,10 +219,10 @@ async function fetchTokenWithRetry(retries = 5) {
);
}
try {
const res = await _fetch(VERCEL_REGISTRATION_URL, {
const res = await _fetch(VERCEL_TEST_REGISTRATION_URL, {
method: 'POST',
headers: {
Authorization: `Bearer ${VERCEL_TEAM_TOKEN}`,
Authorization: `Bearer ${VERCEL_TEST_TOKEN}`,
},
});
if (!res.ok) {

View File

@@ -1,6 +1,7 @@
const os = require('os');
const path = require('path');
const fs = require('fs-extra');
const json5 = require('json5');
const { glob } = require('@vercel/build-utils');
function runAnalyze(wrapper, context) {
@@ -18,7 +19,7 @@ async function runBuildLambda(inputPath) {
if (typeof expect !== 'undefined') {
expect(nowJsonRef).toBeDefined();
}
const nowJson = require(nowJsonRef.fsPath);
const nowJson = json5.parse(await fs.readFile(nowJsonRef.fsPath, 'utf8'));
const build = nowJson.builds[0];
if (typeof expect !== 'undefined') {