diff --git a/src/deps.ts b/src/deps.ts index 4d43826..e0c1d99 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1,8 +1,7 @@ // TODO: latest version of std does not have a io/utils.ts export { readAll } from "https://deno.land/std@0.99.0/io/util.ts"; export { BaseSlackAPIClient } from "https://deno.land/x/deno_slack_api@0.0.2/base-client.ts"; -// TODO: Update to import from `deno-slack-hooks` instead -export { createManifest } from "https://deno.land/x/deno_slack_builder@0.0.14/manifest.ts"; +export { getManifest } from "https://deno.land/x/deno_slack_hooks@1.4.0/get_manifest.ts"; export { parse } from "https://deno.land/std@0.99.0/flags/mod.ts"; export { getProtocolInterface } from "https://deno.land/x/deno_slack_protocols@0.0.2/mod.ts"; export type { Protocol } from "https://deno.land/x/deno_slack_protocols@0.0.2/types.ts"; diff --git a/src/local-run-function.ts b/src/local-run-function.ts index 45ac709..b534d3a 100644 --- a/src/local-run-function.ts +++ b/src/local-run-function.ts @@ -1,5 +1,5 @@ import { - createManifest, + getManifest, getProtocolInterface, Protocol, readAll, @@ -11,18 +11,14 @@ import { DispatchPayload } from "./dispatch-payload.ts"; * @description Runs an application function locally by dispatching a payload to it after loading it. */ export const runLocally = async function ( - create: typeof createManifest, + create: typeof getManifest, parse: typeof ParsePayload, readStdin: typeof readAll, dispatch: typeof DispatchPayload, hookCLI: Protocol, ): Promise { const workingDirectory = Deno.cwd(); - const manifest = await create({ - manifestOnly: true, - log: () => {}, - workingDirectory, - }); + const manifest = await create(workingDirectory); if (!manifest.functions) { throw new Error( `No function definitions were found in the manifest! manifest.functions: ${manifest.functions}`, @@ -53,7 +49,7 @@ export const runLocally = async function ( if (import.meta.main) { const hookCLI = getProtocolInterface(Deno.args); await runLocally( - createManifest, + getManifest, ParsePayload, readAll, DispatchPayload, diff --git a/src/local-run.ts b/src/local-run.ts index e4b34f1..240163d 100644 --- a/src/local-run.ts +++ b/src/local-run.ts @@ -1,9 +1,4 @@ -import { - createManifest, - getProtocolInterface, - parse, - Protocol, -} from "./deps.ts"; +import { getManifest, getProtocolInterface, parse, Protocol } from "./deps.ts"; const SLACK_DEV_DOMAIN_FLAG = "sdk-slack-dev-domain"; @@ -95,16 +90,12 @@ export const getCommandline = function ( * @description Runs an application locally by calling `deno run` with appropriate flags. */ export const runWithOutgoingDomains = async function ( - create: typeof createManifest, + create: typeof getManifest, devDomain: string, hookCLI: Protocol, ): Promise { const workingDirectory = Deno.cwd(); - const manifest = await create({ - manifestOnly: true, - log: () => {}, - workingDirectory, - }); + const manifest = await create(workingDirectory); if (!manifest.functions) { throw new Error( @@ -141,7 +132,7 @@ export const runWithOutgoingDomains = async function ( if (import.meta.main) { const hookCLI = getProtocolInterface(Deno.args); await runWithOutgoingDomains( - createManifest, + getManifest, parseDevDomain(Deno.args), hookCLI, );