@netlify/zip-it-and-ship-it 15.3.0 → 15.3.2
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.
package/dist/archive.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
import { Stats } from 'fs';
|
|
3
3
|
import { Writable } from 'stream';
|
|
4
|
-
import { Archiver } from 'archiver';
|
|
4
|
+
import type { Archiver } from 'archiver';
|
|
5
5
|
import { ObjectValues } from './types/utils.js';
|
|
6
|
-
export { Archiver as ZipArchive } from 'archiver';
|
|
7
6
|
export declare const ARCHIVE_FORMAT: {
|
|
8
7
|
readonly NONE: "none";
|
|
9
8
|
readonly TAR: "tar";
|
package/dist/archive.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createWriteStream, readlinkSync } from 'fs';
|
|
2
|
-
import
|
|
2
|
+
import { TarArchive, ZipArchive } from 'archiver';
|
|
3
3
|
export const ARCHIVE_FORMAT = {
|
|
4
4
|
NONE: 'none',
|
|
5
5
|
TAR: 'tar',
|
|
@@ -8,7 +8,7 @@ export const ARCHIVE_FORMAT = {
|
|
|
8
8
|
// Start zipping files
|
|
9
9
|
export const startZip = function (destPath) {
|
|
10
10
|
const output = createWriteStream(destPath);
|
|
11
|
-
const archive =
|
|
11
|
+
const archive = new ZipArchive();
|
|
12
12
|
archive.pipe(output);
|
|
13
13
|
return { archive, output };
|
|
14
14
|
};
|
|
@@ -43,7 +43,7 @@ export const endZip = async function (archive, output) {
|
|
|
43
43
|
};
|
|
44
44
|
export const startTar = function (destPath) {
|
|
45
45
|
const output = createWriteStream(destPath);
|
|
46
|
-
const archive =
|
|
46
|
+
const archive = new TarArchive({ gzip: true });
|
|
47
47
|
archive.pipe(output);
|
|
48
48
|
return { archive, output };
|
|
49
49
|
};
|
|
@@ -34,6 +34,7 @@ export type GetSrcFilesFunction = (args: {
|
|
|
34
34
|
runtimeAPIVersion: number;
|
|
35
35
|
} & FunctionSource) => Promise<string[]>;
|
|
36
36
|
export interface ZipFunctionResult {
|
|
37
|
+
bootstrapVersion?: string;
|
|
37
38
|
bundler?: NodeBundlerName;
|
|
38
39
|
bundlerReason?: BundlerReason;
|
|
39
40
|
bundlerErrors?: object[];
|
|
@@ -2,6 +2,7 @@ import type { FunctionArchive } from '../function.js';
|
|
|
2
2
|
export declare const getArchiveSize: (path: string) => Promise<number | undefined>;
|
|
3
3
|
export declare const addArchiveSize: (result: FunctionArchive) => Promise<{
|
|
4
4
|
size: number | undefined;
|
|
5
|
+
bootstrapVersion?: string;
|
|
5
6
|
bundler?: import("../main.js").NodeBundlerName;
|
|
6
7
|
bundlerReason?: import("../runtimes/node/bundlers/types.js").BundlerReason;
|
|
7
8
|
bundlerErrors?: object[];
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { FunctionArchive } from '../function.js';
|
|
2
2
|
import { RuntimeName } from '../runtimes/runtime.js';
|
|
3
3
|
import type { ExtendedRoute, Route } from './routes.js';
|
|
4
|
+
export interface BuildData {
|
|
5
|
+
bootstrapVersion?: string;
|
|
6
|
+
runtimeAPIVersion?: number;
|
|
7
|
+
}
|
|
4
8
|
export type FunctionResult = Omit<FunctionArchive, 'runtime'> & {
|
|
5
9
|
bootstrapVersion?: string;
|
|
10
|
+
buildData?: BuildData;
|
|
6
11
|
eventSubscriptions?: string[];
|
|
7
12
|
memory?: number;
|
|
8
13
|
region?: string;
|
|
@@ -3,6 +3,15 @@ import { removeUndefined } from './remove_undefined.js';
|
|
|
3
3
|
export const formatZipResult = (archive) => {
|
|
4
4
|
const memory = archive.staticAnalysisResult?.config?.memory ?? archive?.config?.memory;
|
|
5
5
|
const vcpu = archive.staticAnalysisResult?.config?.vcpu ?? archive?.config?.vcpu;
|
|
6
|
+
const runtimeAPIVersion = archive.staticAnalysisResult?.runtimeAPIVersion;
|
|
7
|
+
// Mirror the `buildData` object that `manifest.ts` persists, so consumers
|
|
8
|
+
// reading the in-memory result see the same shape as the manifest cache.
|
|
9
|
+
// Only attach it when there's something to report (e.g. Node functions),
|
|
10
|
+
// avoiding an empty `buildData: {}` on runtimes like Go and Rust.
|
|
11
|
+
const buildData = removeUndefined({
|
|
12
|
+
bootstrapVersion: archive.bootstrapVersion,
|
|
13
|
+
runtimeAPIVersion,
|
|
14
|
+
});
|
|
6
15
|
const functionResult = {
|
|
7
16
|
...archive,
|
|
8
17
|
staticAnalysisResult: undefined,
|
|
@@ -13,7 +22,8 @@ export const formatZipResult = (archive) => {
|
|
|
13
22
|
memory,
|
|
14
23
|
region: archive.staticAnalysisResult?.config?.region ?? archive?.config?.region,
|
|
15
24
|
schedule: archive.staticAnalysisResult?.config?.schedule ?? archive?.config?.schedule,
|
|
16
|
-
runtimeAPIVersion
|
|
25
|
+
runtimeAPIVersion,
|
|
26
|
+
buildData: Object.keys(buildData).length === 0 ? undefined : buildData,
|
|
17
27
|
vcpu,
|
|
18
28
|
};
|
|
19
29
|
return removeUndefined(functionResult);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/zip-it-and-ship-it",
|
|
3
|
-
"version": "15.3.
|
|
3
|
+
"version": "15.3.2",
|
|
4
4
|
"description": "Zip it and ship it",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@babel/parser": "^7.22.5",
|
|
45
45
|
"@babel/types": "^7.28.5",
|
|
46
46
|
"@netlify/binary-info": "^1.0.0",
|
|
47
|
-
"@netlify/serverless-functions-api": "2.
|
|
47
|
+
"@netlify/serverless-functions-api": "2.18.0",
|
|
48
48
|
"@opentelemetry/api": "~1.8.0",
|
|
49
49
|
"@vercel/nft": "0.29.4",
|
|
50
|
-
"archiver": "^
|
|
50
|
+
"archiver": "^8.0.0",
|
|
51
51
|
"common-path-prefix": "^3.0.0",
|
|
52
52
|
"copy-file": "^11.0.0",
|
|
53
53
|
"es-module-lexer": "^1.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@netlify/types": "2.7.0",
|
|
80
80
|
"@opentelemetry/sdk-trace-base": "~1.24.0",
|
|
81
|
-
"@types/archiver": "
|
|
81
|
+
"@types/archiver": "8.0.0",
|
|
82
82
|
"@types/is-ci": "3.0.4",
|
|
83
83
|
"@types/node": "^22.12.0",
|
|
84
84
|
"@types/normalize-path": "3.0.2",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"engines": {
|
|
103
103
|
"node": ">=22.12.0"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "f34dd81fc3bc8925aabe5cf9c1cdce4e8eebc4e0"
|
|
106
106
|
}
|