dahlia / logtape

Simple logging library with zero dependencies for Deno, Node.js, Bun, browsers, and edge functions
http://logtape.org/
MIT License
546 stars 11 forks source link

Fix bug allowing logtape to work under Node.js #4

Closed kitsonk closed 5 months ago

kitsonk commented 5 months ago

Fixes #3

This dynamic imports the filesink module based on if it is Deno or not, as well as safely access the Deno namespace for top level code that is evaluated when modules are loaded (which occurs when Cloudflare Workers create bundles).

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.00%. Comparing base (b6141a6) to head (e195e73). Report is 1 commits behind head on main.

:exclamation: Current head e195e73 differs from pull request most recent head 683171e

Please upload reports for the commit 683171e to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4 +/- ## ========================================== + Coverage 97.74% 98.00% +0.25% ========================================== Files 9 9 Lines 622 703 +81 Branches 128 128 ========================================== + Hits 608 689 +81 Misses 13 13 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kitsonk commented 5 months ago

Thanks for your contribution!

The lint seemed to fail. Could you check it out?

error[no-slow-types]: found destructuring, which is not supported in the public API
  --> /Users/runner/work/logtape/logtape/logtape/mod.ts:35:14
   | 
35 | export const { getFileSink, getRotatingFileSink } =
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = hint: separate each destructured symbol into its own export statement

  info: destructuring can not be inferred by fast check
  docs: https://jsr.io/go/slow-type-unsupported-destructuring

Yeah, forgot to do a publish dry run... It should pass now.