@netlify/zip-it-and-ship-it 9.33.2 → 9.34.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.d.ts CHANGED
@@ -14,6 +14,7 @@ interface FunctionConfig {
14
14
  zipGo?: boolean;
15
15
  name?: string;
16
16
  generator?: string;
17
+ timeout?: number;
17
18
  nodeModuleFormat?: ModuleFormat;
18
19
  }
19
20
  type GlobPattern = string;
package/dist/main.d.ts CHANGED
@@ -19,6 +19,7 @@ export interface ListedFunction {
19
19
  schedule?: string;
20
20
  displayName?: string;
21
21
  generator?: string;
22
+ timeout?: number;
22
23
  inputModuleFormat?: ModuleFormat;
23
24
  }
24
25
  type ListedFunctionFile = ListedFunction & {
package/dist/main.js CHANGED
@@ -62,6 +62,7 @@ const getListedFunction = function ({ config, extension, staticAnalysisResult, m
62
62
  displayName: config.name,
63
63
  extension,
64
64
  generator: config.generator,
65
+ timeout: config.timeout,
65
66
  mainFile,
66
67
  name,
67
68
  runtime: runtime.name,
@@ -32,6 +32,7 @@ interface ManifestFunction {
32
32
  displayName?: string;
33
33
  bundler?: string;
34
34
  generator?: string;
35
+ timeout?: number;
35
36
  priority?: number;
36
37
  trafficRules?: TrafficRules;
37
38
  }
package/dist/manifest.js CHANGED
@@ -12,11 +12,12 @@ export const createManifest = async ({ functions, path }) => {
12
12
  };
13
13
  await fs.writeFile(path, JSON.stringify(payload));
14
14
  };
15
- const formatFunctionForManifest = ({ bundler, displayName, generator, invocationMode, mainFile, name, path, priority, trafficRules, routes, runtime, runtimeVersion, runtimeAPIVersion, schedule, }) => {
15
+ const formatFunctionForManifest = ({ bundler, displayName, 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
+ timeout,
20
21
  invocationMode,
21
22
  buildData: { runtimeAPIVersion },
22
23
  mainFile,
@@ -11,6 +11,7 @@ export type ISCValues = {
11
11
  trafficRules?: TrafficRules;
12
12
  name?: string;
13
13
  generator?: string;
14
+ timeout?: number;
14
15
  };
15
16
  export interface StaticAnalysisResult extends ISCValues {
16
17
  inputModuleFormat?: ModuleFormat;
@@ -119,6 +119,9 @@ export const parseSource = (source, { functionName }) => {
119
119
  if (typeof configExport.generator === 'string') {
120
120
  result.generator = configExport.generator;
121
121
  }
122
+ if (typeof configExport.timeout === 'number') {
123
+ result.timeout = configExport.timeout;
124
+ }
122
125
  if (configExport.method !== undefined) {
123
126
  result.methods = normalizeMethods(configExport.method, functionName);
124
127
  }
@@ -94,7 +94,7 @@ const zipFunction = async function ({ archiveFormat, basePath, cache, config = {
94
94
  if (name.endsWith('-background')) {
95
95
  invocationMode = INVOCATION_MODE.Background;
96
96
  }
97
- const { trafficRules, generator: staticAnalysisGenerator, name: staticAnalysisName } = staticAnalysisResult;
97
+ const { trafficRules, generator: staticAnalysisGenerator, name: staticAnalysisName, timeout: staticAnalysisTimeout, } = staticAnalysisResult;
98
98
  const outputModuleFormat = extname(finalMainFile) === MODULE_FILE_EXTENSION.MJS ? MODULE_FORMAT.ESM : MODULE_FORMAT.COMMONJS;
99
99
  const priority = isInternal ? Priority.GeneratedFunction : Priority.UserFunction;
100
100
  return {
@@ -104,6 +104,7 @@ const zipFunction = async function ({ archiveFormat, basePath, cache, config = {
104
104
  displayName: staticAnalysisName || config?.name,
105
105
  entryFilename: zipPath.entryFilename,
106
106
  generator: staticAnalysisGenerator || config?.generator || getInternalValue(isInternal),
107
+ timeout: staticAnalysisTimeout || config?.timeout,
107
108
  inputs,
108
109
  includedFiles,
109
110
  staticAnalysisResult,
@@ -39,6 +39,7 @@ export interface ZipFunctionResult {
39
39
  config: FunctionConfig;
40
40
  displayName?: string;
41
41
  generator?: string;
42
+ timeout?: number;
42
43
  inputs?: string[];
43
44
  includedFiles?: string[];
44
45
  invocationMode?: InvocationMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/zip-it-and-ship-it",
3
- "version": "9.33.2",
3
+ "version": "9.34.0",
4
4
  "description": "Zip it and ship it",
5
5
  "main": "./dist/main.js",
6
6
  "type": "module",
@@ -104,5 +104,5 @@
104
104
  "engines": {
105
105
  "node": "^14.18.0 || >=16.0.0"
106
106
  },
107
- "gitHead": "41ec9c9c843d62360892999558e36e170ff9484e"
107
+ "gitHead": "14419e3fd6fdeaba6d8f4460e5c13871db7f26ef"
108
108
  }