mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 04:22:01 +00:00
[all] Remove more "now" references (#5944)
Follow up to #5928 to remove a few more "now" references and replace with "vercel" where appropriate.
This commit is contained in:
@@ -2,7 +2,7 @@ import fs from 'fs';
|
||||
// @ts-ignore
|
||||
import tar from 'tar-fs';
|
||||
import { extract } from '../../_lib/examples/extract';
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
import { withApiHandler } from '../../_lib/util/with-api-handler';
|
||||
|
||||
const TMP_DIR = '/tmp';
|
||||
@@ -11,7 +11,7 @@ function isDirectory(path: string) {
|
||||
return fs.existsSync(path) && fs.lstatSync(path).isDirectory();
|
||||
}
|
||||
|
||||
function notFound(res: NowResponse, message: string) {
|
||||
function notFound(res: VercelResponse, message: string) {
|
||||
return res.status(404).send({
|
||||
error: {
|
||||
code: 'not_found',
|
||||
@@ -36,8 +36,8 @@ function streamToBuffer(stream: any) {
|
||||
}
|
||||
|
||||
export default withApiHandler(async function (
|
||||
req: NowRequest,
|
||||
res: NowResponse
|
||||
req: VercelRequest,
|
||||
res: VercelResponse
|
||||
) {
|
||||
const ext = '.tar.gz';
|
||||
const { segment = '' } = req.query;
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
// @ts-ignore
|
||||
import parseGitUrl from 'parse-github-url';
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
import { withApiHandler } from '../_lib/util/with-api-handler';
|
||||
import { getGitHubRepoInfo } from '../_lib/examples/github-repo-info';
|
||||
import { getGitLabRepoInfo } from '../_lib/examples/gitlab-repo-info';
|
||||
|
||||
export default withApiHandler(async function (
|
||||
req: NowRequest,
|
||||
res: NowResponse
|
||||
req: VercelRequest,
|
||||
res: VercelResponse
|
||||
) {
|
||||
const repoPath = decodeURIComponent((req.query.repo as string) || '');
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
import { getExampleList } from '../_lib/examples/example-list';
|
||||
import { withApiHandler } from '../_lib/util/with-api-handler';
|
||||
|
||||
export default withApiHandler(async function (
|
||||
req: NowRequest,
|
||||
res: NowResponse
|
||||
req: VercelRequest,
|
||||
res: VercelResponse
|
||||
) {
|
||||
res.status(200).json(await getExampleList());
|
||||
});
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { extract } from '../_lib/examples/extract';
|
||||
import { summary } from '../_lib/examples/summary';
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
import { mapOldToNew } from '../_lib/examples/map-old-to-new';
|
||||
import { withApiHandler } from '../_lib/util/with-api-handler';
|
||||
|
||||
export default withApiHandler(async function (
|
||||
req: NowRequest,
|
||||
res: NowResponse
|
||||
req: VercelRequest,
|
||||
res: VercelResponse
|
||||
) {
|
||||
await extract('https://github.com/vercel/vercel/archive/master.zip', '/tmp');
|
||||
const exampleList = summary('/tmp/vercel-master/examples');
|
||||
|
||||
Reference in New Issue
Block a user