mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
Compare commits
11 Commits
@vercel/go
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d98d1cdea | ||
|
|
667af829c4 | ||
|
|
1bb7b37e0c | ||
|
|
ca81c133b9 | ||
|
|
f332b7856c | ||
|
|
9308a0fda5 | ||
|
|
c2f8a5990a | ||
|
|
fc2f0b919b | ||
|
|
a606ab8678 | ||
|
|
13062cd47d | ||
|
|
bb9faaed99 |
3
.github/workflows/cron-update-next.yml
vendored
3
.github/workflows/cron-update-next.yml
vendored
@@ -16,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: |
|
||||
|
||||
5
.github/workflows/cron-update-turbo.yml
vendored
5
.github/workflows/cron-update-turbo.yml
vendored
@@ -16,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: |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.2.3",
|
||||
"version": "6.3.0",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "28.15.5",
|
||||
"version": "28.16.0",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -41,16 +41,16 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@vercel/go": "2.3.5",
|
||||
"@vercel/hydrogen": "0.0.51",
|
||||
"@vercel/next": "3.4.4",
|
||||
"@vercel/node": "2.9.4",
|
||||
"@vercel/python": "3.1.47",
|
||||
"@vercel/redwood": "1.1.3",
|
||||
"@vercel/remix": "1.3.0",
|
||||
"@vercel/ruby": "1.3.63",
|
||||
"@vercel/static-build": "1.3.7"
|
||||
"@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.9",
|
||||
"@vercel/client": "12.4.0",
|
||||
"@vercel/error-utils": "1.0.8",
|
||||
"@vercel/frameworks": "1.3.0",
|
||||
"@vercel/fs-detectors": "3.7.12",
|
||||
"@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 });
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -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 * * *"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
2
packages/cli/test/integration.js
vendored
2
packages/cli/test/integration.js
vendored
@@ -2635,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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -285,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.9",
|
||||
"version": "12.4.0",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"homepage": "https://vercel.com",
|
||||
@@ -43,8 +43,8 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@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.12",
|
||||
"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.3",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"typescript": "4.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/gatsby-plugin-vercel-builder",
|
||||
"version": "1.1.5",
|
||||
"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.3",
|
||||
"@vercel/node": "2.9.4",
|
||||
"@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.5",
|
||||
"version": "2.3.7",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
|
||||
@@ -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.3",
|
||||
"@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.51",
|
||||
"version": "0.0.53",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -21,8 +21,8 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@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.4",
|
||||
"version": "3.4.7",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
||||
@@ -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.3",
|
||||
"@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 {
|
||||
@@ -775,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`
|
||||
@@ -785,6 +785,7 @@ export async function createLambdaFromPseudoLayers({
|
||||
files: baseFiles,
|
||||
layers,
|
||||
isStreaming,
|
||||
nextVersion,
|
||||
...lambdaOptions
|
||||
}: CreateLambdaFromPseudoLayersOptions) {
|
||||
await createLambdaSema.acquire();
|
||||
@@ -828,6 +829,10 @@ export async function createLambdaFromPseudoLayers({
|
||||
shouldAddHelpers: false,
|
||||
shouldAddSourcemapSupport: false,
|
||||
supportsMultiPayloads: !!process.env.NEXT_PRIVATE_MULTI_PAYLOAD,
|
||||
framework: {
|
||||
slug: 'nextjs',
|
||||
version: nextVersion,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1305,7 +1310,6 @@ export function addLocaleOrDefault(
|
||||
export type LambdaGroup = {
|
||||
pages: string[];
|
||||
memory?: number;
|
||||
cron?: Cron;
|
||||
maxDuration?: number;
|
||||
isStreaming?: boolean;
|
||||
isPrerenders?: boolean;
|
||||
@@ -1358,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({
|
||||
@@ -1376,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;
|
||||
@@ -2312,12 +2315,12 @@ interface EdgeFunctionMatcher {
|
||||
}
|
||||
|
||||
export async function getMiddlewareBundle({
|
||||
config = {},
|
||||
entryPath,
|
||||
outputDirectory,
|
||||
routesManifest,
|
||||
isCorrectMiddlewareOrder,
|
||||
prerenderBypassToken,
|
||||
nextVersion,
|
||||
}: {
|
||||
config: Config;
|
||||
entryPath: string;
|
||||
@@ -2325,6 +2328,7 @@ export async function getMiddlewareBundle({
|
||||
prerenderBypassToken: string;
|
||||
routesManifest: RoutesManifest;
|
||||
isCorrectMiddlewareOrder: boolean;
|
||||
nextVersion: string;
|
||||
}): Promise<{
|
||||
staticRoutes: Route[];
|
||||
dynamicRouteMap: Map<string, RouteWithSrc>;
|
||||
@@ -2375,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,
|
||||
@@ -2434,7 +2423,6 @@ export async function getMiddlewareBundle({
|
||||
);
|
||||
|
||||
return new EdgeFunction({
|
||||
...edgeFunctionOptions,
|
||||
deploymentTarget: 'v8-worker',
|
||||
name: edgeFunction.name,
|
||||
files: {
|
||||
@@ -2462,6 +2450,10 @@ export async function getMiddlewareBundle({
|
||||
path: `assets/${name}`,
|
||||
};
|
||||
}),
|
||||
framework: {
|
||||
slug: 'nextjs',
|
||||
version: nextVersion,
|
||||
},
|
||||
});
|
||||
})(),
|
||||
routeMatchers: getRouteMatchers(edgeFunction, routesManifest),
|
||||
|
||||
@@ -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.4",
|
||||
"version": "2.9.6",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
||||
@@ -31,9 +31,9 @@
|
||||
"dependencies": {
|
||||
"@edge-runtime/vm": "2.0.0",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@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",
|
||||
|
||||
@@ -424,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(
|
||||
@@ -475,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
|
||||
@@ -494,7 +491,6 @@ export const build: BuildV3 = async ({
|
||||
shouldAddSourcemapSupport,
|
||||
awsLambdaHandler,
|
||||
experimentalResponseStreaming,
|
||||
cron,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/python",
|
||||
"version": "3.1.47",
|
||||
"version": "3.1.49",
|
||||
"main": "./dist/index.js",
|
||||
"license": "MIT",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
|
||||
@@ -23,7 +23,7 @@
|
||||
"@types/execa": "^0.9.0",
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@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.3",
|
||||
"version": "1.1.5",
|
||||
"main": "./dist/index.js",
|
||||
"license": "MIT",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -20,14 +20,14 @@
|
||||
},
|
||||
"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.3",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"typescript": "4.3.4"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/remix",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.3",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -22,14 +22,14 @@
|
||||
"dependencies": {
|
||||
"@remix-run/dev": "1.12.0",
|
||||
"@vercel/nft": "0.22.5",
|
||||
"@vercel/static-config": "2.0.12",
|
||||
"@vercel/static-config": "2.0.13",
|
||||
"path-to-regexp": "6.2.1",
|
||||
"ts-morph": "12.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"typescript": "4.9.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,9 @@ module.exports = config;`;
|
||||
// If this is a dynamic route then add a Vercel route
|
||||
const keys: Key[] = [];
|
||||
// Replace "/*" at the end to handle "splat routes"
|
||||
const rePath = `/${path.replace(/\/\*$/, '/:params+')}`;
|
||||
const splatPath = '/:params+';
|
||||
const rePath =
|
||||
path === '*' ? splatPath : `/${path.replace(/\/\*$/, splatPath)}`;
|
||||
const re = pathToRegexp(rePath, keys);
|
||||
if (keys.length > 0) {
|
||||
routes.push({
|
||||
|
||||
6
packages/remix/test/fixtures/03-with-pnpm/app/routes/$.tsx
vendored
Normal file
6
packages/remix/test/fixtures/03-with-pnpm/app/routes/$.tsx
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { useParams } from "@remix-run/react";
|
||||
|
||||
export default function CatchAll() {
|
||||
const params = useParams();
|
||||
return <div>{params['*']}</div>;
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
{ "path": "/b", "mustContain": "B page" },
|
||||
{ "path": "/nested", "mustContain": "Nested index page" },
|
||||
{ "path": "/nested/another", "mustContain": "Nested another page" },
|
||||
{ "path": "/nested/index", "mustContain": "Not Found" },
|
||||
{ "path": "/asdf", "mustContain": "Not Found" }
|
||||
{ "path": "/nested/index", "mustContain": "<div>nested/index</div>" },
|
||||
{ "path": "/asdf", "mustContain": "<div>asdf</div>" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/routing-utils",
|
||||
"version": "2.1.8",
|
||||
"version": "2.1.9",
|
||||
"description": "Vercel routing utilities",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
||||
@@ -43,6 +43,10 @@ export type RouteWithSrc = {
|
||||
* Overrides a `middleware` definition.
|
||||
*/
|
||||
middlewarePath?: string;
|
||||
/**
|
||||
* The original middleware matchers.
|
||||
*/
|
||||
middlewareRawSrc?: string[];
|
||||
/**
|
||||
* A middleware index in the `middleware` key under the build result
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@vercel/ruby",
|
||||
"author": "Nathan Cahill <nathan@nathancahill.com>",
|
||||
"version": "1.3.63",
|
||||
"version": "1.3.65",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
|
||||
@@ -22,7 +22,7 @@
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "8.0.0",
|
||||
"@types/semver": "6.0.0",
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"execa": "2.0.4",
|
||||
"fs-extra": "^7.0.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/static-build",
|
||||
"version": "1.3.7",
|
||||
"version": "1.3.9",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/build-step",
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/gatsby-plugin-vercel-analytics": "1.0.7",
|
||||
"@vercel/gatsby-plugin-vercel-builder": "1.1.5"
|
||||
"@vercel/gatsby-plugin-vercel-builder": "1.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/aws-lambda": "8.10.64",
|
||||
@@ -42,12 +42,12 @@
|
||||
"@types/node-fetch": "2.5.4",
|
||||
"@types/promise-timeout": "1.3.0",
|
||||
"@types/semver": "7.3.13",
|
||||
"@vercel/build-utils": "6.2.3",
|
||||
"@vercel/frameworks": "1.3.0",
|
||||
"@vercel/fs-detectors": "3.7.12",
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/frameworks": "1.3.1",
|
||||
"@vercel/fs-detectors": "3.7.14",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/static-config": "2.0.12",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"@vercel/static-config": "2.0.13",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "10.0.0",
|
||||
"get-port": "5.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/static-config",
|
||||
"version": "2.0.12",
|
||||
"version": "2.0.13",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"repository": {
|
||||
|
||||
@@ -14,7 +14,6 @@ export const BaseFunctionConfigSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
runtime: { type: 'string' },
|
||||
cron: { type: 'string' },
|
||||
memory: { type: 'number' },
|
||||
maxDuration: { type: 'number' },
|
||||
regions: {
|
||||
|
||||
93
pnpm-lock.yaml
generated
93
pnpm-lock.yaml
generated
@@ -90,7 +90,7 @@ importers:
|
||||
'@vercel/frameworks': 1.3.0
|
||||
devDependencies:
|
||||
'@types/jest': 27.4.1
|
||||
'@vercel/frameworks': link:../packages/frameworks
|
||||
'@vercel/frameworks': 1.3.0
|
||||
|
||||
packages/build-utils:
|
||||
specifiers:
|
||||
@@ -204,23 +204,23 @@ importers:
|
||||
'@types/which': 1.3.2
|
||||
'@types/write-json-file': 2.2.1
|
||||
'@types/yauzl-promise': 2.1.0
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/client': 12.3.9
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/client': 12.4.0
|
||||
'@vercel/error-utils': 1.0.8
|
||||
'@vercel/frameworks': 1.3.0
|
||||
'@vercel/fs-detectors': 3.7.12
|
||||
'@vercel/frameworks': 1.3.1
|
||||
'@vercel/fs-detectors': 3.7.14
|
||||
'@vercel/fun': 1.0.4
|
||||
'@vercel/go': 2.3.5
|
||||
'@vercel/hydrogen': 0.0.51
|
||||
'@vercel/go': 2.3.7
|
||||
'@vercel/hydrogen': 0.0.53
|
||||
'@vercel/ncc': 0.24.0
|
||||
'@vercel/next': 3.4.4
|
||||
'@vercel/node': 2.9.4
|
||||
'@vercel/python': 3.1.47
|
||||
'@vercel/redwood': 1.1.3
|
||||
'@vercel/remix': 1.3.0
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
'@vercel/ruby': 1.3.63
|
||||
'@vercel/static-build': 1.3.7
|
||||
'@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/routing-utils': 2.1.9
|
||||
'@vercel/ruby': 1.3.65
|
||||
'@vercel/static-build': 1.3.9
|
||||
'@zeit/source-map-support': 0.6.2
|
||||
ajv: 6.12.2
|
||||
alpha-sort: 2.0.1
|
||||
@@ -446,8 +446,8 @@ importers:
|
||||
'@types/node-fetch': 2.5.4
|
||||
'@types/recursive-readdir': 2.2.0
|
||||
'@types/tar-fs': 1.16.1
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@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
|
||||
@@ -527,7 +527,7 @@ importers:
|
||||
'@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
|
||||
js-yaml: 3.13.1
|
||||
typescript: 4.3.4
|
||||
@@ -551,10 +551,10 @@ importers:
|
||||
'@types/minimatch': 3.0.5
|
||||
'@types/node': 14.18.33
|
||||
'@types/semver': 7.3.10
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@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
|
||||
@@ -599,9 +599,9 @@ importers:
|
||||
'@types/fs-extra': 11.0.1
|
||||
'@types/node': 14.18.33
|
||||
'@types/react': 18.0.26
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/node': 2.9.4
|
||||
'@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
|
||||
@@ -634,7 +634,7 @@ importers:
|
||||
'@types/node': 14.18.33
|
||||
'@types/node-fetch': ^2.3.0
|
||||
'@types/tar': ^4.0.0
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
async-retry: 1.3.1
|
||||
execa: ^1.0.0
|
||||
@@ -666,8 +666,8 @@ importers:
|
||||
specifiers:
|
||||
'@types/jest': 27.5.1
|
||||
'@types/node': 14.18.33
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@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
|
||||
@@ -697,9 +697,9 @@ importers:
|
||||
'@types/semver': 6.0.0
|
||||
'@types/text-table': 0.2.1
|
||||
'@types/webpack-sources': 3.2.0
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@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
|
||||
@@ -776,11 +776,11 @@ importers:
|
||||
'@types/node': 14.18.33
|
||||
'@types/node-fetch': ^2.6.1
|
||||
'@types/test-listen': 1.1.0
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
'@vercel/nft': 0.22.5
|
||||
'@vercel/node-bridge': 3.1.11
|
||||
'@vercel/static-config': 2.0.12
|
||||
'@vercel/static-config': 2.0.13
|
||||
content-type: 1.0.4
|
||||
cookie: 0.4.0
|
||||
edge-runtime: 2.0.0
|
||||
@@ -860,7 +860,7 @@ importers:
|
||||
'@types/execa': ^0.9.0
|
||||
'@types/jest': 27.4.1
|
||||
'@types/node': 14.18.33
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
execa: ^1.0.0
|
||||
typescript: 4.3.4
|
||||
@@ -878,9 +878,9 @@ importers:
|
||||
'@types/aws-lambda': 8.10.19
|
||||
'@types/node': 14.18.33
|
||||
'@types/semver': 6.0.0
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/nft': 0.22.5
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
'@vercel/routing-utils': 2.1.9
|
||||
execa: 3.2.0
|
||||
fs-extra: 11.1.0
|
||||
semver: 6.1.1
|
||||
@@ -903,9 +903,9 @@ importers:
|
||||
'@remix-run/dev': 1.12.0
|
||||
'@types/jest': 27.5.1
|
||||
'@types/node': 14.18.33
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/nft': 0.22.5
|
||||
'@vercel/static-config': 2.0.12
|
||||
'@vercel/static-config': 2.0.13
|
||||
path-to-regexp: 6.2.1
|
||||
ts-morph: 12.0.0
|
||||
typescript: 4.9.4
|
||||
@@ -960,7 +960,7 @@ importers:
|
||||
specifiers:
|
||||
'@types/fs-extra': 8.0.0
|
||||
'@types/semver': 6.0.0
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
execa: 2.0.4
|
||||
fs-extra: ^7.0.1
|
||||
@@ -987,14 +987,14 @@ importers:
|
||||
'@types/node-fetch': 2.5.4
|
||||
'@types/promise-timeout': 1.3.0
|
||||
'@types/semver': 7.3.13
|
||||
'@vercel/build-utils': 6.2.3
|
||||
'@vercel/frameworks': 1.3.0
|
||||
'@vercel/fs-detectors': 3.7.12
|
||||
'@vercel/build-utils': 6.3.0
|
||||
'@vercel/frameworks': 1.3.1
|
||||
'@vercel/fs-detectors': 3.7.14
|
||||
'@vercel/gatsby-plugin-vercel-analytics': 1.0.7
|
||||
'@vercel/gatsby-plugin-vercel-builder': 1.1.5
|
||||
'@vercel/gatsby-plugin-vercel-builder': 1.1.7
|
||||
'@vercel/ncc': 0.24.0
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
'@vercel/static-config': 2.0.12
|
||||
'@vercel/routing-utils': 2.1.9
|
||||
'@vercel/static-config': 2.0.13
|
||||
execa: 3.2.0
|
||||
fs-extra: 10.0.0
|
||||
get-port: 5.0.0
|
||||
@@ -7148,6 +7148,13 @@ packages:
|
||||
resolution: {integrity: sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ==}
|
||||
dev: false
|
||||
|
||||
/@vercel/frameworks/1.3.0:
|
||||
resolution: {integrity: sha512-guXALpQLhL0bCvIjUhHbYFyS8XusZQ6RtjqCTq0eJM6p8QLun4DI1TToqbIah/o7DY3s+RAyC2OUyOAY91qH4w==}
|
||||
dependencies:
|
||||
'@iarna/toml': 2.2.3
|
||||
js-yaml: 3.13.1
|
||||
dev: true
|
||||
|
||||
/@vercel/fun/1.0.4:
|
||||
resolution: {integrity: sha512-zLY2d1U9JJm3CorfEcuZ7307fo77/Z/mU12LDJpSGtdpjzxgpxMlU5NPq8whz8hIZhIMkBJv0DqZ5bgenktQnw==}
|
||||
engines: {node: '>= 10'}
|
||||
|
||||
4
utils/update-next.js
vendored
4
utils/update-next.js
vendored
@@ -58,8 +58,8 @@ module.exports = async ({ github, context }) => {
|
||||
pull_number: pr.data.number,
|
||||
reviewers: ['ijjk', 'styfle'],
|
||||
});
|
||||
|
||||
github.rest.issues.addLabels({
|
||||
|
||||
await github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: pr.data.number,
|
||||
|
||||
2
utils/update-turbo.js
vendored
2
utils/update-turbo.js
vendored
@@ -54,7 +54,7 @@ module.exports = async ({ github, context }) => {
|
||||
body: `This auto-generated PR updates Turbo to version ${newVersion}`,
|
||||
});
|
||||
|
||||
github.rest.issues.addLabels({
|
||||
await github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: pr.data.number,
|
||||
|
||||
Reference in New Issue
Block a user