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

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
32
  10kB dist/main/types.d.ts
32
- 1232kB dist/main/index.js
33
- 1261kB [9158ms] - ncc 0.24.0
33
+ 1234kB dist/main/index.js
34
+ 1265kB [7426ms] - 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;
@@ -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
@@ -33932,6 +33932,31 @@ class DetectorFilesystem {
33932
33932
  exports.DetectorFilesystem = DetectorFilesystem;
33933
33933
 
33934
33934
 
33935
+ /***/ }),
33936
+
33937
+ /***/ 8038:
33938
+ /***/ ((__unused_webpack_module, exports) => {
33939
+
33940
+ "use strict";
33941
+
33942
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
33943
+ exports.EdgeFunction = void 0;
33944
+ /**
33945
+ * An Edge Functions output
33946
+ */
33947
+ class EdgeFunction {
33948
+ constructor(params) {
33949
+ this.type = 'EdgeFunction';
33950
+ this.name = params.name;
33951
+ this.deploymentTarget = params.deploymentTarget;
33952
+ this.entrypoint = params.entrypoint;
33953
+ this.files = params.files;
33954
+ this.envVarsInUse = params.envVarsInUse;
33955
+ }
33956
+ }
33957
+ exports.EdgeFunction = EdgeFunction;
33958
+
33959
+
33935
33960
  /***/ }),
33936
33961
 
33937
33962
  /***/ 3983:
@@ -34891,6 +34916,9 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts) {
34891
34916
  if (cliType === 'npm') {
34892
34917
  opts.prettyCommand = `npm run ${scriptName}`;
34893
34918
  }
34919
+ else if (cliType === 'pnpm') {
34920
+ opts.prettyCommand = `pnpm run ${scriptName}`;
34921
+ }
34894
34922
  else {
34895
34923
  opts.prettyCommand = `yarn run ${scriptName}`;
34896
34924
  }
@@ -35109,7 +35137,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35109
35137
  return (mod && mod.__esModule) ? mod : { "default": mod };
35110
35138
  };
35111
35139
  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;
35140
+ 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
35141
  const file_blob_1 = __importDefault(__webpack_require__(2397));
35114
35142
  exports.FileBlob = file_blob_1.default;
35115
35143
  const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
@@ -35165,6 +35193,8 @@ const get_ignore_filter_1 = __importDefault(__webpack_require__(1148));
35165
35193
  exports.getIgnoreFilter = get_ignore_filter_1.default;
35166
35194
  const get_platform_env_1 = __webpack_require__(4678);
35167
35195
  Object.defineProperty(exports, "getPlatformEnv", ({ enumerable: true, get: function () { return get_platform_env_1.getPlatformEnv; } }));
35196
+ var edge_function_1 = __webpack_require__(8038);
35197
+ Object.defineProperty(exports, "EdgeFunction", ({ enumerable: true, get: function () { return edge_function_1.EdgeFunction; } }));
35168
35198
  var detect_builders_1 = __webpack_require__(4246);
35169
35199
  Object.defineProperty(exports, "detectBuilders", ({ enumerable: true, get: function () { return detect_builders_1.detectBuilders; } }));
35170
35200
  Object.defineProperty(exports, "detectOutputDirectory", ({ enumerable: true, get: function () { return detect_builders_1.detectOutputDirectory; } }));
@@ -35223,7 +35253,7 @@ const download_1 = __webpack_require__(1611);
35223
35253
  const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
35224
35254
  class Lambda {
35225
35255
  constructor(opts) {
35226
- const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, } = opts;
35256
+ const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, } = opts;
35227
35257
  if ('files' in opts) {
35228
35258
  assert_1.default(typeof opts.files === 'object', '"files" must be an object');
35229
35259
  }
@@ -35243,6 +35273,9 @@ class Lambda {
35243
35273
  assert_1.default(Array.isArray(allowQuery), '"allowQuery" is not an Array');
35244
35274
  assert_1.default(allowQuery.every(q => typeof q === 'string'), '"allowQuery" is not a string Array');
35245
35275
  }
35276
+ if (supportsMultiPayloads !== undefined) {
35277
+ assert_1.default(typeof supportsMultiPayloads === 'boolean', '"supportsMultiPayloads" is not a boolean');
35278
+ }
35246
35279
  if (regions !== undefined) {
35247
35280
  assert_1.default(Array.isArray(regions), '"regions" is not an Array');
35248
35281
  assert_1.default(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
@@ -35257,6 +35290,7 @@ class Lambda {
35257
35290
  this.allowQuery = allowQuery;
35258
35291
  this.regions = regions;
35259
35292
  this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
35293
+ this.supportsMultiPayloads = supportsMultiPayloads;
35260
35294
  }
35261
35295
  async createZip() {
35262
35296
  let { zipBuffer } = this;
package/dist/lambda.d.ts CHANGED
@@ -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;
package/dist/types.d.ts CHANGED
@@ -1,8 +1,9 @@
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 { Lambda } from './lambda';
5
+ import type { Prerender } from './prerender';
6
+ import type { EdgeFunction } from './edge-function';
6
7
  export interface Env {
7
8
  [name: string]: string | undefined;
8
9
  }
@@ -343,7 +344,7 @@ export interface BuildResultV2 {
343
344
  routes?: any[];
344
345
  images?: Images;
345
346
  output: {
346
- [key: string]: File | Lambda | Prerender;
347
+ [key: string]: File | Lambda | Prerender | EdgeFunction;
347
348
  };
348
349
  wildcard?: Array<{
349
350
  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.4",
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.3",
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": "a24fd64bce88d5025c52ac7dfbdc3c0f457de077"
53
53
  }