mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 12:57:46 +00:00
Compare commits
26 Commits
@vercel/py
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d98d1cdea | ||
|
|
667af829c4 | ||
|
|
1bb7b37e0c | ||
|
|
ca81c133b9 | ||
|
|
f332b7856c | ||
|
|
9308a0fda5 | ||
|
|
c2f8a5990a | ||
|
|
fc2f0b919b | ||
|
|
a606ab8678 | ||
|
|
13062cd47d | ||
|
|
bb9faaed99 | ||
|
|
881e43a0e2 | ||
|
|
578a7742fe | ||
|
|
2d84a64430 | ||
|
|
200ac99647 | ||
|
|
1d3f2b5a62 | ||
|
|
8f49969585 | ||
|
|
cfbfaa7cd0 | ||
|
|
25747a7621 | ||
|
|
8d635beed7 | ||
|
|
6225f050fa | ||
|
|
30a899bab1 | ||
|
|
a010d8fe8a | ||
|
|
a9ff23fe22 | ||
|
|
b60d3f657a | ||
|
|
e7947a1b33 |
5
.github/workflows/cron-update-next.yml
vendored
5
.github/workflows/cron-update-next.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: Cron Update Next
|
||||
|
||||
on:
|
||||
# Allow manual runs
|
||||
workflow_dispatch:
|
||||
# Run every 4 hours https://crontab.guru/every-4-hours
|
||||
schedule:
|
||||
- cron: '0 */4 * * *'
|
||||
@@ -14,10 +16,13 @@ jobs:
|
||||
# 0 means fetch all commits so we can commit and push in the script below
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Enable corepack
|
||||
run: corepack enable pnpm
|
||||
- name: Create Pull Request
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
||||
with:
|
||||
script: |
|
||||
|
||||
7
.github/workflows/cron-update-turbo.yml
vendored
7
.github/workflows/cron-update-turbo.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: Cron Update Turbo
|
||||
|
||||
on:
|
||||
# Allow manual runs
|
||||
workflow_dispatch:
|
||||
# Run every week https://crontab.guru/every-week
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
@@ -14,12 +16,13 @@ jobs:
|
||||
# 0 means fetch all commits so we can commit and push in the script below
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: install pnpm@7.26.0
|
||||
run: npm i -g pnpm@7.26.0
|
||||
- name: Enable corepack
|
||||
run: corepack enable pnpm
|
||||
- name: Create Pull Request
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
||||
with:
|
||||
script: |
|
||||
|
||||
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
||||
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
- name: install pnpm@7.24.2
|
||||
run: npm i -g pnpm@7.24.2
|
||||
- name: Install
|
||||
|
||||
4
.github/workflows/test-integration-cli.yml
vendored
4
.github/workflows/test-integration-cli.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [14]
|
||||
node: [16]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
run: npm i -g pnpm@7.24.2
|
||||
- run: pnpm install
|
||||
- run: pnpm run build
|
||||
- run: pnpm test-integration-cli
|
||||
- run: pnpm test-cli
|
||||
env:
|
||||
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
|
||||
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
|
||||
|
||||
2
.github/workflows/test-unit.yml
vendored
2
.github/workflows/test-unit.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: [14]
|
||||
node: [16]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -9,7 +9,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
NODE_VERSION: '14'
|
||||
NODE_VERSION: '16'
|
||||
TURBO_REMOTE_ONLY: 'true'
|
||||
TURBO_TEAM: 'vercel'
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
|
||||
@@ -11,4 +11,4 @@ Remove the `functions` config from your `now.json` or `vercel.json` to take adva
|
||||
|
||||
### Useful Links
|
||||
|
||||
- [Functions Config Documentation](https://vercel.com/docs/configuration?query=functions#project/functions)
|
||||
- [Functions Config Documentation](https://vercel.com/docs/concepts/projects/project-configuration#functions)
|
||||
|
||||
@@ -11,6 +11,6 @@ Migrate from using legacy `routes` to the new `rewrites`, `redirects`, and `head
|
||||
|
||||
### Useful Links
|
||||
|
||||
- [Rewrites Documentation](https://vercel.com/docs/configuration?query=rewrites#project/rewrites)
|
||||
- [Redirects Documentation](https://vercel.com/docs/configuration?query=rewrites#project/redirects)
|
||||
- [Headers Documentation](https://vercel.com/docs/configuration?query=rewrites#project/headers)
|
||||
- [Rewrites Documentation](https://vercel.com/docs/concepts/projects/project-configuration#rewrites)
|
||||
- [Redirects Documentation](https://vercel.com/docs/concepts/projects/project-configuration#redirects)
|
||||
- [Headers Documentation](https://vercel.com/docs/concepts/projects/project-configuration#headers)
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
This could be caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
|
||||
This error is often caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
In the Vercel dashboard, open your "Project Settings" and draw attention to "Build & Development Settings":
|
||||
|
||||
1. Ensure that the "Build Command" setting is not changed, or that it calls `next build`. If this command is not changed but you are seeing this error, double check that your `build` script in `package.json` calls `next build`.
|
||||
2. Ensure that the "Output Directory" setting is not changed. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`.
|
||||
3. For `next export` users: **do not override the "Output Directory"**. Next.js automatically detects what folder you outputted `next export` to.
|
||||
1. Ensure that the "Build Command" setting is not overridden, or that it calls `next build`. If this command is not overridden but you are seeing this error, double check that your `build` script in `package.json` calls `next build`. If `buildCommand` exists in `vercel.json`, make sure it calls `next build`.
|
||||
2. Ensure that the "Output Directory" setting is not overridden. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`. If `outputDirectory` exists in `vercel.json`, remove that property.
|
||||
3. For `next export` users: **do not override the "Output Directory"**, even if you customized the `next export` output directory. It will automatically detects the correct output.
|
||||
|
||||
In rare scenarios, this error message can also be caused by a Next.js build failure (if your "Build Command" accidentally returns an exit code that is not 0).
|
||||
Double check for any error messages above the Routes Manifest error, which may provide additional details.
|
||||
|
||||
2
examples/package.json
vendored
2
examples/package.json
vendored
@@ -4,7 +4,7 @@
|
||||
"description": "Each subdirectory is an example boilerplate for a framework. This package.json only exists for testing purposes.",
|
||||
"scripts": {
|
||||
"test-unit": "pnpm test __tests__/unit/",
|
||||
"test-integration-once": "pnpm test __tests__/integration/",
|
||||
"test-e2e": "pnpm test __tests__/integration/",
|
||||
"test": "jest --env node --verbose --runInBand --bail"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "28.0.5",
|
||||
"turbo": "1.7.0"
|
||||
"turbo": "1.7.4"
|
||||
},
|
||||
"scripts": {
|
||||
"lerna": "lerna",
|
||||
@@ -47,9 +47,9 @@
|
||||
"pre-commit": "lint-staged",
|
||||
"test": "jest --rootDir=\"test\" --testPathPattern=\"\\.test.js\"",
|
||||
"test-unit": "pnpm test && node utils/gen.js && turbo run test-unit",
|
||||
"test-integration-cli": "node utils/gen.js && turbo run test-integration-cli",
|
||||
"test-integration-once": "node utils/gen.js && turbo run test-integration-once",
|
||||
"test-integration-dev": "node utils/gen.js && turbo run test-integration-dev",
|
||||
"test-cli": "node utils/gen.js && turbo run test-cli",
|
||||
"test-e2e": "node utils/gen.js && turbo run test-e2e",
|
||||
"test-dev": "node utils/gen.js && turbo run test-dev",
|
||||
"lint": "eslint . --cache --ext .ts,.js",
|
||||
"prepare": "husky install",
|
||||
"pack": "cd utils && node -r ts-eager/register ./pack.ts"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.2.2",
|
||||
"version": "6.3.0",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
@@ -14,7 +14,7 @@
|
||||
"build": "node build",
|
||||
"test": "jest --env node --verbose --runInBand --bail",
|
||||
"test-unit": "pnpm test test/unit.*test.*",
|
||||
"test-integration-once": "pnpm test test/integration.test.ts"
|
||||
"test-e2e": "pnpm test test/integration.test.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iarna/toml": "2.2.3",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Cron, Files } from './types';
|
||||
import type { Files, FunctionFramework } from './types';
|
||||
|
||||
/**
|
||||
* An Edge Functions output
|
||||
@@ -41,8 +41,8 @@ export class EdgeFunction {
|
||||
/** The regions where the edge function will be executed on */
|
||||
regions?: string | string[];
|
||||
|
||||
/** Cronjob definition for the edge function */
|
||||
cron?: Cron;
|
||||
/** The framework */
|
||||
framework?: FunctionFramework;
|
||||
|
||||
constructor(params: Omit<EdgeFunction, 'type'>) {
|
||||
this.type = 'EdgeFunction';
|
||||
@@ -53,6 +53,6 @@ export class EdgeFunction {
|
||||
this.envVarsInUse = params.envVarsInUse;
|
||||
this.assets = params.assets;
|
||||
this.regions = params.regions;
|
||||
this.cron = params.cron;
|
||||
this.framework = params.framework;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ export function getPrettyError(obj: {
|
||||
message?: string;
|
||||
params: any;
|
||||
}): NowBuildError {
|
||||
const docsUrl = 'https://vercel.com/docs/configuration';
|
||||
const docsUrl =
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration';
|
||||
try {
|
||||
const { dataPath, params, message: ajvMessage } = obj;
|
||||
const prop = getTopLevelPropertyName(dataPath);
|
||||
@@ -63,7 +64,7 @@ export function getPrettyError(obj: {
|
||||
return new NowBuildError({
|
||||
code: 'INVALID_VERCEL_CONFIG',
|
||||
message: message,
|
||||
link: prop ? `${docsUrl}#project/${prop.toLowerCase()}` : docsUrl,
|
||||
link: prop ? `${docsUrl}#${prop.toLowerCase()}` : docsUrl,
|
||||
action: 'View Documentation',
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import minimatch from 'minimatch';
|
||||
import { readlink } from 'fs-extra';
|
||||
import { isSymbolicLink, isDirectory } from './fs/download';
|
||||
import streamToBuffer from './fs/stream-to-buffer';
|
||||
import type { Files, Config, Cron } from './types';
|
||||
import type { Files, Config, FunctionFramework } from './types';
|
||||
|
||||
interface Environment {
|
||||
[key: string]: string;
|
||||
@@ -25,7 +25,7 @@ export interface LambdaOptionsBase {
|
||||
supportsWrapper?: boolean;
|
||||
experimentalResponseStreaming?: boolean;
|
||||
operationType?: string;
|
||||
cron?: Cron;
|
||||
framework?: FunctionFramework;
|
||||
}
|
||||
|
||||
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
|
||||
@@ -63,7 +63,6 @@ export class Lambda {
|
||||
environment: Environment;
|
||||
allowQuery?: string[];
|
||||
regions?: string[];
|
||||
cron?: Cron;
|
||||
/**
|
||||
* @deprecated Use `await lambda.createZip()` instead.
|
||||
*/
|
||||
@@ -71,6 +70,7 @@ export class Lambda {
|
||||
supportsMultiPayloads?: boolean;
|
||||
supportsWrapper?: boolean;
|
||||
experimentalResponseStreaming?: boolean;
|
||||
framework?: FunctionFramework;
|
||||
|
||||
constructor(opts: LambdaOptions) {
|
||||
const {
|
||||
@@ -81,11 +81,11 @@ export class Lambda {
|
||||
environment = {},
|
||||
allowQuery,
|
||||
regions,
|
||||
cron,
|
||||
supportsMultiPayloads,
|
||||
supportsWrapper,
|
||||
experimentalResponseStreaming,
|
||||
operationType,
|
||||
framework,
|
||||
} = opts;
|
||||
if ('files' in opts) {
|
||||
assert(typeof opts.files === 'object', '"files" must be an object');
|
||||
@@ -135,8 +135,18 @@ export class Lambda {
|
||||
);
|
||||
}
|
||||
|
||||
if (cron !== undefined) {
|
||||
assert(typeof cron === 'string', '"cron" is not a string');
|
||||
if (framework !== undefined) {
|
||||
assert(typeof framework === 'object', '"framework" is not an object');
|
||||
assert(
|
||||
typeof framework.slug === 'string',
|
||||
'"framework.slug" is not a string'
|
||||
);
|
||||
if (framework.version !== undefined) {
|
||||
assert(
|
||||
typeof framework.version === 'string',
|
||||
'"framework.version" is not a string'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.type = 'Lambda';
|
||||
@@ -149,11 +159,11 @@ export class Lambda {
|
||||
this.environment = environment;
|
||||
this.allowQuery = allowQuery;
|
||||
this.regions = regions;
|
||||
this.cron = cron;
|
||||
this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
|
||||
this.supportsMultiPayloads = supportsMultiPayloads;
|
||||
this.supportsWrapper = supportsWrapper;
|
||||
this.experimentalResponseStreaming = experimentalResponseStreaming;
|
||||
this.framework = framework;
|
||||
}
|
||||
|
||||
async createZip(): Promise<Buffer> {
|
||||
@@ -228,7 +238,7 @@ export async function getLambdaOptionsFromFunction({
|
||||
sourceFile,
|
||||
config,
|
||||
}: GetLambdaOptionsFromFunctionOptions): Promise<
|
||||
Pick<LambdaOptions, 'memory' | 'maxDuration' | 'cron'>
|
||||
Pick<LambdaOptions, 'memory' | 'maxDuration'>
|
||||
> {
|
||||
if (config?.functions) {
|
||||
for (const [pattern, fn] of Object.entries(config.functions)) {
|
||||
@@ -236,7 +246,6 @@ export async function getLambdaOptionsFromFunction({
|
||||
return {
|
||||
memory: fn.memory,
|
||||
maxDuration: fn.maxDuration,
|
||||
cron: fn.cron,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,8 @@ export const functionsSchema = {
|
||||
maxLength: 256,
|
||||
},
|
||||
memory: {
|
||||
// Number between 128 and 3008 in steps of 64
|
||||
enum: Object.keys(Array.from({ length: 50 }))
|
||||
.slice(2, 48)
|
||||
.map(x => Number(x) * 64),
|
||||
minimum: 128,
|
||||
maximum: 3008,
|
||||
},
|
||||
maxDuration: {
|
||||
type: 'number',
|
||||
@@ -31,11 +29,6 @@ export const functionsSchema = {
|
||||
type: 'string',
|
||||
maxLength: 256,
|
||||
},
|
||||
cron: {
|
||||
type: 'string',
|
||||
minLength: 9,
|
||||
maxLength: 256,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -319,7 +319,6 @@ export interface BuilderFunctions {
|
||||
runtime?: string;
|
||||
includeFiles?: string;
|
||||
excludeFiles?: string;
|
||||
cron?: Cron;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -411,7 +410,16 @@ export interface BuildResultBuildOutput {
|
||||
buildOutputPath: string;
|
||||
}
|
||||
|
||||
export type Cron = string;
|
||||
export interface Cron {
|
||||
path: string;
|
||||
schedule: string;
|
||||
}
|
||||
|
||||
/** The framework which created the function */
|
||||
export interface FunctionFramework {
|
||||
slug: string;
|
||||
version?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* When a Builder implements `version: 2`, the `build()` function is expected
|
||||
|
||||
4
packages/build-utils/test/unit.test.ts
vendored
4
packages/build-utils/test/unit.test.ts
vendored
@@ -502,6 +502,10 @@ it('should retry npm install when peer deps invalid and npm@8 on node@16', async
|
||||
console.log(`Skipping test on node@${nodeMajor}`);
|
||||
return;
|
||||
}
|
||||
if (process.platform === 'win32') {
|
||||
console.log('Skipping test on windows');
|
||||
return;
|
||||
}
|
||||
const fixture = path.join(__dirname, 'fixtures', '15-npm-8-legacy-peer-deps');
|
||||
const nodeVersion = { major: nodeMajor } as any;
|
||||
await runNpmInstall(fixture, [], {}, {}, nodeVersion);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "28.15.4",
|
||||
"version": "28.16.0",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -14,8 +14,8 @@
|
||||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"test": "jest --env node --verbose --bail",
|
||||
"test-unit": "pnpm test test/unit/",
|
||||
"test-integration-cli": "rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose",
|
||||
"test-integration-dev": "pnpm test test/dev/",
|
||||
"test-cli": "rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose",
|
||||
"test-dev": "pnpm test test/dev/",
|
||||
"coverage": "codecov",
|
||||
"build": "ts-node ./scripts/build.ts",
|
||||
"dev": "ts-node ./src/index.ts"
|
||||
@@ -41,16 +41,16 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/go": "2.3.4",
|
||||
"@vercel/hydrogen": "0.0.50",
|
||||
"@vercel/next": "3.4.3",
|
||||
"@vercel/node": "2.9.3",
|
||||
"@vercel/python": "3.1.46",
|
||||
"@vercel/redwood": "1.1.2",
|
||||
"@vercel/remix": "1.2.13",
|
||||
"@vercel/ruby": "1.3.62",
|
||||
"@vercel/static-build": "1.3.6"
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/go": "2.3.7",
|
||||
"@vercel/hydrogen": "0.0.53",
|
||||
"@vercel/next": "3.4.7",
|
||||
"@vercel/node": "2.9.6",
|
||||
"@vercel/python": "3.1.49",
|
||||
"@vercel/redwood": "1.1.5",
|
||||
"@vercel/remix": "1.3.3",
|
||||
"@vercel/ruby": "1.3.65",
|
||||
"@vercel/static-build": "1.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
@@ -93,13 +93,13 @@
|
||||
"@types/which": "1.3.2",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel/client": "12.3.8",
|
||||
"@vercel/client": "12.4.0",
|
||||
"@vercel/error-utils": "1.0.8",
|
||||
"@vercel/frameworks": "1.3.0",
|
||||
"@vercel/fs-detectors": "3.7.11",
|
||||
"@vercel/frameworks": "1.3.1",
|
||||
"@vercel/fs-detectors": "3.7.14",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"@zeit/source-map-support": "0.6.2",
|
||||
"ajv": "6.12.2",
|
||||
"alpha-sort": "2.0.1",
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
BuildResultV2Typical,
|
||||
BuildResultV3,
|
||||
NowBuildError,
|
||||
Cron,
|
||||
} from '@vercel/build-utils';
|
||||
import {
|
||||
detectBuilders,
|
||||
@@ -88,6 +89,7 @@ interface BuildOutputConfig {
|
||||
framework?: {
|
||||
version: string;
|
||||
};
|
||||
crons?: Cron[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -623,6 +625,7 @@ async function doBuild(
|
||||
});
|
||||
|
||||
const mergedImages = mergeImages(localConfig.images, buildResults.values());
|
||||
const mergedCrons = mergeCrons(localConfig.crons, buildResults.values());
|
||||
const mergedWildcard = mergeWildcard(buildResults.values());
|
||||
const mergedOverrides: Record<string, PathOverride> =
|
||||
overrides.length > 0 ? Object.assign({}, ...overrides) : undefined;
|
||||
@@ -638,6 +641,7 @@ async function doBuild(
|
||||
wildcard: mergedWildcard,
|
||||
overrides: mergedOverrides,
|
||||
framework,
|
||||
crons: mergedCrons,
|
||||
};
|
||||
await fs.writeJSON(join(outputDir, 'config.json'), config, { spaces: 2 });
|
||||
|
||||
@@ -701,7 +705,7 @@ function expandBuild(files: string[], build: Builder): Builder[] {
|
||||
throw new NowBuildError({
|
||||
code: `invalid_build_specification`,
|
||||
message: 'Field `use` is missing in build specification',
|
||||
link: 'https://vercel.com/docs/configuration#project/builds',
|
||||
link: 'https://vercel.com/docs/concepts/projects/project-configuration#builds',
|
||||
action: 'View Documentation',
|
||||
});
|
||||
}
|
||||
@@ -711,7 +715,7 @@ function expandBuild(files: string[], build: Builder): Builder[] {
|
||||
throw new NowBuildError({
|
||||
code: `invalid_build_specification`,
|
||||
message: 'A build `src` path resolves to an empty string',
|
||||
link: 'https://vercel.com/docs/configuration#project/builds',
|
||||
link: 'https://vercel.com/docs/concepts/projects/project-configuration#builds',
|
||||
action: 'View Documentation',
|
||||
});
|
||||
}
|
||||
@@ -746,6 +750,18 @@ function mergeImages(
|
||||
return images;
|
||||
}
|
||||
|
||||
function mergeCrons(
|
||||
crons: BuildOutputConfig['crons'],
|
||||
buildResults: Iterable<BuildResult | BuildOutputConfig>
|
||||
): BuildOutputConfig['crons'] {
|
||||
for (const result of buildResults) {
|
||||
if ('crons' in result && result.crons) {
|
||||
crons = Object.assign({}, crons, result.crons);
|
||||
}
|
||||
}
|
||||
return crons;
|
||||
}
|
||||
|
||||
function mergeWildcard(
|
||||
buildResults: Iterable<BuildResult | BuildOutputConfig>
|
||||
): BuildResultV2Typical['wildcard'] {
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
Builder,
|
||||
BuildResultV2,
|
||||
BuildResultV3,
|
||||
Cron,
|
||||
File,
|
||||
FileFsRef,
|
||||
BuilderV2,
|
||||
@@ -41,7 +40,6 @@ export const OUTPUT_DIR = join(VERCEL_DIR, 'output');
|
||||
* An entry in the "functions" object in `vercel.json`.
|
||||
*/
|
||||
interface FunctionConfiguration {
|
||||
cron?: Cron;
|
||||
memory?: number;
|
||||
maxDuration?: number;
|
||||
}
|
||||
@@ -372,14 +370,12 @@ async function writeLambda(
|
||||
throw new Error('Malformed `Lambda` - no "files" present');
|
||||
}
|
||||
|
||||
const cron = functionConfiguration?.cron ?? lambda.cron;
|
||||
const memory = functionConfiguration?.memory ?? lambda.memory;
|
||||
const maxDuration = functionConfiguration?.maxDuration ?? lambda.maxDuration;
|
||||
|
||||
const config = {
|
||||
...lambda,
|
||||
handler: normalizePath(lambda.handler),
|
||||
cron,
|
||||
memory,
|
||||
maxDuration,
|
||||
type: undefined,
|
||||
|
||||
@@ -93,6 +93,29 @@ const imagesSchema = {
|
||||
},
|
||||
};
|
||||
|
||||
const cronsSchema = {
|
||||
type: 'array',
|
||||
minItems: 0,
|
||||
items: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['path', 'schedule'],
|
||||
properties: {
|
||||
path: {
|
||||
type: 'string',
|
||||
minLength: 1,
|
||||
maxLength: 512,
|
||||
pattern: '^/.*',
|
||||
},
|
||||
schedule: {
|
||||
type: 'string',
|
||||
minLength: 9,
|
||||
maxLength: 256,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const vercelConfigSchema = {
|
||||
type: 'object',
|
||||
// These are not all possibilities because `vc dev`
|
||||
@@ -108,6 +131,7 @@ const vercelConfigSchema = {
|
||||
trailingSlash: trailingSlashSchema,
|
||||
functions: functionsSchema,
|
||||
images: imagesSchema,
|
||||
crons: cronsSchema,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.build
|
||||
|
||||
# gatsby files
|
||||
.cache/
|
||||
public
|
||||
|
||||
# Mac files
|
||||
.DS_Store
|
||||
|
||||
# Yarn
|
||||
yarn-error.log
|
||||
.pnp/
|
||||
.pnp.js
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
.now
|
||||
.vercel
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Implement Gatsby's Browser APIs in this file.
|
||||
*
|
||||
* See: https://www.gatsbyjs.org/docs/browser-apis/
|
||||
*/
|
||||
|
||||
// You can delete this file if you're not using it
|
||||
@@ -1,16 +0,0 @@
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
title: 'Gatsby Default Starter',
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
resolve: `gatsby-plugin-manifest`,
|
||||
options: {
|
||||
name: `05-gatsby`,
|
||||
short_name: `starter`,
|
||||
start_url: `/`,
|
||||
icon: 'src/images/gatsby-icon.png',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Implement Gatsby's Node APIs in this file.
|
||||
*
|
||||
* See: https://www.gatsbyjs.org/docs/node-apis/
|
||||
*/
|
||||
|
||||
// You can delete this file if you're not using it
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
|
||||
*
|
||||
* See: https://www.gatsbyjs.org/docs/ssr-apis/
|
||||
*/
|
||||
|
||||
// You can delete this file if you're not using it
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "gatsby",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"gatsby": "^2.18.14",
|
||||
"gatsby-image": "^2.0.15",
|
||||
"gatsby-plugin-manifest": "^2.0.5",
|
||||
"react": "^16.5.1",
|
||||
"react-dom": "^16.5.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "gatsby develop",
|
||||
"build": "gatsby build"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
@@ -1,11 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
function Custom404() {
|
||||
return (
|
||||
<main>
|
||||
<h1>Custom Gatsby 404</h1>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default Custom404;
|
||||
@@ -1,12 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
function Index() {
|
||||
return (
|
||||
<main>
|
||||
<h1>Gatsby Default Starter</h1>
|
||||
<p>Hello World</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default Index;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +0,0 @@
|
||||
*.log
|
||||
.cache
|
||||
.DS_Store
|
||||
src/.temp
|
||||
node_modules
|
||||
dist
|
||||
.env
|
||||
.env.*
|
||||
!yarn.lock
|
||||
|
||||
.now
|
||||
.vercel
|
||||
@@ -1,2 +0,0 @@
|
||||
README.md
|
||||
yarn.lock
|
||||
@@ -1,19 +0,0 @@
|
||||
# Gridsome Example
|
||||
|
||||
This directory is a brief example of a [Gridsome](https://gridsome.org/) app that can be deployed to Vercel with zero configuration.
|
||||
|
||||
## How we created this example
|
||||
|
||||
To get started with Gridsome on Vercel, you can use the [Gridsome CLI](https://gridsome.org/docs/gridsome-cli/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ gridsome create my-website
|
||||
```
|
||||
|
||||
## Deploying this Example
|
||||
|
||||
Once initialized, you can deploy the Gridsome example with just a single command:
|
||||
|
||||
```shell
|
||||
$ vercel
|
||||
```
|
||||
@@ -1,10 +0,0 @@
|
||||
// This is where project configuration and plugin options are located.
|
||||
// Learn more: https://gridsome.org/docs/config
|
||||
|
||||
// Changes here require a server restart.
|
||||
// To restart press CTRL + C in terminal and run `gridsome develop`
|
||||
|
||||
module.exports = {
|
||||
siteName: 'Gridsome',
|
||||
plugins: []
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// Server API makes it possible to hook into various parts of Gridsome
|
||||
// on server-side and add custom data to the GraphQL data layer.
|
||||
// Learn more: https://gridsome.org/docs/server-api
|
||||
|
||||
// Changes here require a server restart.
|
||||
// To restart press CTRL + C in terminal and run `gridsome develop`
|
||||
|
||||
module.exports = function (api) {
|
||||
api.loadSource(({ addContentType }) => {
|
||||
// Use the Data Store API here: https://gridsome.org/docs/data-store-api
|
||||
})
|
||||
|
||||
api.createPages(({ createPage }) => {
|
||||
// Use the Pages API here: https://gridsome.org/docs/pages-api
|
||||
})
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"name": "gridsomee",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "gridsome build",
|
||||
"dev": "gridsome develop -p $PORT",
|
||||
"explore": "gridsome explore"
|
||||
},
|
||||
"dependencies": {
|
||||
"gridsome": "0.7.23"
|
||||
},
|
||||
"engines": {
|
||||
"node": "14.x"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
Add components that will be imported to Pages and Layouts to this folder.
|
||||
Learn more about components here: https://gridsome.org/docs/components
|
||||
|
||||
You can delete this file.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
@@ -1,50 +0,0 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<header class="header">
|
||||
<strong>
|
||||
<g-link to="/">{{ $static.metaData.siteName }}</g-link>
|
||||
</strong>
|
||||
<nav class="nav">
|
||||
<g-link class="nav__link" to="/">Home</g-link>
|
||||
<g-link class="nav__link" to="/about">About</g-link>
|
||||
</nav>
|
||||
</header>
|
||||
<slot/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<static-query>
|
||||
query {
|
||||
metaData {
|
||||
siteName
|
||||
}
|
||||
}
|
||||
</static-query>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
||||
margin:0;
|
||||
padding:0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.layout {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.nav__link {
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +0,0 @@
|
||||
Layout components are used to wrap pages and templates. Layouts should contain components like headers, footers or sidebars that will be used across the site.
|
||||
|
||||
Learn more about Layouts: https://gridsome.org/docs/layouts
|
||||
|
||||
You can delete this file.
|
||||
@@ -1,9 +0,0 @@
|
||||
// This is the main.js file. Import global CSS and scripts here.
|
||||
// The Client API can be used here. Learn more: gridsome.org/docs/client-api
|
||||
|
||||
import DefaultLayout from '~/layouts/Default.vue'
|
||||
|
||||
export default function (Vue, { router, head, isClient }) {
|
||||
// Set default layout as a global component
|
||||
Vue.component('Layout', DefaultLayout)
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<template>
|
||||
<Layout>
|
||||
<h1>Not Found</h1>
|
||||
<p>This is a Custom Gridsome 404.</p>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
metaInfo: {
|
||||
title: 'Not Found'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,14 +0,0 @@
|
||||
<template>
|
||||
<Layout>
|
||||
<h1>About us</h1>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error doloremque omnis animi, eligendi magni a voluptatum, vitae, consequuntur rerum illum odit fugit assumenda rem dolores inventore iste reprehenderit maxime! Iusto.</p>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
metaInfo: {
|
||||
title: 'About us'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,33 +0,0 @@
|
||||
<template>
|
||||
<Layout>
|
||||
|
||||
<!-- Learn how to use images here: https://gridsome.org/docs/images -->
|
||||
<g-image alt="Example image" src="~/favicon.png" width="135" />
|
||||
|
||||
<h1>Gridsome on Vercel</h1>
|
||||
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur excepturi labore tempore expedita, et iste tenetur suscipit explicabo! Dolores, aperiam non officia eos quod asperiores
|
||||
</p>
|
||||
|
||||
<p class="home-links">
|
||||
<a href="https://gridsome.org/docs" target="_blank" rel="noopener">Gridsome Docs</a>
|
||||
<a href="https://github.com/gridsome/gridsome" target="_blank" rel="noopener">GitHub</a>
|
||||
</p>
|
||||
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
metaInfo: {
|
||||
title: 'Hello, world!'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.home-links a {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +0,0 @@
|
||||
Pages are usually used for normal pages or for listing items from a GraphQL collection.
|
||||
Add .vue files here to create pages. For example **About.vue** will be **site.com/about**.
|
||||
Learn more about pages: https://gridsome.org/docs/pages
|
||||
|
||||
You can delete this file.
|
||||
@@ -1,7 +0,0 @@
|
||||
Templates for **GraphQL collections** should be added here.
|
||||
To create a template for a collection called `WordPressPost`
|
||||
create a file named `WordPressPost.vue` in this folder.
|
||||
|
||||
Learn more: https://gridsome.org/docs/templates
|
||||
|
||||
You can delete this file.
|
||||
@@ -1,3 +0,0 @@
|
||||
Add static files here. Files in this directory will be copied directly to `dist` folder during build. For example, /static/robots.txt will be located at https://yoursite.com/robots.txt.
|
||||
|
||||
This file should be deleted.
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"redirects": [{ "source": "/support", "destination": "/about?ref=support" }]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -105,7 +105,7 @@ test('[vercel dev] throws an error when an edge function has no response', async
|
||||
expect(await res.status).toBe(500);
|
||||
expect(await res.text()).toMatch('FUNCTION_INVOCATION_FAILED');
|
||||
expect(stdout).toMatch(
|
||||
/Error from API Route api\/edge-no-response: Edge Function "api\/edge-no-response.js" did not return a response./g
|
||||
/Error from API Route \/api\/edge-no-response: Edge Function "api\/edge-no-response.js" did not return a response./g
|
||||
);
|
||||
} finally {
|
||||
await dev.kill();
|
||||
@@ -161,7 +161,7 @@ test('[vercel dev] should handle runtime errors thrown in edge functions', async
|
||||
/<strong>500<\/strong>: INTERNAL_SERVER_ERROR/g
|
||||
);
|
||||
expect(stdout).toMatch(
|
||||
/Error from API Route api\/edge-error-runtime: intentional runtime error/g
|
||||
/Error from API Route \/api\/edge-error-runtime: intentional runtime error/g
|
||||
);
|
||||
} finally {
|
||||
await dev.kill();
|
||||
|
||||
@@ -70,27 +70,6 @@ test(
|
||||
await testPath(200, '/', /React App/m);
|
||||
})
|
||||
);
|
||||
/*
|
||||
test(
|
||||
'[vercel dev] 05-gatsby',
|
||||
testFixtureStdio('05-gatsby', async (testPath: any) => {
|
||||
await testPath(200, '/', /Gatsby Default Starter/m);
|
||||
})
|
||||
);
|
||||
*/
|
||||
test(
|
||||
'[vercel dev] 06-gridsome',
|
||||
testFixtureStdio('06-gridsome', async (testPath: any) => {
|
||||
await testPath(200, '/');
|
||||
await testPath(200, '/about');
|
||||
await testPath(308, '/support', 'Redirecting to /about?ref=support (308)', {
|
||||
Location: '/about?ref=support',
|
||||
});
|
||||
// Bug with gridsome's dev server: https://github.com/gridsome/gridsome/issues/831
|
||||
// Works in prod only so leave out for now
|
||||
// await testPath(404, '/nothing');
|
||||
})
|
||||
);
|
||||
|
||||
test(
|
||||
'[vercel dev] 07-hexo-node',
|
||||
|
||||
@@ -10,7 +10,7 @@ const { version: cliVersion } = require('../../package.json');
|
||||
const {
|
||||
fetchCachedToken,
|
||||
} = require('../../../../test/lib/deployment/now-deploy');
|
||||
const { spawnSync } = require('child_process');
|
||||
const { spawnSync, execFileSync } = require('child_process');
|
||||
|
||||
jest.setTimeout(6 * 60 * 1000);
|
||||
|
||||
@@ -522,7 +522,7 @@ async function ps(parentPid, pids = {}) {
|
||||
: ['ps', '-o', 'pid', '--no-headers', '--ppid', parentPid];
|
||||
|
||||
try {
|
||||
const { stdout: buf } = spawnSync(cmd[0], cmd.slice(1), {
|
||||
const buf = execFileSync(cmd[0], cmd.slice(1), {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
for (let pid of buf.match(/\d+/g)) {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default function (req, res) {
|
||||
res.json('hello from the edge');
|
||||
res.send('Hello from cron job!');
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
export const config = {
|
||||
runtime: 'edge',
|
||||
cron: '* * * * *',
|
||||
};
|
||||
|
||||
export default async function edge(request, event) {
|
||||
const requestBody = await request.text();
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
headerContentType: request.headers.get('content-type'),
|
||||
url: request.url,
|
||||
method: request.method,
|
||||
body: requestBody,
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function (req, res) {
|
||||
res.end('serverless says hello');
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
export default function (req, res) {
|
||||
res.json({ memory: parseInt(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE) });
|
||||
}
|
||||
|
||||
export const config = {
|
||||
cron: '* * * * *',
|
||||
};
|
||||
@@ -1,10 +1,8 @@
|
||||
{
|
||||
"functions": {
|
||||
"api/overwrite/serverless.js": {
|
||||
"cron": "0 10-20 * * *"
|
||||
},
|
||||
"api/overwrite/edge.js": {
|
||||
"cron": "10 * * * *"
|
||||
"crons": [
|
||||
{
|
||||
"path": "/api/cron-job",
|
||||
"schedule": "0 0 * * *"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
|
||||
},
|
||||
}),
|
||||
},
|
||||
'lambda-with-200-memory': {
|
||||
'lambda-with-123-memory': {
|
||||
'api/memory.js': `
|
||||
module.exports = (req, res) => {
|
||||
res.json({ memory: parseInt(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE) });
|
||||
@@ -280,7 +280,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
|
||||
'now.json': JSON.stringify({
|
||||
functions: {
|
||||
'api/**/*.js': {
|
||||
memory: 200,
|
||||
memory: 123,
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
26
packages/cli/test/integration.js
vendored
26
packages/cli/test/integration.js
vendored
@@ -1967,7 +1967,11 @@ test('try to create a builds deployments with wrong now.json', async t => {
|
||||
'Error: Invalid now.json - should NOT have additional property `builder`. Did you mean `builds`?'
|
||||
)
|
||||
);
|
||||
t.true(stderr.includes('https://vercel.com/docs/configuration'));
|
||||
t.true(
|
||||
stderr.includes(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration'
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
test('try to create a builds deployments with wrong vercel.json', async t => {
|
||||
@@ -1991,7 +1995,11 @@ test('try to create a builds deployments with wrong vercel.json', async t => {
|
||||
'Error: Invalid vercel.json - should NOT have additional property `fake`. Please remove it.'
|
||||
)
|
||||
);
|
||||
t.true(stderr.includes('https://vercel.com/docs/configuration'));
|
||||
t.true(
|
||||
stderr.includes(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration'
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
test('try to create a builds deployments with wrong `build.env` property', async t => {
|
||||
@@ -2014,7 +2022,9 @@ test('try to create a builds deployments with wrong `build.env` property', async
|
||||
formatOutput({ stdout, stderr })
|
||||
);
|
||||
t.true(
|
||||
stderr.includes('https://vercel.com/docs/configuration'),
|
||||
stderr.includes(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration'
|
||||
),
|
||||
formatOutput({ stdout, stderr })
|
||||
);
|
||||
});
|
||||
@@ -2625,7 +2635,7 @@ test('next unsupported functions config shows warning link', async t => {
|
||||
t.is(output.exitCode, 0, formatOutput(output));
|
||||
t.regex(
|
||||
output.stderr,
|
||||
/Ignoring function property `runtime`\. When using Next\.js, only `memory`, `maxDuration`, and `cron` can be used\./gm,
|
||||
/Ignoring function property `runtime`\. When using Next\.js, only `memory` and `maxDuration` can be used\./gm,
|
||||
formatOutput(output)
|
||||
);
|
||||
t.regex(
|
||||
@@ -2719,11 +2729,15 @@ test('deploy a Lambda with 128MB of memory', async t => {
|
||||
});
|
||||
|
||||
test('fail to deploy a Lambda with an incorrect value for of memory', async t => {
|
||||
const directory = fixture('lambda-with-200-memory');
|
||||
const directory = fixture('lambda-with-123-memory');
|
||||
const output = await execute([directory, '--yes']);
|
||||
|
||||
t.is(output.exitCode, 1, formatOutput(output));
|
||||
t.regex(output.stderr, /steps of 64/gm, formatOutput(output));
|
||||
t.regex(
|
||||
output.stderr,
|
||||
/Serverless Functions.+memory/gm,
|
||||
formatOutput(output)
|
||||
);
|
||||
t.regex(output.stderr, /Learn More/gm, formatOutput(output));
|
||||
});
|
||||
|
||||
|
||||
@@ -1080,7 +1080,7 @@ describe('build', () => {
|
||||
await expect(client.stderr).toOutput(
|
||||
'Error: Invalid vercel.json - `rewrites[2]` should NOT have additional property `src`. Did you mean `source`?' +
|
||||
'\n' +
|
||||
'View Documentation: https://vercel.com/docs/configuration#project/rewrites'
|
||||
'View Documentation: https://vercel.com/docs/concepts/projects/project-configuration#rewrites'
|
||||
);
|
||||
const builds = await fs.readJSON(join(output, 'builds.json'));
|
||||
expect(builds.builds).toBeUndefined();
|
||||
@@ -1091,7 +1091,7 @@ describe('build', () => {
|
||||
stack: expect.stringContaining('at validateConfig'),
|
||||
hideStackTrace: true,
|
||||
code: 'INVALID_VERCEL_CONFIG',
|
||||
link: 'https://vercel.com/docs/configuration#project/rewrites',
|
||||
link: 'https://vercel.com/docs/concepts/projects/project-configuration#rewrites',
|
||||
action: 'View Documentation',
|
||||
});
|
||||
const configJson = await fs.readJSON(join(output, 'config.json'));
|
||||
@@ -1104,32 +1104,20 @@ describe('build', () => {
|
||||
|
||||
it('should include crons property in build output', async () => {
|
||||
const cwd = fixture('with-cron');
|
||||
const output = join(cwd, '.vercel', 'output', 'functions', 'api');
|
||||
const output = join(cwd, '.vercel', 'output');
|
||||
|
||||
try {
|
||||
process.chdir(cwd);
|
||||
const exitCode = await build(client);
|
||||
expect(exitCode).toBe(0);
|
||||
|
||||
const edge = await fs.readJSON(
|
||||
join(output, 'edge.func', '.vc-config.json')
|
||||
);
|
||||
expect(edge).toHaveProperty('cron', '* * * * *');
|
||||
|
||||
const serverless = await fs.readJSON(
|
||||
join(output, 'serverless.func', '.vc-config.json')
|
||||
);
|
||||
expect(serverless).toHaveProperty('cron', '* * * * *');
|
||||
|
||||
const overwriteServerless = await fs.readJSON(
|
||||
join(output, 'overwrite', 'serverless.func', '.vc-config.json')
|
||||
);
|
||||
expect(overwriteServerless).toHaveProperty('cron', '0 10-20 * * *');
|
||||
|
||||
const overwriteEdge = await fs.readJSON(
|
||||
join(output, 'overwrite', 'edge.func', '.vc-config.json')
|
||||
);
|
||||
expect(overwriteEdge).toHaveProperty('cron', '10 * * * *');
|
||||
const config = await fs.readJSON(join(output, 'config.json'));
|
||||
expect(config).toHaveProperty('crons', [
|
||||
{
|
||||
path: '/api/cron-job',
|
||||
schedule: '0 0 * * *',
|
||||
},
|
||||
]);
|
||||
} finally {
|
||||
process.chdir(originalCwd);
|
||||
delete process.env.__VERCEL_BUILD_RUNNING;
|
||||
|
||||
@@ -41,7 +41,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `rewrites[0]` should NOT have additional property `src`. Did you mean `source`?'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/rewrites'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#rewrites'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `routes[0]` should NOT have additional property `source`. Did you mean `src`?'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/routes'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#routes'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `routes` should be array.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/routes'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#routes'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -84,7 +84,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `redirects[0]` missing required property `source`.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/redirects'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#redirects'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -97,7 +97,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `redirects[0].permanent` should be boolean.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/redirects'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#redirects'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -110,7 +110,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `cleanUrls` should be boolean.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/cleanurls'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#cleanurls'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -123,7 +123,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `trailingSlash` should be boolean.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/trailingslash'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#trailingslash'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -136,7 +136,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `headers[0]` should NOT have additional property `Content-Type`. Please remove it.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/headers'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -149,7 +149,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `headers[0].source` should be string.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/headers'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -162,7 +162,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `headers[0]` should NOT have additional property `stuff`. Please remove it.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/headers'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -175,7 +175,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `headers[0].headers[0]` should NOT have additional property `Content-Type`. Please remove it.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/headers'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -190,7 +190,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `headers[0].headers[0]` should NOT have additional property `val`. Please remove it.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/headers'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -205,7 +205,7 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `redirects` should NOT have more than 1024 items.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/redirects'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#redirects'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -229,7 +229,39 @@ describe('validateConfig', () => {
|
||||
'Invalid vercel.json - `headers[1].headers` should NOT have more than 1024 items.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/configuration#project/headers'
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
|
||||
);
|
||||
});
|
||||
|
||||
it('should error with too low memory value', async () => {
|
||||
const error = validateConfig({
|
||||
functions: {
|
||||
'api/test.js': {
|
||||
memory: 127,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
"Invalid vercel.json - `functions['api/test.js'].memory` should be >= 128."
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#functions'
|
||||
);
|
||||
});
|
||||
|
||||
it('should error with too high memory value', async () => {
|
||||
const error = validateConfig({
|
||||
functions: {
|
||||
'api/test.js': {
|
||||
memory: 3009,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
"Invalid vercel.json - `functions['api/test.js'].memory` should be <= 3008."
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#functions'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -253,4 +285,90 @@ describe('validateConfig', () => {
|
||||
|
||||
expect(error!.link).toEqual('https://vercel.link/functions-and-builds');
|
||||
});
|
||||
|
||||
it('should error when crons have missing schedule', () => {
|
||||
const error = validateConfig({
|
||||
// @ts-ignore
|
||||
crons: [{ path: '/api/test.js' }],
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
'Invalid vercel.json - `crons[0]` missing required property `schedule`.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#crons'
|
||||
);
|
||||
});
|
||||
|
||||
it('should error when crons have missing path', () => {
|
||||
const error = validateConfig({
|
||||
// @ts-ignore
|
||||
crons: [{ schedule: '* * * * *' }],
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
'Invalid vercel.json - `crons[0]` missing required property `path`.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#crons'
|
||||
);
|
||||
});
|
||||
|
||||
it('should error when path is too long', () => {
|
||||
const error = validateConfig({
|
||||
crons: [{ path: '/' + 'x'.repeat(512), schedule: '* * * * *' }],
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
'Invalid vercel.json - `crons[0].path` should NOT be longer than 512 characters.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#crons'
|
||||
);
|
||||
});
|
||||
|
||||
it('should error when schedule is too long', () => {
|
||||
const error = validateConfig({
|
||||
crons: [{ path: '/', schedule: '*'.repeat(257) }],
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
'Invalid vercel.json - `crons[0].schedule` should NOT be longer than 256 characters.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#crons'
|
||||
);
|
||||
});
|
||||
|
||||
it('should error when path is empty', () => {
|
||||
const error = validateConfig({
|
||||
crons: [{ path: '', schedule: '* * * * *' }],
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
'Invalid vercel.json - `crons[0].path` should NOT be shorter than 1 characters.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#crons'
|
||||
);
|
||||
});
|
||||
|
||||
it('should error when schedule is too short', () => {
|
||||
const error = validateConfig({
|
||||
crons: [{ path: '/', schedule: '* * * * ' }],
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
'Invalid vercel.json - `crons[0].schedule` should NOT be shorter than 9 characters.'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#crons'
|
||||
);
|
||||
});
|
||||
|
||||
it("should error when path doesn't start with `/`", () => {
|
||||
const error = validateConfig({
|
||||
crons: [{ path: 'api/cron', schedule: '* * * * *' }],
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
'Invalid vercel.json - `crons[0].path` should match pattern "^/.*".'
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#crons'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/client",
|
||||
"version": "12.3.8",
|
||||
"version": "12.4.0",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"homepage": "https://vercel.com",
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test-integration-once": "pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts",
|
||||
"test-e2e": "pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts",
|
||||
"test": "jest --env node --verbose --runInBand --bail",
|
||||
"test-unit": "pnpm test tests/unit.*test.*"
|
||||
},
|
||||
@@ -43,8 +43,8 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"@zeit/fetch": "5.2.0",
|
||||
"async-retry": "1.2.3",
|
||||
"async-sema": "3.0.0",
|
||||
|
||||
@@ -3,6 +3,7 @@ import type {
|
||||
BuilderFunctions,
|
||||
Images,
|
||||
ProjectSettings,
|
||||
Cron,
|
||||
} from '@vercel/build-utils';
|
||||
import type { Header, Route, Redirect, Rewrite } from '@vercel/routing-utils';
|
||||
|
||||
@@ -154,6 +155,7 @@ export interface VercelConfig {
|
||||
framework?: string | null;
|
||||
outputDirectory?: string | null;
|
||||
images?: Images;
|
||||
crons?: Cron[];
|
||||
}
|
||||
|
||||
export interface GitMetadata {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/frameworks",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"main": "./dist/frameworks.js",
|
||||
"types": "./dist/frameworks.d.ts",
|
||||
"files": [
|
||||
@@ -21,7 +21,7 @@
|
||||
"@types/js-yaml": "3.12.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/node-fetch": "2.5.8",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"ajv": "6.12.2",
|
||||
"typescript": "4.3.4"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/fs-detectors",
|
||||
"version": "3.7.11",
|
||||
"version": "3.7.14",
|
||||
"description": "Vercel filesystem detectors",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -20,8 +20,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/error-utils": "1.0.8",
|
||||
"@vercel/frameworks": "1.3.0",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/frameworks": "1.3.1",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"glob": "8.0.3",
|
||||
"js-yaml": "4.1.0",
|
||||
"json5": "2.2.2",
|
||||
@@ -35,7 +35,7 @@
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/semver": "7.3.10",
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"typescript": "4.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/gatsby-plugin-vercel-builder",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.7",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -14,9 +14,9 @@
|
||||
"build:src": "tsc -p tsconfig.src.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/node": "2.9.3",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/node": "2.9.6",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"ajv": "8.12.0",
|
||||
"esbuild": "0.14.47",
|
||||
"etag": "1.8.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/go",
|
||||
"version": "2.3.4",
|
||||
"version": "2.3.7",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
|
||||
@@ -12,7 +12,7 @@
|
||||
"scripts": {
|
||||
"build": "node build",
|
||||
"test": "jest --env node --verbose --runInBand --bail",
|
||||
"test-integration-once": "pnpm test"
|
||||
"test-e2e": "pnpm test"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
@@ -36,7 +36,7 @@
|
||||
"@types/node": "14.18.33",
|
||||
"@types/node-fetch": "^2.3.0",
|
||||
"@types/tar": "^4.0.0",
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"async-retry": "1.3.1",
|
||||
"execa": "^1.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/hydrogen",
|
||||
"version": "0.0.50",
|
||||
"version": "0.0.53",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
"test-integration-once": "pnpm test test/test.js",
|
||||
"test-e2e": "pnpm test test/test.js",
|
||||
"test": "jest --env node --verbose --bail --runInBand"
|
||||
},
|
||||
"files": [
|
||||
@@ -21,8 +21,8 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/static-config": "2.0.12",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/static-config": "2.0.13",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"ts-morph": "12.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/next",
|
||||
"version": "3.4.3",
|
||||
"version": "3.4.7",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
||||
@@ -11,7 +11,7 @@
|
||||
"test-unit": "pnpm test test/unit/",
|
||||
"test-next-local": "pnpm test test/integration/*.test.js test/integration/*.test.ts",
|
||||
"test-next-local:middleware": "pnpm test test/integration/middleware.test.ts",
|
||||
"test-integration-once": "rm -f test/builder-info.json; pnpm test test/fixtures/**/*.test.js"
|
||||
"test-e2e": "rm -f test/builder-info.json; pnpm test test/fixtures/**/*.test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -45,9 +45,9 @@
|
||||
"@types/semver": "6.0.0",
|
||||
"@types/text-table": "0.2.1",
|
||||
"@types/webpack-sources": "3.2.0",
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/nft": "0.22.5",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"async-sema": "3.0.1",
|
||||
"buffer-crc32": "0.2.13",
|
||||
"bytes": "3.1.2",
|
||||
|
||||
@@ -1094,6 +1094,10 @@ export const build: BuildV2 = async ({
|
||||
shouldAddHelpers: false,
|
||||
shouldAddSourcemapSupport: false,
|
||||
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
||||
framework: {
|
||||
slug: 'nextjs',
|
||||
version: nextVersion,
|
||||
},
|
||||
});
|
||||
debug(`Created serverless function for page: "${page}"`);
|
||||
})
|
||||
@@ -1816,6 +1820,7 @@ export const build: BuildV2 = async ({
|
||||
'___next_launcher.cjs'
|
||||
),
|
||||
runtime: nodeVersion.runtime,
|
||||
nextVersion,
|
||||
...lambdaOptions,
|
||||
});
|
||||
} else {
|
||||
@@ -1835,6 +1840,7 @@ export const build: BuildV2 = async ({
|
||||
'___next_launcher.cjs'
|
||||
),
|
||||
runtime: nodeVersion.runtime,
|
||||
nextVersion,
|
||||
...lambdaOptions,
|
||||
});
|
||||
}
|
||||
@@ -2046,6 +2052,7 @@ export const build: BuildV2 = async ({
|
||||
'___next_launcher.cjs'
|
||||
),
|
||||
runtime: nodeVersion.runtime,
|
||||
nextVersion,
|
||||
});
|
||||
}
|
||||
)
|
||||
@@ -2644,7 +2651,10 @@ async function getServerlessPages(params: {
|
||||
const [pages, appPaths, middlewareManifest] = await Promise.all([
|
||||
glob('**/!(_middleware).js', params.pagesDir),
|
||||
params.appPathRoutesManifest
|
||||
? glob('**/page.js', path.join(params.pagesDir, '../app'))
|
||||
? Promise.all([
|
||||
glob('**/page.js', path.join(params.pagesDir, '../app')),
|
||||
glob('**/route.js', path.join(params.pagesDir, '../app')),
|
||||
]).then(items => Object.assign(...items))
|
||||
: Promise.resolve({}),
|
||||
getMiddlewareManifest(params.entryPath, params.outputDirectory),
|
||||
]);
|
||||
|
||||
@@ -873,7 +873,7 @@ export async function serverBuild({
|
||||
runtime: nodeVersion.runtime,
|
||||
maxDuration: group.maxDuration,
|
||||
isStreaming: group.isStreaming,
|
||||
cron: group.cron,
|
||||
nextVersion,
|
||||
});
|
||||
|
||||
for (const page of group.pages) {
|
||||
@@ -974,6 +974,7 @@ export async function serverBuild({
|
||||
routesManifest,
|
||||
isCorrectMiddlewareOrder,
|
||||
prerenderBypassToken: prerenderManifest.bypassToken || '',
|
||||
nextVersion,
|
||||
});
|
||||
|
||||
const isNextDataServerResolving =
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
NodejsLambda,
|
||||
EdgeFunction,
|
||||
Images,
|
||||
Cron,
|
||||
} from '@vercel/build-utils';
|
||||
import { NodeFileTraceReasons } from '@vercel/nft';
|
||||
import type {
|
||||
@@ -269,12 +268,7 @@ export async function getRoutesManifest(
|
||||
|
||||
if (shouldHaveManifest && !hasRoutesManifest) {
|
||||
throw new NowBuildError({
|
||||
message:
|
||||
`The file "${pathRoutesManifest}" couldn't be found. This is normally caused by a misconfiguration in your project.\n` +
|
||||
'Please check the following, and reach out to support if you cannot resolve the problem:\n' +
|
||||
' 1. If present, be sure your `build` script in "package.json" calls `next build`.' +
|
||||
' 2. Navigate to your project\'s settings in the Vercel dashboard, and verify that the "Build Command" is not overridden, or that it calls `next build`.' +
|
||||
' 3. Navigate to your project\'s settings in the Vercel dashboard, and verify that the "Output Directory" is not overridden. Note that `next export` does **not** require you change this setting, even if you customize the `next export` output directory.',
|
||||
message: `The file "${pathRoutesManifest}" couldn't be found. This is often caused by a misconfiguration in your project.`,
|
||||
link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
|
||||
code: 'NEXT_NO_ROUTES_MANIFEST',
|
||||
});
|
||||
@@ -780,6 +774,7 @@ export async function createPseudoLayer(files: {
|
||||
interface CreateLambdaFromPseudoLayersOptions extends LambdaOptionsWithFiles {
|
||||
layers: PseudoLayer[];
|
||||
isStreaming?: boolean;
|
||||
nextVersion?: string;
|
||||
}
|
||||
|
||||
// measured with 1, 2, 5, 10, and `os.cpus().length || 5`
|
||||
@@ -790,6 +785,7 @@ export async function createLambdaFromPseudoLayers({
|
||||
files: baseFiles,
|
||||
layers,
|
||||
isStreaming,
|
||||
nextVersion,
|
||||
...lambdaOptions
|
||||
}: CreateLambdaFromPseudoLayersOptions) {
|
||||
await createLambdaSema.acquire();
|
||||
@@ -833,6 +829,10 @@ export async function createLambdaFromPseudoLayers({
|
||||
shouldAddHelpers: false,
|
||||
shouldAddSourcemapSupport: false,
|
||||
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
||||
framework: {
|
||||
slug: 'nextjs',
|
||||
version: nextVersion,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1310,7 +1310,6 @@ export function addLocaleOrDefault(
|
||||
export type LambdaGroup = {
|
||||
pages: string[];
|
||||
memory?: number;
|
||||
cron?: Cron;
|
||||
maxDuration?: number;
|
||||
isStreaming?: boolean;
|
||||
isPrerenders?: boolean;
|
||||
@@ -1363,7 +1362,7 @@ export async function getPageLambdaGroups({
|
||||
const routeName = normalizePage(page.replace(/\.js$/, ''));
|
||||
const isPrerenderRoute = prerenderRoutes.has(routeName);
|
||||
|
||||
let opts: { memory?: number; maxDuration?: number; cron?: Cron } = {};
|
||||
let opts: { memory?: number; maxDuration?: number } = {};
|
||||
|
||||
if (config && config.functions) {
|
||||
const sourceFile = await getSourceFilePathFromPage({
|
||||
@@ -1381,8 +1380,7 @@ export async function getPageLambdaGroups({
|
||||
const matches =
|
||||
group.maxDuration === opts.maxDuration &&
|
||||
group.memory === opts.memory &&
|
||||
group.isPrerenders === isPrerenderRoute &&
|
||||
!opts.cron; // Functions with a cronjob must be on their own
|
||||
group.isPrerenders === isPrerenderRoute;
|
||||
|
||||
if (matches) {
|
||||
let newTracedFilesSize = group.pseudoLayerBytes;
|
||||
@@ -2031,7 +2029,8 @@ export const onPrerenderRoute =
|
||||
const rscVaryHeader =
|
||||
routesManifest?.rsc?.varyHeader ||
|
||||
'__rsc__, __next_router_state_tree__, __next_router_prefetch__';
|
||||
const rscContentTypeHeader = routesManifest?.rsc?.contentTypeHeader || 'application/octet-stream';
|
||||
const rscContentTypeHeader =
|
||||
routesManifest?.rsc?.contentTypeHeader || 'application/octet-stream';
|
||||
|
||||
prerenders[outputPathPage] = new Prerender({
|
||||
expiration: initialRevalidate,
|
||||
@@ -2316,12 +2315,12 @@ interface EdgeFunctionMatcher {
|
||||
}
|
||||
|
||||
export async function getMiddlewareBundle({
|
||||
config = {},
|
||||
entryPath,
|
||||
outputDirectory,
|
||||
routesManifest,
|
||||
isCorrectMiddlewareOrder,
|
||||
prerenderBypassToken,
|
||||
nextVersion,
|
||||
}: {
|
||||
config: Config;
|
||||
entryPath: string;
|
||||
@@ -2329,6 +2328,7 @@ export async function getMiddlewareBundle({
|
||||
prerenderBypassToken: string;
|
||||
routesManifest: RoutesManifest;
|
||||
isCorrectMiddlewareOrder: boolean;
|
||||
nextVersion: string;
|
||||
}): Promise<{
|
||||
staticRoutes: Route[];
|
||||
dynamicRouteMap: Map<string, RouteWithSrc>;
|
||||
@@ -2379,21 +2379,6 @@ export async function getMiddlewareBundle({
|
||||
edgeFunction.wasm
|
||||
);
|
||||
|
||||
const edgeFunctionOptions: { cron?: Cron } = {};
|
||||
if (config.functions) {
|
||||
const sourceFile = await getSourceFilePathFromPage({
|
||||
workPath: entryPath,
|
||||
page: `${edgeFunction.page}.js`,
|
||||
});
|
||||
|
||||
const opts = await getLambdaOptionsFromFunction({
|
||||
sourceFile,
|
||||
config,
|
||||
});
|
||||
|
||||
edgeFunctionOptions.cron = opts.cron;
|
||||
}
|
||||
|
||||
return {
|
||||
type,
|
||||
page: edgeFunction.page,
|
||||
@@ -2438,7 +2423,6 @@ export async function getMiddlewareBundle({
|
||||
);
|
||||
|
||||
return new EdgeFunction({
|
||||
...edgeFunctionOptions,
|
||||
deploymentTarget: 'v8-worker',
|
||||
name: edgeFunction.name,
|
||||
files: {
|
||||
@@ -2466,6 +2450,10 @@ export async function getMiddlewareBundle({
|
||||
path: `assets/${name}`,
|
||||
};
|
||||
}),
|
||||
framework: {
|
||||
slug: 'nextjs',
|
||||
version: nextVersion,
|
||||
},
|
||||
});
|
||||
})(),
|
||||
routeMatchers: getRouteMatchers(edgeFunction, routesManifest),
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"RSC": "1"
|
||||
},
|
||||
"responseHeaders": {
|
||||
"content-type": "application/octet-stream"
|
||||
"content-type": "text/x-component"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -51,7 +51,7 @@
|
||||
"RSC": "1"
|
||||
},
|
||||
"responseHeaders": {
|
||||
"content-type": "application/octet-stream"
|
||||
"content-type": "text/x-component"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"RSC": "1"
|
||||
},
|
||||
"responseHeaders": {
|
||||
"content-type": "application/octet-stream",
|
||||
"content-type": "text/x-component",
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
"RSC": "1"
|
||||
},
|
||||
"responseHeaders": {
|
||||
"content-type": "application/octet-stream",
|
||||
"content-type": "text/x-component",
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
"RSC": "1"
|
||||
},
|
||||
"responseHeaders": {
|
||||
"content-type": "application/octet-stream",
|
||||
"content-type": "text/x-component",
|
||||
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"build": "next build"
|
||||
},
|
||||
"engines": {
|
||||
"node": "14.x"
|
||||
"node": "16.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"chrome-aws-lambda": "8.0.0",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "25-mono-repo-packages-webapp",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"node": "14.x"
|
||||
"node": "16.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "9.3.4",
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"private": true
|
||||
"private": true,
|
||||
"packageManager": "yarn@1.22.19"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "26-packages-webapp",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"node": "14.x"
|
||||
"node": "16.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "9.3.4",
|
||||
|
||||
@@ -1089,11 +1089,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
|
||||
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
|
||||
|
||||
abbrev@1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
|
||||
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
|
||||
|
||||
acorn@^6.2.1:
|
||||
version "6.4.1"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
|
||||
@@ -1135,11 +1130,6 @@ ansi-regex@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
|
||||
|
||||
ansi-regex@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
|
||||
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
|
||||
|
||||
ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
@@ -1168,19 +1158,11 @@ anymatch@~3.1.1:
|
||||
normalize-path "^3.0.0"
|
||||
picomatch "^2.0.4"
|
||||
|
||||
aproba@^1.0.3, aproba@^1.1.1:
|
||||
aproba@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
|
||||
integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
|
||||
|
||||
are-we-there-yet@~1.1.2:
|
||||
version "1.1.5"
|
||||
resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
|
||||
integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==
|
||||
dependencies:
|
||||
delegates "^1.0.0"
|
||||
readable-stream "^2.0.6"
|
||||
|
||||
arity-n@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/arity-n/-/arity-n-1.0.4.tgz#d9e76b11733e08569c0847ae7b39b2860b30b745"
|
||||
@@ -1616,11 +1598,6 @@ clone-deep@^4.0.1:
|
||||
kind-of "^6.0.2"
|
||||
shallow-clone "^3.0.0"
|
||||
|
||||
code-point-at@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
|
||||
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
|
||||
|
||||
collection-visit@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
|
||||
@@ -1683,11 +1660,6 @@ console-browserify@^1.1.0:
|
||||
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
|
||||
integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==
|
||||
|
||||
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
|
||||
integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=
|
||||
|
||||
constants-browserify@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
|
||||
@@ -1844,13 +1816,6 @@ debug@^2.2.0, debug@^2.3.3:
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^3.2.6:
|
||||
version "3.2.6"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
||||
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debug@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
@@ -1863,11 +1828,6 @@ decode-uri-component@^0.2.0:
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
|
||||
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
|
||||
|
||||
deep-extend@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
|
||||
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
|
||||
|
||||
define-properties@^1.1.2:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
|
||||
@@ -1897,11 +1857,6 @@ define-property@^2.0.2:
|
||||
is-descriptor "^1.0.2"
|
||||
isobject "^3.0.1"
|
||||
|
||||
delegates@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
|
||||
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
|
||||
|
||||
des.js@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843"
|
||||
@@ -1910,11 +1865,6 @@ des.js@^1.0.0:
|
||||
inherits "^2.0.1"
|
||||
minimalistic-assert "^1.0.0"
|
||||
|
||||
detect-libc@^1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
|
||||
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
|
||||
|
||||
diffie-hellman@^5.0.0:
|
||||
version "5.0.3"
|
||||
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
|
||||
@@ -2244,13 +2194,6 @@ from2@^2.1.0:
|
||||
inherits "^2.0.1"
|
||||
readable-stream "^2.0.0"
|
||||
|
||||
fs-minipass@^1.2.5:
|
||||
version "1.2.7"
|
||||
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
|
||||
integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==
|
||||
dependencies:
|
||||
minipass "^2.6.0"
|
||||
|
||||
fs-write-stream-atomic@^1.0.8:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9"
|
||||
@@ -2284,20 +2227,6 @@ function-bind@^1.1.1:
|
||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
|
||||
|
||||
gauge@~2.7.3:
|
||||
version "2.7.4"
|
||||
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
|
||||
integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=
|
||||
dependencies:
|
||||
aproba "^1.0.3"
|
||||
console-control-strings "^1.0.0"
|
||||
has-unicode "^2.0.0"
|
||||
object-assign "^4.1.0"
|
||||
signal-exit "^3.0.0"
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
wide-align "^1.1.0"
|
||||
|
||||
get-value@^2.0.3, get-value@^2.0.6:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
|
||||
@@ -2362,11 +2291,6 @@ has-symbols@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8"
|
||||
integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==
|
||||
|
||||
has-unicode@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
|
||||
integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
|
||||
|
||||
has-value@^0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
|
||||
@@ -2445,13 +2369,6 @@ https-browserify@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
|
||||
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
|
||||
|
||||
iconv-lite@^0.4.4:
|
||||
version "0.4.24"
|
||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
||||
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
|
||||
dependencies:
|
||||
safer-buffer ">= 2.1.2 < 3"
|
||||
|
||||
icss-utils@^4.0.0, icss-utils@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.1.1.tgz#21170b53789ee27447c2f47dd683081403f9a467"
|
||||
@@ -2469,13 +2386,6 @@ iferr@^0.1.5:
|
||||
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
|
||||
integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE=
|
||||
|
||||
ignore-walk@^3.0.1:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37"
|
||||
integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==
|
||||
dependencies:
|
||||
minimatch "^3.0.4"
|
||||
|
||||
imurmurhash@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
|
||||
@@ -2514,11 +2424,6 @@ inherits@2.0.3:
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
|
||||
ini@~1.3.0:
|
||||
version "1.3.5"
|
||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
||||
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
|
||||
|
||||
invariant@^2.2.2:
|
||||
version "2.2.4"
|
||||
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
|
||||
@@ -2608,18 +2513,6 @@ is-extglob@^2.1.0, is-extglob@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
||||
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
|
||||
|
||||
is-fullwidth-code-point@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
|
||||
integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
|
||||
dependencies:
|
||||
number-is-nan "^1.0.0"
|
||||
|
||||
is-fullwidth-code-point@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
||||
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
|
||||
|
||||
is-glob@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a"
|
||||
@@ -2952,21 +2845,6 @@ minimist@^1.2.0, minimist@^1.2.5:
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
||||
|
||||
minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0:
|
||||
version "2.9.0"
|
||||
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6"
|
||||
integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==
|
||||
dependencies:
|
||||
safe-buffer "^5.1.2"
|
||||
yallist "^3.0.0"
|
||||
|
||||
minizlib@^1.2.1:
|
||||
version "1.3.3"
|
||||
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
|
||||
integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==
|
||||
dependencies:
|
||||
minipass "^2.9.0"
|
||||
|
||||
mississippi@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022"
|
||||
@@ -2991,7 +2869,7 @@ mixin-deep@^1.2.0:
|
||||
for-in "^1.0.2"
|
||||
is-extendable "^1.0.1"
|
||||
|
||||
mkdirp@^0.5.0, mkdirp@^0.5.1:
|
||||
mkdirp@^0.5.1:
|
||||
version "0.5.5"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
||||
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
||||
@@ -3049,15 +2927,6 @@ native-url@0.2.6:
|
||||
dependencies:
|
||||
querystring "^0.2.0"
|
||||
|
||||
needle@^2.2.1:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.1.tgz#14af48732463d7475696f937626b1b993247a56a"
|
||||
integrity sha512-x/gi6ijr4B7fwl6WYL9FwlCvRQKGlUNvnceho8wxkwXqN8jvVmmmATTmZPRRG7b/yC1eode26C2HO9jl78Du9g==
|
||||
dependencies:
|
||||
debug "^3.2.6"
|
||||
iconv-lite "^0.4.4"
|
||||
sax "^1.2.4"
|
||||
|
||||
neo-async@^2.5.0, neo-async@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
|
||||
@@ -3148,35 +3017,11 @@ node-libs-browser@^2.2.1:
|
||||
util "^0.11.0"
|
||||
vm-browserify "^1.0.1"
|
||||
|
||||
node-pre-gyp@*:
|
||||
version "0.14.0"
|
||||
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
|
||||
integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==
|
||||
dependencies:
|
||||
detect-libc "^1.0.2"
|
||||
mkdirp "^0.5.1"
|
||||
needle "^2.2.1"
|
||||
nopt "^4.0.1"
|
||||
npm-packlist "^1.1.6"
|
||||
npmlog "^4.0.2"
|
||||
rc "^1.2.7"
|
||||
rimraf "^2.6.1"
|
||||
semver "^5.3.0"
|
||||
tar "^4.4.2"
|
||||
|
||||
node-releases@^1.1.44, node-releases@^1.1.53:
|
||||
version "1.1.53"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4"
|
||||
integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ==
|
||||
|
||||
nopt@^4.0.1:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48"
|
||||
integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==
|
||||
dependencies:
|
||||
abbrev "1"
|
||||
osenv "^0.1.4"
|
||||
|
||||
normalize-html-whitespace@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/normalize-html-whitespace/-/normalize-html-whitespace-1.0.0.tgz#5e3c8e192f1b06c3b9eee4b7e7f28854c7601e34"
|
||||
@@ -3204,42 +3049,6 @@ normalize-url@1.9.1:
|
||||
query-string "^4.1.0"
|
||||
sort-keys "^1.0.0"
|
||||
|
||||
npm-bundled@^1.0.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b"
|
||||
integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==
|
||||
dependencies:
|
||||
npm-normalize-package-bin "^1.0.1"
|
||||
|
||||
npm-normalize-package-bin@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2"
|
||||
integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==
|
||||
|
||||
npm-packlist@^1.1.6:
|
||||
version "1.4.8"
|
||||
resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e"
|
||||
integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==
|
||||
dependencies:
|
||||
ignore-walk "^3.0.1"
|
||||
npm-bundled "^1.0.1"
|
||||
npm-normalize-package-bin "^1.0.1"
|
||||
|
||||
npmlog@^4.0.2:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
|
||||
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
|
||||
dependencies:
|
||||
are-we-there-yet "~1.1.2"
|
||||
console-control-strings "~1.1.0"
|
||||
gauge "~2.7.3"
|
||||
set-blocking "~2.0.0"
|
||||
|
||||
number-is-nan@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
|
||||
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
|
||||
|
||||
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
@@ -3300,24 +3109,6 @@ os-browserify@^0.3.0:
|
||||
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
|
||||
integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=
|
||||
|
||||
os-homedir@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
|
||||
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
|
||||
|
||||
os-tmpdir@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
|
||||
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
|
||||
|
||||
osenv@^0.1.4:
|
||||
version "0.1.5"
|
||||
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
|
||||
integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
|
||||
dependencies:
|
||||
os-homedir "^1.0.0"
|
||||
os-tmpdir "^1.0.0"
|
||||
|
||||
p-limit@^1.1.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
|
||||
@@ -3657,16 +3448,6 @@ randomfill@^1.0.3:
|
||||
randombytes "^2.0.5"
|
||||
safe-buffer "^5.1.0"
|
||||
|
||||
rc@^1.2.7:
|
||||
version "1.2.8"
|
||||
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
|
||||
integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
|
||||
dependencies:
|
||||
deep-extend "^0.6.0"
|
||||
ini "~1.3.0"
|
||||
minimist "^1.2.0"
|
||||
strip-json-comments "~2.0.1"
|
||||
|
||||
react-dom@^16.8.6:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
|
||||
@@ -3696,7 +3477,7 @@ react@^16.8.6:
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.2"
|
||||
|
||||
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
|
||||
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
|
||||
version "2.3.7"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
|
||||
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
|
||||
@@ -3853,7 +3634,7 @@ rework@1.0.1:
|
||||
convert-source-map "^0.3.3"
|
||||
css "^2.0.0"
|
||||
|
||||
rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3:
|
||||
rimraf@^2.5.4, rimraf@^2.6.3:
|
||||
version "2.7.1"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
|
||||
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
|
||||
@@ -3892,11 +3673,6 @@ safe-regex@^1.1.0:
|
||||
dependencies:
|
||||
ret "~0.1.10"
|
||||
|
||||
"safer-buffer@>= 2.1.2 < 3":
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||
|
||||
sass-loader@8.0.2:
|
||||
version "8.0.2"
|
||||
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-8.0.2.tgz#debecd8c3ce243c76454f2e8290482150380090d"
|
||||
@@ -3908,11 +3684,6 @@ sass-loader@8.0.2:
|
||||
schema-utils "^2.6.1"
|
||||
semver "^6.3.0"
|
||||
|
||||
sax@^1.2.4:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
|
||||
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
|
||||
|
||||
scheduler@^0.19.1:
|
||||
version "0.19.1"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
|
||||
@@ -3943,7 +3714,7 @@ semver@7.0.0:
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
|
||||
integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==
|
||||
|
||||
semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
|
||||
semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
||||
@@ -3958,11 +3729,6 @@ serialize-javascript@^2.1.2:
|
||||
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
|
||||
integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==
|
||||
|
||||
set-blocking@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
|
||||
integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
|
||||
|
||||
set-value@^2.0.0, set-value@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
|
||||
@@ -3993,11 +3759,6 @@ shallow-clone@^3.0.0:
|
||||
dependencies:
|
||||
kind-of "^6.0.2"
|
||||
|
||||
signal-exit@^3.0.0:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
|
||||
integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==
|
||||
|
||||
snapdragon-node@^2.0.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
|
||||
@@ -4143,23 +3904,6 @@ string-hash@1.1.3:
|
||||
resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"
|
||||
integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=
|
||||
|
||||
string-width@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||
integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
|
||||
dependencies:
|
||||
code-point-at "^1.0.0"
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
"string-width@^1.0.2 || 2":
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
|
||||
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
|
||||
dependencies:
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^4.0.0"
|
||||
|
||||
string_decoder@^1.0.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
|
||||
@@ -4174,25 +3918,13 @@ string_decoder@~1.1.1:
|
||||
dependencies:
|
||||
safe-buffer "~5.1.0"
|
||||
|
||||
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
|
||||
strip-ansi@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
strip-ansi@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
|
||||
integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
|
||||
dependencies:
|
||||
ansi-regex "^3.0.0"
|
||||
|
||||
strip-json-comments@~2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
|
||||
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
|
||||
|
||||
style-loader@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.0.0.tgz#1d5296f9165e8e2c85d24eee0b7caf9ec8ca1f82"
|
||||
@@ -4249,19 +3981,6 @@ tapable@^1.0.0, tapable@^1.1.3:
|
||||
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
|
||||
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
|
||||
|
||||
tar@^4.4.2:
|
||||
version "4.4.13"
|
||||
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
|
||||
integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==
|
||||
dependencies:
|
||||
chownr "^1.1.1"
|
||||
fs-minipass "^1.2.5"
|
||||
minipass "^2.8.6"
|
||||
minizlib "^1.2.1"
|
||||
mkdirp "^0.5.0"
|
||||
safe-buffer "^5.1.2"
|
||||
yallist "^3.0.3"
|
||||
|
||||
terser-webpack-plugin@^1.4.3:
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c"
|
||||
@@ -4565,13 +4284,6 @@ whatwg-fetch@3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
|
||||
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
|
||||
|
||||
wide-align@^1.1.0:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
|
||||
integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==
|
||||
dependencies:
|
||||
string-width "^1.0.2 || 2"
|
||||
|
||||
worker-farm@^1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8"
|
||||
@@ -4601,7 +4313,7 @@ y18n@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
|
||||
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
|
||||
|
||||
yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3:
|
||||
yallist@^3.0.2:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
|
||||
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
|
||||
|
||||
@@ -41,14 +41,15 @@ if (parseInt(process.versions.node.split('.')[0], 10) >= 16) {
|
||||
expect(buildResult.output['dashboard.rsc'].fallback.fsPath).toMatch(
|
||||
/server\/app\/dashboard\.rsc$/
|
||||
);
|
||||
expect(buildResult.output['dashboard/index/index'].type).toBe('Prerender');
|
||||
expect(buildResult.output['dashboard/index/index'].fallback.fsPath).toMatch(
|
||||
/server\/app\/dashboard\/index\.html$/
|
||||
);
|
||||
expect(buildResult.output['dashboard/index.rsc'].type).toBe('Prerender');
|
||||
expect(buildResult.output['dashboard/index.rsc'].fallback.fsPath).toMatch(
|
||||
/server\/app\/dashboard\/index\.rsc$/
|
||||
);
|
||||
// TODO: re-enable after index/index handling is corrected
|
||||
// expect(buildResult.output['dashboard/index/index'].type).toBe('Prerender');
|
||||
// expect(buildResult.output['dashboard/index/index'].fallback.fsPath).toMatch(
|
||||
// /server\/app\/dashboard\/index\.html$/
|
||||
// );
|
||||
// expect(buildResult.output['dashboard/index.rsc'].type).toBe('Prerender');
|
||||
// expect(buildResult.output['dashboard/index.rsc'].fallback.fsPath).toMatch(
|
||||
// /server\/app\/dashboard\/index\.rsc$/
|
||||
// );
|
||||
});
|
||||
|
||||
it('should build with app-dir in edge runtime correctly', async () => {
|
||||
@@ -366,11 +367,6 @@ it('Should not deploy preview lambdas for static site', async () => {
|
||||
});
|
||||
|
||||
it('Should opt-out of shared lambdas when routes are detected', async () => {
|
||||
if (__dirname.includes('file-system-api')) {
|
||||
// Ignore, since `26-mono-repo-404-lambda` is not relevant for the File System API
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
buildResult: { output },
|
||||
} = await runBuildLambda(
|
||||
@@ -732,11 +728,6 @@ it('Should not exceed function limit for large dependencies (server build)', asy
|
||||
});
|
||||
|
||||
it('Should not exceed function limit for large dependencies (shared lambda)', async () => {
|
||||
if (__dirname.includes('file-system-api')) {
|
||||
// Test is not relevant for the File System API
|
||||
return;
|
||||
}
|
||||
|
||||
let logs = '';
|
||||
|
||||
const origLog = console.log;
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
const path = require('node:path');
|
||||
const fs = require('fs-extra');
|
||||
const { build } = require('../../dist');
|
||||
|
||||
function getFixture(name) {
|
||||
return path.join(__dirname, 'fixtures', name);
|
||||
}
|
||||
|
||||
const initialCorepackValue = process.env.COREPACK_ENABLE_STRICT;
|
||||
|
||||
beforeEach(() => {
|
||||
process.env.COREPACK_ENABLE_STRICT = '0';
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
process.env.COREPACK_ENABLE_STRICT = initialCorepackValue;
|
||||
});
|
||||
|
||||
it('should include cron property from config', async () => {
|
||||
const cwd = getFixture('03-with-api-routes');
|
||||
await fs.remove(path.join(cwd, '.next'));
|
||||
|
||||
const result = await build({
|
||||
workPath: cwd,
|
||||
repoRootPath: cwd,
|
||||
entrypoint: 'package.json',
|
||||
config: {
|
||||
functions: {
|
||||
'pages/api/edge.js': {
|
||||
cron: '* * * * *',
|
||||
},
|
||||
'pages/api/serverless.js': {
|
||||
cron: '* * * * *',
|
||||
},
|
||||
},
|
||||
},
|
||||
meta: {
|
||||
skipDownload: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.output['api/serverless']).toHaveProperty('cron', '* * * * *');
|
||||
expect(result.output['api/edge']).toHaveProperty('cron', '* * * * *');
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/node",
|
||||
"version": "2.9.3",
|
||||
"version": "2.9.6",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
||||
@@ -13,7 +13,7 @@
|
||||
"build": "node build",
|
||||
"test": "jest --env node --verbose --bail --runInBand",
|
||||
"test-unit": "pnpm test test/prepare-cache.test.ts test/utils.test.ts",
|
||||
"test-integration-once": "pnpm test test/integration-*.test.js"
|
||||
"test-e2e": "pnpm test test/integration-*.test.js"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
@@ -31,9 +31,9 @@
|
||||
"dependencies": {
|
||||
"@edge-runtime/vm": "2.0.0",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/node-bridge": "3.1.11",
|
||||
"@vercel/static-config": "2.0.12",
|
||||
"@vercel/static-config": "2.0.13",
|
||||
"edge-runtime": "2.0.0",
|
||||
"esbuild": "0.14.47",
|
||||
"exit-hook": "2.2.1",
|
||||
|
||||
@@ -61,7 +61,8 @@ async function createEventHandler(
|
||||
return createEdgeEventHandler(
|
||||
entrypointPath,
|
||||
entrypoint,
|
||||
config.middleware || false
|
||||
config.middleware || false,
|
||||
config.zeroConfig
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { EdgeContext } from '@edge-runtime/vm';
|
||||
import esbuild from 'esbuild';
|
||||
import fetch from 'node-fetch';
|
||||
import { createEdgeWasmPlugin, WasmAssets } from './edge-wasm-plugin';
|
||||
import { logError } from '../utils';
|
||||
import { entrypointToOutputPath, logError } from '../utils';
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
const NODE_VERSION_MAJOR = process.version.match(/^v(\d+)\.\d+/)?.[1];
|
||||
@@ -136,7 +136,8 @@ async function createEdgeRuntime(params?: {
|
||||
export async function createEdgeEventHandler(
|
||||
entrypointFullPath: string,
|
||||
entrypointRelativePath: string,
|
||||
isMiddleware: boolean
|
||||
isMiddleware: boolean,
|
||||
isZeroConfig?: boolean
|
||||
): Promise<(request: IncomingMessage) => Promise<VercelProxyResponse>> {
|
||||
const userCode = await compileUserCode(
|
||||
entrypointFullPath,
|
||||
@@ -167,9 +168,12 @@ export async function createEdgeEventHandler(
|
||||
// We can't currently get a real stack trace from the Edge Function error,
|
||||
// but we can fake a basic one that is still usefult to the user.
|
||||
const fakeStackTrace = ` at (${entrypointRelativePath})`;
|
||||
const urlPath = extractUrlPath(entrypointRelativePath);
|
||||
const requestPath = entrypointToRequestPath(
|
||||
entrypointRelativePath,
|
||||
isZeroConfig
|
||||
);
|
||||
console.log(
|
||||
`Error from API Route ${urlPath}: ${body}\n${fakeStackTrace}`
|
||||
`Error from API Route ${requestPath}: ${body}\n${fakeStackTrace}`
|
||||
);
|
||||
|
||||
// this matches the serverless function bridge launcher's behavior when
|
||||
@@ -186,12 +190,11 @@ export async function createEdgeEventHandler(
|
||||
};
|
||||
}
|
||||
|
||||
// turns "api/some.func.js" into "api/some.func"
|
||||
function extractUrlPath(entrypointRelativePath: string) {
|
||||
const parts = entrypointRelativePath.split('.');
|
||||
if (parts.length === 1) {
|
||||
return entrypointRelativePath;
|
||||
}
|
||||
parts.pop();
|
||||
return parts.join('.');
|
||||
function entrypointToRequestPath(
|
||||
entrypointRelativePath: string,
|
||||
isZeroConfig?: boolean
|
||||
) {
|
||||
// ensure the path starts with a slash to match conventions used elsewhere,
|
||||
// notably when rendering serverless function paths in error messages
|
||||
return '/' + entrypointToOutputPath(entrypointRelativePath, isZeroConfig);
|
||||
}
|
||||
|
||||
@@ -180,6 +180,8 @@ async function compile(
|
||||
return source;
|
||||
}
|
||||
|
||||
const conditions = isEdgeFunction ? ['worker', 'browser'] : undefined;
|
||||
|
||||
const { fileList, esmFileList, warnings } = await nodeFileTrace(
|
||||
[...inputFiles],
|
||||
{
|
||||
@@ -187,6 +189,7 @@ async function compile(
|
||||
processCwd: workPath,
|
||||
ts: true,
|
||||
mixedModules: true,
|
||||
conditions,
|
||||
resolve(id, parent, job, cjsResolve) {
|
||||
const normalizedWasmImports = id.replace(/\.wasm\?module$/i, '.wasm');
|
||||
return nftResolveDependency(
|
||||
@@ -197,7 +200,7 @@ async function compile(
|
||||
);
|
||||
},
|
||||
ignore: config.excludeFiles,
|
||||
async readFile(fsPath: string): Promise<Buffer | string | null> {
|
||||
async readFile(fsPath) {
|
||||
const relPath = relative(baseDir, fsPath);
|
||||
|
||||
// If this file has already been read then return from the cache
|
||||
@@ -421,8 +424,6 @@ export const build: BuildV3 = async ({
|
||||
isEdgeFunction = isEdgeRuntime(staticConfig.runtime);
|
||||
}
|
||||
|
||||
const cron = staticConfig?.cron;
|
||||
|
||||
debug('Tracing input files...');
|
||||
const traceTime = Date.now();
|
||||
const { preparedFiles, shouldAddSourcemapSupport } = await compile(
|
||||
@@ -472,7 +473,6 @@ export const build: BuildV3 = async ({
|
||||
// TODO: remove - these two properties should not be required
|
||||
name: outputPath,
|
||||
deploymentTarget: 'v8-worker',
|
||||
cron,
|
||||
});
|
||||
} else {
|
||||
// "nodejs" runtime is the default
|
||||
@@ -491,7 +491,6 @@ export const build: BuildV3 = async ({
|
||||
shouldAddSourcemapSupport,
|
||||
awsLambdaHandler,
|
||||
experimentalResponseStreaming,
|
||||
cron,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
16
packages/node/test/fixtures/61-edge-function/api/react-dom.mjs
vendored
Normal file
16
packages/node/test/fixtures/61-edge-function/api/react-dom.mjs
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
|
||||
export const config = {
|
||||
runtime: 'edge'
|
||||
};
|
||||
|
||||
export default async () => {
|
||||
const el = React.createElement('h1', { children: `RANDOMNESS_PLACEHOLDER:Hello from Edge` });
|
||||
const str = renderToString(el);
|
||||
return new Response(str, {
|
||||
headers: {
|
||||
'content-type': 'text/html'
|
||||
}
|
||||
});
|
||||
}
|
||||
6
packages/node/test/fixtures/61-edge-function/package.json
vendored
Normal file
6
packages/node/test/fixtures/61-edge-function/package.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"builds": [{ "src": "api/**/*.js", "use": "@vercel/node" }],
|
||||
"builds": [{ "src": "api/**/*.{js,mjs}", "use": "@vercel/node" }],
|
||||
"probes": [
|
||||
{
|
||||
"path": "/api/edge.js",
|
||||
@@ -8,6 +8,10 @@
|
||||
{
|
||||
"path": "/api/wasm.js",
|
||||
"mustContain": "RANDOMNESS_PLACEHOLDER:edge, 11."
|
||||
},
|
||||
{
|
||||
"path": "/api/react-dom.mjs",
|
||||
"mustContain": "<h1>RANDOMNESS_PLACEHOLDER:Hello from Edge</h1>"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
100
packages/node/test/fixtures/61-edge-function/yarn.lock
vendored
Normal file
100
packages/node/test/fixtures/61-edge-function/yarn.lock
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
ansi-regex@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1"
|
||||
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
|
||||
|
||||
cowsay@1.3.1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/cowsay/-/cowsay-1.3.1.tgz#56b2a9bde3c865abaa272c6bb68906f68bee9810"
|
||||
integrity sha512-3PVFe6FePVtPj1HTeLin9v8WyLl+VmM1l1H/5P+BTTDkMAjufp+0F9eLjzRnOHzVAYeIYFF5po5NjRrgefnRMQ==
|
||||
dependencies:
|
||||
get-stdin "^5.0.1"
|
||||
optimist "~0.6.1"
|
||||
string-width "~2.1.1"
|
||||
strip-eof "^1.0.0"
|
||||
|
||||
get-stdin@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
|
||||
integrity sha512-jZV7n6jGE3Gt7fgSTJoz91Ak5MuTLwMwkoYdjxuJ/AmjIsE1UC03y/IWkZCQGEvVNS9qoRNwy5BCqxImv0FVeA==
|
||||
|
||||
is-fullwidth-code-point@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
||||
integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==
|
||||
|
||||
"js-tokens@^3.0.0 || ^4.0.0":
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
|
||||
|
||||
loose-envify@^1.1.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
|
||||
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
|
||||
dependencies:
|
||||
js-tokens "^3.0.0 || ^4.0.0"
|
||||
|
||||
minimist@~0.0.1:
|
||||
version "0.0.10"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
|
||||
integrity sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==
|
||||
|
||||
optimist@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
|
||||
integrity sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==
|
||||
dependencies:
|
||||
minimist "~0.0.1"
|
||||
wordwrap "~0.0.2"
|
||||
|
||||
react-dom@18.2.0:
|
||||
version "18.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
|
||||
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
scheduler "^0.23.0"
|
||||
|
||||
react@18.2.0:
|
||||
version "18.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
|
||||
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
|
||||
scheduler@^0.23.0:
|
||||
version "0.23.0"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
|
||||
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
|
||||
string-width@~2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
|
||||
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
|
||||
dependencies:
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^4.0.0"
|
||||
|
||||
strip-ansi@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
|
||||
integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==
|
||||
dependencies:
|
||||
ansi-regex "^3.0.0"
|
||||
|
||||
strip-eof@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
|
||||
integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==
|
||||
|
||||
wordwrap@~0.0.2:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
|
||||
integrity sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/python",
|
||||
"version": "3.1.46",
|
||||
"version": "3.1.49",
|
||||
"main": "./dist/index.js",
|
||||
"license": "MIT",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
|
||||
@@ -17,13 +17,13 @@
|
||||
"build": "node build",
|
||||
"test": "jest --env node --verbose --runInBand --bail",
|
||||
"test-unit": "pnpm test test/unit.test.ts",
|
||||
"test-integration-once": "pnpm test test/integration.test.ts"
|
||||
"test-e2e": "pnpm test test/integration.test.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/execa": "^0.9.0",
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"execa": "^1.0.0",
|
||||
"typescript": "4.3.4"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/redwood",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.5",
|
||||
"main": "./dist/index.js",
|
||||
"license": "MIT",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -14,20 +14,20 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
"test-integration-once": "pnpm test test/test.js",
|
||||
"test-e2e": "pnpm test test/test.js",
|
||||
"test": "jest --env node --verbose --bail --runInBand",
|
||||
"test-unit": "pnpm test test/prepare-cache.test.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/nft": "0.22.5",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"semver": "6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/aws-lambda": "8.10.19",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/semver": "6.0.0",
|
||||
"@vercel/build-utils": "6.2.2",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"typescript": "4.3.4"
|
||||
|
||||
30
packages/remix-entry-server/README.md
Normal file
30
packages/remix-entry-server/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# `@vercel/remix-entry-server`
|
||||
|
||||
This package is meant for use within Remix applications when deploying to Vercel. It provides implementations for the `app/entry.server.tsx` file for both the Node.js Serverless Runtime and the Edge Runtime. The implementations are configured to [handle streaming responses](https://remix.run/docs/en/v1/guides/streaming).
|
||||
|
||||
## Usage
|
||||
|
||||
Make sure `@vercel/remix-entry-server` is installed with your package manager of choice, then replace your `app/entry.server.tsx` file with the following:
|
||||
|
||||
```tsx
|
||||
// `app/entry.server.tsx`
|
||||
|
||||
import handleRequest from '@vercel/remix-entry-server';
|
||||
import { RemixServer } from '@remix-run/react';
|
||||
import type { EntryContext } from '@remix-run/server-runtime';
|
||||
|
||||
export default function (
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext
|
||||
) {
|
||||
const remixServer = <RemixServer context={remixContext} url={request.url} />;
|
||||
return handleRequest(
|
||||
request,
|
||||
responseStatusCode,
|
||||
responseHeaders,
|
||||
remixServer
|
||||
);
|
||||
}
|
||||
```
|
||||
12
packages/remix-entry-server/build.js
Normal file
12
packages/remix-entry-server/build.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const execa = require('execa');
|
||||
const { remove } = require('fs-extra');
|
||||
|
||||
async function main() {
|
||||
await remove('dist');
|
||||
await execa('tsc', [], { stdio: 'inherit' });
|
||||
}
|
||||
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
34
packages/remix-entry-server/package.json
Normal file
34
packages/remix-entry-server/package.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "@vercel/remix-entry-server",
|
||||
"version": "0.1.0",
|
||||
"description": "Isomorphic `entry.server` implementation for Vercel's Serverless and Edge runtimes",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vercel/vercel.git",
|
||||
"directory": "packages/remix-entry-server"
|
||||
},
|
||||
"main": "./dist/entry.server.node.js",
|
||||
"browser": "./dist/entry.server.edge.js",
|
||||
"scripts": {
|
||||
"build": "node build.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@remix-run/node": "1.12.0",
|
||||
"isbot": "3.6.5",
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-dom": "18.0.10",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"typescript": "4.9.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0"
|
||||
}
|
||||
}
|
||||
27
packages/remix-entry-server/src/entry.server.edge.ts
Normal file
27
packages/remix-entry-server/src/entry.server.edge.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import isbot from 'isbot';
|
||||
import { renderToReadableStream } from 'react-dom/server';
|
||||
|
||||
export default async function handleRequest(
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixServer: JSX.Element
|
||||
) {
|
||||
const body = await renderToReadableStream(remixServer, {
|
||||
signal: request.signal,
|
||||
onError(error) {
|
||||
console.error(error);
|
||||
responseStatusCode = 500;
|
||||
},
|
||||
});
|
||||
|
||||
if (isbot(request.headers.get('user-agent'))) {
|
||||
await body.allReady;
|
||||
}
|
||||
|
||||
responseHeaders.set('Content-Type', 'text/html');
|
||||
return new Response(body, {
|
||||
headers: responseHeaders,
|
||||
status: responseStatusCode,
|
||||
});
|
||||
}
|
||||
81
packages/remix-entry-server/src/entry.server.node.ts
Normal file
81
packages/remix-entry-server/src/entry.server.node.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
import { PassThrough } from 'stream';
|
||||
import { renderToPipeableStream } from 'react-dom/server';
|
||||
import { Response } from '@remix-run/node';
|
||||
import isbot from 'isbot';
|
||||
|
||||
const ABORT_DELAY = 5000;
|
||||
|
||||
export default function handleRequest(
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixServer: JSX.Element
|
||||
) {
|
||||
// If the request is from a bot, we want to wait for the full
|
||||
// response to render before sending it to the client. This
|
||||
// ensures that bots can see the full page content.
|
||||
if (isbot(request.headers.get('user-agent'))) {
|
||||
return serveTheBots(responseStatusCode, responseHeaders, remixServer);
|
||||
}
|
||||
|
||||
return serveBrowsers(responseStatusCode, responseHeaders, remixServer);
|
||||
}
|
||||
|
||||
function serveTheBots(
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixServer: any
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const { pipe, abort } = renderToPipeableStream(remixServer, {
|
||||
// Use onAllReady to wait for the entire document to be ready
|
||||
onAllReady() {
|
||||
responseHeaders.set('Content-Type', 'text/html');
|
||||
const body = new PassThrough();
|
||||
pipe(body);
|
||||
resolve(
|
||||
new Response(body, {
|
||||
status: responseStatusCode,
|
||||
headers: responseHeaders,
|
||||
})
|
||||
);
|
||||
},
|
||||
onShellError(err) {
|
||||
reject(err);
|
||||
},
|
||||
});
|
||||
setTimeout(abort, ABORT_DELAY);
|
||||
});
|
||||
}
|
||||
|
||||
function serveBrowsers(
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixServer: any
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let didError = false;
|
||||
const { pipe, abort } = renderToPipeableStream(remixServer, {
|
||||
// use onShellReady to wait until a suspense boundary is triggered
|
||||
onShellReady() {
|
||||
responseHeaders.set('Content-Type', 'text/html');
|
||||
const body = new PassThrough();
|
||||
pipe(body);
|
||||
resolve(
|
||||
new Response(body, {
|
||||
status: didError ? 500 : responseStatusCode,
|
||||
headers: responseHeaders,
|
||||
})
|
||||
);
|
||||
},
|
||||
onShellError(err) {
|
||||
reject(err);
|
||||
},
|
||||
onError(err) {
|
||||
didError = true;
|
||||
console.error(err);
|
||||
},
|
||||
});
|
||||
setTimeout(abort, ABORT_DELAY);
|
||||
});
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user