@vercel/build-utils 2.14.1-canary.3 → 2.14.1-canary.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,12 +22,13 @@ ncc: Using typescript@4.3.4 (local user-provided)
22
22
  1kB dist/main/file-fs-ref.d.ts
23
23
  1kB dist/main/file-blob.d.ts
24
24
  1kB dist/main/errors.d.ts
25
+ 1kB dist/main/edge-function.d.ts
25
26
  1kB dist/main/detect-file-system-api.d.ts
26
27
  1kB dist/main/detect-builders.d.ts
27
28
  2kB dist/main/lambda.d.ts
28
- 2kB dist/main/index.d.ts
29
29
  2kB dist/main/detectors/filesystem.d.ts
30
+ 3kB dist/main/index.d.ts
30
31
  4kB dist/main/fs/run-user-scripts.d.ts
31
- 10kB dist/main/types.d.ts
32
- 1232kB dist/main/index.js
33
- 1261kB [9158ms] - ncc 0.24.0
32
+ 9kB dist/main/types.d.ts
33
+ 1235kB dist/main/index.js
34
+ 1265kB [7455ms] - ncc 0.24.0
@@ -0,0 +1,30 @@
1
+ import type { Files } from './types';
2
+ /**
3
+ * An Edge Functions output
4
+ */
5
+ export declare class EdgeFunction {
6
+ type: 'EdgeFunction';
7
+ /**
8
+ * A display name for the edge function.
9
+ */
10
+ name: string;
11
+ /**
12
+ * The deployment target.
13
+ * Only v8-worker is currently supported.
14
+ */
15
+ deploymentTarget: 'v8-worker';
16
+ /**
17
+ * The entrypoint for the edge function.
18
+ */
19
+ entrypoint: string;
20
+ /**
21
+ * The list of files to be included in the edge function bundle.
22
+ */
23
+ files: Files;
24
+ /**
25
+ * Extra environment variables in use for the user code, to be
26
+ * assigned to the edge function.
27
+ */
28
+ envVarsInUse?: string[];
29
+ constructor(params: Omit<EdgeFunction, 'type'>);
30
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EdgeFunction = void 0;
4
+ /**
5
+ * An Edge Functions output
6
+ */
7
+ class EdgeFunction {
8
+ constructor(params) {
9
+ this.type = 'EdgeFunction';
10
+ this.name = params.name;
11
+ this.deploymentTarget = params.deploymentTarget;
12
+ this.entrypoint = params.entrypoint;
13
+ this.files = params.files;
14
+ this.envVarsInUse = params.envVarsInUse;
15
+ }
16
+ }
17
+ exports.EdgeFunction = EdgeFunction;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { File } from './types';
2
+ import { FileBase } from './types';
3
3
  interface FileBlobOptions {
4
4
  mode?: number;
5
5
  contentType?: string;
@@ -10,13 +10,14 @@ interface FromStreamOptions {
10
10
  contentType?: string;
11
11
  stream: NodeJS.ReadableStream;
12
12
  }
13
- export default class FileBlob implements File {
13
+ export default class FileBlob implements FileBase {
14
14
  type: 'FileBlob';
15
15
  mode: number;
16
16
  data: string | Buffer;
17
17
  contentType: string | undefined;
18
18
  constructor({ mode, contentType, data }: FileBlobOptions);
19
19
  static fromStream({ mode, contentType, stream, }: FromStreamOptions): Promise<FileBlob>;
20
+ toStreamAsync(): Promise<NodeJS.ReadableStream>;
20
21
  toStream(): NodeJS.ReadableStream;
21
22
  }
22
23
  export {};
package/dist/file-blob.js CHANGED
@@ -26,6 +26,9 @@ class FileBlob {
26
26
  const data = Buffer.concat(chunks);
27
27
  return new FileBlob({ mode, contentType, data });
28
28
  }
29
+ async toStreamAsync() {
30
+ return this.toStream();
31
+ }
29
32
  toStream() {
30
33
  return into_stream_1.default(this.data);
31
34
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { File } from './types';
2
+ import { FileBase } from './types';
3
3
  interface FileFsRefOptions {
4
4
  mode?: number;
5
5
  contentType?: string;
@@ -11,7 +11,7 @@ interface FromStreamOptions {
11
11
  stream: NodeJS.ReadableStream;
12
12
  fsPath: string;
13
13
  }
14
- declare class FileFsRef implements File {
14
+ declare class FileFsRef implements FileBase {
15
15
  type: 'FileFsRef';
16
16
  mode: number;
17
17
  fsPath: string;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="node" />
2
- import { File } from './types';
2
+ import { FileBase } from './types';
3
3
  interface FileRefOptions {
4
4
  mode?: number;
5
5
  digest: string;
6
6
  contentType?: string;
7
7
  mutable?: boolean;
8
8
  }
9
- export default class FileRef implements File {
9
+ export default class FileRef implements FileBase {
10
10
  type: 'FileRef';
11
11
  mode: number;
12
12
  digest: string;
@@ -8,26 +8,38 @@ const path_1 = __importDefault(require("path"));
8
8
  const debug_1 = __importDefault(require("../debug"));
9
9
  const file_fs_ref_1 = __importDefault(require("../file-fs-ref"));
10
10
  const fs_extra_1 = require("fs-extra");
11
+ const stream_to_buffer_1 = __importDefault(require("./stream-to-buffer"));
11
12
  const S_IFMT = 61440; /* 0170000 type of file */
12
13
  const S_IFLNK = 40960; /* 0120000 symbolic link */
13
14
  function isSymbolicLink(mode) {
14
15
  return (mode & S_IFMT) === S_IFLNK;
15
16
  }
16
17
  exports.isSymbolicLink = isSymbolicLink;
18
+ async function prepareSymlinkTarget(file, fsPath) {
19
+ const mkdirPromise = fs_extra_1.mkdirp(path_1.default.dirname(fsPath));
20
+ if (file.type === 'FileFsRef') {
21
+ const [target] = await Promise.all([fs_extra_1.readlink(file.fsPath), mkdirPromise]);
22
+ return target;
23
+ }
24
+ if (file.type === 'FileRef' || file.type === 'FileBlob') {
25
+ const targetPathBufferPromise = await stream_to_buffer_1.default(await file.toStreamAsync());
26
+ const [targetPathBuffer] = await Promise.all([
27
+ targetPathBufferPromise,
28
+ mkdirPromise,
29
+ ]);
30
+ return targetPathBuffer.toString('utf8');
31
+ }
32
+ throw new Error(`file.type "${file.type}" not supported for symlink`);
33
+ }
17
34
  async function downloadFile(file, fsPath) {
18
35
  const { mode } = file;
19
- if (mode && isSymbolicLink(mode) && file.type === 'FileFsRef') {
20
- const [target] = await Promise.all([
21
- fs_extra_1.readlink(file.fsPath),
22
- fs_extra_1.mkdirp(path_1.default.dirname(fsPath)),
23
- ]);
36
+ if (isSymbolicLink(mode)) {
37
+ const target = await prepareSymlinkTarget(file, fsPath);
24
38
  await fs_extra_1.symlink(target, fsPath);
25
39
  return file_fs_ref_1.default.fromFsPath({ mode, fsPath });
26
40
  }
27
- else {
28
- const stream = file.toStream();
29
- return file_fs_ref_1.default.fromStream({ mode, stream, fsPath });
30
- }
41
+ const stream = file.toStream();
42
+ return file_fs_ref_1.default.fromStream({ mode, stream, fsPath });
31
43
  }
32
44
  async function removeFile(basePath, fileMatched) {
33
45
  const file = path_1.default.join(basePath, fileMatched);
@@ -320,6 +320,9 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
320
320
  if (cliType === 'npm') {
321
321
  opts.prettyCommand = `npm run ${scriptName}`;
322
322
  }
323
+ else if (cliType === 'pnpm') {
324
+ opts.prettyCommand = `pnpm run ${scriptName}`;
325
+ }
323
326
  else {
324
327
  opts.prettyCommand = `yarn run ${scriptName}`;
325
328
  }
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ import debug from './debug';
16
16
  import getIgnoreFilter from './get-ignore-filter';
17
17
  import { getPlatformEnv } from './get-platform-env';
18
18
  export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, execAsync, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, streamToBuffer, shouldServe, debug, isSymbolicLink, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, };
19
+ export { EdgeFunction } from './edge-function';
19
20
  export { detectBuilders, detectOutputDirectory, detectApiDirectory, detectApiExtensions, } from './detect-builders';
20
21
  export { detectFileSystemAPI } from './detect-file-system-api';
21
22
  export { detectFramework } from './detect-framework';
package/dist/index.js CHANGED
@@ -26617,6 +26617,7 @@ exports.frameworks = [
26617
26617
  slug: 'nextjs',
26618
26618
  demo: 'https://nextjs-template.vercel.app',
26619
26619
  logo: 'https://raw.githubusercontent.com/vercel/vercel/main/packages/frameworks/logos/next.svg',
26620
+ screenshot: 'https://assets.vercel.com/image/upload/v1647366075/front/import/nextjs.png',
26620
26621
  tagline: 'Next.js makes you productive with React instantly — whether you want to build static or dynamic sites.',
26621
26622
  description: 'A Next.js app and a Serverless Function API.',
26622
26623
  website: 'https://nextjs.org',
@@ -27613,6 +27614,7 @@ exports.frameworks = [
27613
27614
  slug: 'sveltekit',
27614
27615
  demo: 'https://sveltekit-template.vercel.app',
27615
27616
  logo: 'https://raw.githubusercontent.com/vercel/vercel/main/packages/frameworks/logos/svelte.svg',
27617
+ screenshot: 'https://assets.vercel.com/image/upload/v1647366075/front/import/sveltekit.png',
27616
27618
  tagline: 'SvelteKit is a framework for building web applications of all sizes.',
27617
27619
  description: 'A SvelteKit app optimized Edge-first.',
27618
27620
  website: 'https://kit.svelte.dev',
@@ -28122,6 +28124,7 @@ exports.frameworks = [
28122
28124
  slug: 'nuxtjs',
28123
28125
  demo: 'https://nuxtjs-template.vercel.app',
28124
28126
  logo: 'https://raw.githubusercontent.com/vercel/vercel/main/packages/frameworks/logos/nuxt.svg',
28127
+ screenshot: 'https://assets.vercel.com/image/upload/v1647366075/front/import/nuxtjs.png',
28125
28128
  tagline: 'Nuxt.js is the web comprehensive framework that lets you dream big with Vue.js.',
28126
28129
  description: 'A Nuxt.js app, bootstrapped with create-nuxt-app.',
28127
28130
  website: 'https://nuxtjs.org',
@@ -28255,7 +28258,7 @@ exports.frameworks = [
28255
28258
  }));
28256
28259
  return (config && config.publishDir) || 'public';
28257
28260
  },
28258
- defaultVersion: '0.92.2',
28261
+ defaultVersion: '0.64.0',
28259
28262
  },
28260
28263
  {
28261
28264
  name: 'Jekyll',
@@ -33932,6 +33935,31 @@ class DetectorFilesystem {
33932
33935
  exports.DetectorFilesystem = DetectorFilesystem;
33933
33936
 
33934
33937
 
33938
+ /***/ }),
33939
+
33940
+ /***/ 8038:
33941
+ /***/ ((__unused_webpack_module, exports) => {
33942
+
33943
+ "use strict";
33944
+
33945
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
33946
+ exports.EdgeFunction = void 0;
33947
+ /**
33948
+ * An Edge Functions output
33949
+ */
33950
+ class EdgeFunction {
33951
+ constructor(params) {
33952
+ this.type = 'EdgeFunction';
33953
+ this.name = params.name;
33954
+ this.deploymentTarget = params.deploymentTarget;
33955
+ this.entrypoint = params.entrypoint;
33956
+ this.files = params.files;
33957
+ this.envVarsInUse = params.envVarsInUse;
33958
+ }
33959
+ }
33960
+ exports.EdgeFunction = EdgeFunction;
33961
+
33962
+
33935
33963
  /***/ }),
33936
33964
 
33937
33965
  /***/ 3983:
@@ -34060,6 +34088,9 @@ class FileBlob {
34060
34088
  const data = Buffer.concat(chunks);
34061
34089
  return new FileBlob({ mode, contentType, data });
34062
34090
  }
34091
+ async toStreamAsync() {
34092
+ return this.toStream();
34093
+ }
34063
34094
  toStream() {
34064
34095
  return into_stream_1.default(this.data);
34065
34096
  }
@@ -34254,26 +34285,38 @@ const path_1 = __importDefault(__webpack_require__(5622));
34254
34285
  const debug_1 = __importDefault(__webpack_require__(1868));
34255
34286
  const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
34256
34287
  const fs_extra_1 = __webpack_require__(5392);
34288
+ const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
34257
34289
  const S_IFMT = 61440; /* 0170000 type of file */
34258
34290
  const S_IFLNK = 40960; /* 0120000 symbolic link */
34259
34291
  function isSymbolicLink(mode) {
34260
34292
  return (mode & S_IFMT) === S_IFLNK;
34261
34293
  }
34262
34294
  exports.isSymbolicLink = isSymbolicLink;
34295
+ async function prepareSymlinkTarget(file, fsPath) {
34296
+ const mkdirPromise = fs_extra_1.mkdirp(path_1.default.dirname(fsPath));
34297
+ if (file.type === 'FileFsRef') {
34298
+ const [target] = await Promise.all([fs_extra_1.readlink(file.fsPath), mkdirPromise]);
34299
+ return target;
34300
+ }
34301
+ if (file.type === 'FileRef' || file.type === 'FileBlob') {
34302
+ const targetPathBufferPromise = await stream_to_buffer_1.default(await file.toStreamAsync());
34303
+ const [targetPathBuffer] = await Promise.all([
34304
+ targetPathBufferPromise,
34305
+ mkdirPromise,
34306
+ ]);
34307
+ return targetPathBuffer.toString('utf8');
34308
+ }
34309
+ throw new Error(`file.type "${file.type}" not supported for symlink`);
34310
+ }
34263
34311
  async function downloadFile(file, fsPath) {
34264
34312
  const { mode } = file;
34265
- if (mode && isSymbolicLink(mode) && file.type === 'FileFsRef') {
34266
- const [target] = await Promise.all([
34267
- fs_extra_1.readlink(file.fsPath),
34268
- fs_extra_1.mkdirp(path_1.default.dirname(fsPath)),
34269
- ]);
34313
+ if (isSymbolicLink(mode)) {
34314
+ const target = await prepareSymlinkTarget(file, fsPath);
34270
34315
  await fs_extra_1.symlink(target, fsPath);
34271
34316
  return file_fs_ref_1.default.fromFsPath({ mode, fsPath });
34272
34317
  }
34273
- else {
34274
- const stream = file.toStream();
34275
- return file_fs_ref_1.default.fromStream({ mode, stream, fsPath });
34276
- }
34318
+ const stream = file.toStream();
34319
+ return file_fs_ref_1.default.fromStream({ mode, stream, fsPath });
34277
34320
  }
34278
34321
  async function removeFile(basePath, fileMatched) {
34279
34322
  const file = path_1.default.join(basePath, fileMatched);
@@ -34891,6 +34934,9 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
34891
34934
  if (cliType === 'npm') {
34892
34935
  opts.prettyCommand = `npm run ${scriptName}`;
34893
34936
  }
34937
+ else if (cliType === 'pnpm') {
34938
+ opts.prettyCommand = `pnpm run ${scriptName}`;
34939
+ }
34894
34940
  else {
34895
34941
  opts.prettyCommand = `yarn run ${scriptName}`;
34896
34942
  }
@@ -35109,7 +35155,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35109
35155
  return (mod && mod.__esModule) ? mod : { "default": mod };
35110
35156
  };
35111
35157
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35112
- exports.isStaticRuntime = exports.isOfficialRuntime = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.shouldServe = exports.streamToBuffer = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
35158
+ exports.isStaticRuntime = exports.isOfficialRuntime = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.shouldServe = exports.streamToBuffer = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
35113
35159
  const file_blob_1 = __importDefault(__webpack_require__(2397));
35114
35160
  exports.FileBlob = file_blob_1.default;
35115
35161
  const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
@@ -35165,6 +35211,8 @@ const get_ignore_filter_1 = __importDefault(__webpack_require__(1148));
35165
35211
  exports.getIgnoreFilter = get_ignore_filter_1.default;
35166
35212
  const get_platform_env_1 = __webpack_require__(4678);
35167
35213
  Object.defineProperty(exports, "getPlatformEnv", ({ enumerable: true, get: function () { return get_platform_env_1.getPlatformEnv; } }));
35214
+ var edge_function_1 = __webpack_require__(8038);
35215
+ Object.defineProperty(exports, "EdgeFunction", ({ enumerable: true, get: function () { return edge_function_1.EdgeFunction; } }));
35168
35216
  var detect_builders_1 = __webpack_require__(4246);
35169
35217
  Object.defineProperty(exports, "detectBuilders", ({ enumerable: true, get: function () { return detect_builders_1.detectBuilders; } }));
35170
35218
  Object.defineProperty(exports, "detectOutputDirectory", ({ enumerable: true, get: function () { return detect_builders_1.detectOutputDirectory; } }));
@@ -35223,7 +35271,7 @@ const download_1 = __webpack_require__(1611);
35223
35271
  const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
35224
35272
  class Lambda {
35225
35273
  constructor(opts) {
35226
- const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, } = opts;
35274
+ const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, } = opts;
35227
35275
  if ('files' in opts) {
35228
35276
  assert_1.default(typeof opts.files === 'object', '"files" must be an object');
35229
35277
  }
@@ -35243,6 +35291,9 @@ class Lambda {
35243
35291
  assert_1.default(Array.isArray(allowQuery), '"allowQuery" is not an Array');
35244
35292
  assert_1.default(allowQuery.every(q => typeof q === 'string'), '"allowQuery" is not a string Array');
35245
35293
  }
35294
+ if (supportsMultiPayloads !== undefined) {
35295
+ assert_1.default(typeof supportsMultiPayloads === 'boolean', '"supportsMultiPayloads" is not a boolean');
35296
+ }
35246
35297
  if (regions !== undefined) {
35247
35298
  assert_1.default(Array.isArray(regions), '"regions" is not an Array');
35248
35299
  assert_1.default(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
@@ -35257,6 +35308,7 @@ class Lambda {
35257
35308
  this.allowQuery = allowQuery;
35258
35309
  this.regions = regions;
35259
35310
  this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
35311
+ this.supportsMultiPayloads = supportsMultiPayloads;
35260
35312
  }
35261
35313
  async createZip() {
35262
35314
  let { zipBuffer } = this;
package/dist/lambda.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { Files, Config } from './types';
2
+ import type { Files, Config } from './types';
3
3
  interface Environment {
4
4
  [key: string]: string;
5
5
  }
@@ -12,6 +12,7 @@ export interface LambdaOptionsBase {
12
12
  environment?: Environment;
13
13
  allowQuery?: string[];
14
14
  regions?: string[];
15
+ supportsMultiPayloads?: boolean;
15
16
  }
16
17
  export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
17
18
  files: Files;
@@ -43,6 +44,7 @@ export declare class Lambda {
43
44
  * @deprecated Use `await lambda.createZip()` instead.
44
45
  */
45
46
  zipBuffer?: Buffer;
47
+ supportsMultiPayloads?: boolean;
46
48
  constructor(opts: LambdaOptions);
47
49
  createZip(): Promise<Buffer>;
48
50
  }
package/dist/lambda.js CHANGED
@@ -13,7 +13,7 @@ const download_1 = require("./fs/download");
13
13
  const stream_to_buffer_1 = __importDefault(require("./fs/stream-to-buffer"));
14
14
  class Lambda {
15
15
  constructor(opts) {
16
- const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, } = opts;
16
+ const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, } = opts;
17
17
  if ('files' in opts) {
18
18
  assert_1.default(typeof opts.files === 'object', '"files" must be an object');
19
19
  }
@@ -33,6 +33,9 @@ class Lambda {
33
33
  assert_1.default(Array.isArray(allowQuery), '"allowQuery" is not an Array');
34
34
  assert_1.default(allowQuery.every(q => typeof q === 'string'), '"allowQuery" is not a string Array');
35
35
  }
36
+ if (supportsMultiPayloads !== undefined) {
37
+ assert_1.default(typeof supportsMultiPayloads === 'boolean', '"supportsMultiPayloads" is not a boolean');
38
+ }
36
39
  if (regions !== undefined) {
37
40
  assert_1.default(Array.isArray(regions), '"regions" is not an Array');
38
41
  assert_1.default(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
@@ -47,6 +50,7 @@ class Lambda {
47
50
  this.allowQuery = allowQuery;
48
51
  this.regions = regions;
49
52
  this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
53
+ this.supportsMultiPayloads = supportsMultiPayloads;
50
54
  }
51
55
  async createZip() {
52
56
  let { zipBuffer } = this;
@@ -1,11 +1,9 @@
1
- import FileBlob from './file-blob';
2
- import FileFsRef from './file-fs-ref';
3
- import FileRef from './file-ref';
1
+ import { File } from './types';
4
2
  import { Lambda } from './lambda';
5
3
  interface PrerenderOptions {
6
4
  expiration: number | false;
7
5
  lambda: Lambda;
8
- fallback: FileBlob | FileFsRef | FileRef | null;
6
+ fallback: File | null;
9
7
  group?: number;
10
8
  bypassToken?: string | null;
11
9
  allowQuery?: string[];
@@ -14,7 +12,7 @@ export declare class Prerender {
14
12
  type: 'Prerender';
15
13
  expiration: number | false;
16
14
  lambda: Lambda;
17
- fallback: FileBlob | FileFsRef | FileRef | null;
15
+ fallback: File | null;
18
16
  group?: number;
19
17
  bypassToken: string | null;
20
18
  allowQuery?: string[];
package/dist/types.d.ts CHANGED
@@ -1,29 +1,25 @@
1
1
  /// <reference types="node" />
2
- import FileRef from './file-ref';
3
- import FileFsRef from './file-fs-ref';
4
- import { Lambda } from './lambda';
5
- import { Prerender } from './prerender';
2
+ import type FileRef from './file-ref';
3
+ import type FileFsRef from './file-fs-ref';
4
+ import type FileBlob from './file-blob';
5
+ import type { Lambda } from './lambda';
6
+ import type { Prerender } from './prerender';
7
+ import type { EdgeFunction } from './edge-function';
6
8
  export interface Env {
7
9
  [name: string]: string | undefined;
8
10
  }
9
- export interface File {
11
+ export declare type File = FileRef | FileFsRef | FileBlob;
12
+ export interface FileBase {
10
13
  type: string;
11
14
  mode: number;
12
15
  contentType?: string;
13
16
  toStream: () => NodeJS.ReadableStream;
14
17
  toStreamAsync?: () => Promise<NodeJS.ReadableStream>;
15
- /**
16
- * The absolute path to the file in the filesystem
17
- */
18
- fsPath?: string;
19
18
  }
20
19
  export interface Files {
21
20
  [filePath: string]: File;
22
21
  }
23
22
  export interface Config {
24
- [key: string]: string | string[] | boolean | number | {
25
- [key: string]: string;
26
- } | BuilderFunctions | ProjectSettings | undefined | null;
27
23
  maxLambdaSize?: string;
28
24
  includeFiles?: string | string[];
29
25
  excludeFiles?: string | string[];
@@ -44,6 +40,7 @@ export interface Config {
44
40
  devCommand?: string;
45
41
  framework?: string | null;
46
42
  nodeVersion?: string;
43
+ [key: string]: unknown;
47
44
  }
48
45
  export interface Meta {
49
46
  isDev?: boolean;
@@ -55,31 +52,7 @@ export interface Meta {
55
52
  env?: Env;
56
53
  buildEnv?: Env;
57
54
  avoidTopLevelInstall?: boolean;
58
- }
59
- export interface AnalyzeOptions {
60
- /**
61
- * All source files of the project
62
- */
63
- files: {
64
- [filePath: string]: FileRef;
65
- };
66
- /**
67
- * Name of entrypoint file for this particular build job. Value
68
- * `files[entrypoint]` is guaranteed to exist and be a valid File reference.
69
- * `entrypoint` is always a discrete file and never a glob, since globs are
70
- * expanded into separate builds at deployment time.
71
- */
72
- entrypoint: string;
73
- /**
74
- * A writable temporary directory where you are encouraged to perform your
75
- * build process. This directory will be populated with the restored cache.
76
- */
77
- workPath: string;
78
- /**
79
- * An arbitrary object passed by the user in the build definition defined
80
- * in `vercel.json`.
81
- */
82
- config: Config;
55
+ [key: string]: unknown;
83
56
  }
84
57
  export interface BuildOptions {
85
58
  /**
@@ -343,7 +316,7 @@ export interface BuildResultV2 {
343
316
  routes?: any[];
344
317
  images?: Images;
345
318
  output: {
346
- [key: string]: File | Lambda | Prerender;
319
+ [key: string]: FileBase | Lambda | Prerender | EdgeFunction;
347
320
  };
348
321
  wildcard?: Array<{
349
322
  domain: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "2.14.1-canary.3",
3
+ "version": "2.14.1-canary.6",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -30,7 +30,7 @@
30
30
  "@types/node-fetch": "^2.1.6",
31
31
  "@types/semver": "6.0.0",
32
32
  "@types/yazl": "^2.4.1",
33
- "@vercel/frameworks": "0.6.1-canary.2",
33
+ "@vercel/frameworks": "0.6.1-canary.5",
34
34
  "@vercel/ncc": "0.24.0",
35
35
  "aggregate-error": "3.0.1",
36
36
  "async-retry": "1.2.3",
@@ -49,5 +49,5 @@
49
49
  "typescript": "4.3.4",
50
50
  "yazl": "2.4.3"
51
51
  },
52
- "gitHead": "a17f3a96ec12483a28667894dcdc3bb57675ead3"
52
+ "gitHead": "9dde99f19ef62f7ea8addc19fab9a1ff025aa4ae"
53
53
  }