@netlify/zip-it-and-ship-it 9.38.0 → 9.39.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/feature_flags.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const defaultFlags: {
|
|
|
9
9
|
readonly zisi_esbuild_fail_double_glob: false;
|
|
10
10
|
readonly zisi_fix_symlinks: false;
|
|
11
11
|
readonly zisi_add_instrumentation_loader: true;
|
|
12
|
+
readonly zisi_add_version_file: false;
|
|
12
13
|
};
|
|
13
14
|
export type FeatureFlags = Partial<Record<keyof typeof defaultFlags, boolean>>;
|
|
14
15
|
export declare const getFlags: (input?: Record<string, boolean>, flags?: {
|
|
@@ -22,4 +23,5 @@ export declare const getFlags: (input?: Record<string, boolean>, flags?: {
|
|
|
22
23
|
readonly zisi_esbuild_fail_double_glob: false;
|
|
23
24
|
readonly zisi_fix_symlinks: false;
|
|
24
25
|
readonly zisi_add_instrumentation_loader: true;
|
|
26
|
+
readonly zisi_add_version_file: false;
|
|
25
27
|
}) => FeatureFlags;
|
package/dist/feature_flags.js
CHANGED
|
@@ -22,6 +22,8 @@ export const defaultFlags = {
|
|
|
22
22
|
zisi_fix_symlinks: false,
|
|
23
23
|
// Adds the `___netlify-telemetry.mjs` file to the function bundle.
|
|
24
24
|
zisi_add_instrumentation_loader: true,
|
|
25
|
+
// Adds a `___netlify-bootstrap-version` file to the function bundle.
|
|
26
|
+
zisi_add_version_file: false,
|
|
25
27
|
};
|
|
26
28
|
// List of supported flags and their default value.
|
|
27
29
|
export const getFlags = (input = {}, flags = defaultFlags) => Object.entries(flags).reduce((result, [key, defaultValue]) => ({
|
|
@@ -2,6 +2,7 @@ import type { FeatureFlags } from '../../../feature_flags.js';
|
|
|
2
2
|
import { ModuleFormat } from './module_format.js';
|
|
3
3
|
export declare const ENTRY_FILE_NAME = "___netlify-entry-point";
|
|
4
4
|
export declare const BOOTSTRAP_FILE_NAME = "___netlify-bootstrap.mjs";
|
|
5
|
+
export declare const BOOTSTRAP_VERSION_FILE_NAME = "___netlify-bootstrap-version";
|
|
5
6
|
export declare const TELEMETRY_FILE_NAME = "___netlify-telemetry.mjs";
|
|
6
7
|
export interface EntryFile {
|
|
7
8
|
contents: string;
|
|
@@ -7,6 +7,7 @@ import { getFileExtensionForFormat, MODULE_FILE_EXTENSION, MODULE_FORMAT, } from
|
|
|
7
7
|
import { normalizeFilePath } from './normalize_path.js';
|
|
8
8
|
export const ENTRY_FILE_NAME = '___netlify-entry-point';
|
|
9
9
|
export const BOOTSTRAP_FILE_NAME = '___netlify-bootstrap.mjs';
|
|
10
|
+
export const BOOTSTRAP_VERSION_FILE_NAME = '___netlify-bootstrap-version';
|
|
10
11
|
export const TELEMETRY_FILE_NAME = '___netlify-telemetry.mjs';
|
|
11
12
|
const require = createRequire(import.meta.url);
|
|
12
13
|
/**
|
|
@@ -7,8 +7,9 @@ import { copyFile } from 'cp-file';
|
|
|
7
7
|
import pMap from 'p-map';
|
|
8
8
|
import { addZipContent, addZipFile, ARCHIVE_FORMAT, endZip, startZip, } from '../../../archive.js';
|
|
9
9
|
import { cachedLstat, mkdirAndWriteFile } from '../../../utils/fs.js';
|
|
10
|
-
import { BOOTSTRAP_FILE_NAME, conflictsWithEntryFile, getEntryFile, getTelemetryFile, isNamedLikeEntryFile, } from './entry_file.js';
|
|
10
|
+
import { BOOTSTRAP_FILE_NAME, BOOTSTRAP_VERSION_FILE_NAME, conflictsWithEntryFile, getEntryFile, getTelemetryFile, isNamedLikeEntryFile, } from './entry_file.js';
|
|
11
11
|
import { normalizeFilePath } from './normalize_path.js';
|
|
12
|
+
import { getPackageJsonIfAvailable } from './package_json.js';
|
|
12
13
|
// Taken from https://www.npmjs.com/package/cpy.
|
|
13
14
|
const COPY_FILE_CONCURRENCY = os.cpus().length === 0 ? 2 : os.cpus().length * 2;
|
|
14
15
|
// Sub-directory to place all user-defined files (i.e. everything other than
|
|
@@ -21,6 +22,7 @@ const addBootstrapFile = function (srcFiles, aliases) {
|
|
|
21
22
|
const v2APIPath = getV2APIPath();
|
|
22
23
|
srcFiles.push(v2APIPath);
|
|
23
24
|
aliases.set(v2APIPath, BOOTSTRAP_FILE_NAME);
|
|
25
|
+
return v2APIPath;
|
|
24
26
|
};
|
|
25
27
|
const createDirectory = async function ({ aliases = new Map(), basePath, cache, destFolder, extension, featureFlags, filename, mainFile, moduleFormat, rewrites = new Map(), runtimeAPIVersion, srcFiles, }) {
|
|
26
28
|
// There is a naming conflict with the entry file if one of the supporting
|
|
@@ -136,7 +138,13 @@ const createZipArchive = async function ({ aliases = new Map(), basePath, cache,
|
|
|
136
138
|
addEntryFileToZip(archive, telemetryFile);
|
|
137
139
|
}
|
|
138
140
|
if (runtimeAPIVersion === 2) {
|
|
139
|
-
addBootstrapFile(srcFiles, aliases);
|
|
141
|
+
const bootstrapPath = addBootstrapFile(srcFiles, aliases);
|
|
142
|
+
if (featureFlags.zisi_add_version_file === true) {
|
|
143
|
+
const { version: bootstrapVersion } = await getPackageJsonIfAvailable(bootstrapPath);
|
|
144
|
+
if (bootstrapVersion) {
|
|
145
|
+
addZipContent(archive, bootstrapVersion, BOOTSTRAP_VERSION_FILE_NAME);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
140
148
|
}
|
|
141
149
|
const deduplicatedSrcFiles = [...new Set(srcFiles)];
|
|
142
150
|
const srcFilesInfos = await Promise.all(deduplicatedSrcFiles.map((file) => addStat(cache, file)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/zip-it-and-ship-it",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.39.0",
|
|
4
4
|
"description": "Zip it and ship it",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/parser": "^7.22.5",
|
|
45
|
-
"@babel/types": "7.25.
|
|
45
|
+
"@babel/types": "7.25.6",
|
|
46
46
|
"@netlify/binary-info": "^1.0.0",
|
|
47
|
-
"@netlify/serverless-functions-api": "^1.
|
|
47
|
+
"@netlify/serverless-functions-api": "^1.23.0",
|
|
48
48
|
"@vercel/nft": "^0.27.1",
|
|
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": "483babcfdfcfdbea21eb9b80a4a1ec7582ebf1b5"
|
|
109
109
|
}
|