Comparing version 11.0.0-beta.3 to 11.0.0-beta.4
@@ -1,6 +0,2 @@ | ||
import express from "express"; | ||
import { Probot } from "../index"; | ||
export declare function defaultApp({ app, getRouter, }: { | ||
app: Probot; | ||
getRouter?: () => express.Router; | ||
}): void; | ||
import { ApplicationFunctionOptions, Probot } from "../index"; | ||
export declare function defaultApp(app: Probot, { getRouter }: ApplicationFunctionOptions): void; |
@@ -8,3 +8,3 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
function defaultApp({ app, getRouter, }) { | ||
function defaultApp(app, { getRouter }) { | ||
if (!getRouter) { | ||
@@ -11,0 +11,0 @@ throw new Error("getRouter() is required for defaultApp"); |
@@ -1,6 +0,3 @@ | ||
import express from "express"; | ||
import { Probot } from "../probot"; | ||
export declare const setupAppFactory: (host: string | undefined, port: number | undefined) => ({ app, getRouter, }: { | ||
app: Probot; | ||
getRouter?: (() => express.Router) | undefined; | ||
}) => Promise<void>; | ||
import { ApplicationFunctionOptions } from "../types"; | ||
export declare const setupAppFactory: (host: string | undefined, port: number | undefined) => (app: Probot, { getRouter }: ApplicationFunctionOptions) => Promise<void>; |
@@ -12,3 +12,3 @@ "use strict"; | ||
const logging_middleware_1 = require("../server/logging-middleware"); | ||
const setupAppFactory = (host, port) => async function setupApp({ app, getRouter, }) { | ||
const setupAppFactory = (host, port) => async function setupApp(app, { getRouter }) { | ||
const setup = new manifest_creation_1.ManifestCreation(); | ||
@@ -15,0 +15,0 @@ // If not on Glitch or Production, create a smee URL |
@@ -14,3 +14,3 @@ import type { Logger } from "pino"; | ||
* ```js | ||
* module.exports = ({ app }) => { | ||
* module.exports = (app) => { | ||
* app.on('issues.opened', async context => { | ||
@@ -17,0 +17,0 @@ * const octokit = await app.auth(); |
@@ -15,3 +15,3 @@ "use strict"; | ||
* ```js | ||
* module.exports = ({ app }) => { | ||
* module.exports = (app) => { | ||
* app.on('issues.opened', async context => { | ||
@@ -18,0 +18,0 @@ * const octokit = await app.auth(); |
@@ -86,3 +86,3 @@ "use strict"; | ||
} | ||
return appFn({ app: this }); | ||
return appFn(this, {}); | ||
} | ||
@@ -89,0 +89,0 @@ } |
@@ -8,5 +8,5 @@ import { ApplicationFunction } from "./types"; | ||
* | ||
* @param appFnOrArgv set to either a probot application function: `({ app }) => { ... }` or to process.argv | ||
* @param appFnOrArgv set to either a probot application function: `(app) => { ... }` or to process.argv | ||
*/ | ||
export declare function run(appFnOrArgv: ApplicationFunction | string[], additionalOptions?: AdditionalOptions): Promise<Server>; | ||
export {}; |
@@ -18,3 +18,3 @@ "use strict"; | ||
* | ||
* @param appFnOrArgv set to either a probot application function: `({ app }) => { ... }` or to process.argv | ||
* @param appFnOrArgv set to either a probot application function: `(app) => { ... }` or to process.argv | ||
*/ | ||
@@ -78,3 +78,3 @@ async function run(appFnOrArgv, additionalOptions) { | ||
const pkg = await pkg_conf_1.default("probot"); | ||
const combinedApps = async ({ app }) => { | ||
const combinedApps = async (app) => { | ||
await server.load(default_1.defaultApp); | ||
@@ -81,0 +81,0 @@ if (Array.isArray(pkg.apps)) { |
@@ -49,4 +49,3 @@ "use strict"; | ||
async load(appFn) { | ||
await appFn({ | ||
app: this.probotApp, | ||
await appFn(this.probotApp, { | ||
getRouter: (path) => this.router(path), | ||
@@ -53,0 +52,0 @@ }); |
@@ -44,6 +44,6 @@ import express from "express"; | ||
export declare type ApplicationFunctionOptions = { | ||
app: Probot; | ||
getRouter?: (path?: string) => express.Router; | ||
[key: string]: unknown; | ||
}; | ||
export declare type ApplicationFunction = (options: ApplicationFunctionOptions) => void; | ||
export declare type ApplicationFunction = (app: Probot, options: ApplicationFunctionOptions) => void; | ||
export declare type ServerOptions = { | ||
@@ -50,0 +50,0 @@ log?: Logger; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "11.0.0-beta.3"; | ||
export declare const VERSION = "11.0.0-beta.4"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
// The version is set automatically before publish to npm | ||
exports.VERSION = "11.0.0-beta.3"; | ||
exports.VERSION = "11.0.0-beta.4"; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "probot", | ||
"version": "11.0.0-beta.3", | ||
"version": "11.0.0-beta.4", | ||
"description": "🤖 A framework for building GitHub Apps to automate and improve your workflow", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/probot/probot", |
@@ -17,3 +17,3 @@ <p align="center"> | ||
```js | ||
module.exports = ({ app }) => { | ||
module.exports = (app) => { | ||
app.on("issues.opened", async (context) => { | ||
@@ -20,0 +20,0 @@ const issueComment = context.issue({ |
@@ -14,3 +14,3 @@ # Probot | ||
```js | ||
module.exports = ({ app }) => { | ||
module.exports = (app) => { | ||
app.on("issues.opened", async (context) => { | ||
@@ -17,0 +17,0 @@ const issueComment = context.issue({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
326627
2298