Skip to content

Commit

Permalink
chore: change package type to es module
Browse files Browse the repository at this point in the history
Signed-off-by: Tomer Figenblat <[email protected]>
  • Loading branch information
TomerFi committed Aug 11, 2024
1 parent 5833c19 commit 0e0d331
Show file tree
Hide file tree
Showing 18 changed files with 505 additions and 742 deletions.
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default [
name: "default",
files: ["**/*.js"],
languageOptions: {
sourceType: "script",
sourceType: "module",
globals: {
...globals.node,
...globals.nodeBuiltin,
...globals.mocha,
}
},
Expand Down
245 changes: 4 additions & 241 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "auto-me-bot",
"version": "2.0.1",
"private": true,
"type": "module",
"description": "A Probot app that takes care of your GitHub repos for you",
"author": {
"name": "Tomer Figenblat",
Expand Down Expand Up @@ -34,7 +35,7 @@
"@commitlint/load": "^19.4.0",
"@digitalroute/email-verify": "^0.3.2",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"marked": "^14.0.0",
"probot": "^13.3.7"
},
Expand All @@ -46,7 +47,6 @@
"globals": "^15.9.0",
"mocha": "^10.7.3",
"nyc": "^17.0.0",
"rewire": "^7.0.0",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0"
},
Expand Down
6 changes: 3 additions & 3 deletions src/app-runner.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { Probot } = require('probot');
const autoMeBot = require('./auto-me-bot');
import { Probot } from 'probot'
import autoMeBot from './auto-me-bot'


// handler function for aws lambda >> 'Handler:src/app-runner.handler'
exports.handler = async (event) => {
export async function handler (event) {
let probot = new Probot({
appId: process.env.APP_ID,
privateKey: Buffer.from(process.env.PRIVATE_KEY, 'base64').toString('utf-8'),
Expand Down
18 changes: 9 additions & 9 deletions src/auto-me-bot.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const yaml = require('js-yaml');
import yaml from 'js-yaml'

// import handlers
const prAutoApproveHandler = require('./handlers/pr-auto-approve');
const prConventionalCommitsHandler = require('./handlers/pr-conventional-commits');
const prConventionalTitleHandler = require('./handlers/pr-conventional-title');
const prLifecycleLabelsHandler = require('./handlers/pr-lifecycle-labels');
const prSignedCommitsHandler = require('./handlers/pr-signed-commits');
const prTasksListHandler = require('./handlers/pr-tasks-list');
import prAutoApproveHandler from './handlers/pr-auto-approve.js'
import prConventionalCommitsHandler from './handlers/pr-conventional-commits.js'
import prConventionalTitleHandler from './handlers/pr-conventional-title.js'
import prLifecycleLabelsHandler from './handlers/pr-lifecycle-labels.js'
import prSignedCommitsHandler from './handlers/pr-signed-commits.js'
import prTasksListHandler from './handlers/pr-tasks-list.js'

/* example configuration (for reference):
pr:
Expand Down Expand Up @@ -52,12 +52,12 @@ const CONFIG_SPEC = Object.freeze({
});

// main entrance point for probot
module.exports = function (probot) {
export default function (probot) {
probot.on(ON_EVENTS, handlersController(CONFIG_SPEC));
};

// distributes handler invocations based on user config and config spec
function handlersController(configSpec) {
export function handlersController(configSpec) {
return async context => {
// get config from current repo .github folder or from the .github repo's .github folder
let config = await context.config('auto-me-bot.yml');
Expand Down
Loading

0 comments on commit 0e0d331

Please sign in to comment.