@netlify/zip-it-and-ship-it 9.40.1 → 9.41.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.
@@ -4,20 +4,20 @@ import type { FunctionResult } from './utils/format_result.js';
4
4
  import type { ExtendedRoute, Route } from './utils/routes.js';
5
5
  interface ManifestFunction {
6
6
  buildData?: Record<string, unknown>;
7
+ bundler?: string;
8
+ displayName?: string;
9
+ excludedRoutes?: Route[];
10
+ generator?: string;
7
11
  invocationMode?: InvocationMode;
8
12
  mainFile: string;
9
13
  name: string;
10
14
  path: string;
15
+ priority?: number;
11
16
  routes?: ExtendedRoute[];
12
- excludedRoutes?: Route[];
13
17
  runtime: string;
14
18
  runtimeVersion?: string;
15
19
  schedule?: string;
16
- displayName?: string;
17
- bundler?: string;
18
- generator?: string;
19
20
  timeout?: number;
20
- priority?: number;
21
21
  trafficRules?: TrafficRules;
22
22
  }
23
23
  export interface Manifest {
package/dist/manifest.js CHANGED
@@ -12,14 +12,14 @@ export const createManifest = async ({ functions, path }) => {
12
12
  };
13
13
  await fs.writeFile(path, JSON.stringify(payload));
14
14
  };
15
- const formatFunctionForManifest = ({ bundler, displayName, excludedRoutes, generator, invocationMode, mainFile, name, path, priority, trafficRules, routes, runtime, runtimeVersion, runtimeAPIVersion, schedule, timeout, }) => {
15
+ const formatFunctionForManifest = ({ bootstrapVersion, bundler, displayName, excludedRoutes, generator, invocationMode, mainFile, name, path, priority, trafficRules, routes, runtime, runtimeVersion, runtimeAPIVersion, schedule, timeout, }) => {
16
16
  const manifestFunction = {
17
17
  bundler,
18
18
  displayName,
19
19
  generator,
20
20
  timeout,
21
21
  invocationMode,
22
- buildData: { runtimeAPIVersion },
22
+ buildData: { bootstrapVersion, runtimeAPIVersion },
23
23
  mainFile,
24
24
  name,
25
25
  priority,
@@ -68,7 +68,7 @@ const zipFunction = async function ({ archiveFormat, basePath, branch, cache, co
68
68
  });
69
69
  createPluginsModulesPathAliases(srcFiles, pluginsModulesPath, aliases, finalBasePath);
70
70
  const generator = mergedConfig?.generator || getInternalValue(isInternal);
71
- const zipPath = await zipNodeJs({
71
+ const zipResult = await zipNodeJs({
72
72
  aliases,
73
73
  archiveFormat,
74
74
  basePath: finalBasePath,
@@ -103,11 +103,12 @@ const zipFunction = async function ({ archiveFormat, basePath, branch, cache, co
103
103
  const priority = isInternal ? Priority.GeneratedFunction : Priority.UserFunction;
104
104
  const trafficRules = mergedConfig?.rateLimit ? getTrafficRulesConfig(mergedConfig.rateLimit) : undefined;
105
105
  return {
106
+ bootstrapVersion: zipResult.bootstrapVersion,
106
107
  bundler: bundlerName,
107
108
  bundlerWarnings,
108
109
  config: mergedConfig,
109
110
  displayName: mergedConfig?.name,
110
- entryFilename: zipPath.entryFilename,
111
+ entryFilename: zipResult.entryFilename,
111
112
  generator,
112
113
  timeout: mergedConfig?.timeout,
113
114
  inputs,
@@ -116,7 +117,7 @@ const zipFunction = async function ({ archiveFormat, basePath, branch, cache, co
116
117
  invocationMode,
117
118
  outputModuleFormat,
118
119
  nativeNodeModules,
119
- path: zipPath.path,
120
+ path: zipResult.path,
120
121
  priority,
121
122
  trafficRules,
122
123
  runtimeVersion: runtimeAPIVersion === 2
@@ -20,10 +20,12 @@ interface ZipNodeParameters {
20
20
  srcFiles: string[];
21
21
  generator?: string;
22
22
  }
23
+ interface ZipNodeJsResult {
24
+ bootstrapVersion?: string;
25
+ entryFilename: string;
26
+ path: string;
27
+ }
23
28
  export declare const zipNodeJs: ({ archiveFormat, ...options }: ZipNodeParameters & {
24
29
  archiveFormat: ArchiveFormat;
25
- }) => Promise<{
26
- path: string;
27
- entryFilename: string;
28
- }>;
30
+ }) => Promise<ZipNodeJsResult>;
29
31
  export {};
@@ -124,6 +124,7 @@ const createZipArchive = async function ({ aliases = new Map(), basePath, branch
124
124
  // than the entry file) to its own sub-directory.
125
125
  const userNamespace = hasEntryFileConflict ? DEFAULT_USER_SUBDIRECTORY : '';
126
126
  let entryFilename = `${basename(filename, extname(filename))}.js`;
127
+ let bootstrapVersion;
127
128
  if (needsEntryFile) {
128
129
  const entryFile = getEntryFile({
129
130
  commonPrefix: basePath,
@@ -144,8 +145,9 @@ const createZipArchive = async function ({ aliases = new Map(), basePath, branch
144
145
  if (runtimeAPIVersion === 2) {
145
146
  const bootstrapPath = addBootstrapFile(srcFiles, aliases);
146
147
  if (featureFlags.zisi_add_metadata_file === true) {
147
- const { version: bootstrapVersion } = await getPackageJsonIfAvailable(bootstrapPath);
148
- const payload = JSON.stringify(getMetadataFile(bootstrapVersion, branch));
148
+ const { version } = await getPackageJsonIfAvailable(bootstrapPath);
149
+ const payload = JSON.stringify(getMetadataFile(version, branch));
150
+ bootstrapVersion = version;
149
151
  addZipContent(archive, payload, METADATA_FILE_NAME);
150
152
  }
151
153
  }
@@ -165,7 +167,7 @@ const createZipArchive = async function ({ aliases = new Map(), basePath, branch
165
167
  });
166
168
  });
167
169
  await endZip(archive, output);
168
- return { path: destPath, entryFilename };
170
+ return { path: destPath, entryFilename, bootstrapVersion };
169
171
  };
170
172
  export const zipNodeJs = function ({ archiveFormat, ...options }) {
171
173
  if (archiveFormat === ARCHIVE_FORMAT.ZIP) {
@@ -2,6 +2,7 @@ import { FunctionArchive } from '../function.js';
2
2
  import { RuntimeName } from '../runtimes/runtime.js';
3
3
  import type { ExtendedRoute, Route } from './routes.js';
4
4
  export type FunctionResult = Omit<FunctionArchive, 'runtime'> & {
5
+ bootstrapVersion?: string;
5
6
  routes?: ExtendedRoute[];
6
7
  excludedRoutes?: Route[];
7
8
  runtime: RuntimeName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/zip-it-and-ship-it",
3
- "version": "9.40.1",
3
+ "version": "9.41.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.25.6",
46
46
  "@netlify/binary-info": "^1.0.0",
47
- "@netlify/serverless-functions-api": "^1.30.0",
47
+ "@netlify/serverless-functions-api": "^1.30.1",
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": "db33121e34a844baeb3be9715e44af8d2b5df8f3"
108
+ "gitHead": "447f98f929b3b9988e82144fabf73255c6daedd6"
109
109
  }