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

View File

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

View File

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

View File

@@ -380,18 +380,22 @@ test(
}) })
); );
test( // DISABLED: These assertions rely on different Go api endpoints existing
'[vercel dev] Should support `*.go` API serverless functions', // but we can't currently compile those. Fixing in:
testFixtureStdio('go', async (testPath: any) => { // https://linear.app/vercel/issue/VCCLI-111/fix-gotestfixtures08-include-files
await testPath(200, `/api`, 'This is the index page'); // test(
await testPath(200, `/api/index`, 'This is the index page'); // '[vercel dev] Should support `*.go` API serverless functions',
await testPath(200, `/api/index.go`, 'This is the index page'); // testFixtureStdio('go', async (testPath: any) => {
await testPath(200, `/api/another`, 'This is another page');
await testPath(200, '/api/another.go', 'This is another page'); // await testPath(200, `/api`, 'This is the index page');
await testPath(200, `/api/foo`, 'Req Path: /api/foo'); // await testPath(200, `/api/index`, 'This is the index page');
await testPath(200, `/api/bar`, 'Req Path: /api/bar'); // 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( test(
'[vercel dev] Should set the `ts-node` "target" to match Node.js version', '[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] ? ['--scope', process.env.VERCEL_TEAM_ID]
: []), : []),
'deploy', 'deploy',
...(process.env.VERCEL_CLI_VERSION
? ['--build-env', `VERCEL_CLI_VERSION=${process.env.VERCEL_CLI_VERSION}`]
: []),
'--public', '--public',
'--debug', '--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': { 'lambda-with-php-runtime': {
'api/test.php': `<?php echo 'Hello from PHP'; ?>`, 'api/test.php': `<?php echo 'Hello from PHP'; ?>`,
'now.json': JSON.stringify({ 'vercel.json': JSON.stringify({
functions: { functions: {
'api/**/*.php': { 'api/**/*.php': {
runtime: 'vercel-php@0.1.0', runtime: 'vercel-php@0.1.0',
@@ -352,7 +352,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
}, },
'lambda-with-invalid-runtime': { 'lambda-with-invalid-runtime': {
'api/test.php': `<?php echo 'Hello from PHP'; ?>`, 'api/test.php': `<?php echo 'Hello from PHP'; ?>`,
'now.json': JSON.stringify({ 'vercel.json': JSON.stringify({
functions: { functions: {
'api/**/*.php': { 'api/**/*.php': {
memory: 128, memory: 128,

View File

@@ -233,14 +233,6 @@ const waitForPrompt = (cp, assertion) =>
cp.stderr.on('data', listener); 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 () => { const createUser = async () => {
await retry( await retry(
async () => { async () => {
@@ -2907,11 +2899,10 @@ test('deploy a Lambda with a specific runtime', async t => {
t.is(output.exitCode, 0, formatOutput(output)); t.is(output.exitCode, 0, formatOutput(output));
const { host: url } = new URL(output.stdout); const url = new URL(output.stdout);
const res = await fetch(`${url}/api/test`);
const builds = await getDeploymentBuildsByUrl(url); const text = await res.text();
const build = builds.find(b => b.use && b.use.includes('php')) || builds[0]; t.is(text, 'Hello from PHP');
t.is(build.use, 'vercel-php@0.1.0', JSON.stringify(build, null, 2));
}); });
test('fail to deploy a Lambda with a specific runtime but without a locked version', async t => { 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 () => { it('should build with `@vercel/node`', async () => {
const cwd = fixture('node'); const cwd = fixture('node');
const output = join(cwd, '.vercel/output'); const output = join(cwd, '.vercel/output');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/python", "name": "@vercel/python",
"version": "3.1.2", "version": "3.1.3",
"main": "./dist/index.js", "main": "./dist/index.js",
"license": "MIT", "license": "MIT",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python", "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -23,8 +23,8 @@
"devDependencies": { "devDependencies": {
"@types/execa": "^0.9.0", "@types/execa": "^0.9.0",
"@types/jest": "27.4.1", "@types/jest": "27.4.1",
"@vercel/build-utils": "5.0.6", "@vercel/build-utils": "5.0.7",
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.24.0",
"execa": "^1.0.0", "execa": "^1.0.0",
"typescript": "4.3.4" "typescript": "4.3.4"
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/redwood", "name": "@vercel/redwood",
"version": "1.0.11", "version": "1.0.12",
"main": "./dist/index.js", "main": "./dist/index.js",
"license": "MIT", "license": "MIT",
"homepage": "https://vercel.com/docs", "homepage": "https://vercel.com/docs",
@@ -28,6 +28,6 @@
"@types/aws-lambda": "8.10.19", "@types/aws-lambda": "8.10.19",
"@types/node": "*", "@types/node": "*",
"@types/semver": "6.0.0", "@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", "name": "@vercel/remix",
"version": "1.0.12", "version": "1.0.13",
"license": "MIT", "license": "MIT",
"main": "./dist/index.js", "main": "./dist/index.js",
"homepage": "https://vercel.com/docs", "homepage": "https://vercel.com/docs",
@@ -26,7 +26,7 @@
"devDependencies": { "devDependencies": {
"@types/jest": "27.5.1", "@types/jest": "27.5.1",
"@types/node": "*", "@types/node": "*",
"@vercel/build-utils": "5.0.6", "@vercel/build-utils": "5.0.7",
"typescript": "4.6.4" "typescript": "4.6.4"
} }
} }

View File

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

View File

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

View File

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