diff --git a/src/config.ts b/src/config.ts index 177776192..ca48f723b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -18,6 +18,7 @@ interface FunctionConfig { nodeVersion?: NodeVersion processDynamicNodeImports?: boolean rustTargetDirectory?: string + schedule?: string } type GlobPattern = string diff --git a/src/manifest.ts b/src/manifest.ts index bba84ee75..d7601cdba 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -18,11 +18,12 @@ const createManifest = async ({ functions, path }: { functions: FunctionResult[] await writeFile(path, JSON.stringify(payload)) } -const formatFunctionForManifest = ({ mainFile, name, path, runtime }: FunctionResult) => ({ +const formatFunctionForManifest = ({ config, mainFile, name, path, runtime }: FunctionResult) => ({ mainFile, name, path: resolve(path), runtime, + schedule: config.schedule, }) export { createManifest } diff --git a/tests/main.js b/tests/main.js index 95710f256..424bed3ab 100644 --- a/tests/main.js +++ b/tests/main.js @@ -2153,7 +2153,14 @@ test('Creates a manifest file with the list of created functions if the `manifes const manifestPath = join(tmpDir, 'manifest.json') const { files } = await zipNode(t, 'many-functions', { length: FUNCTIONS_COUNT, - opts: { manifest: manifestPath }, + opts: { + manifest: manifestPath, + config: { + five: { + schedule: '@daily', + }, + }, + }, }) const manifest = require(manifestPath) @@ -2171,6 +2178,7 @@ test('Creates a manifest file with the list of created functions if the `manifes t.is(fn.name, file.name) t.is(fn.runtime, file.runtime) t.is(fn.path, file.path) + t.is(fn.schedule, fn.name === 'five' ? '@daily' : undefined) }) })