mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 12:57:47 +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:
@@ -1,10 +1,10 @@
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
import { errorHandler } from './error-handler';
|
||||
|
||||
type Handler = (req: NowRequest, res: NowResponse) => Promise<any>;
|
||||
type Handler = (req: VercelRequest, res: VercelResponse) => Promise<any>;
|
||||
|
||||
export function withApiHandler(handler: Handler): Handler {
|
||||
return async (req: NowRequest, res: NowResponse) => {
|
||||
return async (req: VercelRequest, res: VercelResponse) => {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
res.setHeader('Access-Control-Allow-Methods', 'GET');
|
||||
res.setHeader(
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
import { withApiHandler } from './_lib/util/with-api-handler';
|
||||
import _frameworks, { Framework } from '../packages/frameworks';
|
||||
|
||||
@@ -27,8 +27,8 @@ const frameworks = (_frameworks as Framework[])
|
||||
});
|
||||
|
||||
export default withApiHandler(async function (
|
||||
req: NowRequest,
|
||||
res: NowResponse
|
||||
req: VercelRequest,
|
||||
res: VercelResponse
|
||||
) {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
res.setHeader('Access-Control-Allow-Methods', 'GET');
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "13.1.4",
|
||||
"@types/node-fetch": "2.5.4",
|
||||
"@vercel/node": "1.7.2",
|
||||
"@vercel/node": "1.9.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,10 +134,10 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@vercel/node@1.7.2":
|
||||
version "1.7.2"
|
||||
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.7.2.tgz#85cb8aac661c02dfef6fe752740f5b162e90767b"
|
||||
integrity sha512-XV5lrLC+K/cxsaFj8H2OoGu1zliOqnxcrOnPInI8HmQjR/Tztt+0nzgpt+7sx8wXcrib0Nu7lK303jP7VjSETw==
|
||||
"@vercel/node@1.9.0":
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.9.0.tgz#6b64f3b9a962ddb1089276fad00f441a1f4b9cf0"
|
||||
integrity sha512-Vk/ZpuY4Cdc8oUwBi/kf8qETRaJb/KYdFddVkLuS10QwA0yJx+RQ11trhZ1KFUdc27aBr5S2k8/dDxK8sLr+IA==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
ts-node "8.9.1"
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
yarn.lock
|
||||
README.md
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
|
||||
export default (_req: NowRequest, res: NowResponse) => {
|
||||
export default (_req: VercelRequest, res: VercelResponse) => {
|
||||
const date = new Date().toString();
|
||||
res.status(200).send(date);
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"react-helmet": "^5.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/node": "1.8.5"
|
||||
"@vercel/node": "1.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "gatsby develop",
|
||||
|
||||
@@ -1400,10 +1400,10 @@
|
||||
dependencies:
|
||||
wonka "^4.0.14"
|
||||
|
||||
"@vercel/node@1.8.5":
|
||||
version "1.8.5"
|
||||
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.8.5.tgz#2c8b9532f1bb25734a9964c52973386ed78022d4"
|
||||
integrity sha512-1iw7FSR8Oau6vZB1MWfBnA5q2a/IqRHiSZSbt8lz0dyTF599q8pc5GcSv/TvmrYaEGzh3+N0S4cbmuMCqVlwJg==
|
||||
"@vercel/node@1.9.0":
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.9.0.tgz#6b64f3b9a962ddb1089276fad00f441a1f4b9cf0"
|
||||
integrity sha512-Vk/ZpuY4Cdc8oUwBi/kf8qETRaJb/KYdFddVkLuS10QwA0yJx+RQ11trhZ1KFUdc27aBr5S2k8/dDxK8sLr+IA==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
ts-node "8.9.1"
|
||||
|
||||
@@ -15,7 +15,7 @@ function checkPkgOrThrow(pkgname) {
|
||||
checkPkgOrThrow('tls-check');
|
||||
checkPkgOrThrow('exeggcute');
|
||||
|
||||
// This is to satisfy `@now/static-build` which needs a `dist` directory.
|
||||
// This is to satisfy `@vercel/static-build` which needs a `dist` directory.
|
||||
const { exec } = require('exeggcute');
|
||||
exec('mkdir dist', __dirname);
|
||||
exec('echo "node-env:RANDOMNESS_PLACEHOLDER" > dist/index.html', __dirname);
|
||||
|
||||
@@ -18,7 +18,7 @@ if (development) {
|
||||
throw new Error('Expected development dependencies to _NOT_ be installed.');
|
||||
}
|
||||
|
||||
// This is to satisfy `@now/static-build` which needs a `dist` directory.
|
||||
// This is to satisfy `@vercel/static-build` which needs a `dist` directory.
|
||||
const { execSync } = require('child_process');
|
||||
execSync('mkdir dist');
|
||||
execSync('echo "npm-prod:RANDOMNESS_PLACEHOLDER" > dist/index.html');
|
||||
|
||||
@@ -18,7 +18,7 @@ if (development) {
|
||||
throw new Error('Expected development dependencies to _NOT_ be installed.');
|
||||
}
|
||||
|
||||
// This is to satisfy `@now/static-build` which needs a `dist` directory.
|
||||
// This is to satisfy `@vercel/static-build` which needs a `dist` directory.
|
||||
const { execSync } = require('child_process');
|
||||
execSync('mkdir dist');
|
||||
execSync('echo "yarn-prod:RANDOMNESS_PLACEHOLDER" > dist/index.html');
|
||||
|
||||
@@ -7,7 +7,7 @@ const {
|
||||
shouldServe,
|
||||
createLambda,
|
||||
getWritableDirectory,
|
||||
} = require('@now/build-utils');
|
||||
} = require('@vercel/build-utils');
|
||||
|
||||
exports.analyze = ({ files, entrypoint }) => files[entrypoint].digest;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ func (h *CgiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
Env: []string{
|
||||
"HTTPS=on",
|
||||
"SERVER_PORT=443",
|
||||
"SERVER_SOFTWARE=@now/cgi",
|
||||
"SERVER_SOFTWARE=@vercel/cgi",
|
||||
},
|
||||
}
|
||||
handler.ServeHTTP(w, r)
|
||||
|
||||
@@ -4,7 +4,7 @@ import chalk from 'chalk';
|
||||
import {
|
||||
createDeployment,
|
||||
DeploymentOptions,
|
||||
NowClientOptions,
|
||||
VercelClientOptions,
|
||||
} from '@vercel/client';
|
||||
import { Output } from '../output';
|
||||
// @ts-ignore
|
||||
@@ -71,7 +71,7 @@ export default async function processDeployment({
|
||||
|
||||
const { env = {} } = requestBody;
|
||||
|
||||
const nowClientOptions: NowClientOptions = {
|
||||
const clientOptions: VercelClientOptions = {
|
||||
teamId: org.type === 'team' ? org.id : undefined,
|
||||
apiUrl: now._apiUrl,
|
||||
token: now._token,
|
||||
@@ -96,7 +96,7 @@ export default async function processDeployment({
|
||||
|
||||
try {
|
||||
for await (const event of createDeployment(
|
||||
nowClientOptions,
|
||||
clientOptions,
|
||||
requestBody,
|
||||
nowConfig
|
||||
)) {
|
||||
|
||||
44
packages/cli/test/dev-builder.unit.js
vendored
44
packages/cli/test/dev-builder.unit.js
vendored
@@ -178,87 +178,87 @@ test('[dev-builder] filter install not bundled tagged, cached tagged', t => {
|
||||
});
|
||||
|
||||
test('[dev-builder] isBundledBuilder() - stable', t => {
|
||||
const nowCliPkg = {
|
||||
const cliPkg = {
|
||||
dependencies: {
|
||||
'@now/node': '1.5.2',
|
||||
'@vercel/node': '1.6.1',
|
||||
},
|
||||
};
|
||||
|
||||
// "canary" tag
|
||||
{
|
||||
const parsed = npa('@now/node@canary');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node@canary');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, false);
|
||||
}
|
||||
|
||||
// "latest" tag
|
||||
{
|
||||
const parsed = npa('@now/node');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, true);
|
||||
}
|
||||
|
||||
// specific matching version
|
||||
{
|
||||
const parsed = npa('@now/node@1.5.2');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node@1.6.1');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, true);
|
||||
}
|
||||
|
||||
// specific non-matching version
|
||||
{
|
||||
const parsed = npa('@now/node@1.5.1');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node@1.6.0');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, false);
|
||||
}
|
||||
|
||||
// URL
|
||||
{
|
||||
const parsed = npa('https://example.com');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, false);
|
||||
}
|
||||
});
|
||||
|
||||
test('[dev-builder] isBundledBuilder() - canary', t => {
|
||||
const nowCliPkg = {
|
||||
const cliPkg = {
|
||||
dependencies: {
|
||||
'@now/node': '1.5.2-canary.3',
|
||||
'@vercel/node': '1.6.1-canary.0',
|
||||
},
|
||||
};
|
||||
|
||||
// "canary" tag
|
||||
{
|
||||
const parsed = npa('@now/node@canary');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node@canary');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, true);
|
||||
}
|
||||
|
||||
// "latest" tag
|
||||
{
|
||||
const parsed = npa('@now/node');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, false);
|
||||
}
|
||||
|
||||
// specific matching version
|
||||
{
|
||||
const parsed = npa('@now/node@1.5.2-canary.3');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node@1.6.1-canary.0');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, true);
|
||||
}
|
||||
|
||||
// specific non-matching version
|
||||
{
|
||||
const parsed = npa('@now/node@1.5.2-canary.2');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const parsed = npa('@vercel/node@1.5.2-canary.9');
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, false);
|
||||
}
|
||||
|
||||
// URL
|
||||
{
|
||||
const parsed = npa('https://example.com');
|
||||
const result = isBundledBuilder(parsed, nowCliPkg);
|
||||
const result = isBundledBuilder(parsed, cliPkg);
|
||||
t.is(result, false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [
|
||||
{ "src": "*.js", "use": "@now/node" },
|
||||
{ "src": "*.html", "use": "@now/static" }
|
||||
{ "src": "*.js", "use": "@vercel/node" },
|
||||
{ "src": "*.html", "use": "@vercel/static" }
|
||||
],
|
||||
"routes": [
|
||||
{ "src": "/error.js", "dest": "/error.js", "status": 404 },
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [
|
||||
{ "src": "*.js", "use": "@now/node" },
|
||||
{ "src": "*.txt", "use": "@now/static" }
|
||||
]
|
||||
}
|
||||
7
packages/cli/test/fixtures/unit/now-dev-directory-listing/vercel.json
vendored
Normal file
7
packages/cli/test/fixtures/unit/now-dev-directory-listing/vercel.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [
|
||||
{ "src": "*.js", "use": "@vercel/node" },
|
||||
{ "src": "*.txt", "use": "@vercel/static" }
|
||||
]
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"name": "now-dev-headers",
|
||||
"builds": [
|
||||
{ "src": "index.js", "use": "@now/node" },
|
||||
{ "src": "foo.txt", "use": "@now/static" }
|
||||
]
|
||||
}
|
||||
8
packages/cli/test/fixtures/unit/now-dev-headers/vercel.json
vendored
Normal file
8
packages/cli/test/fixtures/unit/now-dev-headers/vercel.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version": 2,
|
||||
"name": "now-dev-headers",
|
||||
"builds": [
|
||||
{ "src": "index.js", "use": "@vercel/node" },
|
||||
{ "src": "foo.txt", "use": "@vercel/static" }
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": 2,
|
||||
"name": "now-dev-next",
|
||||
"builds": [{ "src": "package.json", "use": "@now/next@canary" }],
|
||||
"builds": [{ "src": "package.json", "use": "@vercel/next@canary" }],
|
||||
"routes": [
|
||||
{
|
||||
"src": "/(.*)",
|
||||
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"version": 2,
|
||||
"name": "now-dev-query-test",
|
||||
"builds": [
|
||||
{ "src": "index.js", "use": "@now/node" }
|
||||
],
|
||||
"builds": [{ "src": "index.js", "use": "@vercel/node" }],
|
||||
"routes": [
|
||||
{
|
||||
"src": "/(.*)",
|
||||
@@ -1,8 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [
|
||||
{ "src": "index.js", "use": "@now/node" }
|
||||
],
|
||||
"builds": [{ "src": "index.js", "use": "@vercel/node" }],
|
||||
"routes": [
|
||||
{ "src": "/(.*)", "dest": "http://localhost:$1/something?route-param=b" }
|
||||
]
|
||||
@@ -1,2 +0,0 @@
|
||||
yarn.lock
|
||||
README.md
|
||||
@@ -3,14 +3,14 @@
|
||||
"builds": [
|
||||
{
|
||||
"src": "package.json",
|
||||
"use": "@now/static-build@canary",
|
||||
"use": "@vercel/static-build@canary",
|
||||
"config": {
|
||||
"distDir": "public"
|
||||
}
|
||||
},
|
||||
{
|
||||
"src": "api/**/*.js",
|
||||
"use": "@now/node"
|
||||
"use": "@vercel/node"
|
||||
}
|
||||
],
|
||||
"routes": [{ "src": "^/api/date$", "dest": "api/date.js" }]
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [
|
||||
{ "src": "www/**/*", "use": "@now/static" }
|
||||
],
|
||||
"routes": [
|
||||
{ "src": "(.*)", "dest": "www$1" }
|
||||
]
|
||||
}
|
||||
5
packages/cli/test/fixtures/unit/now-dev-static-routes/vercel.json
vendored
Normal file
5
packages/cli/test/fixtures/unit/now-dev-static-routes/vercel.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "www/**/*", "use": "@vercel/static" }],
|
||||
"routes": [{ "src": "(.*)", "dest": "www$1" }]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
// should not be included
|
||||
@@ -1 +0,0 @@
|
||||
// should be included
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"files": [
|
||||
"b.js"
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "woot",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"dependencies": {},
|
||||
"files": [
|
||||
"a.js"
|
||||
]
|
||||
}
|
||||
@@ -14,7 +14,7 @@ const getRevertAliasConfigFile = () => {
|
||||
builds: [
|
||||
{
|
||||
src: '*.json',
|
||||
use: '@now/static',
|
||||
use: '@vercel/static',
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -30,11 +30,11 @@ module.exports = async function prepare(session) {
|
||||
},
|
||||
'empty-directory': {},
|
||||
'config-scope-property-email': {
|
||||
'now.json': `{ "scope": "${session}@zeit.pub", "builds": [ { "src": "*.html", "use": "@now/static" } ] }`,
|
||||
'now.json': `{ "scope": "${session}@zeit.pub", "builds": [ { "src": "*.html", "use": "@vercel/static" } ] }`,
|
||||
'index.html': '<span>test scope email</span',
|
||||
},
|
||||
'config-scope-property-username': {
|
||||
'now.json': `{ "scope": "${session}", "builds": [ { "src": "*.html", "use": "@now/static" } ] }`,
|
||||
'now.json': `{ "scope": "${session}", "builds": [ { "src": "*.html", "use": "@vercel/static" } ] }`,
|
||||
'index.html': '<span>test scope username</span',
|
||||
},
|
||||
'builds-wrong': {
|
||||
@@ -78,7 +78,7 @@ module.exports = async function prepare(session) {
|
||||
},
|
||||
'build-env-debug': {
|
||||
'now.json': JSON.stringify({
|
||||
builds: [{ src: 'index.js', use: '@now/node' }],
|
||||
builds: [{ src: 'index.js', use: '@vercel/node' }],
|
||||
}),
|
||||
'package.json': JSON.stringify({
|
||||
scripts: {
|
||||
@@ -156,12 +156,12 @@ module.exports = async function prepare(session) {
|
||||
[`test-${session}.html`]: '<h1>hello test</h1>',
|
||||
'now.json': JSON.stringify({
|
||||
name: 'original',
|
||||
builds: [{ src: `main-${session}.html`, use: '@now/static' }],
|
||||
builds: [{ src: `main-${session}.html`, use: '@vercel/static' }],
|
||||
routes: [{ src: '/another-main', dest: `/main-${session}.html` }],
|
||||
}),
|
||||
'now-test.json': JSON.stringify({
|
||||
name: 'secondary',
|
||||
builds: [{ src: `test-${session}.html`, use: '@now/static' }],
|
||||
builds: [{ src: `test-${session}.html`, use: '@vercel/static' }],
|
||||
routes: [{ src: '/another-test', dest: `/test-${session}.html` }],
|
||||
}),
|
||||
},
|
||||
@@ -372,10 +372,10 @@ module.exports = async function prepare(session) {
|
||||
'conflicting-now-json-vercel-json': {
|
||||
'index.html': '<h1>I am a website.</h1>',
|
||||
'vercel.json': JSON.stringify({
|
||||
builds: [{ src: '*.html', use: '@now/static' }],
|
||||
builds: [{ src: '*.html', use: '@vercel/static' }],
|
||||
}),
|
||||
'now.json': JSON.stringify({
|
||||
builds: [{ src: '*.html', use: '@now/static' }],
|
||||
builds: [{ src: '*.html', use: '@vercel/static' }],
|
||||
}),
|
||||
},
|
||||
'unauthorized-vercel-config': {
|
||||
|
||||
@@ -17,10 +17,7 @@ yarn add @vercel/client
|
||||
Next, load it:
|
||||
|
||||
```js
|
||||
// v2
|
||||
const { createDeployment } = require('@vercel/client');
|
||||
// v1
|
||||
const { createLegacyDeployment } = require('@vercel/client');
|
||||
```
|
||||
|
||||
Then call inside a `for...of` loop to follow the progress with the following arguments:
|
||||
@@ -34,7 +31,7 @@ async function deploy() {
|
||||
|
||||
for await (const event of createDeployment({
|
||||
token: process.env.TOKEN,
|
||||
path: '/Users/vercel-user/projects/front',
|
||||
path: '/Users/me/Code/myproject',
|
||||
})) {
|
||||
if (event.type === 'ready') {
|
||||
deployment = event.payload;
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { createDebug } from './utils';
|
||||
import {
|
||||
Deployment,
|
||||
NowClientOptions,
|
||||
VercelClientOptions,
|
||||
DeploymentBuild,
|
||||
DeploymentEventType,
|
||||
} from './types';
|
||||
@@ -24,7 +24,7 @@ interface DeploymentStatus {
|
||||
/* eslint-disable */
|
||||
export async function* checkDeploymentStatus(
|
||||
deployment: Deployment,
|
||||
clientOptions: NowClientOptions
|
||||
clientOptions: VercelClientOptions
|
||||
): AsyncIterableIterator<DeploymentStatus> {
|
||||
const { token, teamId, apiUrl, userAgent } = clientOptions;
|
||||
const debug = createDebug(clientOptions.debug);
|
||||
|
||||
@@ -7,14 +7,14 @@ import { buildFileTree, createDebug, parseVercelConfig } from './utils';
|
||||
import { DeploymentError } from './errors';
|
||||
import {
|
||||
NowConfig,
|
||||
NowClientOptions,
|
||||
VercelClientOptions,
|
||||
DeploymentOptions,
|
||||
DeploymentEventType,
|
||||
} from './types';
|
||||
|
||||
export default function buildCreateDeployment() {
|
||||
return async function* createDeployment(
|
||||
clientOptions: NowClientOptions,
|
||||
clientOptions: VercelClientOptions,
|
||||
deploymentOptions: DeploymentOptions = {},
|
||||
nowConfig: NowConfig = {}
|
||||
): AsyncIterableIterator<{ type: DeploymentEventType; payload: any }> {
|
||||
|
||||
@@ -11,13 +11,13 @@ import {
|
||||
import {
|
||||
Deployment,
|
||||
DeploymentOptions,
|
||||
NowClientOptions,
|
||||
VercelClientOptions,
|
||||
DeploymentEventType,
|
||||
} from './types';
|
||||
|
||||
async function* postDeployment(
|
||||
files: Map<string, DeploymentFile>,
|
||||
clientOptions: NowClientOptions,
|
||||
clientOptions: VercelClientOptions,
|
||||
deploymentOptions: DeploymentOptions
|
||||
): AsyncIterableIterator<{
|
||||
type: DeploymentEventType;
|
||||
@@ -91,7 +91,7 @@ async function* postDeployment(
|
||||
|
||||
function getDefaultName(
|
||||
files: Map<string, DeploymentFile>,
|
||||
clientOptions: NowClientOptions
|
||||
clientOptions: VercelClientOptions
|
||||
): string {
|
||||
const debug = createDebug(clientOptions.debug);
|
||||
const { isDirectory, path } = clientOptions;
|
||||
@@ -110,7 +110,7 @@ function getDefaultName(
|
||||
|
||||
export async function* deploy(
|
||||
files: Map<string, DeploymentFile>,
|
||||
clientOptions: NowClientOptions,
|
||||
clientOptions: VercelClientOptions,
|
||||
deploymentOptions: DeploymentOptions
|
||||
): AsyncIterableIterator<{ type: string; payload: any }> {
|
||||
const debug = createDebug(clientOptions.debug);
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { Builder, BuilderFunctions } from '@vercel/build-utils';
|
||||
import {
|
||||
NowHeader,
|
||||
Route,
|
||||
NowRedirect,
|
||||
NowRewrite,
|
||||
} from '@vercel/routing-utils';
|
||||
import { Header, Route, Redirect, Rewrite } from '@vercel/routing-utils';
|
||||
|
||||
export { DeploymentEventType } from './utils';
|
||||
|
||||
@@ -12,12 +7,7 @@ export interface Dictionary<T> {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for `now-client` or
|
||||
* properties that should not
|
||||
* be part of the payload.
|
||||
*/
|
||||
export interface NowClientOptions {
|
||||
export interface VercelClientOptions {
|
||||
token: string;
|
||||
path: string | string[];
|
||||
debug?: boolean;
|
||||
@@ -31,6 +21,12 @@ export interface NowClientOptions {
|
||||
skipAutoDetectionConfirmation?: boolean;
|
||||
}
|
||||
|
||||
/** @deprecated Use VercelClientOptions instead. */
|
||||
export type NowClientOptions = VercelClientOptions;
|
||||
|
||||
/** @deprecated Use VercelConfig instead. */
|
||||
export type NowConfig = VercelConfig;
|
||||
|
||||
export interface Deployment {
|
||||
id: string;
|
||||
deploymentId?: string;
|
||||
@@ -103,7 +99,7 @@ export interface DeploymentGithubData {
|
||||
|
||||
export const fileNameSymbol = Symbol('fileName');
|
||||
|
||||
export interface NowConfig {
|
||||
export interface VercelConfig {
|
||||
[fileNameSymbol]?: string;
|
||||
name?: string;
|
||||
version?: number;
|
||||
@@ -116,9 +112,9 @@ export interface NowConfig {
|
||||
routes?: Route[];
|
||||
files?: string[];
|
||||
cleanUrls?: boolean;
|
||||
rewrites?: NowRewrite[];
|
||||
redirects?: NowRedirect[];
|
||||
headers?: NowHeader[];
|
||||
rewrites?: Rewrite[];
|
||||
redirects?: Redirect[];
|
||||
headers?: Header[];
|
||||
trailingSlash?: boolean;
|
||||
functions?: BuilderFunctions;
|
||||
github?: DeploymentGithubData;
|
||||
@@ -141,9 +137,9 @@ export interface DeploymentOptions {
|
||||
regions?: string[];
|
||||
routes?: Route[];
|
||||
cleanUrls?: boolean;
|
||||
rewrites?: NowRewrite[];
|
||||
redirects?: NowRedirect[];
|
||||
headers?: NowHeader[];
|
||||
rewrites?: Rewrite[];
|
||||
redirects?: Redirect[];
|
||||
headers?: Header[];
|
||||
trailingSlash?: boolean;
|
||||
builds?: Builder[];
|
||||
functions?: BuilderFunctions;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { DeploymentFile } from './utils/hashes';
|
||||
import { fetch, API_FILES, createDebug } from './utils';
|
||||
import { DeploymentError } from './errors';
|
||||
import { deploy } from './deploy';
|
||||
import { NowClientOptions, DeploymentOptions } from './types';
|
||||
import { VercelClientOptions, DeploymentOptions } from './types';
|
||||
|
||||
const isClientNetworkError = (err: Error | DeploymentError) => {
|
||||
if (err.message) {
|
||||
@@ -27,7 +27,7 @@ const isClientNetworkError = (err: Error | DeploymentError) => {
|
||||
|
||||
export async function* upload(
|
||||
files: Map<string, DeploymentFile>,
|
||||
clientOptions: NowClientOptions,
|
||||
clientOptions: VercelClientOptions,
|
||||
deploymentOptions: DeploymentOptions
|
||||
): AsyncIterableIterator<any> {
|
||||
const { token, teamId, apiUrl, userAgent } = clientOptions;
|
||||
|
||||
@@ -7,7 +7,7 @@ import ignore from 'ignore';
|
||||
type Ignore = ReturnType<typeof ignore>;
|
||||
import { pkgVersion } from '../pkg';
|
||||
import { NowBuildError } from '@vercel/build-utils';
|
||||
import { NowClientOptions, DeploymentOptions, NowConfig } from '../types';
|
||||
import { VercelClientOptions, DeploymentOptions, NowConfig } from '../types';
|
||||
import { Sema } from 'async-sema';
|
||||
import { readFile } from 'fs-extra';
|
||||
import readdir from 'recursive-readdir';
|
||||
@@ -205,7 +205,7 @@ export const fetch = async (
|
||||
delete opts.teamId;
|
||||
}
|
||||
|
||||
const userAgent = opts.userAgent || `now-client-v${pkgVersion}`;
|
||||
const userAgent = opts.userAgent || `client-v${pkgVersion}`;
|
||||
delete opts.userAgent;
|
||||
|
||||
opts.headers = {
|
||||
@@ -237,7 +237,7 @@ const isWin = process.platform.includes('win');
|
||||
|
||||
export const prepareFiles = (
|
||||
files: Map<string, DeploymentFile>,
|
||||
clientOptions: NowClientOptions
|
||||
clientOptions: VercelClientOptions
|
||||
): PreparedFile[] => {
|
||||
const preparedFiles = [...files.keys()].reduce(
|
||||
(acc: PreparedFile[], sha: string): PreparedFile[] => {
|
||||
@@ -280,8 +280,7 @@ export function createDebug(debug?: boolean) {
|
||||
if (debug) {
|
||||
return (...logs: string[]) => {
|
||||
process.stderr.write(
|
||||
[`[now-client-debug] ${new Date().toISOString()}`, ...logs].join(' ') +
|
||||
'\n'
|
||||
[`[client-debug] ${new Date().toISOString()}`, ...logs].join(' ') + '\n'
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { URLSearchParams } from 'url';
|
||||
import { NowClientOptions } from '../types';
|
||||
import { VercelClientOptions } from '../types';
|
||||
|
||||
export function generateQueryString(clientOptions: NowClientOptions): string {
|
||||
export function generateQueryString(
|
||||
clientOptions: VercelClientOptions
|
||||
): string {
|
||||
const options = new URLSearchParams();
|
||||
|
||||
if (clientOptions.teamId) {
|
||||
|
||||
@@ -12,7 +12,7 @@ type LauncherConfiguration = {
|
||||
awsLambdaHandler?: string;
|
||||
};
|
||||
|
||||
export function makeNowLauncher(config: LauncherConfiguration): string {
|
||||
export function makeVercelLauncher(config: LauncherConfiguration): string {
|
||||
const {
|
||||
entrypointPath,
|
||||
bridgePath,
|
||||
|
||||
@@ -8,15 +8,15 @@ const setupFiles = async (entrypoint, shouldAddHelpers) => {
|
||||
|
||||
await fs.copyFile(
|
||||
join(__dirname, '../dist/helpers.js'),
|
||||
join(__dirname, 'lambda/helpers.js'),
|
||||
join(__dirname, 'lambda/helpers.js')
|
||||
);
|
||||
await fs.copyFile(
|
||||
require.resolve('@now/node-bridge/bridge'),
|
||||
join(__dirname, 'lambda/bridge.js'),
|
||||
require.resolve('@vercel/node-bridge/bridge'),
|
||||
join(__dirname, 'lambda/bridge.js')
|
||||
);
|
||||
await fs.copyFile(
|
||||
join(process.cwd(), entrypoint),
|
||||
join(__dirname, 'lambda/entrypoint.js'),
|
||||
join(__dirname, 'lambda/entrypoint.js')
|
||||
);
|
||||
|
||||
let launcher = makeLauncher('./entrypoint', shouldAddHelpers);
|
||||
@@ -47,7 +47,7 @@ const runTests = async (entrypoint, shouldAddHelpers = true, nb) => {
|
||||
console.log(
|
||||
`setting up files with entrypoint ${entrypoint} and ${
|
||||
shouldAddHelpers ? 'helpers' : 'no helpers'
|
||||
}`,
|
||||
}`
|
||||
);
|
||||
await setupFiles(entrypoint, shouldAddHelpers);
|
||||
|
||||
@@ -76,7 +76,7 @@ const runTests = async (entrypoint, shouldAddHelpers = true, nb) => {
|
||||
const main = async () => {
|
||||
if (process.argv.length !== 5) {
|
||||
console.log(
|
||||
'usage : node run.js <entrypoint-file> <add-helpers> <nb-of-request>',
|
||||
'usage : node run.js <entrypoint-file> <add-helpers> <nb-of-request>'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,13 @@
|
||||
// which will fail at compile time if exports
|
||||
// are not found in the index file
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
import { NowRequest, NowResponse } from './index';
|
||||
import {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
NowRequest,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
NowResponse,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
VercelRequest,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
VercelResponse,
|
||||
} from './index';
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import {
|
||||
NowRequest,
|
||||
NowResponse,
|
||||
NowRequestCookies,
|
||||
NowRequestQuery,
|
||||
NowRequestBody,
|
||||
VercelRequest,
|
||||
VercelResponse,
|
||||
VercelRequestCookies,
|
||||
VercelRequestQuery,
|
||||
VercelRequestBody,
|
||||
} from './types';
|
||||
import { Server } from 'http';
|
||||
import { Bridge } from './bridge';
|
||||
|
||||
function getBodyParser(req: NowRequest, body: Buffer) {
|
||||
return function parseBody(): NowRequestBody {
|
||||
function getBodyParser(req: VercelRequest, body: Buffer) {
|
||||
return function parseBody(): VercelRequestBody {
|
||||
if (!req.headers['content-type']) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -46,16 +46,16 @@ function getBodyParser(req: NowRequest, body: Buffer) {
|
||||
};
|
||||
}
|
||||
|
||||
function getQueryParser({ url = '/' }: NowRequest) {
|
||||
return function parseQuery(): NowRequestQuery {
|
||||
function getQueryParser({ url = '/' }: VercelRequest) {
|
||||
return function parseQuery(): VercelRequestQuery {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const { parse: parseURL } = require('url');
|
||||
return parseURL(url, true).query;
|
||||
};
|
||||
}
|
||||
|
||||
function getCookieParser(req: NowRequest) {
|
||||
return function parseCookie(): NowRequestCookies {
|
||||
function getCookieParser(req: VercelRequest) {
|
||||
return function parseCookie(): VercelRequestCookies {
|
||||
const header: undefined | string | string[] = req.headers.cookie;
|
||||
|
||||
if (!header) {
|
||||
@@ -68,16 +68,16 @@ function getCookieParser(req: NowRequest) {
|
||||
};
|
||||
}
|
||||
|
||||
function status(res: NowResponse, statusCode: number): NowResponse {
|
||||
function status(res: VercelResponse, statusCode: number): VercelResponse {
|
||||
res.statusCode = statusCode;
|
||||
return res;
|
||||
}
|
||||
|
||||
function redirect(
|
||||
res: NowResponse,
|
||||
res: VercelResponse,
|
||||
statusOrUrl: string | number,
|
||||
url?: string
|
||||
): NowResponse {
|
||||
): VercelResponse {
|
||||
if (typeof statusOrUrl === 'string') {
|
||||
url = statusOrUrl;
|
||||
statusOrUrl = 307;
|
||||
@@ -108,7 +108,11 @@ function createETag(body: any, encoding: 'utf8' | undefined) {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function send(req: NowRequest, res: NowResponse, body: any): NowResponse {
|
||||
function send(
|
||||
req: VercelRequest,
|
||||
res: VercelResponse,
|
||||
body: any
|
||||
): VercelResponse {
|
||||
let chunk: unknown = body;
|
||||
let encoding: 'utf8' | undefined;
|
||||
|
||||
@@ -206,7 +210,11 @@ function send(req: NowRequest, res: NowResponse, body: any): NowResponse {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function json(req: NowRequest, res: NowResponse, jsonBody: any): NowResponse {
|
||||
function json(
|
||||
req: VercelRequest,
|
||||
res: VercelResponse,
|
||||
jsonBody: any
|
||||
): VercelResponse {
|
||||
const body = JSON.stringify(jsonBody);
|
||||
|
||||
// content-type
|
||||
@@ -227,7 +235,7 @@ export class ApiError extends Error {
|
||||
}
|
||||
|
||||
export function sendError(
|
||||
res: NowResponse,
|
||||
res: VercelResponse,
|
||||
statusCode: number,
|
||||
message: string
|
||||
) {
|
||||
@@ -236,7 +244,7 @@ export function sendError(
|
||||
res.end();
|
||||
}
|
||||
|
||||
function setLazyProp<T>(req: NowRequest, prop: string, getter: () => T) {
|
||||
function setLazyProp<T>(req: VercelRequest, prop: string, getter: () => T) {
|
||||
const opts = { configurable: true, enumerable: true };
|
||||
const optsReset = { ...opts, writable: true };
|
||||
|
||||
@@ -255,12 +263,12 @@ function setLazyProp<T>(req: NowRequest, prop: string, getter: () => T) {
|
||||
}
|
||||
|
||||
export function createServerWithHelpers(
|
||||
handler: (req: NowRequest, res: NowResponse) => void | Promise<void>,
|
||||
handler: (req: VercelRequest, res: VercelResponse) => void | Promise<void>,
|
||||
bridge: Bridge
|
||||
) {
|
||||
const server = new Server(async (_req, _res) => {
|
||||
const req = _req as NowRequest;
|
||||
const res = _res as NowResponse;
|
||||
const req = _req as VercelRequest;
|
||||
const res = _res as VercelResponse;
|
||||
|
||||
try {
|
||||
const reqId = req.headers['x-now-bridge-request-id'];
|
||||
@@ -274,9 +282,13 @@ export function createServerWithHelpers(
|
||||
|
||||
const event = bridge.consumeEvent(reqId);
|
||||
|
||||
setLazyProp<NowRequestCookies>(req, 'cookies', getCookieParser(req));
|
||||
setLazyProp<NowRequestQuery>(req, 'query', getQueryParser(req));
|
||||
setLazyProp<NowRequestBody>(req, 'body', getBodyParser(req, event.body));
|
||||
setLazyProp<VercelRequestCookies>(req, 'cookies', getCookieParser(req));
|
||||
setLazyProp<VercelRequestQuery>(req, 'query', getQueryParser(req));
|
||||
setLazyProp<VercelRequestBody>(
|
||||
req,
|
||||
'body',
|
||||
getBodyParser(req, event.body)
|
||||
);
|
||||
|
||||
res.status = statusCode => status(res, statusCode);
|
||||
res.redirect = (statusOrUrl, url) => redirect(res, statusOrUrl, url);
|
||||
|
||||
@@ -46,11 +46,16 @@ const {
|
||||
isSymbolicLink,
|
||||
walkParentDirs,
|
||||
} = buildUtils;
|
||||
import { makeNowLauncher, makeAwsLauncher } from './launcher';
|
||||
import { makeVercelLauncher, makeAwsLauncher } from './launcher';
|
||||
import { Register, register } from './typescript';
|
||||
|
||||
export { shouldServe };
|
||||
export { NowRequest, NowResponse } from './types';
|
||||
export {
|
||||
NowRequest,
|
||||
NowResponse,
|
||||
VercelRequest,
|
||||
VercelResponse,
|
||||
} from './types';
|
||||
|
||||
interface DownloadOptions {
|
||||
files: Files;
|
||||
@@ -373,11 +378,11 @@ export async function build({
|
||||
);
|
||||
debug(`Trace complete [${Date.now() - traceTime}ms]`);
|
||||
|
||||
const makeLauncher = awsLambdaHandler ? makeAwsLauncher : makeNowLauncher;
|
||||
const launcher = awsLambdaHandler ? makeAwsLauncher : makeVercelLauncher;
|
||||
|
||||
const launcherFiles: Files = {
|
||||
[`${LAUNCHER_FILENAME}.js`]: new FileBlob({
|
||||
data: makeLauncher({
|
||||
data: launcher({
|
||||
entrypointPath: `./${relative(baseDir, entrypointPath)}`,
|
||||
bridgePath: `./${BRIDGE_FILENAME}`,
|
||||
helpersPath: `./${HELPERS_FILENAME}`,
|
||||
|
||||
@@ -22,10 +22,20 @@ export type VercelApiHandler = (
|
||||
res: VercelResponse
|
||||
) => void;
|
||||
|
||||
// Backwards-compat
|
||||
/** @deprecated Use VercelRequestCookies instead. */
|
||||
export type NowRequestCookies = VercelRequestCookies;
|
||||
|
||||
/** @deprecated Use VercelRequestQuery instead. */
|
||||
export type NowRequestQuery = VercelRequestQuery;
|
||||
|
||||
/** @deprecated Use `any` instead. */
|
||||
export type NowRequestBody = any;
|
||||
|
||||
/** @deprecated Use VercelRequest instead. */
|
||||
export type NowRequest = VercelRequest;
|
||||
|
||||
/** @deprecated Use VercelResponse instead. */
|
||||
export type NowResponse = VercelResponse;
|
||||
|
||||
/** @deprecated Use VercelApiHandler instead. */
|
||||
export type NowApiHandler = VercelApiHandler;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NowRequest, NowResponse } from './types';
|
||||
import { VercelRequest, VercelResponse } from './types';
|
||||
|
||||
export default function listener(req: NowRequest, res: NowResponse) {
|
||||
export default function listener(req: VercelRequest, res: VercelResponse) {
|
||||
res.status(200);
|
||||
res.send('hello legacy:RANDOMNESS_PLACEHOLDER');
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NowRequest, NowResponse } from '@now/node';
|
||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
||||
import { hello } from './dep';
|
||||
|
||||
export default function (req: NowRequest, res: NowResponse) {
|
||||
export default function (req: VercelRequest, res: VercelResponse) {
|
||||
if (req) {
|
||||
res.end(hello.toString());
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"devDependencies": {
|
||||
"@now/node": "*",
|
||||
"@vercel/node": "*",
|
||||
"typescript": "3.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "api/**/*.js", "use": "@now/node" }],
|
||||
"builds": [{ "src": "api/**/*.js", "use": "@vercel/node" }],
|
||||
"probes": [
|
||||
{
|
||||
"path": "/api/offset.js",
|
||||
2
packages/node/test/helpers.test.js
vendored
2
packages/node/test/helpers.test.js
vendored
@@ -42,7 +42,7 @@ afterEach(async () => {
|
||||
await server.close();
|
||||
});
|
||||
|
||||
describe('contract with @now/node-bridge', () => {
|
||||
describe('contract with @vercel/node-bridge', () => {
|
||||
test('should call consumeEvent with the correct reqId', async () => {
|
||||
await fetchWithProxyReq(`${url}/`);
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# @now/routing-utils
|
||||
# @vercel/routing-utils
|
||||
|
||||
Route validation utilities
|
||||
|
||||
## Usage
|
||||
|
||||
`yarn add @now/routing-utils`
|
||||
`yarn add @vercel/routing-utils`
|
||||
|
||||
```ts
|
||||
import { normalizeRoutes } from '@now/routing-utils';
|
||||
import { normalizeRoutes } from '@vercel/routing-utils';
|
||||
|
||||
const { routes, error } = normalizeRoutes(inputRoutes);
|
||||
|
||||
@@ -17,7 +17,7 @@ if (error) {
|
||||
```
|
||||
|
||||
```ts
|
||||
import { routesSchema } from '@now/routing-utils';
|
||||
import { routesSchema } from '@vercel/routing-utils';
|
||||
|
||||
const ajv = new Ajv();
|
||||
const validate = ajv.compile(routesSchema);
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
NormalizedRoutes,
|
||||
GetRoutesProps,
|
||||
RouteApiError,
|
||||
NowRedirect,
|
||||
Redirect,
|
||||
} from './types';
|
||||
import {
|
||||
convertCleanUrls,
|
||||
@@ -211,7 +211,7 @@ function checkPatternSyntax(
|
||||
return null;
|
||||
}
|
||||
|
||||
function checkRedirect(r: NowRedirect, index: number) {
|
||||
function checkRedirect(r: Redirect, index: number) {
|
||||
if (
|
||||
typeof r.permanent !== 'undefined' &&
|
||||
typeof r.statusCode !== 'undefined'
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { parse as parseUrl, format as formatUrl } from 'url';
|
||||
import { pathToRegexp, compile, Key } from 'path-to-regexp';
|
||||
import { Route, NowRedirect, NowRewrite, NowHeader } from './types';
|
||||
import { Route, Redirect, Rewrite, Header } from './types';
|
||||
|
||||
const UN_NAMED_SEGMENT = '__UN_NAMED_SEGMENT__';
|
||||
|
||||
@@ -45,7 +45,7 @@ export function convertCleanUrls(
|
||||
}
|
||||
|
||||
export function convertRedirects(
|
||||
redirects: NowRedirect[],
|
||||
redirects: Redirect[],
|
||||
defaultStatus = 308
|
||||
): Route[] {
|
||||
return redirects.map(r => {
|
||||
@@ -72,7 +72,7 @@ export function convertRedirects(
|
||||
});
|
||||
}
|
||||
|
||||
export function convertRewrites(rewrites: NowRewrite[]): Route[] {
|
||||
export function convertRewrites(rewrites: Rewrite[]): Route[] {
|
||||
return rewrites.map(r => {
|
||||
const { src, segments } = sourceToRegex(r.source);
|
||||
try {
|
||||
@@ -85,7 +85,7 @@ export function convertRewrites(rewrites: NowRewrite[]): Route[] {
|
||||
});
|
||||
}
|
||||
|
||||
export function convertHeaders(headers: NowHeader[]): Route[] {
|
||||
export function convertHeaders(headers: Header[]): Route[] {
|
||||
return headers.map(h => {
|
||||
const obj: { [key: string]: string } = {};
|
||||
const { src, segments } = sourceToRegex(h.source);
|
||||
@@ -120,7 +120,7 @@ export function convertTrailingSlash(enable: boolean, status = 308): Route[] {
|
||||
const routes: Route[] = [];
|
||||
if (enable) {
|
||||
routes.push({
|
||||
src: '^/\\.well-known(?:/.*)?$'
|
||||
src: '^/\\.well-known(?:/.*)?$',
|
||||
});
|
||||
routes.push({
|
||||
src: '^/((?:[^/]+/)*[^/\\.]+)$',
|
||||
|
||||
@@ -39,7 +39,7 @@ export type NormalizedRoutes = {
|
||||
};
|
||||
|
||||
export interface GetRoutesProps {
|
||||
nowConfig: NowConfig;
|
||||
nowConfig: VercelConfig;
|
||||
}
|
||||
|
||||
export interface MergeRoutesProps {
|
||||
@@ -53,35 +53,35 @@ export interface Build {
|
||||
routes?: Route[];
|
||||
}
|
||||
|
||||
export interface NowConfig {
|
||||
export interface VercelConfig {
|
||||
name?: string;
|
||||
version?: number;
|
||||
routes?: Route[];
|
||||
cleanUrls?: boolean;
|
||||
rewrites?: NowRewrite[];
|
||||
redirects?: NowRedirect[];
|
||||
headers?: NowHeader[];
|
||||
rewrites?: Rewrite[];
|
||||
redirects?: Redirect[];
|
||||
headers?: Header[];
|
||||
trailingSlash?: boolean;
|
||||
}
|
||||
|
||||
export interface NowRewrite {
|
||||
export interface Rewrite {
|
||||
source: string;
|
||||
destination: string;
|
||||
}
|
||||
|
||||
export interface NowRedirect {
|
||||
export interface Redirect {
|
||||
source: string;
|
||||
destination: string;
|
||||
permanent?: boolean;
|
||||
statusCode?: number;
|
||||
}
|
||||
|
||||
export interface NowHeader {
|
||||
export interface Header {
|
||||
source: string;
|
||||
headers: NowHeaderKeyValue[];
|
||||
headers: HeaderKeyValue[];
|
||||
}
|
||||
|
||||
export interface NowHeaderKeyValue {
|
||||
export interface HeaderKeyValue {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
@@ -100,3 +100,18 @@ export interface AppendRoutesToPhaseProps {
|
||||
*/
|
||||
phase: HandleValue;
|
||||
}
|
||||
|
||||
/** @deprecated Use VercelConfig instead. */
|
||||
export type NowConfig = VercelConfig;
|
||||
|
||||
/** @deprecated Use Rewrite instead. */
|
||||
export type NowRewrite = Rewrite;
|
||||
|
||||
/** @deprecated Use Redirect instead. */
|
||||
export type NowRedirect = Redirect;
|
||||
|
||||
/** @deprecated Use Header instead. */
|
||||
export type NowHeader = Header;
|
||||
|
||||
/** @deprecated Use HeaderKeyValue instead. */
|
||||
export type NowHeaderKeyValue = HeaderKeyValue;
|
||||
|
||||
36
packages/routing-utils/test/merge.spec.js
vendored
36
packages/routing-utils/test/merge.spec.js
vendored
@@ -8,7 +8,7 @@ test('mergeRoutes simple', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ src: '/node1', dest: '/n1' },
|
||||
@@ -16,7 +16,7 @@ test('mergeRoutes simple', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ src: '/python1', dest: '/py1' },
|
||||
@@ -44,7 +44,7 @@ test('mergeRoutes handle filesystem user routes', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ src: '/node1', dest: '/n1' },
|
||||
@@ -52,7 +52,7 @@ test('mergeRoutes handle filesystem user routes', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ src: '/python1', dest: '/py1' },
|
||||
@@ -80,7 +80,7 @@ test('mergeRoutes handle filesystem build routes', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ src: '/node1', dest: '/n1' },
|
||||
@@ -89,7 +89,7 @@ test('mergeRoutes handle filesystem build routes', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ src: '/python1', dest: '/py1' },
|
||||
@@ -119,7 +119,7 @@ test('mergeRoutes handle filesystem both user and builds', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ src: '/node1', dest: '/n1' },
|
||||
@@ -128,7 +128,7 @@ test('mergeRoutes handle filesystem both user and builds', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ src: '/python1', dest: '/py1' },
|
||||
@@ -158,7 +158,7 @@ test('mergeRoutes continue true', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ src: '/node1', dest: '/n1' },
|
||||
@@ -167,7 +167,7 @@ test('mergeRoutes continue true', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ src: '/python1', dest: '/py1' },
|
||||
@@ -199,7 +199,7 @@ test('mergeRoutes check true', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ src: '/node1', dest: '/n1' },
|
||||
@@ -208,7 +208,7 @@ test('mergeRoutes check true', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ src: '/python1', dest: '/py1' },
|
||||
@@ -241,7 +241,7 @@ test('mergeRoutes check true, continue true, handle filesystem middle', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ src: '/node1', dest: '/n1', continue: true },
|
||||
@@ -251,7 +251,7 @@ test('mergeRoutes check true, continue true, handle filesystem middle', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ src: '/python1', dest: '/py1', check: true },
|
||||
@@ -281,7 +281,7 @@ test('mergeRoutes check true, continue true, handle filesystem top', () => {
|
||||
const userRoutes = [{ handle: 'filesystem' }, { src: '/user1', dest: '/u1' }];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ handle: 'filesystem' },
|
||||
@@ -291,7 +291,7 @@ test('mergeRoutes check true, continue true, handle filesystem top', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ handle: 'filesystem' },
|
||||
@@ -326,7 +326,7 @@ test('mergeRoutes multiple handle values', () => {
|
||||
];
|
||||
const builds = [
|
||||
{
|
||||
use: '@now/node',
|
||||
use: '@vercel/node',
|
||||
entrypoint: 'api/home.js',
|
||||
routes: [
|
||||
{ handle: 'filesystem' },
|
||||
@@ -338,7 +338,7 @@ test('mergeRoutes multiple handle values', () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
use: '@now/python',
|
||||
use: '@vercel/python',
|
||||
entrypoint: 'api/users.py',
|
||||
routes: [
|
||||
{ handle: 'filesystem' },
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const airtable = require('airtable');
|
||||
|
||||
module.exports = (req, res) => {
|
||||
res.end('Hello world');
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "index.js", "use": "@now/node" }]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "airtable",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"airtable": "^0.5.7"
|
||||
}
|
||||
}
|
||||
@@ -1,416 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
airtable@^0.5.7:
|
||||
version "0.5.7"
|
||||
resolved "https://registry.yarnpkg.com/airtable/-/airtable-0.5.7.tgz#19df9893564166fc2719f8e43118dbc4d7b776f6"
|
||||
integrity sha512-xJiayyBTPgE0grEttU7ABdNzgvLAcmSz1l91aEea2bjqkxrVOViMPOyXilRZdVSUltPssgLMeeE+HOVVbh+Fwg==
|
||||
dependencies:
|
||||
async "1.5.2"
|
||||
lodash "4.17.10"
|
||||
request "2.88.0"
|
||||
xhr "2.3.3"
|
||||
|
||||
ajv@^6.5.5:
|
||||
version "6.5.5"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.5.tgz#cf97cdade71c6399a92c6d6c4177381291b781a1"
|
||||
integrity sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==
|
||||
dependencies:
|
||||
fast-deep-equal "^2.0.1"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
|
||||
integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
|
||||
dependencies:
|
||||
safer-buffer "~2.1.0"
|
||||
|
||||
assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
|
||||
|
||||
async@1.5.2:
|
||||
version "1.5.2"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
|
||||
integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
|
||||
integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
|
||||
|
||||
aws4@^1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
||||
integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
|
||||
|
||||
combined-stream@^1.0.6, combined-stream@~1.0.6:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
|
||||
integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
core-util-is@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
||||
|
||||
dashdash@^1.12.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
|
||||
integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
|
||||
dom-walk@^0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018"
|
||||
integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
|
||||
integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
|
||||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.1.0"
|
||||
|
||||
extend@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
|
||||
|
||||
extsprintf@1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
|
||||
integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
|
||||
|
||||
extsprintf@^1.2.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
|
||||
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
|
||||
|
||||
fast-deep-equal@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
|
||||
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
|
||||
integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I=
|
||||
|
||||
for-each@^0.3.2:
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
|
||||
integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==
|
||||
dependencies:
|
||||
is-callable "^1.1.3"
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
|
||||
|
||||
form-data@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
|
||||
integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
global@~4.3.0:
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f"
|
||||
integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=
|
||||
dependencies:
|
||||
min-document "^2.19.0"
|
||||
process "~0.5.1"
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
|
||||
|
||||
har-validator@~5.1.0:
|
||||
version "5.1.3"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
|
||||
integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==
|
||||
dependencies:
|
||||
ajv "^6.5.5"
|
||||
har-schema "^2.0.0"
|
||||
|
||||
http-signature@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||
integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
is-callable@^1.1.3:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
|
||||
integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==
|
||||
|
||||
is-function@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5"
|
||||
integrity sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
|
||||
|
||||
json-schema-traverse@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
|
||||
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
|
||||
|
||||
json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
|
||||
dependencies:
|
||||
assert-plus "1.0.0"
|
||||
extsprintf "1.3.0"
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
lodash@4.17.10:
|
||||
version "4.17.10"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
|
||||
integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==
|
||||
|
||||
mime-db@~1.37.0:
|
||||
version "1.37.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8"
|
||||
integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==
|
||||
|
||||
mime-types@^2.1.12, mime-types@~2.1.19:
|
||||
version "2.1.21"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96"
|
||||
integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==
|
||||
dependencies:
|
||||
mime-db "~1.37.0"
|
||||
|
||||
min-document@^2.19.0:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685"
|
||||
integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=
|
||||
dependencies:
|
||||
dom-walk "^0.1.0"
|
||||
|
||||
oauth-sign@~0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
|
||||
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
|
||||
|
||||
parse-headers@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.1.tgz#6ae83a7aa25a9d9b700acc28698cd1f1ed7e9536"
|
||||
integrity sha1-aug6eqJanZtwCswoaYzR8e1+lTY=
|
||||
dependencies:
|
||||
for-each "^0.3.2"
|
||||
trim "0.0.1"
|
||||
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
||||
|
||||
process@~0.5.1:
|
||||
version "0.5.2"
|
||||
resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
|
||||
integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=
|
||||
|
||||
psl@^1.1.24:
|
||||
version "1.1.29"
|
||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67"
|
||||
integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
|
||||
|
||||
punycode@^2.1.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
qs@~6.5.2:
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
|
||||
|
||||
request@2.88.0:
|
||||
version "2.88.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
|
||||
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
|
||||
dependencies:
|
||||
aws-sign2 "~0.7.0"
|
||||
aws4 "^1.8.0"
|
||||
caseless "~0.12.0"
|
||||
combined-stream "~1.0.6"
|
||||
extend "~3.0.2"
|
||||
forever-agent "~0.6.1"
|
||||
form-data "~2.3.2"
|
||||
har-validator "~5.1.0"
|
||||
http-signature "~1.2.0"
|
||||
is-typedarray "~1.0.0"
|
||||
isstream "~0.1.2"
|
||||
json-stringify-safe "~5.0.1"
|
||||
mime-types "~2.1.19"
|
||||
oauth-sign "~0.9.0"
|
||||
performance-now "^2.1.0"
|
||||
qs "~6.5.2"
|
||||
safe-buffer "^5.1.2"
|
||||
tough-cookie "~2.4.3"
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.15.2"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.2.tgz#c946d6bd9b1a39d0e8635763f5242d6ed6dcb629"
|
||||
integrity sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==
|
||||
dependencies:
|
||||
asn1 "~0.2.3"
|
||||
assert-plus "^1.0.0"
|
||||
bcrypt-pbkdf "^1.0.0"
|
||||
dashdash "^1.12.0"
|
||||
ecc-jsbn "~0.1.1"
|
||||
getpass "^0.1.1"
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.0.2"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
tough-cookie@~2.4.3:
|
||||
version "2.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
|
||||
integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
|
||||
dependencies:
|
||||
psl "^1.1.24"
|
||||
punycode "^1.4.1"
|
||||
|
||||
trim@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd"
|
||||
integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0=
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
|
||||
integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
uuid@^3.3.2:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
|
||||
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
|
||||
|
||||
verror@1.10.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
||||
integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
xhr@2.3.3:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.3.3.tgz#ad6b810e0917ce72b5ec704f5d41f1503b8e7524"
|
||||
integrity sha1-rWuBDgkXznK17HBPXUHxUDuOdSQ=
|
||||
dependencies:
|
||||
global "~4.3.0"
|
||||
is-function "^1.0.1"
|
||||
parse-headers "^2.0.0"
|
||||
xtend "^4.0.0"
|
||||
|
||||
xtend@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
||||
integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68=
|
||||
@@ -1,6 +0,0 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const aws = require('aws-sdk');
|
||||
|
||||
module.exports = (req, res) => {
|
||||
res.end('Hello world');
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "index.js", "use": "@now/node" }]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "aws-sdk",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.353.0"
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
aws-sdk@^2.353.0:
|
||||
version "2.353.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.353.0.tgz#3c809d2b02834d892a3f5c3f1171273b336e5692"
|
||||
integrity sha512-c5MwJhfcHwA2lC1Wq9csQvP9gz8dVGpZ64s5j9f/sWY6eZiDCQ6OWjxj+VJfpnCmfxyC/pdZO7JDGwems7dqIQ==
|
||||
dependencies:
|
||||
buffer "4.9.1"
|
||||
events "1.1.1"
|
||||
ieee754 "1.1.8"
|
||||
jmespath "0.15.0"
|
||||
querystring "0.2.0"
|
||||
sax "1.2.1"
|
||||
url "0.10.3"
|
||||
uuid "3.1.0"
|
||||
xml2js "0.4.19"
|
||||
|
||||
base64-js@^1.0.2:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
|
||||
integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==
|
||||
|
||||
buffer@4.9.1:
|
||||
version "4.9.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298"
|
||||
integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=
|
||||
dependencies:
|
||||
base64-js "^1.0.2"
|
||||
ieee754 "^1.1.4"
|
||||
isarray "^1.0.0"
|
||||
|
||||
events@1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
|
||||
integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=
|
||||
|
||||
ieee754@1.1.8:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
|
||||
integrity sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=
|
||||
|
||||
ieee754@^1.1.4:
|
||||
version "1.1.12"
|
||||
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b"
|
||||
integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==
|
||||
|
||||
isarray@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
|
||||
|
||||
jmespath@0.15.0:
|
||||
version "0.15.0"
|
||||
resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217"
|
||||
integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=
|
||||
|
||||
punycode@1.3.2:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
|
||||
integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=
|
||||
|
||||
querystring@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
|
||||
integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=
|
||||
|
||||
sax@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a"
|
||||
integrity sha1-e45lYZCyKOgaZq6nSEgNgozS03o=
|
||||
|
||||
sax@>=0.6.0:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
|
||||
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
|
||||
|
||||
url@0.10.3:
|
||||
version "0.10.3"
|
||||
resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64"
|
||||
integrity sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=
|
||||
dependencies:
|
||||
punycode "1.3.2"
|
||||
querystring "0.2.0"
|
||||
|
||||
uuid@3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
|
||||
integrity sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==
|
||||
|
||||
xml2js@0.4.19:
|
||||
version "0.4.19"
|
||||
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7"
|
||||
integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==
|
||||
dependencies:
|
||||
sax ">=0.6.0"
|
||||
xmlbuilder "~9.0.1"
|
||||
|
||||
xmlbuilder@~9.0.1:
|
||||
version "9.0.7"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
|
||||
integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=
|
||||
@@ -1,6 +0,0 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const axios = require('axios');
|
||||
|
||||
module.exports = (req, res) => {
|
||||
res.end('Hello world');
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "index.js", "use": "@now/node" }]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0"
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
axios@^0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102"
|
||||
integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=
|
||||
dependencies:
|
||||
follow-redirects "^1.3.0"
|
||||
is-buffer "^1.1.5"
|
||||
|
||||
debug@=3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
follow-redirects@^1.3.0:
|
||||
version "1.5.9"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.9.tgz#c9ed9d748b814a39535716e531b9196a845d89c6"
|
||||
integrity sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==
|
||||
dependencies:
|
||||
debug "=3.1.0"
|
||||
|
||||
is-buffer@^1.1.5:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
@@ -1,44 +0,0 @@
|
||||
const path = require('path');
|
||||
const runBuildLambda = require('../../lib/run-build-lambda');
|
||||
|
||||
const TWO_MINUTES = 120000;
|
||||
|
||||
function runBuildForFolder(folder) {
|
||||
return runBuildLambda(path.join(__dirname, folder));
|
||||
}
|
||||
|
||||
it(
|
||||
'Should build the airtable folder',
|
||||
async () => {
|
||||
const { buildResult } = await runBuildForFolder('airtable');
|
||||
expect(buildResult.output['index.js']).toBeDefined();
|
||||
},
|
||||
TWO_MINUTES
|
||||
);
|
||||
|
||||
it(
|
||||
'Should build the aws-sdk folder',
|
||||
async () => {
|
||||
const { buildResult } = await runBuildForFolder('aws-sdk');
|
||||
expect(buildResult.output['index.js']).toBeDefined();
|
||||
},
|
||||
TWO_MINUTES
|
||||
);
|
||||
|
||||
it(
|
||||
'Should build the axios folder',
|
||||
async () => {
|
||||
const { buildResult } = await runBuildForFolder('axios');
|
||||
expect(buildResult.output['index.js']).toBeDefined();
|
||||
},
|
||||
TWO_MINUTES
|
||||
);
|
||||
|
||||
it(
|
||||
'Should build the mongoose folder',
|
||||
async () => {
|
||||
const { buildResult } = await runBuildForFolder('mongoose');
|
||||
expect(buildResult.output['index.js']).toBeDefined();
|
||||
},
|
||||
TWO_MINUTES
|
||||
);
|
||||
@@ -1,6 +0,0 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
module.exports = (req, res) => {
|
||||
res.end('Hello world');
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "index.js", "use": "@now/node" }]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "mongoose",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mongoose": "^5.3.11"
|
||||
}
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
async@2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610"
|
||||
integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==
|
||||
dependencies:
|
||||
lodash "^4.17.10"
|
||||
|
||||
bluebird@3.5.1:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
|
||||
integrity sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
|
||||
|
||||
bson@^1.1.0, bson@~1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.0.tgz#bee57d1fb6a87713471af4e32bcae36de814b5b0"
|
||||
integrity sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA==
|
||||
|
||||
debug@3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
kareem@2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.0.tgz#ef33c42e9024dce511eeaf440cd684f3af1fc769"
|
||||
integrity sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg==
|
||||
|
||||
lodash.get@4.4.2:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
|
||||
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=
|
||||
|
||||
lodash@^4.17.10:
|
||||
version "4.17.14"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba"
|
||||
integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==
|
||||
|
||||
memory-pager@^1.0.2:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.1.0.tgz#9308915e0e972849fefbae6f8bc95d6b350e7344"
|
||||
integrity sha512-Mf9OHV/Y7h6YWDxTzX/b4ZZ4oh9NSXblQL8dtPCOomOtZciEHxePR78+uHFLLlsk01A6jVHhHsQZZ/WcIPpnzg==
|
||||
|
||||
mongodb-core@3.1.7:
|
||||
version "3.1.7"
|
||||
resolved "https://registry.yarnpkg.com/mongodb-core/-/mongodb-core-3.1.7.tgz#fe61853a6a6acbd2046c91794e5325ecad85428a"
|
||||
integrity sha512-YffpSrLmgFNmrvkGx+yX00KyBNk64C0BalfEn6vHHkXtcMUGXw8nxrMmhq5eXPLLlYeBpD/CsgNxE2Chf0o4zQ==
|
||||
dependencies:
|
||||
bson "^1.1.0"
|
||||
require_optional "^1.0.1"
|
||||
safe-buffer "^5.1.2"
|
||||
optionalDependencies:
|
||||
saslprep "^1.0.0"
|
||||
|
||||
mongodb@3.1.8:
|
||||
version "3.1.8"
|
||||
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.1.8.tgz#df8084fda2efdbaddd05dfd6a269891fc4cc72df"
|
||||
integrity sha512-yNKwYxQ6m00NV6+pMoWoheFTHSQVv1KkSrfOhRDYMILGWDYtUtQRqHrFqU75rmPIY8hMozVft8zdC4KYMWaM3Q==
|
||||
dependencies:
|
||||
mongodb-core "3.1.7"
|
||||
safe-buffer "^5.1.2"
|
||||
|
||||
mongoose-legacy-pluralize@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4"
|
||||
integrity sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==
|
||||
|
||||
mongoose@^5.3.11:
|
||||
version "5.3.11"
|
||||
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.3.11.tgz#ab71e070dabcb8b2aebff4702a09198a3f8a9401"
|
||||
integrity sha512-LrsatxtUfZAerAxyFiaw/8T8M4T9Ff9+6wFkJwfTVDz9skX+HVOs70QOzTDawz0k0Q0I6qt9xv/ZYQi2Paykgw==
|
||||
dependencies:
|
||||
async "2.6.1"
|
||||
bson "~1.1.0"
|
||||
kareem "2.3.0"
|
||||
lodash.get "4.4.2"
|
||||
mongodb "3.1.8"
|
||||
mongodb-core "3.1.7"
|
||||
mongoose-legacy-pluralize "1.0.2"
|
||||
mpath "0.5.1"
|
||||
mquery "3.2.0"
|
||||
ms "2.0.0"
|
||||
regexp-clone "0.0.1"
|
||||
safe-buffer "5.1.2"
|
||||
sliced "1.0.1"
|
||||
|
||||
mpath@0.5.1:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mpath/-/mpath-0.5.1.tgz#17131501f1ff9e6e4fbc8ffa875aa7065b5775ab"
|
||||
integrity sha512-H8OVQ+QEz82sch4wbODFOz+3YQ61FYz/z3eJ5pIdbMEaUzDqA268Wd+Vt4Paw9TJfvDgVKaayC0gBzMIw2jhsg==
|
||||
|
||||
mquery@3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/mquery/-/mquery-3.2.0.tgz#e276472abd5109686a15eb2a8e0761db813c81cc"
|
||||
integrity sha512-qPJcdK/yqcbQiKoemAt62Y0BAc0fTEKo1IThodBD+O5meQRJT/2HSe5QpBNwaa4CjskoGrYWsEyjkqgiE0qjhg==
|
||||
dependencies:
|
||||
bluebird "3.5.1"
|
||||
debug "3.1.0"
|
||||
regexp-clone "0.0.1"
|
||||
safe-buffer "5.1.2"
|
||||
sliced "1.0.1"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
regexp-clone@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-0.0.1.tgz#a7c2e09891fdbf38fbb10d376fb73003e68ac589"
|
||||
integrity sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=
|
||||
|
||||
require_optional@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e"
|
||||
integrity sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==
|
||||
dependencies:
|
||||
resolve-from "^2.0.0"
|
||||
semver "^5.1.0"
|
||||
|
||||
resolve-from@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57"
|
||||
integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=
|
||||
|
||||
safe-buffer@5.1.2, safe-buffer@^5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
saslprep@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.2.tgz#da5ab936e6ea0bbae911ffec77534be370c9f52d"
|
||||
integrity sha512-4cDsYuAjXssUSjxHKRe4DTZC0agDwsCqcMqtJAQPzC74nJ7LfAJflAtC1Zed5hMzEQKj82d3tuzqdGNRsLJ4Gw==
|
||||
dependencies:
|
||||
sparse-bitfield "^3.0.3"
|
||||
|
||||
semver@^5.1.0:
|
||||
version "5.6.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
|
||||
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
|
||||
|
||||
sliced@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41"
|
||||
integrity sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=
|
||||
|
||||
sparse-bitfield@^3.0.3:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11"
|
||||
integrity sha1-/0rm5oZWBWuks+eSqzM004JzyhE=
|
||||
dependencies:
|
||||
memory-pager "^1.0.2"
|
||||
Reference in New Issue
Block a user