[all] Rename packages to vercel and add logic to publish legacy package names to npm (#4233)

https://vercel.com/blog/zeit-is-now-vercel

* Updates all org packages from `@now` to `@vercel`
* Updates Now CLI package name from `now` to `vercel`
  * Packages contains `"bin"` entries for _both_ `vercel` and `now` in the package.json
* Updates `now-client` package name to `@vercel/client` (org scoped, for authenticity)

There is also a new `publish-legacy.sh` script which ensures that all the legacy package names (i.e. `now`, `now-client`, `@now/node`, etc.) will still be published as well.

We will remove this legacy publishing logic on Jan 1, 2021.
This commit is contained in:
Nathan Rajlich
2020-05-05 16:43:57 -07:00
committed by GitHub
parent 2765207c93
commit 8a68211cad
247 changed files with 696 additions and 519 deletions

View File

@@ -28,7 +28,7 @@ jobs:
- run: yarn run lint
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run lint once
- run: yarn run test-unit --clean false
- run: yarn workspace now run coverage
- run: yarn workspace vercel run coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run coverage once
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@ npm-debug.log
yarn-error.log
.nyc_output
coverage
coverage.lcov
*.swp
*.bak
*.tgz

View File

@@ -1,5 +1,5 @@
{
"name": "now-builders",
"name": "vercel-monorepo",
"version": "0.0.0",
"private": true,
"license": "MIT",
@@ -27,6 +27,7 @@
"json5": "2.1.1",
"lint-staged": "9.2.5",
"node-fetch": "2.6.0",
"npm-package-arg": "6.1.0",
"prettier": "1.18.2"
},
"scripts": {

View File

@@ -1,5 +1,5 @@
{
"name": "@now/frameworks",
"name": "@vercel/frameworks",
"version": "0.0.13",
"main": "frameworks.json",
"license": "UNLICENSED"

View File

@@ -1,5 +1,5 @@
{
"name": "@now/build-utils",
"name": "@vercel/build-utils",
"version": "2.2.2-canary.6",
"license": "MIT",
"main": "./dist/index.js",
@@ -12,8 +12,8 @@
},
"scripts": {
"build": "./build.sh",
"test-unit": "jest --env node --verbose --runInBand test/unit.*test.*",
"test-integration-once": "jest --env node --verbose --runInBand test/integration.test.js",
"test-unit": "jest --env node --verbose --runInBand --bail test/unit.*test.*",
"test-integration-once": "jest --env node --verbose --runInBand --bail test/integration.test.js",
"prepublishOnly": "./build.sh"
},
"devDependencies": {

View File

@@ -1,8 +1,9 @@
import minimatch from 'minimatch';
import { valid as validSemver } from 'semver';
import { parse as parsePath, extname } from 'path';
import { Route, Source } from '@now/routing-utils';
import { Route, Source } from '@vercel/routing-utils';
import { PackageJson, Builder, Config, BuilderFunctions } from './types';
import { isOfficialRuntime } from './';
interface ErrorResponse {
code: string;
@@ -55,7 +56,7 @@ export function detectApiDirectory(builders: Builder[]): string | null {
function getPublicBuilder(builders: Builder[]): Builder | null {
const builder = builders.find(
builder =>
builder.use === '@now/static' &&
isOfficialRuntime('static', builder.use) &&
/^.*\/\*\*\/\*$/.test(builder.src) &&
builder.config &&
builder.config.zeroConfig === true
@@ -390,11 +391,11 @@ function getApiMatches({ tag }: Options = {}) {
const config = { zeroConfig: true };
return [
{ src: 'api/**/*.js', use: `@now/node${withTag}`, config },
{ src: 'api/**/*.ts', use: `@now/node${withTag}`, config },
{ src: 'api/**/!(*_test).go', use: `@now/go${withTag}`, config },
{ src: 'api/**/*.py', use: `@now/python${withTag}`, config },
{ src: 'api/**/*.rb', use: `@now/ruby${withTag}`, config },
{ src: 'api/**/*.js', use: `@vercel/node${withTag}`, config },
{ src: 'api/**/*.ts', use: `@vercel/node${withTag}`, config },
{ src: 'api/**/!(*_test).go', use: `@vercel/go${withTag}`, config },
{ src: 'api/**/*.py', use: `@vercel/python${withTag}`, config },
{ src: 'api/**/*.rb', use: `@vercel/ruby${withTag}`, config },
];
}
@@ -456,7 +457,7 @@ function detectFrontBuilder(
}
if (framework === 'nextjs') {
return { src: 'package.json', use: `@now/next${withTag}`, config };
return { src: 'package.json', use: `@vercel/next${withTag}`, config };
}
// Entrypoints for other frameworks
@@ -479,7 +480,7 @@ function detectFrontBuilder(
return {
src: source || 'package.json',
use: `@now/static-build${withTag}`,
use: `@vercel/static-build${withTag}`,
config,
};
}
@@ -594,7 +595,7 @@ function checkUnusedFunctions(
}
// Next.js can use functions only for `src/pages` or `pages`
if (frontendBuilder && frontendBuilder.use.startsWith('@now/next')) {
if (frontendBuilder && isOfficialRuntime('next', frontendBuilder.use)) {
for (const fnKey of unusedFunctions.values()) {
if (fnKey.startsWith('pages/') || fnKey.startsWith('src/pages')) {
unusedFunctions.delete(fnKey);
@@ -959,7 +960,7 @@ function getRouteResult(
outputDirectory &&
frontendBuilder &&
!options.featHandleMiss &&
frontendBuilder.use === '@now/static'
isOfficialRuntime('static', frontendBuilder.use)
) {
defaultRoutes.push({
src: '/(.*)',

View File

@@ -1,4 +1,4 @@
import { Framework, FrameworkDetectionItem } from '@now/frameworks';
import { Framework, FrameworkDetectionItem } from '@vercel/frameworks';
import { DetectorFilesystem } from './detectors/filesystem';
export interface DetectFrameworkOptions {

View File

@@ -80,3 +80,14 @@ export { readConfigFile } from './fs/read-config-file';
export * from './schemas';
export * from './types';
export * from './errors';
/**
* Helper function to support both `@vercel` and legacy `@now` official Runtimes.
*/
export const isOfficialRuntime = (desired: string, name?: string): boolean => {
return (
typeof name === 'string' &&
(name.startsWith(`@vercel/${desired}`) ||
name.startsWith(`@now/${desired}`))
);
};

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "api/index.js", "use": "@now/node" }],
"builds": [{ "src": "api/index.js", "use": "@vercel/node" }],
"probes": [
{
"path": "/api/index.js",

View File

@@ -1,9 +1,9 @@
{
"version": 2,
"builds": [
{ "src": "with-npm/index.js", "use": "@now/node" },
{ "src": "with-yarn/index.js", "use": "@now/node" },
{ "src": "with-yarn-and-npm/index.js", "use": "@now/node" }
{ "src": "with-npm/index.js", "use": "@vercel/node" },
{ "src": "with-yarn/index.js", "use": "@vercel/node" },
{ "src": "with-yarn-and-npm/index.js", "use": "@vercel/node" }
],
"probes": [
{ "path": "/with-npm", "mustContain": "npm:RANDOMNESS_PLACEHOLDER" },

View File

@@ -3,7 +3,7 @@
"builds": [
{
"src": "index.js",
"use": "@now/node"
"use": "@vercel/node"
}
],
"probes": [{ "path": "/", "mustContain": "found:RANDOMNESS_PLACEHOLDER" }]

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
"build": { "env": { "NODE_ENV": "production" } },
"probes": [{ "path": "/", "mustContain": "node-env:RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
"build": { "env": { "NODE_ENV": "custom-value:RANDOMNESS_PLACEHOLDER" } },
"probes": [
{ "path": "/", "mustContain": "custom-value:RANDOMNESS_PLACEHOLDER" }

View File

@@ -2,8 +2,8 @@
"version": 2,
"build": { "env": { "NPM_ONLY_PRODUCTION": "1" } },
"builds": [
{ "src": "npm/package.json", "use": "@now/static-build" },
{ "src": "yarn/package.json", "use": "@now/static-build" }
{ "src": "npm/package.json", "use": "@vercel/static-build" },
{ "src": "yarn/package.json", "use": "@vercel/static-build" }
],
"probes": [
{ "path": "/npm", "mustContain": "npm-prod:RANDOMNESS_PLACEHOLDER" },

View File

@@ -27,7 +27,7 @@ for (const fixture of fs.readdirSync(fixturesPath)) {
}
// eslint-disable-next-line no-loop-func
it(`should build ${fixture}`, async () => {
it(`Should build "${fixture}"`, async () => {
await expect(
testDeployment(
{ builderUrl, buildUtilsUrl },
@@ -53,7 +53,7 @@ for (const builder of buildersToTestWith) {
// don't run all foreign fixtures, just some
if (['01-cowsay', '01-cache-headers', '03-env-vars'].includes(fixture)) {
// eslint-disable-next-line no-loop-func
it(`should build ${builder}/${fixture}`, async () => {
it(`Should build "${builder}/${fixture}"`, async () => {
await expect(
testDeployment(
{ builderUrl, buildUtilsUrl },
@@ -113,6 +113,7 @@ it('Test `detectBuilders` and `detectRoutes`', async () => {
const { builders, defaultRoutes } = await detectBuilders(files, pkg);
const nowConfig = { builds: builders, routes: defaultRoutes, probes };
await fs.writeFile(
path.join(fixture, 'now.json'),
JSON.stringify(nowConfig, null, 2)

View File

@@ -1,10 +1,10 @@
import { Source, Route, Handler } from '@now/routing-utils';
import { detectBuilders } from '../src';
import { Source, Route, Handler } from '@vercel/routing-utils';
import {
detectBuilders,
detectOutputDirectory,
detectApiDirectory,
detectApiExtensions,
} from '../';
} from '../src';
describe('Test `detectBuilders`', () => {
it('should never select now.json src', async () => {
@@ -35,7 +35,7 @@ describe('Test `detectBuilders`', () => {
};
const files = ['package.json', 'pages/index.js'];
const { builders, errors } = await detectBuilders(files, pkg);
expect(builders![0].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/next');
expect(errors).toBe(null);
});
@@ -46,7 +46,7 @@ describe('Test `detectBuilders`', () => {
};
const files = ['package.json', 'pages/index.js'];
const { builders, errors } = await detectBuilders(files, pkg);
expect(builders![0].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/next');
expect(errors).toBe(null);
});
@@ -75,7 +75,7 @@ describe('Test `detectBuilders`', () => {
it('no package.json + no build + raw static + api', async () => {
const files = ['api/users.js', 'index.html'];
const { builders, errors } = await detectBuilders(files);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/users.js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -86,7 +86,7 @@ describe('Test `detectBuilders`', () => {
it('package.json + no build + root + api', async () => {
const files = ['index.html', 'api/[endpoint].js', 'static/image.png'];
const { builders, errors } = await detectBuilders(files);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint].js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -102,7 +102,7 @@ describe('Test `detectBuilders`', () => {
];
const { builders } = await detectBuilders(files);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint]/[id].js');
expect(builders!.length).toBe(1);
});
@@ -115,9 +115,9 @@ describe('Test `detectBuilders`', () => {
const files = ['package.json', 'api/endpoint.js', 'public/index.html'];
const { builders } = await detectBuilders(files, pkg);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/next');
expect(builders![1].use).toBe('@vercel/next');
expect(builders![1].src).toBe('package.json');
expect(builders!.length).toBe(2);
});
@@ -130,9 +130,9 @@ describe('Test `detectBuilders`', () => {
const files = ['package.json', 'api/endpoint.js', 'index.html'];
const { builders } = await detectBuilders(files, pkg);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/next');
expect(builders![1].use).toBe('@vercel/next');
expect(builders![1].src).toBe('package.json');
expect(builders!.length).toBe(2);
});
@@ -141,7 +141,7 @@ describe('Test `detectBuilders`', () => {
const files = ['api/endpoint.js', 'index.html', 'favicon.ico'];
const { builders } = await detectBuilders(files);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -157,7 +157,7 @@ describe('Test `detectBuilders`', () => {
];
const { builders } = await detectBuilders(files);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('public/**/*');
@@ -201,7 +201,7 @@ describe('Test `detectBuilders`', () => {
const files = ['package.json', 'public/index.html', 'README.md'];
const { builders } = await detectBuilders(files, pkg);
expect(builders![0].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/next');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
});
@@ -214,7 +214,7 @@ describe('Test `detectBuilders`', () => {
const files = ['package.json', 'pages/index.js'];
const { builders } = await detectBuilders(files, pkg);
expect(builders![0].use).toBe('@now/static-build');
expect(builders![0].use).toBe('@vercel/static-build');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
});
@@ -227,7 +227,7 @@ describe('Test `detectBuilders`', () => {
const files = ['package.json', 'pages/index.js'];
const { builders } = await detectBuilders(files, pkg, { tag: 'canary' });
expect(builders![0].use).toBe('@now/static-build@canary');
expect(builders![0].use).toBe('@vercel/static-build@canary');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
});
@@ -237,7 +237,7 @@ describe('Test `detectBuilders`', () => {
const files = ['package.json', 'api/[endpoint].js'];
const { builders } = await detectBuilders(files, pkg);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint].js');
expect(builders!.length).toBe(1);
});
@@ -278,9 +278,9 @@ describe('Test `detectBuilders`', () => {
];
const { builders } = await detectBuilders(files, pkg, { tag: 'canary' });
expect(builders![0].use).toBe('@now/node@canary');
expect(builders![1].use).toBe('@now/node@canary');
expect(builders![2].use).toBe('@now/next@canary');
expect(builders![0].use).toBe('@vercel/node@canary');
expect(builders![1].use).toBe('@vercel/node@canary');
expect(builders![2].use).toBe('@vercel/next@canary');
expect(builders!.length).toBe(3);
});
@@ -296,9 +296,9 @@ describe('Test `detectBuilders`', () => {
];
const { builders } = await detectBuilders(files, pkg, { tag: 'latest' });
expect(builders![0].use).toBe('@now/node@latest');
expect(builders![1].use).toBe('@now/node@latest');
expect(builders![2].use).toBe('@now/next@latest');
expect(builders![0].use).toBe('@vercel/node@latest');
expect(builders![1].use).toBe('@vercel/node@latest');
expect(builders![2].use).toBe('@vercel/next@latest');
expect(builders!.length).toBe(3);
});
@@ -314,9 +314,9 @@ describe('Test `detectBuilders`', () => {
];
const { builders } = await detectBuilders(files, pkg, { tag: 'haha' });
expect(builders![0].use).toBe('@now/node@haha');
expect(builders![1].use).toBe('@now/node@haha');
expect(builders![2].use).toBe('@now/next@haha');
expect(builders![0].use).toBe('@vercel/node@haha');
expect(builders![1].use).toBe('@vercel/node@haha');
expect(builders![2].use).toBe('@vercel/next@haha');
expect(builders!.length).toBe(3);
});
@@ -334,8 +334,8 @@ describe('Test `detectBuilders`', () => {
expect(warnings[0].code).toBe('conflicting_files');
expect(builders).toBeDefined();
expect(builders!.length).toBe(2);
expect(builders![0].use).toBe('@now/node');
expect(builders![1].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![1].use).toBe('@vercel/next');
});
it('many static files + one api file', async () => {
@@ -344,7 +344,7 @@ describe('Test `detectBuilders`', () => {
const { builders } = await detectBuilders(files);
expect(builders!.length).toBe(2);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/index.ts');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -374,7 +374,7 @@ describe('Test `detectBuilders`', () => {
expect(builders!.length).toBe(1);
expect(builders![0]).toEqual({
src: 'package.json',
use: '@now/next',
use: '@vercel/next',
config: {
zeroConfig: true,
functions: {
@@ -412,7 +412,7 @@ describe('Test `detectBuilders`', () => {
expect(builders!.length).toBe(3);
expect(builders![0]).toEqual({
src: 'api/teams/members.ts',
use: '@now/node',
use: '@vercel/node',
config: {
zeroConfig: true,
functions: {
@@ -437,7 +437,7 @@ describe('Test `detectBuilders`', () => {
});
expect(builders![2]).toEqual({
src: 'package.json',
use: '@now/next',
use: '@vercel/next',
config: {
zeroConfig: true,
},
@@ -538,7 +538,7 @@ describe('Test `detectBuilders`', () => {
expect(errors![0].code).toBe('invalid_function');
});
it('Do not allow functions that are not used by @now/next', async () => {
it('Do not allow functions that are not used by @vercel/next', async () => {
const pkg = {
scripts: { build: 'next build' },
dependencies: { next: '9.0.0' },
@@ -564,7 +564,7 @@ describe('Test `detectBuilders`', () => {
expect(errors).toBe(null);
expect(builders).not.toBe(null);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].config).toMatchObject({
functions,
zeroConfig: true,
@@ -584,7 +584,7 @@ describe('Test `detectBuilders`', () => {
expect(errors).toBe(null);
expect(builders).not.toBe(null);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].config).toMatchObject({
functions,
zeroConfig: true,
@@ -607,7 +607,7 @@ describe('Test `detectBuilders`', () => {
expect(errors).toBe(null);
expect(builders).not.toBe(null);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].config).toMatchObject({
functions,
zeroConfig: true,
@@ -705,7 +705,7 @@ describe('Test `detectBuilders`', () => {
expect(builders).toEqual([
{
use: '@now/static-build',
use: '@vercel/static-build',
src: 'config.yaml',
config: {
zeroConfig: true,
@@ -727,7 +727,7 @@ describe('Test `detectBuilders`', () => {
expect(builders).toEqual([
{
use: '@now/static-build',
use: '@vercel/static-build',
src: 'package.json',
config: {
zeroConfig: true,
@@ -744,14 +744,14 @@ describe('Test `detectBuilders`', () => {
expect(builders).toEqual([
{
use: '@now/ruby',
use: '@vercel/ruby',
src: 'api/date.rb',
config: {
zeroConfig: true,
},
},
{
use: '@now/static-build',
use: '@vercel/static-build',
src: 'config.rb',
config: {
zeroConfig: true,
@@ -765,7 +765,7 @@ describe('Test `detectBuilders`', () => {
const files = ['server/hello.ts', 'public/index.html'];
const functions = {
'server/**/*.ts': {
runtime: '@now/node@1.3.1',
runtime: '@vercel/node@1.3.1',
},
};
@@ -868,7 +868,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/next');
expect(errors).toBe(null);
expect(defaultRoutes).toStrictEqual([]);
expect(redirectRoutes).toStrictEqual([]);
@@ -888,7 +888,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/next');
expect(errors).toBe(null);
expect(defaultRoutes).toStrictEqual([]);
expect(redirectRoutes).toStrictEqual([]);
@@ -950,7 +950,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, null, { featHandleMiss });
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/users.js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -970,7 +970,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
const { builders, errors } = await detectBuilders(files, null, {
featHandleMiss,
});
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint].js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -991,7 +991,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, undefined, { featHandleMiss });
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint]/[id].js');
expect(builders!.length).toBe(1);
@@ -1017,9 +1017,9 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/next');
expect(builders![1].use).toBe('@vercel/next');
expect(builders![1].src).toBe('package.json');
expect(builders!.length).toBe(2);
@@ -1044,9 +1044,9 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/next');
expect(builders![1].use).toBe('@vercel/next');
expect(builders![1].src).toBe('package.json');
expect(builders!.length).toBe(2);
@@ -1067,7 +1067,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, null, { featHandleMiss });
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -1094,7 +1094,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
redirectRoutes,
rewriteRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/version.js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -1119,7 +1119,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
const { builders } = await detectBuilders(files, undefined, {
featHandleMiss,
});
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('public/**/*');
@@ -1167,7 +1167,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
const files = ['package.json', 'public/index.html', 'README.md'];
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/next');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
});
@@ -1180,7 +1180,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
const files = ['package.json', 'pages/index.js'];
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/static-build');
expect(builders![0].use).toBe('@vercel/static-build');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
});
@@ -1196,7 +1196,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
tag: 'canary',
featHandleMiss,
});
expect(builders![0].use).toBe('@now/static-build@canary');
expect(builders![0].use).toBe('@vercel/static-build@canary');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
});
@@ -1206,7 +1206,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
const files = ['package.json', 'api/[endpoint].js'];
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint].js');
expect(builders!.length).toBe(1);
});
@@ -1256,9 +1256,9 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
tag: 'canary',
featHandleMiss,
});
expect(builders![0].use).toBe('@now/node@canary');
expect(builders![1].use).toBe('@now/node@canary');
expect(builders![2].use).toBe('@now/next@canary');
expect(builders![0].use).toBe('@vercel/node@canary');
expect(builders![1].use).toBe('@vercel/node@canary');
expect(builders![2].use).toBe('@vercel/next@canary');
expect(builders!.length).toBe(3);
});
@@ -1277,9 +1277,9 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
tag: 'latest',
featHandleMiss,
});
expect(builders![0].use).toBe('@now/node@latest');
expect(builders![1].use).toBe('@now/node@latest');
expect(builders![2].use).toBe('@now/next@latest');
expect(builders![0].use).toBe('@vercel/node@latest');
expect(builders![1].use).toBe('@vercel/node@latest');
expect(builders![2].use).toBe('@vercel/next@latest');
expect(builders!.length).toBe(3);
});
@@ -1298,9 +1298,9 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
tag: 'haha',
featHandleMiss,
});
expect(builders![0].use).toBe('@now/node@haha');
expect(builders![1].use).toBe('@now/node@haha');
expect(builders![2].use).toBe('@now/next@haha');
expect(builders![0].use).toBe('@vercel/node@haha');
expect(builders![1].use).toBe('@vercel/node@haha');
expect(builders![2].use).toBe('@vercel/next@haha');
expect(builders!.length).toBe(3);
});
@@ -1320,8 +1320,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(warnings[0].code).toBe('conflicting_files');
expect(builders).toBeDefined();
expect(builders!.length).toBe(2);
expect(builders![0].use).toBe('@now/node');
expect(builders![1].use).toBe('@now/next');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![1].use).toBe('@vercel/next');
});
it('many static files + one api file', async () => {
@@ -1332,7 +1332,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
});
expect(builders!.length).toBe(2);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/index.ts');
expect(builders![1].use).toBe('@now/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
@@ -1363,7 +1363,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(builders!.length).toBe(1);
expect(builders![0]).toEqual({
src: 'package.json',
use: '@now/next',
use: '@vercel/next',
config: {
zeroConfig: true,
functions: {
@@ -1404,7 +1404,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(builders!.length).toBe(3);
expect(builders![0]).toEqual({
src: 'api/teams/members.ts',
use: '@now/node',
use: '@vercel/node',
config: {
zeroConfig: true,
functions: {
@@ -1429,7 +1429,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
});
expect(builders![2]).toEqual({
src: 'package.json',
use: '@now/next',
use: '@vercel/next',
config: {
zeroConfig: true,
},
@@ -1538,7 +1538,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(errors![0].code).toBe('invalid_function');
});
it('Do not allow functions that are not used by @now/next', async () => {
it('Do not allow functions that are not used by @vercel/next', async () => {
const pkg = {
scripts: { build: 'next build' },
dependencies: { next: '9.0.0' },
@@ -1568,7 +1568,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(errors).toBe(null);
expect(builders).not.toBe(null);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].config).toMatchObject({
functions,
zeroConfig: true,
@@ -1589,7 +1589,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(errors).toBe(null);
expect(builders).not.toBe(null);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].config).toMatchObject({
functions,
zeroConfig: true,
@@ -1613,7 +1613,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(errors).toBe(null);
expect(builders).not.toBe(null);
expect(builders![0].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].config).toMatchObject({
functions,
zeroConfig: true,
@@ -1737,7 +1737,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(builders).toEqual([
{
use: '@now/static-build',
use: '@vercel/static-build',
src: 'config.yaml',
config: {
zeroConfig: true,
@@ -1759,7 +1759,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(builders).toEqual([
{
use: '@now/static-build',
use: '@vercel/static-build',
src: 'package.json',
config: {
zeroConfig: true,
@@ -1779,14 +1779,14 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(builders).toEqual([
{
use: '@now/ruby',
use: '@vercel/ruby',
src: 'api/date.rb',
config: {
zeroConfig: true,
},
},
{
use: '@now/static-build',
use: '@vercel/static-build',
src: 'config.rb',
config: {
zeroConfig: true,
@@ -1800,7 +1800,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
const files = ['server/hello.ts', 'public/index.html'];
const functions = {
'server/**/*.ts': {
runtime: '@now/node@1.3.1',
runtime: '@vercel/node@1.3.1',
},
};
@@ -2000,10 +2000,10 @@ it('Test `detectRoutes`', async () => {
const { builders, defaultRoutes } = await detectBuilders(files);
expect(builders!.length).toBe(4);
expect(builders![0].use).toBe('@now/node');
expect(builders![1].use).toBe('@now/node');
expect(builders![2].use).toBe('@now/node');
expect(builders![3].use).toBe('@now/node');
expect(builders![0].use).toBe('@vercel/node');
expect(builders![1].use).toBe('@vercel/node');
expect(builders![2].use).toBe('@vercel/node');
expect(builders![3].use).toBe('@vercel/node');
expect(defaultRoutes!.length).toBe(5);
}
@@ -2883,7 +2883,7 @@ describe('Test `detectOutputDirectory`', () => {
config: { zeroConfig: true },
},
{
use: '@now/node',
use: '@vercel/node',
src: 'api/index.js',
},
];
@@ -2896,7 +2896,7 @@ describe('Test `detectApiDirectory`', () => {
it('should be `null` with no config', async () => {
const builders = [
{
use: '@now/node',
use: '@vercel/node',
src: 'api/**/*.js',
},
];
@@ -2907,7 +2907,7 @@ describe('Test `detectApiDirectory`', () => {
it('should be `null` with no zero config builds', async () => {
const builders = [
{
use: '@now/node',
use: '@vercel/node',
src: 'api/**/*.js',
config: {},
},
@@ -2919,7 +2919,7 @@ describe('Test `detectApiDirectory`', () => {
it('should be `api` with one zero config', async () => {
const builders = [
{
use: '@now/node',
use: '@vercel/node',
src: 'api/**/*.js',
config: { zeroConfig: true },
},
@@ -2931,12 +2931,12 @@ describe('Test `detectApiDirectory`', () => {
it('should be `api` with one zero config and one without config', async () => {
const builders = [
{
use: '@now/node',
use: '@vercel/node',
src: 'api/**/*.js',
config: { zeroConfig: true },
},
{
use: '@now/php',
use: '@vercel/php',
src: 'api/**/*.php',
},
];
@@ -2947,7 +2947,7 @@ describe('Test `detectApiDirectory`', () => {
it('should be `null` with zero config but without api directory', async () => {
const builders = [
{
use: '@now/next',
use: '@vercel/next',
src: 'package.json',
config: { zeroConfig: true },
},
@@ -2961,28 +2961,28 @@ describe('Test `detectApiExtensions`', () => {
it('should have correct extensions', async () => {
const builders = [
{
use: '@now/node',
use: '@vercel/node',
src: 'api/**/*.js',
config: {
zeroConfig: true,
},
},
{
use: '@now/python',
use: '@vercel/python',
src: 'api/**/*.py',
config: {
zeroConfig: true,
},
},
{
use: '@now/go',
use: '@vercel/go',
src: 'api/**/*.go',
config: {
zeroConfig: true,
},
},
{
use: '@now/ruby',
use: '@vercel/ruby',
src: 'api/**/*.rb',
config: {
zeroConfig: true,
@@ -3002,7 +3002,7 @@ describe('Test `detectApiExtensions`', () => {
},
},
{
use: '@now/next',
use: '@vercel/next',
src: 'package.json',
// No api directory should not be added
config: {

View File

@@ -1,6 +1,6 @@
import path from 'path';
import { readFileSync } from 'fs-extra';
import { Framework } from '@now/frameworks';
import { Framework } from '@vercel/frameworks';
import { detectFramework, DetectorFilesystem } from '../src';
const frameworkList = JSON.parse(

View File

@@ -134,21 +134,21 @@ it('should throw for discontinued versions', async () => {
});
it('should support require by path for legacy builders', () => {
const index = require('@now/build-utils');
const index = require('@vercel/build-utils');
const download2 = require('@now/build-utils/fs/download.js');
const getWriteableDirectory2 = require('@now/build-utils/fs/get-writable-directory.js');
const glob2 = require('@now/build-utils/fs/glob.js');
const rename2 = require('@now/build-utils/fs/rename.js');
const download2 = require('@vercel/build-utils/fs/download.js');
const getWriteableDirectory2 = require('@vercel/build-utils/fs/get-writable-directory.js');
const glob2 = require('@vercel/build-utils/fs/glob.js');
const rename2 = require('@vercel/build-utils/fs/rename.js');
const {
runNpmInstall: runNpmInstall2,
} = require('@now/build-utils/fs/run-user-scripts.js');
const streamToBuffer2 = require('@now/build-utils/fs/stream-to-buffer.js');
} = require('@vercel/build-utils/fs/run-user-scripts.js');
const streamToBuffer2 = require('@vercel/build-utils/fs/stream-to-buffer.js');
const FileBlob2 = require('@now/build-utils/file-blob.js');
const FileFsRef2 = require('@now/build-utils/file-fs-ref.js');
const FileRef2 = require('@now/build-utils/file-ref.js');
const { Lambda: Lambda2 } = require('@now/build-utils/lambda.js');
const FileBlob2 = require('@vercel/build-utils/file-blob.js');
const FileFsRef2 = require('@vercel/build-utils/file-fs-ref.js');
const FileRef2 = require('@vercel/build-utils/file-ref.js');
const { Lambda: Lambda2 } = require('@vercel/build-utils/lambda.js');
expect(download2).toBe(index.download);
expect(getWriteableDirectory2).toBe(index.getWriteableDirectory);

View File

@@ -1,5 +1,5 @@
{
"name": "@now/cgi",
"name": "@vercel/cgi",
"version": "1.0.5-canary.0",
"license": "MIT",
"repository": {

View File

@@ -1,5 +1,5 @@
{
"name": "now",
"name": "vercel",
"version": "18.0.1-canary.18",
"preferGlobal": true,
"license": "Apache-2.0",
@@ -41,7 +41,8 @@
"all": true
},
"bin": {
"now": "./dist/index.js"
"now": "./dist/index.js",
"vercel": "./dist/index.js"
},
"files": [
"dist",

View File

@@ -1,6 +1,6 @@
import path from 'path';
import chalk from 'chalk';
import { PackageJson } from '@now/build-utils';
import { PackageJson } from '@vercel/build-utils';
import getArgs from '../../util/get-args';
import getSubcommand from '../../util/get-subcommand';

View File

@@ -5,7 +5,7 @@ import {
createDeployment,
DeploymentOptions,
NowClientOptions,
} from 'now-client';
} from '@vercel/client';
import { Output } from '../output';
// @ts-ignore
import Now from '../../util';

View File

@@ -6,7 +6,7 @@ import {
createLegacyDeployment,
DeploymentOptions,
NowClientOptions,
} from 'now-client';
} from '@vercel/client';
import { Output } from '../output';
// @ts-ignore
import Now from '../../util';

View File

@@ -8,7 +8,7 @@ import { extract } from 'tar-fs';
import { createHash } from 'crypto';
import { createGunzip } from 'zlib';
import { join } from 'path';
import { PackageJson } from '@now/build-utils';
import { PackageJson } from '@vercel/build-utils';
import XDGAppPaths from 'xdg-app-paths';
import {
createReadStream,
@@ -31,12 +31,17 @@ declare const __non_webpack_require__: typeof require;
const registryTypes = new Set(['version', 'tag', 'range']);
const localBuilders: { [key: string]: BuilderWithPackage } = {
'@now/static': {
const createStaticBuilder = (scope: string): BuilderWithPackage => {
return {
runInProcess: true,
builder: Object.freeze(staticBuilder),
package: Object.freeze({ name: '@now/static', version: '' }),
},
package: Object.freeze({ name: `@${scope}/static`, version: '' }),
};
};
const localBuilders: { [key: string]: BuilderWithPackage } = {
'@now/static': createStaticBuilder('now'),
'@vercel/static': createStaticBuilder('vercel'),
};
const distTag = getDistTag(pkg.version);
@@ -142,14 +147,14 @@ function getNpmVersion(use = ''): string {
return '';
}
export function getBuildUtils(packages: string[]): string {
export function getBuildUtils(packages: string[], org: string): string {
const version = packages
.map(getNpmVersion)
.some(ver => ver.includes('canary'))
? 'canary'
: 'latest';
return `@now/build-utils@${version}`;
return `@${org}/build-utils@${version}`;
}
function parseVersionSafe(rawSpec: string) {
@@ -230,7 +235,10 @@ export async function installBuilders(
const buildersPkgPath = join(builderDir, 'package.json');
const buildersPkgBefore = await readJSON(buildersPkgPath);
packages.push(getBuildUtils(packages));
packages.push(
getBuildUtils(packages, 'vercel'),
getBuildUtils(packages, 'now')
);
// Filter out any packages that come packaged with `now-cli`
const packagesToInstall = packages.filter(p =>
@@ -299,7 +307,10 @@ export async function updateBuilders(
const buildersPkgPath = join(builderDir, 'package.json');
const buildersPkgBefore = await readJSON(buildersPkgPath);
packages.push(getBuildUtils(packages));
packages.push(
getBuildUtils(packages, 'vercel'),
getBuildUtils(packages, 'now')
);
await retry(
() =>

View File

@@ -6,11 +6,18 @@ import { promisify } from 'util';
import { delimiter, dirname, join } from 'path';
import { fork, ChildProcess } from 'child_process';
import { createFunction } from '@zeit/fun';
import { Builder, File, Lambda, FileBlob, FileFsRef } from '@now/build-utils';
import {
Builder,
File,
Lambda,
FileBlob,
FileFsRef,
} from '@vercel/build-utils';
import plural from 'pluralize';
import minimatch from 'minimatch';
import _treeKill from 'tree-kill';
import { isOfficialRuntime } from '../is-official-runtime';
import { Output } from '../output';
import highlight from '../output/highlight';
import { relative } from '../path-helpers';
@@ -30,7 +37,7 @@ import {
BuilderParams,
EnvConfigs,
} from './types';
import { normalizeRoutes } from '@now/routing-utils';
import { normalizeRoutes } from '@vercel/routing-utils';
import getUpdateCommand from '../get-update-command';
interface BuildMessage {
@@ -115,7 +122,7 @@ export async function executeBuild(
const startTime = Date.now();
const showBuildTimestamp =
match.use !== '@now/static' && (!isInitialBuild || debug);
!isOfficialRuntime('static', match.use) && (!isInitialBuild || debug);
if (showBuildTimestamp) {
devServer.output.log(`Building ${match.use}:${entrypoint}`);
@@ -151,7 +158,7 @@ export async function executeBuild(
filesChanged,
filesRemoved,
// This env distiniction is only necessary to maintain
// backwards compatibility with the `@now/next` builder.
// backwards compatibility with the `@vercel/next` builder.
env: envConfigs.runEnv,
buildEnv: envConfigs.buildEnv,
},
@@ -404,7 +411,7 @@ export async function getBuildMatches(
}
const noMatches: Builder[] = [];
const builds = nowConfig.builds || [{ src: '**', use: '@now/static' }];
const builds = nowConfig.builds || [{ src: '**', use: '@vercel/static' }];
for (const buildConfig of builds) {
let { src, use } = buildConfig;

View File

@@ -1,11 +1,11 @@
export function getBundledBuilders() {
return [
'@now/go',
'@now/next',
'@now/node',
'@now/ruby',
'@now/python',
'@now/static-build',
'@now/build-utils',
'@vercel/go',
'@vercel/next',
'@vercel/node',
'@vercel/ruby',
'@vercel/python',
'@vercel/static-build',
'@vercel/build-utils',
];
}

View File

@@ -5,7 +5,7 @@ import isURL from './is-url';
import DevServer from './server';
import { HttpHeadersConfig, RouteConfig, RouteResult } from './types';
import { isHandler, Route, HandleValue } from '@now/routing-utils';
import { isHandler, Route, HandleValue } from '@vercel/routing-utils';
export function resolveRouteParameters(
str: string,

View File

@@ -12,18 +12,18 @@ import serveHandler from 'serve-handler';
import { watch, FSWatcher } from 'chokidar';
import { parse as parseDotenv } from 'dotenv';
import { basename, dirname, extname, join } from 'path';
import {
getTransformedRoutes,
appendRoutesToPhase,
HandleValue,
} from '@now/routing-utils';
import directoryTemplate from 'serve-handler/src/directory';
import getPort from 'get-port';
import { ChildProcess } from 'child_process';
import isPortReachable from 'is-port-reachable';
import which from 'which';
import { getVercelIgnore } from 'now-client';
import { getVercelIgnore } from '@vercel/client';
import {
getTransformedRoutes,
appendRoutesToPhase,
HandleValue,
} from '@vercel/routing-utils';
import {
Builder,
FileFsRef,
@@ -32,7 +32,7 @@ import {
detectApiDirectory,
detectApiExtensions,
spawnCommand,
} from '@now/build-utils';
} from '@vercel/build-utils';
import { once } from '../once';
import link from '../output/link';
@@ -41,6 +41,7 @@ import { relative } from '../path-helpers';
import { getDistTag } from '../get-dist-tag';
import getNowConfigPath from '../config/local-path';
import { MissingDotenvVarsError } from '../errors-ts';
import { isOfficialRuntime } from '../is-official-runtime';
import { version as cliVersion } from '../../../package.json';
import { staticFiles as getFiles, getAllProjectFiles } from '../get-files';
import {
@@ -92,11 +93,11 @@ interface FSEvent {
}
function sortBuilders(buildA: Builder, buildB: Builder) {
if (buildA && buildA.use && buildA.use.startsWith('@now/static-build')) {
if (buildA && buildA.use && isOfficialRuntime('static-build', buildA.use)) {
return 1;
}
if (buildB && buildB.use && buildB.use.startsWith('@now/static-build')) {
if (buildB && buildB.use && isOfficialRuntime('static-build', buildB.use)) {
return -1;
}
@@ -411,7 +412,7 @@ export default class DevServer {
.catch(cleanup);
}
// Sort build matches to make sure `@now/static-build` is always last
// Sort build matches to make sure `@vercel/static-build` is always last
this.buildMatches = new Map(
[...this.buildMatches.entries()].sort((matchA, matchB) => {
return sortBuilders(matchA[1] as Builder, matchB[1] as Builder);
@@ -434,7 +435,7 @@ export default class DevServer {
src,
builderWithPkg: { package: pkg },
} = buildMatch;
if (pkg.name === '@now/static') continue;
if (isOfficialRuntime('static', pkg.name)) continue;
if (pkg.name && updatedBuilders.includes(pkg.name)) {
shutdownBuilder(buildMatch, this.output);
this.buildMatches.delete(src);
@@ -596,7 +597,7 @@ export default class DevServer {
config.builds = config.builds.filter(filterFrontendBuilds);
}
// `@now/static-build` needs to be the last builder
// `@vercel/static-build` needs to be the last builder
// since it might catch all other requests
config.builds.sort(sortBuilders);
}
@@ -2036,7 +2037,7 @@ async function checkForPort(
function filterFrontendBuilds(build: Builder) {
return (
!build.use.startsWith('@now/static-build') &&
!build.use.startsWith('@now/next')
!isOfficialRuntime('static-build', build.use) &&
!isOfficialRuntime('next', build.use)
);
}

View File

@@ -8,9 +8,9 @@ import {
Lambda,
PackageJson,
Config,
} from '@now/build-utils';
import { NowConfig } from 'now-client';
import { HandleValue, Route } from '@now/routing-utils';
} from '@vercel/build-utils';
import { NowConfig } from '@vercel/client';
import { HandleValue, Route } from '@vercel/routing-utils';
import { Output } from '../output';
export { NowConfig };

View File

@@ -6,9 +6,9 @@ import {
redirectsSchema,
rewritesSchema,
trailingSlashSchema,
} from '@now/routing-utils';
} from '@vercel/routing-utils';
import { NowConfig } from './types';
import { functionsSchema, buildsSchema } from '@now/build-utils';
import { functionsSchema, buildsSchema } from '@vercel/build-utils';
const ajv = new Ajv();

View File

@@ -4,6 +4,7 @@ import { NowError } from './now-error';
import param from './output/param';
import cmd from './output/cmd';
import code from './output/code';
import { getPkgName } from './pkg-name';
/**
* This error is thrown when there is an API error with a payload. The error
@@ -52,7 +53,7 @@ export class TeamDeleted extends NowError<'TEAM_DELETED', {}> {
super({
code: 'TEAM_DELETED',
message: `Your team was deleted. You can switch to a different one using ${param(
'now switch'
`${getPkgName()} switch`
)}.`,
meta: {},
});
@@ -143,7 +144,7 @@ export class SourceNotFound extends NowError<'SOURCE_NOT_FOUND', {}> {
code: 'SOURCE_NOT_FOUND',
meta: {},
message: `Not able to purchase. Please add a payment method using ${cmd(
'now billing add'
`${getPkgName()} billing add`
)}.`,
});
}

View File

@@ -3,7 +3,7 @@ import ignore from 'ignore';
import dockerignore from '@zeit/dockerignore';
import _glob, { IOptions } from 'glob';
import fs from 'fs-extra';
import { getVercelIgnore } from 'now-client';
import { getVercelIgnore } from '@vercel/client';
import IGNORED from './ignored';
import uniqueStrings from './unique-strings';
import getLocalConfigPath from './config/local-path';

View File

@@ -1,4 +1,4 @@
import { Framework } from '@now/frameworks';
import { Framework } from '@vercel/frameworks';
import Client from './client';
export async function getFrameworks(client: Client) {

View File

@@ -2,7 +2,7 @@ import inquirer from 'inquirer';
import confirm from './confirm';
import chalk from 'chalk';
import { Output } from '../output';
import { Framework } from '@now/frameworks';
import { Framework } from '@vercel/frameworks';
import { isSettingValue } from '../is-setting-value';
export interface ProjectSettings {

View File

@@ -0,0 +1,7 @@
export const isOfficialRuntime = (desired: string, name?: string): boolean => {
return (
typeof name === 'string' &&
(name.startsWith(`@vercel/${desired}`) ||
name.startsWith(`@now/${desired}`))
);
};

View File

@@ -1,4 +1,4 @@
import { SettingValue } from '@now/frameworks';
import { SettingValue } from '@vercel/frameworks';
export function isSettingValue(setting: any): setting is SettingValue {
return setting && typeof setting.value === 'string';

View File

@@ -1,6 +1,6 @@
import { join } from 'path';
import { exists } from 'fs-extra';
import { PackageJson } from '@now/build-utils';
import { PackageJson } from '@vercel/build-utils';
import Client from './client';
import { Config } from '../types';

View File

@@ -2,7 +2,7 @@ import path from 'path';
import { CantParseJSONFile } from './errors-ts';
import readJSONFile from './read-json-file';
import { Config } from '../types';
import { PackageJson } from '@now/build-utils';
import { PackageJson } from '@vercel/build-utils';
interface CustomPackage extends PackageJson {
now?: Config;

View File

@@ -4,21 +4,21 @@ import { filterPackage } from '../src/util/dev/builder-cache';
test('[dev-builder] filter install "latest", cached canary', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': '0.0.1-canary.0',
'@vercel/build-utils': '0.0.1-canary.0',
},
};
const result = filterPackage('@now/build-utils', 'canary', buildersPkg);
const result = filterPackage('@vercel/build-utils', 'canary', buildersPkg);
t.is(result, true);
});
test('[dev-builder] filter install "canary", cached stable', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': '0.0.1',
'@vercel/build-utils': '0.0.1',
},
};
const result = filterPackage(
'@now/build-utils@canary',
'@vercel/build-utils@canary',
'latest',
buildersPkg
);
@@ -28,21 +28,21 @@ test('[dev-builder] filter install "canary", cached stable', async t => {
test('[dev-builder] filter install "latest", cached stable', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': '0.0.1',
'@vercel/build-utils': '0.0.1',
},
};
const result = filterPackage('@now/build-utils', 'latest', buildersPkg);
const result = filterPackage('@vercel/build-utils', 'latest', buildersPkg);
t.is(result, false);
});
test('[dev-builder] filter install "canary", cached canary', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': '0.0.1-canary.0',
'@vercel/build-utils': '0.0.1-canary.0',
},
};
const result = filterPackage(
'@now/build-utils@canary',
'@vercel/build-utils@canary',
'canary',
buildersPkg
);
@@ -52,7 +52,7 @@ test('[dev-builder] filter install "canary", cached canary', async t => {
test('[dev-builder] filter install URL, cached stable', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': '0.0.1',
'@vercel/build-utils': '0.0.1',
},
};
const result = filterPackage('https://tarball.now.sh', 'latest', buildersPkg);
@@ -62,7 +62,7 @@ test('[dev-builder] filter install URL, cached stable', async t => {
test('[dev-builder] filter install URL, cached canary', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': '0.0.1-canary.0',
'@vercel/build-utils': '0.0.1-canary.0',
},
};
const result = filterPackage('https://tarball.now.sh', 'canary', buildersPkg);
@@ -72,20 +72,20 @@ test('[dev-builder] filter install URL, cached canary', async t => {
test('[dev-builder] filter install "latest", cached URL - stable', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': 'https://tarball.now.sh',
'@vercel/build-utils': 'https://tarball.now.sh',
},
};
const result = filterPackage('@now/build-utils', 'latest', buildersPkg);
const result = filterPackage('@vercel/build-utils', 'latest', buildersPkg);
t.is(result, true);
});
test('[dev-builder] filter install "latest", cached URL - canary', async t => {
const buildersPkg = {
dependencies: {
'@now/build-utils': 'https://tarball.now.sh',
'@vercel/build-utils': 'https://tarball.now.sh',
},
};
const result = filterPackage('@now/build-utils', 'canary', buildersPkg);
const result = filterPackage('@vercel/build-utils', 'canary', buildersPkg);
t.is(result, true);
});

View File

@@ -192,30 +192,60 @@ test('[DevServer] Does not install builders if there are no builds', async t =>
test('[DevServer] Installs canary build-utils if one more more builders is canary', t => {
t.is(
getBuildUtils(['@now/static', '@now/node@canary']),
'@now/build-utils@canary'
getBuildUtils(['@vercel/static', '@vercel/node@canary'], 'vercel'),
'@vercel/build-utils@canary'
);
t.is(
getBuildUtils(['@now/static', '@now/node@0.7.4-canary.0']),
'@now/build-utils@canary'
getBuildUtils(['@vercel/static', '@vercel/node@0.7.4-canary.0'], 'vercel'),
'@vercel/build-utils@canary'
);
t.is(
getBuildUtils(['@now/static', '@now/node@0.8.0']),
'@now/build-utils@latest'
getBuildUtils(['@vercel/static', '@vercel/node@0.8.0'], 'vercel'),
'@vercel/build-utils@latest'
);
t.is(getBuildUtils(['@now/static', '@now/node']), '@now/build-utils@latest');
t.is(getBuildUtils(['@now/static']), '@now/build-utils@latest');
t.is(getBuildUtils(['@now/md@canary']), '@now/build-utils@canary');
t.is(getBuildUtils(['custom-builder']), '@now/build-utils@latest');
t.is(getBuildUtils(['custom-builder@canary']), '@now/build-utils@canary');
t.is(getBuildUtils(['canary-bird']), '@now/build-utils@latest');
t.is(getBuildUtils(['canary-bird@4.0.0']), '@now/build-utils@latest');
t.is(getBuildUtils(['canary-bird@canary']), '@now/build-utils@canary');
t.is(getBuildUtils(['@canary/bird']), '@now/build-utils@latest');
t.is(getBuildUtils(['@canary/bird@0.1.0']), '@now/build-utils@latest');
t.is(getBuildUtils(['@canary/bird@canary']), '@now/build-utils@canary');
t.is(getBuildUtils(['https://example.com']), '@now/build-utils@latest');
t.is(getBuildUtils(['']), '@now/build-utils@latest');
t.is(
getBuildUtils(['@vercel/static', '@vercel/node'], 'vercel'),
'@vercel/build-utils@latest'
);
t.is(
getBuildUtils(['@vercel/static'], 'vercel'),
'@vercel/build-utils@latest'
);
t.is(
getBuildUtils(['@vercel/md@canary'], 'vercel'),
'@vercel/build-utils@canary'
);
t.is(
getBuildUtils(['custom-builder'], 'vercel'),
'@vercel/build-utils@latest'
);
t.is(
getBuildUtils(['custom-builder@canary'], 'vercel'),
'@vercel/build-utils@canary'
);
t.is(getBuildUtils(['canary-bird'], 'vercel'), '@vercel/build-utils@latest');
t.is(
getBuildUtils(['canary-bird@4.0.0'], 'vercel'),
'@vercel/build-utils@latest'
);
t.is(
getBuildUtils(['canary-bird@canary'], 'vercel'),
'@vercel/build-utils@canary'
);
t.is(getBuildUtils(['@canary/bird'], 'vercel'), '@vercel/build-utils@latest');
t.is(
getBuildUtils(['@canary/bird@0.1.0'], 'vercel'),
'@vercel/build-utils@latest'
);
t.is(
getBuildUtils(['@canary/bird@canary'], 'vercel'),
'@vercel/build-utils@canary'
);
t.is(
getBuildUtils(['https://example.com'], 'vercel'),
'@vercel/build-utils@latest'
);
t.is(getBuildUtils([''], 'vercel'), '@vercel/build-utils@latest');
});
test(
@@ -255,7 +285,7 @@ test(
);
test(
'[DevServer] Test `@now/static` routing',
'[DevServer] Test `@vercel/static` routing',
testFixture('now-dev-static-routes', async (t, server) => {
{
const res = await fetch(`${server.address}/`);
@@ -266,7 +296,7 @@ test(
);
test(
'[DevServer] Test `@now/static-build` routing',
'[DevServer] Test `@vercel/static-build` routing',
testFixture('now-dev-static-build-routing', async (t, server) => {
{
const res = await fetch(`${server.address}/api/date`);

View File

@@ -18,7 +18,7 @@ import prepareFixtures from './helpers/prepare';
const binaryPath = path.resolve(__dirname, `../scripts/start.js`);
const fixture = name => path.join(__dirname, 'fixtures', 'integration', name);
const deployHelpMessage = `${logo} now [options] <command | path>`;
const deployHelpMessage = `${logo} vercel [options] <command | path>`;
const session = Math.random()
.toString(36)
.split('.')[1];

View File

@@ -31,7 +31,7 @@ function execa(file, args, options) {
const binaryPath = path.resolve(__dirname, `../scripts/start.js`);
const fixture = name => path.join(__dirname, 'fixtures', 'integration', name);
const deployHelpMessage = `${logo} now [options] <command | path>`;
const deployHelpMessage = `${logo} vercel [options] <command | path>`;
let session = 'temp-session';
const isCanary = pkg.version.includes('canary');
@@ -850,7 +850,7 @@ test('try to purchase a domain', async t => {
t.is(exitCode, 1);
t.true(
stderr.includes(
`Error! Could not purchase domain. Please add a payment method using \`now billing add\`.`
`Error! Could not purchase domain. Please add a payment method using \`vercel billing add\`.`
)
);
});
@@ -1801,7 +1801,7 @@ test('try to initialize misspelled example (noce) in non-tty', async t => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
const cwd = tmpDir.name;
const goal =
'Error! No example found for noce, run `now init` to see the list of available examples.';
'Error! No example found for noce, run `vercel init` to see the list of available examples.';
const { stdout, stderr, exitCode } = await execute(['init', 'noce'], { cwd });
@@ -1817,7 +1817,7 @@ test('try to initialize example "example-404"', async t => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
const cwd = tmpDir.name;
const goal =
'Error! No example found for example-404, run `now init` to see the list of available examples.';
'Error! No example found for example-404, run `vercel init` to see the list of available examples.';
const { stdout, stderr, exitCode } = await execute(['init', 'example-404'], {
cwd,

View File

@@ -1,5 +1,5 @@
{
"name": "now-client",
"name": "@vercel/client",
"version": "7.1.1-canary.3",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@@ -15,7 +15,7 @@
},
"scripts": {
"build": "tsc",
"test-integration-once": "jest --verbose --runInBand"
"test-integration-once": "jest --verbose --runInBand --bail"
},
"devDependencies": {
"@types/async-retry": "1.4.1",

View File

@@ -1,5 +1,10 @@
import { Builder, BuilderFunctions } from '@now/build-utils';
import { NowHeader, Route, NowRedirect, NowRewrite } from '@now/routing-utils';
import { Builder, BuilderFunctions } from '@vercel/build-utils';
import {
NowHeader,
Route,
NowRedirect,
NowRewrite,
} from '@vercel/routing-utils';
export { DeploymentEventType } from './utils';

View File

@@ -1,4 +1,4 @@
ncc build index.ts -e @now/build-utils -o dist
ncc build install.ts -e @now/build-utils -o dist/install
ncc build index.ts -e @vercel/build-utils -o dist
ncc build install.ts -e @vercel/build-utils -o dist/install
mv dist/install/index.js dist/install.js
rm -rf dist/install

View File

@@ -4,7 +4,7 @@ import fetch from 'node-fetch';
import { mkdirp, pathExists } from 'fs-extra';
import { dirname, join } from 'path';
import { homedir } from 'os';
import { debug } from '@now/build-utils';
import { debug } from '@vercel/build-utils';
import stringArgv from 'string-argv';
const archMap = new Map([['x64', 'amd64'], ['x86', '386']]);

View File

@@ -13,7 +13,7 @@ import {
Files,
debug,
Meta,
} from '@now/build-utils';
} from '@vercel/build-utils';
import { createGo, getAnalyzedEntrypoint, OUT_EXTENSION } from './go-helpers';
const handlerFileName = `handler${OUT_EXTENSION}`;

View File

@@ -1,5 +1,5 @@
{
"name": "@now/go",
"name": "@vercel/go",
"version": "1.0.8-canary.0",
"license": "MIT",
"main": "./dist/index",
@@ -11,7 +11,7 @@
},
"scripts": {
"build": "./build.sh",
"test-integration-once": "jest --env node --verbose --runInBand",
"test-integration-once": "jest --env node --verbose --runInBand --bail",
"prepublish": "./build.sh",
"now-postinstall": "node dist/install.js"
},

View File

@@ -1,8 +1,8 @@
{
"version": 2,
"builds": [
{ "src": "index.go", "use": "@now/go" },
{ "src": "subdirectory/index.go", "use": "@now/go" }
{ "src": "index.go", "use": "@vercel/go" },
{ "src": "subdirectory/index.go", "use": "@vercel/go" }
],
"probes": [
{ "path": "/", "mustContain": "cow:RANDOMNESS_PLACEHOLDER" },

View File

@@ -3,12 +3,12 @@
"builds": [
{
"src": "/api/go-one/one.go",
"use": "@now/go",
"use": "@vercel/go",
"config": { "parallel": true }
},
{
"src": "/api/go-two/two.go",
"use": "@now/go",
"use": "@vercel/go",
"config": { "parallel": true }
}
],

View File

@@ -3,7 +3,7 @@
"builds": [
{
"src": "env/index.go",
"use": "@now/go"
"use": "@vercel/go"
}
],
"env": {

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "index.go", "use": "@now/go" }]
"builds": [{ "src": "index.go", "use": "@vercel/go" }]
}

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "*.go", "use": "@now/go" }],
"builds": [{ "src": "*.go", "use": "@vercel/go" }],
"env": {
"RANDOMNESS_ENV_VAR": "RANDOMNESS_PLACEHOLDER"
}

View File

@@ -3,14 +3,14 @@
"builds": [
{
"src": "index.go",
"use": "@now/go",
"use": "@vercel/go",
"config": {
"includeFiles": ["templates/**"]
}
},
{
"src": "another.go",
"use": "@now/go",
"use": "@vercel/go",
"config": {
"includeFiles": "templates/**"
}

View File

@@ -1,5 +1,5 @@
{
"version": 2,
"builds": [{ "src": "index.go", "use": "@now/go" }],
"builds": [{ "src": "index.go", "use": "@vercel/go" }],
"probes": [{ "path": "/", "mustContain": "RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -1,5 +1,5 @@
{
"version": 2,
"builds": [{ "src": "index.go", "use": "@now/go" }],
"builds": [{ "src": "index.go", "use": "@vercel/go" }],
"probes": [{ "path": "/", "mustContain": "RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -1,5 +1,5 @@
{
"version": 2,
"builds": [{ "src": "api/*.go", "use": "@now/go" }],
"builds": [{ "src": "api/*.go", "use": "@vercel/go" }],
"probes": [{ "path": "/api", "mustContain": "RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "**/*.go", "use": "@now/go" }],
"builds": [{ "src": "**/*.go", "use": "@vercel/go" }],
"probes": [
{ "path": "/sub-1", "mustContain": "RANDOMNESS_PLACEHOLDER" },
{ "path": "/sub-2", "mustContain": "RANDOMNESS_PLACEHOLDER" }

View File

@@ -1,5 +1,5 @@
{
"version": 2,
"builds": [{ "src": "api/nested/*.go", "use": "@now/go" }],
"builds": [{ "src": "api/nested/*.go", "use": "@vercel/go" }],
"probes": [{ "path": "/api/nested", "mustContain": "RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -1,5 +1,5 @@
{
"version": 2,
"builds": [{ "src": "api/**/*.go", "use": "@now/go" }],
"builds": [{ "src": "api/**/*.go", "use": "@vercel/go" }],
"probes": [{ "path": "/api", "mustContain": "RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "*.go", "use": "@now/go" }],
"builds": [{ "src": "*.go", "use": "@vercel/go" }],
"probes": [
{ "path": "/", "mustContain": "RANDOMNESS_PLACEHOLDER" },
{ "path": "/multiple.go", "mustContain": "three:RANDOMNESS_PLACEHOLDER" }

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "index.go", "use": "@now/go" }],
"builds": [{ "src": "index.go", "use": "@vercel/go" }],
"build": { "env": { "GO_BUILD_FLAGS": "-tags first -ldflags '-s -w'" } },
"probes": [{ "path": "/", "mustContain": "first:RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -3,7 +3,7 @@
"builds": [
{
"src": "api/v1/**/*.go",
"use": "@now/go",
"use": "@vercel/go",
"config": { "zeroConfig": true }
}
],

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "api/**/*.go", "use": "@now/go" }],
"builds": [{ "src": "api/**/*.go", "use": "@vercel/go" }],
"probes": [
{
"path": "/api/[hello].go",

View File

@@ -7,10 +7,10 @@ cp -v "$bridge_defs" src/now__bridge.ts
tsc
ncc build src/dev-server.ts -e @now/build-utils -o dist/dev
ncc build src/dev-server.ts -e @vercel/build-utils -o dist/dev
mv dist/dev/index.js dist/dev-server.js
rm -rf dist/dev
ncc build src/index.ts -e @now/build-utils -o dist/main
ncc build src/index.ts -e @vercel/build-utils -o dist/main
mv dist/main/index.js dist/index.js
rm -rf dist/main

View File

@@ -1,12 +1,12 @@
{
"name": "@now/next",
"name": "@vercel/next",
"version": "2.5.5-canary.5",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
"scripts": {
"build": "./build.sh",
"test-integration-once": "jest --env node --verbose --runInBand",
"test-integration-once": "jest --env node --verbose --runInBand --bail",
"prepublishOnly": "./build.sh"
},
"repository": {

View File

@@ -20,13 +20,13 @@ import {
execCommand,
getNodeBinPath,
NowBuildError,
} from '@now/build-utils';
import { Route, Handler } from '@now/routing-utils';
} from '@vercel/build-utils';
import { Route, Handler } from '@vercel/routing-utils';
import {
convertHeaders,
convertRedirects,
convertRewrites,
} from '@now/routing-utils/dist/superstatic';
} from '@vercel/routing-utils/dist/superstatic';
import nodeFileTrace, { NodeFileTraceReasons } from '@zeit/node-file-trace';
import { ChildProcess, fork } from 'child_process';
import {
@@ -165,7 +165,7 @@ function isLegacyNext(nextVersion: string) {
return true;
}
const name = '[@now/next]';
const name = '[@vercel/next]';
const urls: stringMap = {};
function startDevServer(entryPath: string, runtimeEnv: EnvConfig) {
@@ -283,7 +283,7 @@ export const build = async ({
}
console.warn(
"WARNING: your application is being deployed in @now/next's legacy mode. http://err.sh/zeit/now/now-next-legacy-mode"
"WARNING: your application is being deployed in @vercel/next's legacy mode. http://err.sh/zeit/now/now-next-legacy-mode"
);
debug('Normalizing package.json');
@@ -445,14 +445,14 @@ export const build = async ({
throw new NowBuildError({
code: 'NOW_NEXT_BASEPATH_STARTING_SLASH',
message:
'basePath must start with `/`. Please upgrade your `@now/next` builder and try again. Contact support if this continues to happen.',
'basePath must start with `/`. Please upgrade your `@vercel/next` builder and try again. Contact support if this continues to happen.',
});
}
if (nextBasePath.endsWith('/')) {
throw new NowBuildError({
code: 'NOW_NEXT_BASEPATH_TRAILING_SLASH',
message:
'basePath must not end with `/`. Please upgrade your `@now/next` builder and try again. Contact support if this continues to happen.',
'basePath must not end with `/`. Please upgrade your `@vercel/next` builder and try again. Contact support if this continues to happen.',
});
}
@@ -469,8 +469,8 @@ export const build = async ({
throw new NowBuildError({
code: 'NOW_NEXT_VERSION_OUTDATED',
message:
'This version of `@now/next` does not support the version of Next.js you are trying to deploy.\n' +
'Please upgrade your `@now/next` builder and try again. Contact support if this continues to happen.',
'This version of `@vercel/next` does not support the version of Next.js you are trying to deploy.\n' +
'Please upgrade your `@vercel/next` builder and try again. Contact support if this continues to happen.',
});
}
}

View File

@@ -13,8 +13,8 @@ import {
Lambda,
NowBuildError,
isSymbolicLink,
} from '@now/build-utils';
import { Route, Source, NowHeader, NowRewrite } from '@now/routing-utils';
} from '@vercel/build-utils';
import { Route, Source, NowHeader, NowRewrite } from '@vercel/routing-utils';
type stringMap = { [key: string]: string };
@@ -41,7 +41,7 @@ function validateEntrypoint(entrypoint: string) {
) {
throw new NowBuildError({
message:
'Specified "src" for "@now/next" has to be "package.json" or "next.config.js"',
'Specified "src" for "@vercel/next" has to be "package.json" or "next.config.js"',
code: 'NOW_NEXT_INCORRECT_SRC',
});
}
@@ -296,7 +296,7 @@ async function getRoutes(
return routes;
}
// TODO: update to use type from @now/routing-utils after
// TODO: update to use type from `@vercel/routing-utils` after
// adding permanent: true/false handling
export type Redirect = NowRewrite & {
statusCode?: number;
@@ -398,8 +398,8 @@ export async function getDynamicRoutes(
// update MIN_ROUTES_MANIFEST_VERSION
throw new NowBuildError({
message:
'This version of `@now/next` does not support the version of Next.js you are trying to deploy.\n' +
'Please upgrade your `@now/next` builder and try again. Contact support if this continues to happen.',
'This version of `@vercel/next` does not support the version of Next.js you are trying to deploy.\n' +
'Please upgrade your `@vercel/next` builder and try again. Contact support if this continues to happen.',
code: 'NOW_NEXT_VERSION_UPGRADE',
});
}

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/_next/static/testing-build-id/pages/index.js",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{ "path": "/hello1", "mustContain": "Hello World 1" },
{ "path": "/nested/hello2", "mustContain": "Hello World 2" }

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{ "path": "/nested/fb", "mustContain": "Hello Firebase: <!-- -->0" },
{ "path": "/nested/moar/fb", "mustContain": "Hello Firebase: <!-- -->0" }

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/lambda",

View File

@@ -2,7 +2,7 @@
"builds": [
{
"src": "package.json",
"use": "@now/next",
"use": "@vercel/next",
"config": {
"functions": {
"src/pages/api/memory.js": {

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/redir1",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/_next/static/build-id/pages/hello.js",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "packages/web/next.config.js", "use": "@now/next" }],
"builds": [{ "src": "packages/web/next.config.js", "use": "@vercel/next" }],
"routes": [{ "src": "/(.*)", "dest": "/packages/web/$1", "continue": true }],
"probes": [
{

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/_next/static/testing-build-id/pages/index.js",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/first",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/docs/_next/static/testing-build-id/pages/index.js",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/lambda",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/lambda",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
// make sure index responds correctly
{

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
{
"path": "/lambda",

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }],
"builds": [{ "src": "package.json", "use": "@vercel/next" }],
"probes": [
// should handle one-to-one rewrite successfully
{

View File

@@ -2,7 +2,7 @@
"builds": [
{
"src": "package.json",
"use": "@now/next",
"use": "@vercel/next",
"config": {
"buildCommand": "next build",
"outputDirectory": "the-output-directory"

View File

@@ -6,7 +6,7 @@
"builds": [
{
"src": "packages/webapp/next.config.js",
"use": "@now/next"
"use": "@vercel/next"
}
],
"probes": [

View File

@@ -6,7 +6,7 @@
"builds": [
{
"src": "packages/webapp/next.config.js",
"use": "@now/next"
"use": "@vercel/next"
}
],
"probes": [

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
"builds": [{ "src": "package.json", "use": "@vercel/next" }]
}

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "next.config.js", "use": "@now/next" }]
"builds": [{ "src": "next.config.js", "use": "@vercel/next" }]
}

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "next.config.js", "use": "@now/next" }]
"builds": [{ "src": "next.config.js", "use": "@vercel/next" }]
}

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "www/package.json", "use": "@now/next" }]
"builds": [{ "src": "www/package.json", "use": "@vercel/next" }]
}

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "pages/index.js", "use": "@now/next" }]
"builds": [{ "src": "pages/index.js", "use": "@vercel/next" }]
}

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "next.config.js", "use": "@now/next" }]
"builds": [{ "src": "next.config.js", "use": "@vercel/next" }]
}

View File

@@ -1,4 +1,4 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
"builds": [{ "src": "package.json", "use": "@vercel/next" }]
}

Some files were not shown because too many files have changed in this diff Show More