Coder Social home page Coder Social logo

depcheck-es6's People

Contributors

lijunle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

depcheck-es6's Issues

Pluggable desgin

The document has moved to here.

While, if anybody has feedback on the design, please comment on this thread..

latest version of depcheck-es6 can't be installed

Something happening during the latest publish to npm:

❯ nvm use 4
Now using node v4.2.1 (npm v3.3.6)
 ❯ npm cache clean
 ❯ npm i depcheck-es6
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/dgreene/.nvm/versions/node/v4.2.1/bin/node" "/Users/dgreene/.nvm/versions/node/v4.2.1/bin/npm" "i" "depcheck-es6"
npm ERR! node v4.2.1
npm ERR! npm  v3.3.6

npm ERR! shasum check failed for /var/folders/hl/c611mdq92fd6q6_rf_mj33cr0000gp/T/npm-34889-dad6951d/registry.npmjs.org/depcheck-es6/-/depcheck-es6-0.5.4.tgz
npm ERR! Expected: 7cfa907d49a6db295acfd0da89b326d9e8a5a071
npm ERR! Actual:   a4e35e665e4d13d749edddeb1419dd4621175c4a
npm ERR! From:     https://registry.npmjs.org/depcheck-es6/-/depcheck-es6-0.5.4.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/hl/c611mdq92fd6q6_rf_mj33cr0000gp/T/node_modules/package-json/npm-debug.log

I've repeated this in various versions of node, and my users are reporting this as well.

api error

Hi,

I tried calling api from my code, I am getting the following error, can you tell me why its happening.

-MacBook-Pro:todomvc $ npm install
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No repository field.

[email protected] install /Users/Desktop/FrontEnd/redux-master/examples/todomvc
node test-depcheck.js

testing
module.js:338
throw err;
^
Error: Cannot find module '/path/to/your/project/package.json'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at depcheck (/Users/Desktop/FrontEnd/redux-master/examples/todomvc/node_modules/depcheck-es6/dist/index.js:251:40)
at Object. (/Users/Desktop/FrontEnd/redux-master/examples/todomvc/test-depcheck.js:31:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node test-depcheck.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node test-depcheck.js'.
npm ERR! This is most likely a problem with the redux-todomvc-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node test-depcheck.js
npm ERR! You can get their info via:
npm ERR! npm owner ls redux-todomvc-example
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Desktop/FrontEnd/redux-master/examples/todomvc/npm-debug.log

https://github.com/lijunle/depcheck-es6#api

Thanks,

Publish on npm

Thanks for doing this, I think it was necessary! Thought I'd make this issue just so I got the notification for when it got published on npm :)

Integrate with npm install

Hi,

What I am trying to do is when I do npm install itslef I need to check unused dependencies, is there any way to include depcheck-es6 package during npm install itself, so that I dont need to install it seprately and it will show me the result unused depencies.

Thanks,

Babel plugin support

In .babelrc:

{
  "stage": 2,
  "env": {
    "development": {
      "plugins": [
        "react-transform"
      ],
      "extra": {
        "react-transform": {
          "transforms": [{
            "transform": "react-transform-hmr",
            "imports": ["react"],
            "locals":  ["module"]
          }]
        }
      }
    }
  }
}

Expected packages:

  • babel-plugin-react-transform
  • react-transform-hmr

Work items:

  • The configs in .babelrc file.
  • Configs with options (example).
  • The configs in envionment (example).
  • The configs in package.json (example).
  • The configs in Babel CLI. (see note below)
  • The configs in API calls. (see note below)

Note: It need more affect to support Babel plugins in CLI and API calls. They are not recommended by Babel. Please open an issue and let me know the reason if anybody think they are necessary.

*react-redux and *classnames package bug

Hi,

We have tested the depcheck-es6 package with a sample todo react app, but its not recognizing the *react-redux and *classnames package. We are using the npm version : 2.11.3 and node version: v0.12.7.

You can see in the code where they have used react-redux and classnames packages
https://github.com/rackt/redux/blob/master/examples/todomvc/containers/App.js
import { connect } from 'react-redux';

https://github.com/rackt/redux/blob/master/examples/todomvc/components/TodoTextInput.js
import classnames from 'classnames';

Providing the output below.

depcheck-es6

D:\todomvc>.\node_modules.bin\depcheck
Unused Dependencies

  • classnames
  • react-redux

Unused devDependencies

  • babel-core
  • babel-loader
  • jsdom
  • node-libs-browser
  • raw-loader
  • react-hot-loader
  • style-loader
  • todomvc-app-css

Thanks

Possibility of dependency check for child custom modules

Hi @lijunle,

Thanks a lot for great plug-in, it helping us a lot to identify unused dependencies.

As per my understanding, depcheck-es6 will looks in to current package.json and identifies whether dependencies are used in the code or not and list down the results.

is there any possibility to check recursively into custom node_modules and list down the same by special configurations.

untitled diagram

While i run the "depcheck" against the App/package.json, based on configurations it should do recursive check and provide results in one shot.

Hope my problem is clear to you.. :)

Please guide me if there is possibility, have tried some possibilities, but not succeeded.

Thanks again..

Parser for coffeescript

Adding a parser for coffeescript files would be awesome.

I'm not familiar with the code, we just need to find a parser?

vice versa function

Is it possble to identify the package name in package.json file when that module is not present. I mean can we do a vice versa function in depcheck-es6

Reporting of parsing errors

Currently no errors are reported if node-source-walk encounters an error while parsing a file, which makes it tough to differentiate between a file that simply didn't include dependencies and a file with a syntax error.

I'm not sure what the best way to report errors would be... Should it be with a debug option that triggers a console.debug or perhaps returns some kind of ParsingError object that the calling method can use... or simply re-raise the error?

Performance enhancement

Currently, depCheck looks for all files under directory to get dependency result.

Some strategies can be used to optimize the performance:

  1. First, it get packages from a part of files, compare with declaring packages.
  2. If all declaring packages are used, stop reading files. Return everything is good. ✅
  3. If not all declaring packages are used, continue the step 1.
  4. If all files are searched, but there are some declaring packaged not fulfilled, show them as unused. ❌

Concretely, it need to convert the promise queue in checkDirectory to Array<Func<Promise>> queue. The promises are triggered only then function is invoked.

instead of rejecting syntax, try another parser

In index.js, if the parser throws an error, we give up.

This means es6 files with the .js extension will never parse.

Instead, it should fall back to another parser.

This probably should only happen with .js files and if the original parser isn't already es6.

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.