From 1ab4aadef05f7eba8878d60136eb11291d0d2493 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Tue, 16 Apr 2024 15:08:35 -0400 Subject: [PATCH 1/2] docs: add note on needed config changes for TypeScript --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 007bf5a..7de3b52 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,12 @@ const authentication = await auth(); // } ``` +> [!IMPORTANT] +> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `"moduleResolution": "node16", "module": "node16"`. +> +> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).
+> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus) + ## `createActionAuth()` The `createActionAuth()` method has no options. From 24679ad08c214f40e16fd66e6e583b9a8aba0927 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Tue, 16 Apr 2024 15:08:54 -0400 Subject: [PATCH 2/2] fix(pkg): add a default fallback export --- scripts/build.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index e59e91f..8a4cee0 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -56,12 +56,13 @@ async function main() { { ...pkg, files: ["dist-*/**"], - main: "dist-src/index.js", types: "dist-types/index.d.ts", exports: { ".": { types: "./dist-types/index.d.ts", import: "./dist-src/index.js", + // Tooling currently are having issues with the "exports" field when there is no "default", ex: TypeScript, eslint + default: "./dist-src/index.js", } }, sideEffects: false,