Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils/color): Deno does not require permission for NO_COLOR #3306

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

ryuapp
Copy link
Contributor

@ryuapp ryuapp commented Aug 21, 2024

If we run Hono with Deno in node-compat mode, permission to obtain NO_COLOR from env is required in logger and showRoutes.
This PR fixes that and add the Doc.

If you want to reproduce the current situation, try the following ways:

  1. Make a directory and add Hono.
mkdir my-app
cd my-app
bun add hono
  1. Run this script by Deno.
// deno run main.ts
import { getColorEnabled } from "hono/utils/color"
console.log(getColorEnabled())
  1. Deno requests env access to "NO_COLOR".
┌ ⚠️  Deno requests env access to "NO_COLOR".
├ Run again with --allow-env to bypass this prompt.
└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions) >

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.31%. Comparing base (8f16802) to head (558e869).
Report is 13 commits behind head on main.

Files Patch % Lines
src/utils/color.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3306      +/-   ##
==========================================
+ Coverage   96.20%   96.31%   +0.11%     
==========================================
  Files         151      151              
  Lines       15293    15375      +82     
  Branches     2761     2686      -75     
==========================================
+ Hits        14713    14809      +96     
+ Misses        580      566      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ryuapp ryuapp changed the title fix(color): Deno does not require permission for NO_COLOR fix(utils/color): Deno does not require permission for NO_COLOR Aug 22, 2024
Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

Hi @ryuapp

I've never noticed that! Good improvement. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants