diff --git a/src/event-handler/index.ts b/src/event-handler/index.ts index ea6bd98d..4a82eeb9 100644 --- a/src/event-handler/index.ts +++ b/src/event-handler/index.ts @@ -1,4 +1,4 @@ -import { createLogger } from "../createLogger"; +import { createLogger } from "../createLogger.js"; import type { EmitterWebhookEvent, EmitterWebhookEventName, @@ -11,9 +11,9 @@ import { receiverOn as on, receiverOnAny as onAny, receiverOnError as onError, -} from "./on"; -import { receiverHandle as receive } from "./receive"; -import { removeListener } from "./remove-listener"; +} from "./on.js"; +import { receiverHandle as receive } from "./receive.js"; +import { removeListener } from "./remove-listener.js"; interface EventHandler { on( diff --git a/src/event-handler/on.ts b/src/event-handler/on.ts index e95e6216..6e4a0399 100644 --- a/src/event-handler/on.ts +++ b/src/event-handler/on.ts @@ -1,4 +1,4 @@ -import { emitterEventNames } from "../generated/webhook-names"; +import { emitterEventNames } from "../generated/webhook-names.js"; import type { EmitterWebhookEvent, EmitterWebhookEventName, diff --git a/src/index.ts b/src/index.ts index 373cb2a6..6a0e4125 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ -import { createLogger } from "./createLogger"; -import { createEventHandler } from "./event-handler/index"; +import { createLogger } from "./createLogger.js"; +import { createEventHandler } from "./event-handler/index.js"; import { sign, verify } from "@octokit/webhooks-methods"; -import { verifyAndReceive } from "./verify-and-receive"; +import { verifyAndReceive } from "./verify-and-receive.js"; import type { EmitterWebhookEvent, EmitterWebhookEventName, @@ -12,10 +12,10 @@ import type { WebhookError, WebhookEventHandlerError, EmitterWebhookEventWithStringPayloadAndSignature, -} from "./types"; +} from "./types.ts"; -export { createNodeMiddleware } from "./middleware/node/index"; -export { emitterEventNames } from "./generated/webhook-names"; +export { createNodeMiddleware } from "./middleware/node/index.js"; +export { emitterEventNames } from "./generated/webhook-names.js"; // U holds the return value of `transform` function in Options class Webhooks { diff --git a/src/middleware/node/index.ts b/src/middleware/node/index.ts index 7f57368d..a3aacd37 100644 --- a/src/middleware/node/index.ts +++ b/src/middleware/node/index.ts @@ -1,7 +1,7 @@ -import { createLogger } from "../../createLogger"; -import type { Webhooks } from "../../index"; -import { middleware } from "./middleware"; -import type { MiddlewareOptions } from "./types"; +import { createLogger } from "../../createLogger.js"; +import type { Webhooks } from "../../index.js"; +import { middleware } from "./middleware.js"; +import type { MiddlewareOptions } from "./types.ts"; export function createNodeMiddleware( webhooks: Webhooks, diff --git a/src/middleware/node/types.ts b/src/middleware/node/types.ts index 92dec00f..a7138589 100644 --- a/src/middleware/node/types.ts +++ b/src/middleware/node/types.ts @@ -1,4 +1,4 @@ -import type { Logger } from "../../createLogger"; +import type { Logger } from "../../createLogger.js"; export type MiddlewareOptions = { path?: string; diff --git a/test/integration/event-handler-test.ts b/test/integration/event-handler-test.ts index 67ec266c..d03b30e1 100644 --- a/test/integration/event-handler-test.ts +++ b/test/integration/event-handler-test.ts @@ -1,6 +1,9 @@ -import { createEventHandler } from "../../src/event-handler"; +import { createEventHandler } from "../../src/event-handler/index.js"; import { EmitterWebhookEvent, WebhookEventHandlerError } from "../../src/types"; -import { installationCreatedPayload, pushEventPayload } from "../fixtures"; +import { + installationCreatedPayload, + pushEventPayload, +} from "../fixtures/index.js"; test("events", async () => { const eventHandler = createEventHandler({}); diff --git a/test/integration/node-middleware.test.ts b/test/integration/node-middleware.test.ts index e2500807..71fba234 100644 --- a/test/integration/node-middleware.test.ts +++ b/test/integration/node-middleware.test.ts @@ -6,7 +6,7 @@ import { sign } from "@octokit/webhooks-methods"; // import without types const express = require("express"); -import { createNodeMiddleware, Webhooks } from "../../src"; +import { createNodeMiddleware, Webhooks } from "../../src/index.ts"; const pushEventPayload = readFileSync( "test/fixtures/push-payload.json", diff --git a/test/integration/smoke-test.ts b/test/integration/smoke-test.ts index 987290dc..1c763464 100644 --- a/test/integration/smoke-test.ts +++ b/test/integration/smoke-test.ts @@ -1,4 +1,4 @@ -import { Webhooks, createEventHandler, emitterEventNames } from "../../src"; +import { Webhooks, createEventHandler, emitterEventNames } from "../../src/index.ts"; test("@octokit/webhooks", () => { const emitWarningSpy = jest.spyOn(process, "emitWarning"); diff --git a/test/integration/webhooks.test.ts b/test/integration/webhooks.test.ts index 9973a55a..04db8d48 100644 --- a/test/integration/webhooks.test.ts +++ b/test/integration/webhooks.test.ts @@ -2,7 +2,7 @@ import { readFileSync } from "fs"; import { sign } from "@octokit/webhooks-methods"; -import { Webhooks } from "../../src"; +import { Webhooks } from "../../src/index.ts"; const pushEventPayloadString = readFileSync( "test/fixtures/push-payload.json", diff --git a/test/typescript-validate.ts b/test/typescript-validate.ts index db7249c6..94c6234e 100644 --- a/test/typescript-validate.ts +++ b/test/typescript-validate.ts @@ -4,7 +4,7 @@ import { EmitterWebhookEvent, WebhookError, createNodeMiddleware, -} from "../src/index"; +} from "../src/index.js"; import { createServer } from "http"; import { HandlerFunction, diff --git a/test/unit/createLogger-test.ts b/test/unit/createLogger-test.ts index 568a6fde..1c186302 100644 --- a/test/unit/createLogger-test.ts +++ b/test/unit/createLogger-test.ts @@ -1,4 +1,4 @@ -import { createLogger } from "../../src/createLogger"; +import { createLogger } from "../../src/createLogger.js"; const noop = () => {}; diff --git a/test/unit/event-handler-on-test.ts b/test/unit/event-handler-on-test.ts index 61357a2e..604b9232 100644 --- a/test/unit/event-handler-on-test.ts +++ b/test/unit/event-handler-on-test.ts @@ -1,4 +1,4 @@ -import { receiverOn } from "../../src/event-handler/on"; +import { receiverOn } from "../../src/event-handler/on.js"; import { State } from "../../src/types"; function noop() {} diff --git a/test/unit/event-handler-receive-test.ts b/test/unit/event-handler-receive-test.ts index 240566eb..224c475c 100644 --- a/test/unit/event-handler-receive-test.ts +++ b/test/unit/event-handler-receive-test.ts @@ -1,4 +1,4 @@ -import { receiverHandle as receive } from "../../src/event-handler/receive"; +import { receiverHandle as receive } from "../../src/event-handler/receive.js"; import { State } from "../../src/types"; const state: State = { diff --git a/test/unit/event-handler-remove-listener-test.ts b/test/unit/event-handler-remove-listener-test.ts index 231be656..8fec9d94 100644 --- a/test/unit/event-handler-remove-listener-test.ts +++ b/test/unit/event-handler-remove-listener-test.ts @@ -1,4 +1,4 @@ -import { removeListener } from "../../src/event-handler/remove-listener"; +import { removeListener } from "../../src/event-handler/remove-listener.js"; import { State } from "../../src/types"; test("remove-listener: single listener", () => { diff --git a/test/unit/event-handler-wrap-error-handler-test.ts b/test/unit/event-handler-wrap-error-handler-test.ts index 63b8ecf2..1cfafb96 100644 --- a/test/unit/event-handler-wrap-error-handler-test.ts +++ b/test/unit/event-handler-wrap-error-handler-test.ts @@ -1,4 +1,4 @@ -import { wrapErrorHandler } from "../../src/event-handler/wrap-error-handler"; +import { wrapErrorHandler } from "../../src/event-handler/wrap-error-handler.js"; const noop = () => {};