Skip to content

Commit

Permalink
Update client library to use .js extension for imports (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettimus authored Jul 22, 2024
1 parent 6237250 commit 19d7c4e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Fiberplane<[email protected]>",
"type": "module",
"main": "dist/index.js",
"version": "0.2.0",
"version": "0.2.1-beta.1",
"dependencies": {
"@neondatabase/serverless": "^0.9.3"
},
Expand Down
7 changes: 4 additions & 3 deletions client-library/src/honoMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { env } from "hono/adapter";
import { createMiddleware } from "hono/factory";
import { replaceFetch } from "./replace-fetch";
import { RECORDED_CONSOLE_METHODS, log } from "./request-logger";

import { replaceFetch } from "./replace-fetch.js";
import { RECORDED_CONSOLE_METHODS, log } from "./request-logger.js";
import {
errorToJson,
extractCallerLocation,
Expand All @@ -12,7 +13,7 @@ import {
specialFormatMessage,
tryCreateFriendlyLink,
tryPrettyPrintLoggerLog,
} from "./utils";
} from "./utils.js";

// Type hack that makes our middleware types play nicely with Hono types
type RouterRoute = {
Expand Down
2 changes: 1 addition & 1 deletion client-library/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { createHonoMiddleware } from "./honoMiddleware";
export { createHonoMiddleware } from "./honoMiddleware.js";
2 changes: 1 addition & 1 deletion client-library/src/replace-fetch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IGNORE_FPX_LOGGER_LOG, errorToJson, generateUUID } from "./utils";
import { IGNORE_FPX_LOGGER_LOG, errorToJson, generateUUID } from "./utils.js";

/**
* Hacky function that monkey-patches fetch to send data about network requests to fpx.
Expand Down
2 changes: 1 addition & 1 deletion client-library/src/request-logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const RECORDED_CONSOLE_METHODS = [
"warn",
] as const;

import { PRETTIFY_FPX_LOGGER_LOG, type PrintFunc } from "./utils";
import { PRETTIFY_FPX_LOGGER_LOG, type PrintFunc } from "./utils.js";

// === LOGGER FUNCTION === //
function logReq(
Expand Down
4 changes: 3 additions & 1 deletion package-lock.json

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

0 comments on commit 19d7c4e

Please sign in to comment.