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

Add ability to pass one or many directories to jscodeshift. Fixes #21 #24

Merged
merged 1 commit into from
Jul 28, 2015

Conversation

cpojer
Copy link
Contributor

@cpojer cpojer commented Jul 24, 2015

This allows us to use jscodeshift without find/xargs which should really help with the cli ergonomics. I've been fighting with this all the time and got really annoyed, so glad I finally got around to change the Runner.

This makes use of node-dir and uses Promises. I converted the Runner code to ES6, pretty sure there are some subjective code style choices but I tried to make the style more "functional" and use const where appropriate.

@fkling
Copy link
Contributor

fkling commented Jul 27, 2015

Can you simply increase the timeout in bin/__tests__/jscodeshift-test.js so that this test passes as well?

cpojer added a commit that referenced this pull request Jul 28, 2015
Add ability to pass one or many directories to jscodeshift. Fixes #21
@cpojer cpojer merged commit cc4a8c5 into master Jul 28, 2015
@fkling fkling deleted the dir-resolver branch July 28, 2015 22:19
@pieterv
Copy link
Member

pieterv commented Jul 30, 2015

Would be nice to use node-glob instead of node-dir, so you can do nice matching like my-project/**/MyPrefix*.js. Any reason why you didn't use it? if not i can do a PR if find the need for it :)

@cpojer
Copy link
Contributor Author

cpojer commented Jul 30, 2015

I didn't think that was important. In my codemods I always do the filtering in code (like search for specific require statements) and I just run them on everything. If you would prefer node-glob, feel free to send a PR.

@pieterv
Copy link
Member

pieterv commented Jul 30, 2015

Ok thanks @cpojer, ill see if it comes up and PR if needed :)

@fkling
Copy link
Contributor

fkling commented Jul 30, 2015

I think one of the issues is also that your shell will evaluate the path before it's passed to jscodeshift. However, some shells, with the correct setting, actually support ** natively.
I'm not opposed to it, but I'd also say we just see if there is an actual need for this.

euphocat pushed a commit to euphocat/jscodeshift that referenced this pull request Oct 22, 2017
…fier

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

Successfully merging this pull request may close these issues.

4 participants