diff --git a/app.js b/app.js index c2c99c5..5406e7f 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ /** * @param {import('probot').Probot} app */ -module.exports = (app) => { +export default (app) => { console.log("Yay! The app was loaded!"); app.on("issues.opened", async (context) => { diff --git a/handler.js b/handler.js index 60fd79a..30142d0 100644 --- a/handler.js +++ b/handler.js @@ -1,10 +1,10 @@ -const { +import { createLambdaFunction, createProbot, -} = require("@probot/adapter-aws-lambda-serverless"); +} from "@probot/adapter-aws-lambda-serverless"; -const appFn = require("./"); +import appFn from "./app.js"; -module.exports.webhooks = createLambdaFunction(appFn, { +export const webhooks = createLambdaFunction(appFn, { probot: createProbot(), }); diff --git a/package.json b/package.json index fbfe55b..cd410b1 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@probot/example-aws-lambda-serverless", "version": "1.0.0", "private": true, + "type": "module", "description": "Probot & AWS Lambda example", "main": "app.js", "scripts": { diff --git a/start.js b/start.js index 8247da2..8a61bf7 100644 --- a/start.js +++ b/start.js @@ -1,3 +1,3 @@ -const { run } = require("@probot/adapter-aws-lambda-serverless"); +import { run } from "@probot/adapter-aws-lambda-serverless"; run(process.argv); diff --git a/test.js b/test.js index 4e210ce..eaaa940 100644 --- a/test.js +++ b/test.js @@ -1,15 +1,15 @@ -const { suite } = require("uvu"); -const assert = require("uvu/assert"); +import { suite } from "uvu"; +import * as assert from "uvu/assert"; -const { default: nock } = require("nock"); +import nock from "nock"; nock.disableNetConnect(); -const { +import { Probot, ProbotOctokit, -} = require("@probot/adapter-aws-lambda-serverless"); +} from "@probot/adapter-aws-lambda-serverless"; -const app = require("./app"); +import app from "./app.js"; /** @type {import('probot').Probot */ let probot;