Compare commits

...

4 Commits

Author SHA1 Message Date
Sean Massa
e8c7db59cf Publish Stable
- @vercel/build-utils@5.0.7
 - vercel@27.3.2
 - @vercel/client@12.1.6
 - @vercel/go@2.0.11
 - @vercel/hydrogen@0.0.8
 - @vercel/next@3.1.11
 - @vercel/node@2.5.2
 - @vercel/python@3.1.3
 - @vercel/redwood@1.0.12
 - @vercel/remix@1.0.13
 - @vercel/ruby@1.3.19
 - @vercel/static-build@1.0.12
2022-07-29 13:45:48 -05:00
Steven
57b230e25f [all] Revert ncc back to 0.24.0 (#8276) 2022-07-29 13:44:09 -05:00
Steven
ab3fb25790 [tests] Run dev e2e against same cli version (#8274)
The dev integration tests compare `vc dev` with a real deployment to make sure the results are the same. This PR ensures the deployment uses the same version of Vercel CLI as the local `vc dev` instance.

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2022-07-29 13:19:36 -04:00
Steven
88d98f7497 [cli] Fix vc build with legacy @now/static (#8273)
There was a special case for `@vercel/static` but vc build was missing a special case for the legacy `@now/static`, which should work the same way.
2022-07-29 11:40:09 -04:00
23 changed files with 118 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "5.0.6",
"version": "5.0.7",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
@@ -31,7 +31,7 @@
"@types/node-fetch": "^2.1.6",
"@types/semver": "6.0.0",
"@types/yazl": "2.4.2",
"@vercel/ncc": "0.34.0",
"@vercel/ncc": "0.24.0",
"aggregate-error": "3.0.1",
"async-retry": "1.2.3",
"async-sema": "2.1.4",

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "27.3.1",
"version": "27.3.2",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -42,16 +42,16 @@
"node": ">= 14"
},
"dependencies": {
"@vercel/build-utils": "5.0.6",
"@vercel/go": "2.0.10",
"@vercel/hydrogen": "0.0.7",
"@vercel/next": "3.1.10",
"@vercel/node": "2.5.1",
"@vercel/python": "3.1.2",
"@vercel/redwood": "1.0.11",
"@vercel/remix": "1.0.12",
"@vercel/ruby": "1.3.18",
"@vercel/static-build": "1.0.11",
"@vercel/build-utils": "5.0.7",
"@vercel/go": "2.0.11",
"@vercel/hydrogen": "0.0.8",
"@vercel/next": "3.1.11",
"@vercel/node": "2.5.2",
"@vercel/python": "3.1.3",
"@vercel/redwood": "1.0.12",
"@vercel/remix": "1.0.13",
"@vercel/ruby": "1.3.19",
"@vercel/static-build": "1.0.12",
"update-notifier": "5.1.0"
},
"devDependencies": {
@@ -97,11 +97,11 @@
"@types/which": "1.3.2",
"@types/write-json-file": "2.2.1",
"@types/yauzl-promise": "2.1.0",
"@vercel/client": "12.1.5",
"@vercel/client": "12.1.6",
"@vercel/frameworks": "1.1.1",
"@vercel/fs-detectors": "2.0.2",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.34.0",
"@vercel/ncc": "0.24.0",
"@zeit/source-map-support": "0.6.2",
"ajv": "6.12.2",
"alpha-sort": "2.0.1",

View File

@@ -81,7 +81,7 @@ export async function resolveBuilders(
continue;
}
if (name === '@vercel/static') {
if (name === '@vercel/static' || name === '@now/static') {
// `@vercel/static` is a special-case built-in builder
builders.set(name, {
builder: staticBuilder,

View File

@@ -380,18 +380,22 @@ test(
})
);
test(
'[vercel dev] Should support `*.go` API serverless functions',
testFixtureStdio('go', async (testPath: any) => {
await testPath(200, `/api`, 'This is the index page');
await testPath(200, `/api/index`, 'This is the index page');
await testPath(200, `/api/index.go`, 'This is the index page');
await testPath(200, `/api/another`, 'This is another page');
await testPath(200, '/api/another.go', 'This is another page');
await testPath(200, `/api/foo`, 'Req Path: /api/foo');
await testPath(200, `/api/bar`, 'Req Path: /api/bar');
})
);
// DISABLED: These assertions rely on different Go api endpoints existing
// but we can't currently compile those. Fixing in:
// https://linear.app/vercel/issue/VCCLI-111/fix-gotestfixtures08-include-files
// test(
// '[vercel dev] Should support `*.go` API serverless functions',
// testFixtureStdio('go', async (testPath: any) => {
// await testPath(200, `/api`, 'This is the index page');
// await testPath(200, `/api/index`, 'This is the index page');
// await testPath(200, `/api/index.go`, 'This is the index page');
// await testPath(200, `/api/another`, 'This is another page');
// await testPath(200, '/api/another.go', 'This is another page');
// await testPath(200, `/api/foo`, 'Req Path: /api/foo');
// await testPath(200, `/api/bar`, 'Req Path: /api/bar');
// })
// );
test(
'[vercel dev] Should set the `ts-node` "target" to match Node.js version',

View File

@@ -347,6 +347,9 @@ function testFixtureStdio(
? ['--scope', process.env.VERCEL_TEAM_ID]
: []),
'deploy',
...(process.env.VERCEL_CLI_VERSION
? ['--build-env', `VERCEL_CLI_VERSION=${process.env.VERCEL_CLI_VERSION}`]
: []),
'--public',
'--debug',
],

View File

@@ -0,0 +1,7 @@
{
"orgId": ".",
"projectId": ".",
"settings": {
"framework": null
}
}

View File

@@ -0,0 +1 @@
this file should be ignored

View File

@@ -0,0 +1,8 @@
{
"builds": [
{
"src": "www/**",
"use": "@now/static"
}
]
}

View File

@@ -0,0 +1 @@
<h1>Now</h1>

View File

@@ -342,7 +342,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
},
'lambda-with-php-runtime': {
'api/test.php': `<?php echo 'Hello from PHP'; ?>`,
'now.json': JSON.stringify({
'vercel.json': JSON.stringify({
functions: {
'api/**/*.php': {
runtime: 'vercel-php@0.1.0',
@@ -352,7 +352,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
},
'lambda-with-invalid-runtime': {
'api/test.php': `<?php echo 'Hello from PHP'; ?>`,
'now.json': JSON.stringify({
'vercel.json': JSON.stringify({
functions: {
'api/**/*.php': {
memory: 128,

View File

@@ -233,14 +233,6 @@ const waitForPrompt = (cp, assertion) =>
cp.stderr.on('data', listener);
});
const getDeploymentBuildsByUrl = async url => {
const hostRes = await apiFetch(`/v10/now/deployments/get?url=${url}`);
const { id } = await hostRes.json();
const buildsRes = await apiFetch(`/v10/now/deployments/${id}/builds`);
const { builds } = await buildsRes.json();
return builds;
};
const createUser = async () => {
await retry(
async () => {
@@ -2907,11 +2899,10 @@ test('deploy a Lambda with a specific runtime', async t => {
t.is(output.exitCode, 0, formatOutput(output));
const { host: url } = new URL(output.stdout);
const builds = await getDeploymentBuildsByUrl(url);
const build = builds.find(b => b.use && b.use.includes('php')) || builds[0];
t.is(build.use, 'vercel-php@0.1.0', JSON.stringify(build, null, 2));
const url = new URL(output.stdout);
const res = await fetch(`${url}/api/test`);
const text = await res.text();
t.is(text, 'Hello from PHP');
});
test('fail to deploy a Lambda with a specific runtime but without a locked version', async t => {

View File

@@ -47,6 +47,37 @@ describe('build', () => {
}
});
it('should build with `@now/static`', async () => {
const cwd = fixture('now-static');
const output = join(cwd, '.vercel/output');
try {
process.chdir(cwd);
const exitCode = await build(client);
expect(exitCode).toEqual(0);
const builds = await fs.readJSON(join(output, 'builds.json'));
expect(builds).toMatchObject({
target: 'preview',
builds: [
{
require: '@now/static',
apiVersion: 2,
src: 'www/index.html',
use: '@now/static',
},
],
});
const files = await fs.readdir(join(output, 'static'));
expect(files).toEqual(['www']);
const www = await fs.readdir(join(output, 'static', 'www'));
expect(www).toEqual(['index.html']);
} finally {
process.chdir(originalCwd);
delete process.env.__VERCEL_BUILD_RUNNING;
}
});
it('should build with `@vercel/node`', async () => {
const cwd = fixture('node');
const output = join(cwd, '.vercel/output');

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "12.1.5",
"version": "12.1.6",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -42,7 +42,7 @@
]
},
"dependencies": {
"@vercel/build-utils": "5.0.6",
"@vercel/build-utils": "5.0.7",
"@vercel/routing-utils": "2.0.0",
"@zeit/fetch": "5.2.0",
"async-retry": "1.2.3",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/go",
"version": "2.0.10",
"version": "2.0.11",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
@@ -25,8 +25,8 @@
"@types/fs-extra": "^5.0.5",
"@types/node-fetch": "^2.3.0",
"@types/tar": "^4.0.0",
"@vercel/build-utils": "5.0.6",
"@vercel/ncc": "0.34.0",
"@vercel/build-utils": "5.0.7",
"@vercel/ncc": "0.24.0",
"async-retry": "1.3.1",
"execa": "^1.0.0",
"fs-extra": "^7.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/hydrogen",
"version": "0.0.7",
"version": "0.0.8",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -22,7 +22,7 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "*",
"@vercel/build-utils": "5.0.6",
"@vercel/build-utils": "5.0.7",
"typescript": "4.6.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.1.10",
"version": "3.1.11",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -45,7 +45,7 @@
"@types/semver": "6.0.0",
"@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "5.0.6",
"@vercel/build-utils": "5.0.7",
"@vercel/nft": "0.21.0",
"@vercel/routing-utils": "2.0.0",
"async-sema": "3.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.5.1",
"version": "2.5.2",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -31,7 +31,7 @@
},
"dependencies": {
"@types/node": "*",
"@vercel/build-utils": "5.0.6",
"@vercel/build-utils": "5.0.7",
"@vercel/node-bridge": "3.0.0",
"@vercel/static-config": "2.0.1",
"edge-runtime": "1.0.1",
@@ -52,7 +52,7 @@
"@types/jest": "27.4.1",
"@types/node-fetch": "^2.6.1",
"@types/test-listen": "1.1.0",
"@vercel/ncc": "0.34.0",
"@vercel/ncc": "0.24.0",
"@vercel/nft": "0.21.0",
"content-type": "1.0.4",
"cookie": "0.4.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/python",
"version": "3.1.2",
"version": "3.1.3",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -23,8 +23,8 @@
"devDependencies": {
"@types/execa": "^0.9.0",
"@types/jest": "27.4.1",
"@vercel/build-utils": "5.0.6",
"@vercel/ncc": "0.34.0",
"@vercel/build-utils": "5.0.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.11",
"version": "1.0.12",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs",
@@ -28,6 +28,6 @@
"@types/aws-lambda": "8.10.19",
"@types/node": "*",
"@types/semver": "6.0.0",
"@vercel/build-utils": "5.0.6"
"@vercel/build-utils": "5.0.7"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix",
"version": "1.0.12",
"version": "1.0.13",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -26,7 +26,7 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "*",
"@vercel/build-utils": "5.0.6",
"@vercel/build-utils": "5.0.7",
"typescript": "4.6.4"
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "@vercel/ruby",
"author": "Nathan Cahill <nathan@nathancahill.com>",
"version": "1.3.18",
"version": "1.3.19",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
@@ -23,8 +23,8 @@
"devDependencies": {
"@types/fs-extra": "8.0.0",
"@types/semver": "6.0.0",
"@vercel/build-utils": "5.0.6",
"@vercel/ncc": "0.34.0",
"@vercel/build-utils": "5.0.7",
"@vercel/ncc": "0.24.0",
"execa": "2.0.4",
"fs-extra": "^7.0.1",
"semver": "6.1.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "1.0.11",
"version": "1.0.12",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -37,9 +37,9 @@
"@types/ms": "0.7.31",
"@types/node-fetch": "2.5.4",
"@types/promise-timeout": "1.3.0",
"@vercel/build-utils": "5.0.6",
"@vercel/build-utils": "5.0.7",
"@vercel/frameworks": "1.1.1",
"@vercel/ncc": "0.34.0",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.0.0",
"fs-extra": "10.0.0",
"get-port": "5.0.0",

View File

@@ -3194,10 +3194,10 @@
xdg-app-paths "5.1.0"
yauzl-promise "2.1.3"
"@vercel/ncc@0.34.0":
version "0.34.0"
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.34.0.tgz#d0139528320e46670d949c82967044a8f66db054"
integrity sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==
"@vercel/ncc@0.24.0":
version "0.24.0"
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.24.0.tgz#a2e8783a185caa99b5d8961a57dfc9665de16296"
integrity sha512-crqItMcIwCkvdXY/V3/TzrHJQx6nbIaRqE1cOopJhgGX6izvNov40SmD//nS5flfEvdK54YGjwVVq+zG6crjOg==
"@vercel/nft@0.21.0":
version "0.21.0"