MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.62k stars 137 forks source link

fix/430-make-debug-logging-noop #434

Closed MasterKale closed 1 year ago

MasterKale commented 1 year ago

I'm disabling logging output for now while I investigate an alternative library to https://www.npmjs.com/package/debug. The fact that it requires @types/debug to also be installed is creating this catch-22 with dnt, specifically the Debugger type that comes from @types/debug.

In a Node project you'd re-export it like this after installing @types/debug:

export { Debugger, default as debug } from 'debug';

But Deno requires you to import Debugger from @types/debug specifically:

export { default as debug } from 'https://esm.sh/debug@4.3.4';
export type { Debugger } from 'https://esm.sh/@types/debug@4.1.8';

Unfortunately after dnt builds the project, trying to build a TypeScript project with tsc results in an error like the one reported in Issue #430:

node_modules/@simplewebauthn/server/script/deps.d.ts:6:31 - error TS6137: Cannot
import type declaration files. Consider importing 'debug' instead of '@types/debug'.

6 export type { Debugger } from '@types/debug';
                                ~~~~~~~~~~~~~~

Disabling logging now will give me time to research an alternative.