Giter Club home page Giter Club logo

compat's People

Contributors

jgardella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

compat's Issues

ES2016+ Support

Implement detection for ES2016+ features:

2016 features

  • exponentiation (**) operator
  • Array.prototype.includes

2016 misc

  • nested rest destructuring, declarations
  • nested rest destructuring, parameters

2017 features

  • Object.values
  • Object.entries
  • Object.getOwnPropertyDescriptors
  • String padding
  • async functions

2017 misc

  • class extends null

Error: Cannot find module './data-common'

Trying to run it in my project and get this error:

Failed to create JS table: Error: Cannot find module './data-common'
No previous compatibility table. Exiting.

Error: /usr/bin/env: ‘node\r’: No such file or directory

I'm trying to use this on a linux OS and I'm getting the following error:

$ compat --target assets/js/
/usr/bin/env: ‘node\r’: No such file or directory

I think it's coming from:

#! /usr/bin/env node

I debugged with

$od -c index.js | head

and I got:

0000000   #   !       /   u   s   r   /   b   i   n   /   e   n   v    
0000020   n   o   d   e  \r  \n   l   e   t       y   a   r   g   s    

So, I'm guessing my shell doesn't like these windows(?) line endings?

Exit code is 0 even if incompatibilities are detected

If incompatibilities are detected, the program does not indicate failure by returning a non-zero status. Fixing this would make it easier to use this in CI settings.

Furthermore, the errors are not printed to stderr. It might be a good idea to print the errors to stderr.

Broken CanIUse repo link since switch from "master" to "main"

Context

Compat uses the CanIUse repository to validate feature compatibility by grabbing the latest git commit.

Issue

This is hardcoded at line 181 from createTable.js: getLatestCommitSHA('fyrd', 'caniuse', 'heads/master')
In recent changes, the "master" branches got renamed to "main" to follow BLM movement, a seen here. Thus, it can no longer resolve and running compat now fails with an error:

stderr: (node:40588) UnhandledPromiseRejectionWarning: Error: Failed to load latest commit
at ClientRequest.<anonymous> ([MyPath]\node_modules\compat-cli\src\tableUpdater\createTable.js:158:16)

Impact:

No issues are found from compat, as the list fetching is never properly resolved. This makes the library's result unreliable (/unusable).

Fix

The easiest fix would be to hardcode the new main branch 'heads/main'. Maybe a better approach might be to have it fixed as the default but allow a config parameter url/branch name to be passed in case the repo or structure change in the future?

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.