Giter VIP home page Giter VIP logo

yatsl's People

Contributors

phanty133 avatar sakars avatar towergame avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

phanty133 sakars

yatsl's Issues

Browser Detection

The logger should detect when it's running in a browser environment and automatically apply a different configuration that plays nicer with browsers (will most likely require some redesign of how the logger logs things in a browser context, at the very least, disable ANSI, but preferably use some other method of prettying the text and making objects still explorable like with console.log)

Logger logs incorrect line

The package logs an incorrect line reference when called.
Expected behaviour:
Calling logger.log("I live!") on line 4 of index.ts would output:
2022-08-05T15:15:27.266Z [debug | index.ts:4:8] I live!

Actual behaviour:
Calling logger.log("I live!") on line 4 of index.ts outputs:
2022-08-05T15:15:27.266Z [debug | index.ts:150:53] I live!

Rewrite tests to be less cumbersome

Currently test code isn't particularly DRY and repeats itself quite often ideally it should iterate through all the logging funcs more elegantly.

JSON.stringify removes information from objects

As the title alludes, JSON.stringify only handles JSON objects. Those are only a subset of what a Javascript object can be.
Things like class instance names or functions are simply removed in the current implementation of the private Logger.stringify function.
Logging pure functions simply throws undefined and while rare and possibly almost never used in practice, this is highly inconsistent with the normal behaviour.

Line logging is broken on Windows

Malformed regex does not work with Windows handling of file systems as it uses back slashes instead of forward slashes like on Linux.

Breaks on TypeScript 4.7 with ts-node

Trying to run a project using yatsl on TypeScript 4.7 using ts-node seems to make it complain:

Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.

Removing yatsl from the code seems to let it run just fine.

Fix tabs = false behaviour

Currently a mistake makes tabs = false indent using the s character instead of the character.

Additionally, fix the unit test for spaces to actually detect whether the object is indented using spaces.

Object pretty-print

Set up pretty-printing for objects, perhaps even syntax highlighting

TODO list:

  • Switch the logging functions from string to any
  • Add the ability to make it log as JSON (or anything else, if there's a better way of doing it)
    • potentially add a special case for if the output is a browser console, as they handle objects themselves
  • On ANSI-supported consoles, add syntax highlighting

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.