Open imrantvlk opened 6 years ago
I think you're not supposed to traverse a repo's node_modules since it's not the actual source and probably irrelevant. Looking at the repo's directory structure you're running this on, a better way to execute this would probably be:
$ refreshdeps lib
where lib
is the directory in which source code is located.
We could, however, handle this better by providing better configuration defaults, so I think actionables are:
node_modules
folder to the default ignore list..gitignore
, but we also need to support include
option, just in case.PS. I can probably work on this on Monday. However feel free to take this if you have the urgency :+1:
I did the following:
refreshdeps -v ./ Traversing bin/kerouac.js Traversing lib/application.js Traversing lib/index.js Traversing lib/layout.js Traversing lib/page.js Traversing lib/queue.js Traversing lib/route.js Traversing lib/router.js Traversing lib/utils.js Traversing test/index.test.js Traversing test/route.test.js Traversing test/router.test.js Traversing lib/cli/build.js Traversing lib/cli/index.js Traversing lib/engines/identity.js Traversing lib/middleware/absoluteURL.js Traversing lib/middleware/canonicalURL.js Traversing lib/middleware/copy.js Traversing lib/middleware/findFile.js Traversing lib/middleware/index.js Traversing lib/middleware/init.js Traversing lib/middleware/layout.js Traversing lib/middleware/loadContent.js Traversing lib/middleware/manifest.js Traversing lib/middleware/prettyURL.js Traversing lib/middleware/render.js Traversing lib/middleware/timestamps.js Traversing lib/plugins/assets.js Traversing lib/plugins/content.js Traversing lib/plugins/index.js Traversing node_modules/append/append.js Traversing node_modules/argparse/index.js Traversing node_modules/assertion-error/index.js Traversing node_modules/canonical-path/index.js Traversing node_modules/canonical-path/index.spec.js Traversing node_modules/chai/chai.js Traversing node_modules/chai/index.js Traversing node_modules/chai/karma.conf.js Traversing node_modules/chai/karma.sauce.js Traversing node_modules/chai/sauce.browsers.js Traversing node_modules/commander/index.js Traversing node_modules/debug/node.js Traversing node_modules/deep-eql/index.js Traversing node_modules/deep-eql/karma.conf.js Traversing node_modules/diff/diff.js Traversing node_modules/diveSync/diveSync.js Traversing node_modules/escape-string-regexp/index.js Traversing node_modules/glob/glob.js Traversing node_modules/growl/test.js Traversing node_modules/inherits/inherits.js Traversing node_modules/inherits/inherits_browser.js Traversing node_modules/jade/index.js Traversing node_modules/jade/jade.js Unable to parse node_modules/jade/jade.js: Octal literal in strict mode (944:46). You may need some additional plugins to parse this source file. See: https://babeljs.io/docs/en/next/babel-parser.html#plugins
I am not sure which plugin to get to resolve the issue.
Perhaps instead of killing the process we could skip the files that couldn't be parsed and give an output for the ones that have successfully parsed. Also throw a warning for the modules that have been skipped.