refactor: port github-bot to ESM

This is one of those annoying things. Updating OctoKit updated some transitive sindresorhus dependency which now forces onto ESM.

This proves to be a pretty annoying problem because you can't use CommonJS from inside ESM and vice versa. Somehow, as an industry, we've managed to invent "what color is your import" for NodeJS, which is a pretty brutal problem.

Anyway. I've made this specific package into an ESM module, and what it compiles to is a module now, too, instead of CommonJS. Luckily, because the github bot is so small and isolated, it means we have very little trouble doing this (and hopefully no brutal side effects).
This commit is contained in:
zkldi
2024-08-23 09:56:58 +00:00
parent f20c70be2d
commit 65cb74faa4
4 changed files with 46 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
import { ProcessEnv } from "./config";
import { ProcessEnv } from "./config.js";
import { App, createNodeMiddleware } from "@octokit/app";
import express from "express";
import fetch from "node-fetch";