Compare commits

...

8 Commits

Author SHA1 Message Date
JJ Kasper
0964be1710 Publish Stable
- vercel@28.4.15
 - @vercel/client@12.2.16
 - @vercel/error-utils@1.0.3
 - @vercel/frameworks@1.1.11
 - @vercel/fs-detectors@3.4.8
 - @vercel/hydrogen@0.0.29
 - @vercel/next@3.2.9
 - @vercel/node-bridge@3.1.2
 - @vercel/node@2.6.2
 - @vercel/redwood@1.0.34
 - @vercel/remix@1.0.35
 - @vercel/routing-utils@2.1.2
 - @vercel/static-build@1.0.35
 - @vercel/static-config@2.0.6
2022-11-07 12:46:03 -08:00
JJ Kasper
9618ffe05f [next] Update rsc header handling (#8862)
### Related Issues

Required for https://github.com/vercel/next.js/pull/42482

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with
tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a
reviewer
- [ ] Issue from task tracker has a link to this PR
2022-11-07 12:42:26 -08:00
github-actions[bot]
832ba3fe23 [examples] Upgrade Next.js to version 13.0.2 (#8847)
This auto-generated PR updates Next.js to version 13.0.2
2022-11-04 16:18:30 -07:00
Ethan Arrowood
253b4fd1d2 [cli][client][error-utils][frameworks][fs-detectors][hydrogen][next][node-bridge][node][redwood][remix][routing-utils][static-config] update @types/node to v14 across repo (#8842)
### Related Issues

Updates @types/node to the latest version within the v14 major (based on `npm view @types/node`)

```
❯ npm view @types/node@'>=14.0.0 <15.0.0' version | tail -1
@types/node@14.18.33 '14.18.33'
```

This PR also fixes the various necessary type changes

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-11-04 20:21:13 +00:00
Nathan Rajlich
9e5f17b3c6 [cli] Allow vc link to overwrite existing link (#8845)
There was a regression in #8670 which caused `vc link` to be a no-op
when there was already a link to a Vercel project in the `.vercel`
directory.
2022-11-04 12:12:37 -07:00
Ethan Arrowood
39d0f8dbfc [cli] fix broken integration test (#8844)
### Related Issues

https://github.com/vercel/api/pull/15009 broke one of our integration tests. This PR fixes it.

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-11-04 00:12:56 +00:00
Andy McKay
a567d047d1 Publish Stable
- @vercel/build-utils@5.5.7
 - vercel@28.4.14
 - @vercel/client@12.2.15
 - @vercel/edge@0.1.1
 - @vercel/error-utils@1.0.2
 - @vercel/frameworks@1.1.10
 - @vercel/fs-detectors@3.4.7
 - @vercel/go@2.2.15
 - @vercel/hydrogen@0.0.28
 - @vercel/next@3.2.8
 - @vercel/node-bridge@3.1.1
 - @vercel/node@2.6.1
 - @vercel/python@3.1.24
 - @vercel/redwood@1.0.33
 - @vercel/remix@1.0.34
 - @vercel/routing-utils@2.1.1
 - @vercel/ruby@1.3.41
 - @vercel/static-build@1.0.34
 - @vercel/static-config@2.0.5
2022-11-02 13:14:37 -07:00
Steven
fdfb3a385e [error-utils] Allow publishing to npm (#8839)
> If you set "private": true in your package.json, then npm will refuse
to publish it.


https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private
2022-11-02 16:12:09 -04:00
39 changed files with 4505 additions and 268 deletions

View File

@@ -16,7 +16,7 @@
"unzip-stream": "0.3.0"
},
"devDependencies": {
"@types/node": "13.1.4",
"@types/node": "14.18.33",
"@types/node-fetch": "2.5.4",
"@vercel/node": "1.9.0",
"typescript": "3.9.6"

View File

@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,9 @@
"lint": "next lint"
},
"dependencies": {
"next": "13.0.1",
"eslint": "8.26.0",
"eslint-config-next": "13.0.2",
"next": "13.0.2",
"react": "18.2.0",
"react-dom": "18.2.0"
}

View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.4.13",
"version": "28.4.15",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -41,16 +41,16 @@
"node": ">= 14"
},
"dependencies": {
"@vercel/build-utils": "5.5.6",
"@vercel/go": "2.2.14",
"@vercel/hydrogen": "0.0.27",
"@vercel/next": "3.2.7",
"@vercel/node": "2.6.0",
"@vercel/python": "3.1.23",
"@vercel/redwood": "1.0.32",
"@vercel/remix": "1.0.33",
"@vercel/ruby": "1.3.40",
"@vercel/static-build": "1.0.33",
"@vercel/build-utils": "5.5.7",
"@vercel/go": "2.2.15",
"@vercel/hydrogen": "0.0.29",
"@vercel/next": "3.2.9",
"@vercel/node": "2.6.2",
"@vercel/python": "3.1.24",
"@vercel/redwood": "1.0.34",
"@vercel/remix": "1.0.35",
"@vercel/ruby": "1.3.41",
"@vercel/static-build": "1.0.35",
"update-notifier": "5.1.0"
},
"devDependencies": {
@@ -81,7 +81,7 @@
"@types/minimatch": "3.0.3",
"@types/mri": "1.1.0",
"@types/ms": "0.7.30",
"@types/node": "11.11.0",
"@types/node": "14.18.33",
"@types/node-fetch": "2.5.10",
"@types/npm-package-arg": "6.1.0",
"@types/pluralize": "0.0.29",
@@ -95,10 +95,10 @@
"@types/which": "1.3.2",
"@types/write-json-file": "2.2.1",
"@types/yauzl-promise": "2.1.0",
"@vercel/client": "12.2.14",
"@vercel/error-utils": "1.0.1",
"@vercel/frameworks": "1.1.9",
"@vercel/fs-detectors": "3.4.6",
"@vercel/client": "12.2.16",
"@vercel/error-utils": "1.0.3",
"@vercel/frameworks": "1.1.11",
"@vercel/fs-detectors": "3.4.8",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@zeit/source-map-support": "0.6.2",

View File

@@ -1,8 +1,7 @@
import { bold } from 'chalk';
import inquirer from 'inquirer';
import { EventEmitter } from 'events';
import { URLSearchParams } from 'url';
import { parse as parseUrl } from 'url';
import { URL } from 'url';
import { VercelConfig } from '@vercel/client';
import retry, { RetryFunction, Options as RetryOptions } from 'async-retry';
import fetch, { BodyInit, Headers, RequestInit, Response } from 'node-fetch';
@@ -87,25 +86,18 @@ export default class Client extends EventEmitter implements Stdio {
}
private _fetch(_url: string, opts: FetchOptions = {}) {
const parsedUrl = parseUrl(_url, true);
const apiUrl = parsedUrl.host
? `${parsedUrl.protocol}//${parsedUrl.host}`
: '';
const url = new URL(_url, this.apiUrl);
if (opts.accountId || opts.useCurrentTeam !== false) {
const query = new URLSearchParams(parsedUrl.query);
if (opts.accountId) {
if (opts.accountId.startsWith('team_')) {
query.set('teamId', opts.accountId);
url.searchParams.set('teamId', opts.accountId);
} else {
query.delete('teamId');
url.searchParams.delete('teamId');
}
} else if (opts.useCurrentTeam !== false && this.config.currentTeam) {
query.set('teamId', this.config.currentTeam);
url.searchParams.set('teamId', this.config.currentTeam);
}
_url = `${apiUrl}${parsedUrl.pathname}?${query}`;
}
const headers = new Headers(opts.headers);
@@ -122,7 +114,6 @@ export default class Client extends EventEmitter implements Stdio {
body = opts.body;
}
const url = `${apiUrl ? '' : this.apiUrl}${_url}`;
const requestId = this.requestIdCounter++;
return this.output.time(res => {
if (res) {
@@ -130,7 +121,7 @@ export default class Client extends EventEmitter implements Stdio {
res.statusText
}: ${res.headers.get('x-vercel-id')}`;
} else {
return `#${requestId}${opts.method || 'GET'} ${url}`;
return `#${requestId}${opts.method || 'GET'} ${url.href}`;
}
}, fetch(url, { ...opts, headers, body }));
}

View File

@@ -87,8 +87,12 @@ async function createBuildProcess(
return new Promise((resolve, reject) => {
// The first message that the builder process sends is the `ready` event
buildProcess.once('message', ({ type }) => {
if (type !== 'ready') {
buildProcess.once('message', data => {
if (
data !== null &&
typeof data === 'object' &&
(data as { type: string }).type !== 'ready'
) {
reject(new Error('Did not get "ready" event from builder'));
} else {
resolve(buildProcess);

View File

@@ -31,11 +31,11 @@ export function parseListen(str: string, defaultPort = 3000): ListenSpec {
return [url.pathname];
case 'tcp:':
url.port = url.port || String(defaultPort);
return [parseInt(url.port, 10), url.hostname];
return [parseInt(url.port, 10), url.hostname ?? undefined];
default:
if (!url.slashes) {
if (url.protocol === null) {
return [defaultPort, url.pathname];
return [defaultPort, url.pathname ?? undefined];
}
port = Number(url.hostname);
if (url.protocol && !isNaN(port)) {

View File

@@ -4,7 +4,7 @@
* @param querystring - The querystring to parse, also known as the "search" string.
*/
export function parseQueryString(
querystring?: string
querystring?: string | null
): Record<string, string[]> {
const query: Record<string, string[]> = Object.create(null);
if (!querystring || !querystring.startsWith('?') || querystring === '?') {
@@ -38,9 +38,9 @@ export function parseQueryString(
*/
export function formatQueryString(
query: Record<string, string[]> | undefined
): string | undefined {
): string | null {
if (!query) {
return undefined;
return null;
}
let s = '';
let prefix = '?';
@@ -55,5 +55,5 @@ export function formatQueryString(
prefix = '&';
}
}
return s || undefined;
return s || null;
}

View File

@@ -57,7 +57,8 @@ export async function devRouter(
phase?: HandleValue | null
): Promise<RouteResult> {
let result: RouteResult | undefined;
let { pathname: reqPathname = '/', search: reqSearch } = url.parse(reqUrl);
let { pathname: reqPathname, search: reqSearch } = url.parse(reqUrl);
reqPathname ??= '/';
const reqQuery = parseQueryString(reqSearch);
const combinedHeaders: HttpHeadersConfig = { ...previousHeaders };
let status: number | undefined;
@@ -130,7 +131,8 @@ export async function devRouter(
phase !== 'hit' &&
!isDestUrl
) {
const { pathname = '/' } = url.parse(destPath);
let { pathname } = url.parse(destPath);
pathname ??= '/';
const hasDestFile = await devServer.hasFilesystem(
pathname,
vercelConfig
@@ -186,8 +188,9 @@ export async function devRouter(
if (!destPath.startsWith('/')) {
destPath = `/${destPath}`;
}
const { pathname: destPathname = '/', search: destSearch } =
let { pathname: destPathname, search: destSearch } =
url.parse(destPath);
destPathname ??= '/';
const destQuery = parseQueryString(destSearch);
Object.assign(destQuery, reqQuery);
result = {

View File

@@ -1,4 +1,4 @@
import Client from '../client';
import type Client from '../client';
export default async function confirm(
client: Client,

View File

@@ -34,7 +34,10 @@ export async function ensureLink(
): Promise<LinkResult | number> {
let link = await getLinkedProject(client, cwd);
if (link.status === 'not_linked') {
if (
(link.status === 'linked' && opts.forceDelete) ||
link.status === 'not_linked'
) {
link = await setupAndLink(client, cwd, opts);
if (link.status === 'not_linked') {

View File

@@ -1,4 +1,6 @@
const { exec } = require('exeggcute');
const path = require('path');
const { existsSync, writeFileSync } = require('fs');
const a = require('./a');
const b = require('./b');
@@ -8,8 +10,14 @@ b();
exec('mkdir public', __dirname)
.then(() => {
exec('echo "Hello, World!" > public/index.html', __dirname).then(() => {
const cacheFile = path.join(__dirname, 'node_modules/.was-cached');
const cacheExists = existsSync(cacheFile);
exec(
`echo ${cacheExists ? 'cache exists' : 'no cache'} > public/index.html`,
__dirname
).then(() => {
console.log('Success');
writeFileSync(cacheFile, '1');
});
})
.catch(console.error);

View File

@@ -3446,23 +3446,20 @@ test('deploy pnpm twice using pnp and symlink=false', async t => {
]);
}
function logs(deploymentUrl) {
return execa(binaryPath, ['logs', deploymentUrl, ...defaultArgs]);
}
let { exitCode, stderr, stdout } = await deploy();
t.is(exitCode, 0, formatOutput({ stderr, stdout }));
let { stdout: logsOutput } = await logs(stdout);
t.regex(logsOutput, /Build Cache not found/m);
let page = await fetch(stdout);
let text = await page.text();
t.is(text, 'no cache\n');
({ exitCode, stderr, stdout } = await deploy());
t.is(exitCode, 0, formatOutput({ stderr, stdout }));
({ stdout: logsOutput } = await logs(stdout));
page = await fetch(stdout);
text = await page.text();
t.regex(logsOutput, /Build cache downloaded/m);
t.is(text, 'cache exists\n');
});
test('reject deploying with wrong team .vercel config', async t => {

View File

@@ -23,7 +23,7 @@ class MockStream extends PassThrough {
this.isTTY = true;
}
// These is for the `ora` module
// These are for the `ora` module
clearLine() {}
cursorTo() {}
}

View File

@@ -0,0 +1,125 @@
import { basename, join } from 'path';
import { mkdtemp, readJSON, remove } from 'fs-extra';
import link from '../../../src/commands/link';
import { client } from '../../mocks/client';
import { useUser } from '../../mocks/user';
import { useTeams } from '../../mocks/team';
import {
defaultProject,
useProject,
useUnknownProject,
} from '../../mocks/project';
import { tmpdir } from 'os';
describe('link', () => {
const origCwd = process.cwd();
it('should prompt for link', async () => {
const cwd = await mkdtemp(join(tmpdir(), 'cli-'));
try {
process.chdir(cwd);
const user = useUser();
useTeams('team_dummy');
const { project } = useProject({
...defaultProject,
id: basename(cwd),
name: basename(cwd),
});
useUnknownProject();
const exitCodePromise = link(client);
await expect(client.stderr).toOutput('Set up');
client.stdin.write('y\n');
await expect(client.stderr).toOutput(
'Which scope should contain your project?'
);
client.stdin.write('y\n');
await expect(client.stderr).toOutput('Link to it?');
client.stdin.write('y\n');
await expect(client.stderr).toOutput(
`Linked to ${user.username}/${project.name} (created .vercel and added it to .gitignore)`
);
await expect(exitCodePromise).resolves.toEqual(0);
const projectJson = await readJSON(join(cwd, '.vercel/project.json'));
expect(projectJson.orgId).toEqual(user.id);
expect(projectJson.projectId).toEqual(project.id);
} finally {
process.chdir(origCwd);
await remove(cwd);
}
});
it('should allow specifying `--project` flag', async () => {
const cwd = await mkdtemp(join(tmpdir(), 'cli-'));
try {
process.chdir(cwd);
const user = useUser();
useTeams('team_dummy');
const { project } = useProject({
...defaultProject,
id: basename(cwd),
name: basename(cwd),
});
useUnknownProject();
client.setArgv('--project', project.name!, '--yes');
const exitCodePromise = link(client);
await expect(client.stderr).toOutput(
`Linked to ${user.username}/${project.name} (created .vercel and added it to .gitignore)`
);
await expect(exitCodePromise).resolves.toEqual(0);
const projectJson = await readJSON(join(cwd, '.vercel/project.json'));
expect(projectJson.orgId).toEqual(user.id);
expect(projectJson.projectId).toEqual(project.id);
} finally {
process.chdir(origCwd);
await remove(cwd);
}
});
it('should allow overwriting existing link', async () => {
const cwd = await mkdtemp(join(tmpdir(), 'cli-'));
try {
process.chdir(cwd);
const user = useUser();
useTeams('team_dummy');
const { project: proj1 } = useProject({
...defaultProject,
id: 'one',
name: 'one',
});
const { project: proj2 } = useProject({
...defaultProject,
id: 'two',
name: 'two',
});
useUnknownProject();
client.setArgv('--project', proj1.name!, '--yes');
await expect(link(client)).resolves.toEqual(0);
let projectJson = await readJSON(join(cwd, '.vercel/project.json'));
expect(projectJson.orgId).toEqual(user.id);
expect(projectJson.projectId).toEqual(proj1.id);
client.setArgv('--project', proj2.name!, '--yes');
await expect(link(client)).resolves.toEqual(0);
projectJson = await readJSON(join(cwd, '.vercel/project.json'));
expect(projectJson.orgId).toEqual(user.id);
expect(projectJson.projectId).toEqual(proj2.id);
} finally {
process.chdir(origCwd);
await remove(cwd);
}
});
});

View File

@@ -23,24 +23,24 @@ describe('parseQueryString', () => {
const parsed = parseQueryString('');
expect(parsed).toEqual({});
const format = formatQueryString(parsed);
expect(format).toEqual(undefined);
expect(format).toEqual(null);
});
it('should work with question mark', async () => {
const parsed = parseQueryString('?');
expect(parsed).toEqual({});
const format = formatQueryString(parsed);
expect(format).toEqual(undefined);
expect(format).toEqual(null);
});
it('should work without question mark', async () => {
const parsed = parseQueryString('blarg');
expect(parsed).toEqual({});
const format = formatQueryString(parsed);
expect(format).toEqual(undefined);
expect(format).toEqual(null);
});
it('should work with undefined', async () => {
const parsed = parseQueryString(undefined);
expect(parsed).toEqual({});
const format = formatQueryString(parsed);
expect(format).toEqual(undefined);
expect(format).toEqual(null);
});
});

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "12.2.14",
"version": "12.2.16",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -28,7 +28,7 @@
"@types/jest": "27.4.1",
"@types/minimatch": "3.0.5",
"@types/ms": "0.7.30",
"@types/node": "12.0.4",
"@types/node": "14.18.33",
"@types/node-fetch": "2.5.4",
"@types/recursive-readdir": "2.2.0",
"@types/tar-fs": "1.16.1",
@@ -43,8 +43,8 @@
]
},
"dependencies": {
"@vercel/build-utils": "5.5.6",
"@vercel/routing-utils": "2.1.0",
"@vercel/build-utils": "5.5.7",
"@vercel/routing-utils": "2.1.2",
"@zeit/fetch": "5.2.0",
"async-retry": "1.2.3",
"async-sema": "3.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/edge",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",

View File

@@ -1,7 +1,6 @@
{
"name": "@vercel/error-utils",
"version": "1.0.1",
"private": true,
"version": "1.0.3",
"description": "A collection of error utilities for vercel/vercel",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -18,7 +17,7 @@
"license": "MIT",
"devDependencies": {
"@types/jest": "29.2.1",
"@types/node": "16.11.7",
"@types/node": "14.18.33",
"jest": "29.2.2",
"ts-jest": "29.0.3",
"typescript": "^4.8.4"

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/frameworks",
"version": "1.1.9",
"version": "1.1.11",
"main": "./dist/frameworks.js",
"types": "./dist/frameworks.d.ts",
"files": [
@@ -19,9 +19,9 @@
"devDependencies": {
"@types/jest": "27.4.1",
"@types/js-yaml": "3.12.1",
"@types/node": "12.0.4",
"@types/node": "14.18.33",
"@types/node-fetch": "2.5.8",
"@vercel/routing-utils": "2.1.0",
"@vercel/routing-utils": "2.1.2",
"ajv": "6.12.2",
"typescript": "4.3.4"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "3.4.6",
"version": "3.4.8",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -19,8 +19,8 @@
"test-unit": "yarn test"
},
"dependencies": {
"@vercel/frameworks": "1.1.9",
"@vercel/routing-utils": "2.1.0",
"@vercel/frameworks": "1.1.11",
"@vercel/routing-utils": "2.1.2",
"glob": "8.0.3",
"js-yaml": "4.1.0",
"json5": "2.2.1",
@@ -32,7 +32,7 @@
"@types/jest": "27.5.1",
"@types/js-yaml": "4.0.5",
"@types/minimatch": "3.0.5",
"@types/node": "12.12.20",
"@types/node": "14.18.33",
"@types/semver": "7.3.10",
"@vercel/build-utils": "4.2.0",
"typescript": "4.3.4"

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/go",
"version": "2.2.14",
"version": "2.2.15",
"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.5.6",
"@vercel/build-utils": "5.5.7",
"@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.27",
"version": "0.0.29",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -20,9 +20,9 @@
],
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "*",
"@vercel/build-utils": "5.5.6",
"@vercel/static-config": "2.0.4",
"@types/node": "14.18.33",
"@vercel/build-utils": "5.5.7",
"@vercel/static-config": "2.0.6",
"typescript": "4.6.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.2.7",
"version": "3.2.9",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -39,14 +39,14 @@
"@types/fs-extra": "8.0.0",
"@types/glob": "7.1.3",
"@types/next-server": "8.0.0",
"@types/node": "14.17.27",
"@types/node": "14.18.33",
"@types/resolve-from": "5.0.1",
"@types/semver": "6.0.0",
"@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "5.5.6",
"@vercel/build-utils": "5.5.7",
"@vercel/nft": "0.22.1",
"@vercel/routing-utils": "2.1.0",
"@vercel/routing-utils": "2.1.2",
"async-sema": "3.0.1",
"buffer-crc32": "0.2.13",
"cheerio": "1.0.0-rc.10",

View File

@@ -1137,6 +1137,8 @@ export async function serverBuild({
}
}
const rscHeader = routesManifest.rsc?.header || '__rsc__';
return {
wildcard: wildcardConfig,
images:
@@ -1390,7 +1392,7 @@ export async function serverBuild({
has: [
{
type: 'header',
key: '__rsc__',
key: rscHeader,
},
],
dest: path.posix.join('/', entryDirectory, '/index.rsc'),
@@ -1401,7 +1403,7 @@ export async function serverBuild({
has: [
{
type: 'header',
key: '__rsc__',
key: rscHeader,
},
],
dest: path.posix.join('/', entryDirectory, '/$1.rsc'),

View File

@@ -209,6 +209,10 @@ type RoutesManifestOld = {
defaultLocale: string;
}>;
};
rsc?: {
header: string;
varyHeader: string;
};
};
type RoutesManifestV4 = Omit<RoutesManifestOld, 'dynamicRoutes' | 'version'> & {
@@ -1991,6 +1995,9 @@ export const onPrerenderRoute =
allowQuery = [];
}
}
const rscVaryHeader =
routesManifest?.rsc?.varyHeader ||
'__rsc__, __next_router_state_tree__, __next_router_prefetch__';
prerenders[outputPathPage] = new Prerender({
expiration: initialRevalidate,
@@ -2008,7 +2015,7 @@ export const onPrerenderRoute =
...(isAppPathRoute
? {
initialHeaders: {
vary: '__rsc__, __next_router_state_tree__, __next_router_prefetch__',
vary: rscVaryHeader,
},
}
: {}),
@@ -2031,7 +2038,7 @@ export const onPrerenderRoute =
? {
initialHeaders: {
'content-type': 'application/octet-stream',
vary: '__rsc__, __next_router_state_tree__, __next_router_prefetch__',
vary: rscVaryHeader,
},
}
: {}),

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node-bridge",
"version": "3.1.0",
"version": "3.1.2",
"license": "MIT",
"main": "./index.js",
"repository": {
@@ -22,7 +22,7 @@
},
"devDependencies": {
"@types/aws-lambda": "8.10.19",
"@types/node": "*",
"@types/node": "14.18.33",
"jsonlines": "0.1.1",
"test-listen": "1.1.0",
"typescript": "4.3.4"

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.6.0",
"version": "2.6.2",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -30,10 +30,10 @@
},
"dependencies": {
"@edge-runtime/vm": "2.0.0",
"@types/node": "*",
"@vercel/build-utils": "5.5.6",
"@vercel/node-bridge": "3.1.0",
"@vercel/static-config": "2.0.4",
"@types/node": "14.18.33",
"@vercel/build-utils": "5.5.7",
"@vercel/node-bridge": "3.1.2",
"@vercel/static-config": "2.0.6",
"edge-runtime": "2.0.0",
"esbuild": "0.14.47",
"exit-hook": "2.2.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/python",
"version": "3.1.23",
"version": "3.1.24",
"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.5.6",
"@vercel/build-utils": "5.5.7",
"@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.32",
"version": "1.0.34",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs",
@@ -20,13 +20,13 @@
},
"dependencies": {
"@vercel/nft": "0.22.1",
"@vercel/routing-utils": "2.1.0",
"@vercel/routing-utils": "2.1.2",
"semver": "6.1.1"
},
"devDependencies": {
"@types/aws-lambda": "8.10.19",
"@types/node": "*",
"@types/node": "14.18.33",
"@types/semver": "6.0.0",
"@vercel/build-utils": "5.5.6"
"@vercel/build-utils": "5.5.7"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix",
"version": "1.0.33",
"version": "1.0.35",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -24,8 +24,8 @@
},
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "*",
"@vercel/build-utils": "5.5.6",
"@types/node": "14.18.33",
"@vercel/build-utils": "5.5.7",
"typescript": "4.6.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/routing-utils",
"version": "2.1.0",
"version": "2.1.2",
"description": "Vercel routing utilities",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -23,7 +23,7 @@
},
"devDependencies": {
"@types/jest": "27.4.1",
"@types/node": "12.12.20",
"@types/node": "14.18.33",
"ajv": "^6.0.0",
"typescript": "4.3.4"
},

View File

@@ -297,7 +297,12 @@ function replaceSegments(
safelyCompile(unescapeSegments(str), indexes, true)
);
} else {
query[key] = safelyCompile(unescapeSegments(strOrArray), indexes, true);
// TODO: handle strOrArray is undefined
query[key] = safelyCompile(
unescapeSegments(strOrArray as string),
indexes,
true
);
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "@vercel/ruby",
"author": "Nathan Cahill <nathan@nathancahill.com>",
"version": "1.3.40",
"version": "1.3.41",
"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.5.6",
"@vercel/build-utils": "5.5.7",
"@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.33",
"version": "1.0.35",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -36,11 +36,11 @@
"@types/ms": "0.7.31",
"@types/node-fetch": "2.5.4",
"@types/promise-timeout": "1.3.0",
"@vercel/build-utils": "5.5.6",
"@vercel/frameworks": "1.1.9",
"@vercel/build-utils": "5.5.7",
"@vercel/frameworks": "1.1.11",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.1.0",
"@vercel/static-config": "2.0.4",
"@vercel/routing-utils": "2.1.2",
"@vercel/static-config": "2.0.6",
"fs-extra": "10.0.0",
"get-port": "5.0.0",
"is-port-reachable": "2.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-config",
"version": "2.0.4",
"version": "2.0.6",
"license": "MIT",
"main": "./dist/index",
"repository": {
@@ -24,7 +24,7 @@
"devDependencies": {
"@swc/core": "1.2.182",
"@types/jest": "27.4.1",
"@types/node": "*"
"@types/node": "14.18.33"
},
"jest": {
"preset": "ts-jest",

View File

@@ -3033,30 +3033,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67"
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==
"@types/node@11.11.0":
version "11.11.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.0.tgz#070e9ce7c90e727aca0e0c14e470f9a93ffe9390"
integrity sha512-D5Rt+HXgEywr3RQJcGlZUCTCx1qVbCZpVk3/tOOA6spLNZdGm8BU+zRgdRYDoF1pO3RuXLxADzMrF903JlQXqg==
"@types/node@12.0.4":
version "12.0.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.4.tgz#46832183115c904410c275e34cf9403992999c32"
integrity sha512-j8YL2C0fXq7IONwl/Ud5Kt0PeXw22zGERt+HSSnwbKOJVsAGkEz3sFCYwaF9IOuoG1HOtE0vKCj6sXF7Q0+Vaw==
"@types/node@12.12.20":
version "12.12.20"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.20.tgz#7b693038ce661fe57a7ffa4679440b5e7c5e8b99"
integrity sha512-VAe+DiwpnC/g448uN+/3gRl4th0BTdrR9gSLIOHA+SUQskaYZQDOHG7xmjiE7JUhjbXnbXytf6Ih+/pA6CtMFQ==
"@types/node@14.17.27":
version "14.17.27"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.27.tgz#5054610d37bb5f6e21342d0e6d24c494231f3b85"
integrity sha512-94+Ahf9IcaDuJTle/2b+wzvjmutxXAEXU6O81JHblYXUg2BDG+dnBy7VxIPHKAyEEDHzCMQydTJuWvrE+Aanzw==
"@types/node@16.11.7":
version "16.11.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42"
integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==
"@types/node@14.18.33":
version "14.18.33"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.33.tgz#8c29a0036771569662e4635790ffa9e057db379b"
integrity sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==
"@types/normalize-package-data@^2.4.0":
version "2.4.0"