@netlify/zip-it-and-ship-it 9.43.0 → 10.0.0
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/config.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
2
|
import { basename, extname, dirname, join } from 'path';
|
|
3
3
|
import isPathInside from 'is-path-inside';
|
|
4
|
+
// @ts-expect-error(serhalp) -- Remove once https://github.com/schnittstabil/merge-options/pull/28 is merged, or replace
|
|
5
|
+
// this dependency.
|
|
4
6
|
import mergeOptions from 'merge-options';
|
|
5
7
|
import { z } from 'zod';
|
|
6
8
|
import { nodeBundler } from './runtimes/node/bundlers/types.js';
|
package/dist/feature_flags.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export declare const defaultFlags: {
|
|
|
8
8
|
readonly zisi_unique_entry_file: false;
|
|
9
9
|
readonly zisi_esbuild_fail_double_glob: false;
|
|
10
10
|
readonly zisi_add_instrumentation_loader: true;
|
|
11
|
-
readonly zisi_add_metadata_file: false;
|
|
12
11
|
};
|
|
13
12
|
export type FeatureFlags = Partial<Record<keyof typeof defaultFlags, boolean>>;
|
|
14
13
|
export declare const getFlags: (input?: Record<string, boolean>, flags?: {
|
|
@@ -21,5 +20,4 @@ export declare const getFlags: (input?: Record<string, boolean>, flags?: {
|
|
|
21
20
|
readonly zisi_unique_entry_file: false;
|
|
22
21
|
readonly zisi_esbuild_fail_double_glob: false;
|
|
23
22
|
readonly zisi_add_instrumentation_loader: true;
|
|
24
|
-
readonly zisi_add_metadata_file: false;
|
|
25
23
|
}) => FeatureFlags;
|
package/dist/feature_flags.js
CHANGED
|
@@ -20,8 +20,6 @@ export const defaultFlags = {
|
|
|
20
20
|
zisi_esbuild_fail_double_glob: false,
|
|
21
21
|
// Adds the `___netlify-telemetry.mjs` file to the function bundle.
|
|
22
22
|
zisi_add_instrumentation_loader: true,
|
|
23
|
-
// Adds a `___netlify-metadata.json` file to the function bundle.
|
|
24
|
-
zisi_add_metadata_file: false,
|
|
25
23
|
};
|
|
26
24
|
// List of supported flags and their default value.
|
|
27
25
|
export const getFlags = (input = {}, flags = defaultFlags) => Object.entries(flags).reduce((result, [key, defaultValue]) => ({
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { dirname } from 'path';
|
|
2
|
+
// @ts-expect-error(serhalp) -- Remove once https://github.com/schnittstabil/merge-options/pull/28 is merged, or replace
|
|
3
|
+
// this dependency.
|
|
2
4
|
import mergeOptions from 'merge-options';
|
|
3
5
|
import { z } from 'zod';
|
|
4
6
|
import { functionConfig } from '../../../config.js';
|
|
@@ -144,12 +144,10 @@ const createZipArchive = async function ({ aliases = new Map(), basePath, branch
|
|
|
144
144
|
}
|
|
145
145
|
if (runtimeAPIVersion === 2) {
|
|
146
146
|
const bootstrapPath = addBootstrapFile(srcFiles, aliases);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
addZipContent(archive, payload, METADATA_FILE_NAME);
|
|
152
|
-
}
|
|
147
|
+
const { version } = await getPackageJsonIfAvailable(bootstrapPath);
|
|
148
|
+
const payload = JSON.stringify(getMetadataFile(version, branch));
|
|
149
|
+
bootstrapVersion = version;
|
|
150
|
+
addZipContent(archive, payload, METADATA_FILE_NAME);
|
|
153
151
|
}
|
|
154
152
|
const deduplicatedSrcFiles = [...new Set(srcFiles)];
|
|
155
153
|
const srcFilesInfos = await Promise.all(deduplicatedSrcFiles.map((file) => addStat(cache, file)));
|
package/dist/zip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
|
-
import { resolve } from 'path';
|
|
2
|
+
import { join, resolve } from 'path';
|
|
3
3
|
import isPathInside from 'is-path-inside';
|
|
4
4
|
import pMap from 'p-map';
|
|
5
5
|
import { ARCHIVE_FORMAT } from './archive.js';
|
|
@@ -71,9 +71,7 @@ export const zipFunctions = async function (relativeSrcFolders, destFolder, { ar
|
|
|
71
71
|
const resultWithSize = await addArchiveSize(result);
|
|
72
72
|
return formatZipResult(resultWithSize);
|
|
73
73
|
}));
|
|
74
|
-
|
|
75
|
-
await createManifest({ functions: formattedResults, path: resolve(manifest) });
|
|
76
|
-
}
|
|
74
|
+
await createManifest({ functions: formattedResults, path: resolve(manifest || join(destFolder, 'manifest.json')) });
|
|
77
75
|
return formattedResults;
|
|
78
76
|
};
|
|
79
77
|
export const zipFunction = async function (relativeSrcPath, destFolder, { archiveFormat = ARCHIVE_FORMAT.ZIP, basePath, config: inputConfig = {}, featureFlags: inputFeatureFlags, repositoryRoot = basePath, systemLog, debug, internalSrcFolder, } = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/zip-it-and-ship-it",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Zip it and ship it",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/parser": "^7.22.5",
|
|
45
45
|
"@babel/types": "7.26.9",
|
|
46
46
|
"@netlify/binary-info": "^1.0.0",
|
|
47
|
-
"@netlify/serverless-functions-api": "^1.
|
|
47
|
+
"@netlify/serverless-functions-api": "^1.35.0",
|
|
48
48
|
"@vercel/nft": "0.27.7",
|
|
49
49
|
"archiver": "^7.0.0",
|
|
50
50
|
"common-path-prefix": "^3.0.0",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"engines": {
|
|
106
106
|
"node": "^14.18.0 || >=16.0.0"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "65206cf82369d2e0412c707c763590690cc1819a"
|
|
109
109
|
}
|