@vercel/build-utils
Advanced tools
Comparing version 7.5.0 to 7.5.1
# @vercel/build-utils | ||
## 7.5.1 | ||
### Patch Changes | ||
- Add experimental field to Lambda and size to FileFsRef output ([#11059](https://github.com/vercel/vercel/pull/11059)) | ||
## 7.5.0 | ||
@@ -4,0 +10,0 @@ |
@@ -7,2 +7,3 @@ /// <reference types="node" /> | ||
fsPath: string; | ||
size?: number; | ||
} | ||
@@ -19,5 +20,6 @@ interface FromStreamOptions { | ||
fsPath: string; | ||
size?: number; | ||
contentType: string | undefined; | ||
constructor({ mode, contentType, fsPath }: FileFsRefOptions); | ||
static fromFsPath({ mode, contentType, fsPath, }: FileFsRefOptions): Promise<FileFsRef>; | ||
constructor({ mode, contentType, fsPath, size, }: FileFsRefOptions); | ||
static fromFsPath({ mode, contentType, fsPath, size, }: FileFsRefOptions): Promise<FileFsRef>; | ||
static fromStream({ mode, contentType, stream, fsPath, }: FromStreamOptions): Promise<FileFsRef>; | ||
@@ -24,0 +26,0 @@ toStreamAsync(): Promise<NodeJS.ReadableStream>; |
@@ -41,3 +41,8 @@ "use strict"; | ||
class FileFsRef { | ||
constructor({ mode = 33188, contentType, fsPath }) { | ||
constructor({ | ||
mode = 33188, | ||
contentType, | ||
fsPath, | ||
size | ||
}) { | ||
(0, import_assert.default)(typeof mode === "number"); | ||
@@ -49,2 +54,3 @@ (0, import_assert.default)(typeof fsPath === "string"); | ||
this.fsPath = fsPath; | ||
this.size = size; | ||
} | ||
@@ -54,10 +60,13 @@ static async fromFsPath({ | ||
contentType, | ||
fsPath | ||
fsPath, | ||
size | ||
}) { | ||
let m = mode; | ||
if (!m) { | ||
let s = size; | ||
if (!m || typeof s === "undefined") { | ||
const stat = await import_fs_extra.default.lstat(fsPath); | ||
m = stat.mode; | ||
s = stat.size; | ||
} | ||
return new FileFsRef({ mode: m, contentType, fsPath }); | ||
return new FileFsRef({ mode: m, contentType, fsPath, size: s }); | ||
} | ||
@@ -83,3 +92,3 @@ static async fromStream({ | ||
}); | ||
return new FileFsRef({ mode, contentType, fsPath }); | ||
return FileFsRef.fromFsPath({ mode, contentType, fsPath }); | ||
} | ||
@@ -86,0 +95,0 @@ async toStreamAsync() { |
@@ -29,2 +29,3 @@ /// <reference types="node" /> | ||
files: Files; | ||
experimentalAllowBundling?: boolean; | ||
} | ||
@@ -69,2 +70,3 @@ /** | ||
framework?: FunctionFramework; | ||
experimentalAllowBundling?: boolean; | ||
constructor(opts: LambdaOptions); | ||
@@ -71,0 +73,0 @@ createZip(): Promise<Buffer>; |
@@ -77,2 +77,8 @@ "use strict"; | ||
} | ||
if ("experimentalAllowBundling" in opts && opts.experimentalAllowBundling !== void 0) { | ||
(0, import_assert.default)( | ||
typeof opts.experimentalAllowBundling === "boolean", | ||
'"experimentalAllowBundling" is not a boolean' | ||
); | ||
} | ||
if (memory !== void 0) { | ||
@@ -139,2 +145,3 @@ (0, import_assert.default)(typeof memory === "number", '"memory" is not a number'); | ||
this.framework = framework; | ||
this.experimentalAllowBundling = "experimentalAllowBundling" in opts ? opts.experimentalAllowBundling : void 0; | ||
} | ||
@@ -141,0 +148,0 @@ async createZip() { |
{ | ||
"name": "@vercel/build-utils", | ||
"version": "7.5.0", | ||
"version": "7.5.1", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1200887
27071