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

Force LF line endings in bin/jscodeshift.js and remove spaces after shebang #555

Merged
merged 1 commit into from Apr 3, 2023

Conversation

jakeboone02
Copy link
Contributor

This PR forces LF line endings for bin/jscodeshift.js and removes the spaces added after the shebang pragma in #549. I believe the spaces are not necessary as long as the line endings are LF and not CRLF.

See my comment about Bun here: #549 (comment)

@Daniel15
Copy link
Member

Daniel15 commented Apr 3, 2023

Thanks - I'll try to cut a new release soon.

@Daniel15 Daniel15 merged commit a317249 into facebook:main Apr 3, 2023
4 checks passed
@jakeboone02
Copy link
Contributor Author

Thanks! 🚀

@jakeboone02 jakeboone02 deleted the lf-line-endings branch April 3, 2023 23:11
@juzerzarif
Copy link

Is there a release published with this fix?

@Daniel15
Copy link
Member

Daniel15 commented May 6, 2023 via email

@ElonVolo
Copy link
Collaborator

ElonVolo commented May 7, 2023 via email

@Daniel15
Copy link
Member

Daniel15 commented May 7, 2023

npm is giving me an error when I try to publish:

npm ERR! code E429
npm ERR! 429 Too Many Requests - PUT https://registry.npmjs.org/jscodeshift

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Daniel\AppData\Roaming\npm-cache\_logs\2023-05-07T19_48_27_396Z-debug.log

Not sure why I'm getting a 429 given I haven't used npm today 🤔

@Daniel15
Copy link
Member

Daniel15 commented May 7, 2023

Fixed my npm issue. New version has been published. Thanks for the patience.

I'm going to see if I can somehow automatically publish dev versions of jscodeshift.

@razzeee
Copy link

razzeee commented Nov 9, 2023

This seems to be a regression an reintroduce the original issue.

Trying to run the codemod in https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5 on the codebase of https://github.com/flathub/website/ leaves me with

─ npx jscodeshift ./src/ \                                                                                                                                                 ─╯
  --extensions=ts,tsx \
  --parser=tsx \
  --transform=./node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.js
/usr/bin/env: „node\r“: Datei oder Verzeichnis nicht gefunden
/usr/bin/env: Verwenden Sie -[v]S, um Optionen in #!-Zeichen zu übergeben

Using linux with zsh (in vscode)

@Daniel15
Copy link
Member

Hmm I'm not sure how this could have regressed :/ I'll look into it.

@ElonVolo
Copy link
Collaborator

Normally don't most projects prevent these sorts of regressions by including an .editorconfig file and some fairly aggressive eslint/prettier configs?

@Daniel15
Copy link
Member

@EnolVolo We do have an .editorconfig file that says to use LF newlines for all files: https://github.com/facebook/jscodeshift/blob/main/.editorconfig

@Daniel15
Copy link
Member

Daniel15 commented Nov 16, 2023

@razzeee I'm unable to reproduce the issue. I tested on both Ubuntu 22.04 and Debian 12, and both can run jscodeshift without an error:

11:02 daniel@la05 /home/daniel
% npx jscodeshift --version
Need to install the following packages:
jscodeshift@0.15.1
Ok to proceed? (y) y
jscodeshift: 0.15.1
 - babel: 7.23.3
 - babylon: 7.23.3
 - flow: 0.222.0
 - recast: 0.23.4

It may be something to do with that specific transform? I'm unsure. Please open a new issue with more debugging info if you need help.

@razzeee
Copy link

razzeee commented Nov 17, 2023

Sorry for the comotion, it's that standard npx bug again 🙄

So you need to run npx jscodeshift@latest ... to actually not get a random version.

npx jscodeshift@latest ./src/ \
  --extensions=ts,tsx \
  --parser=tsx \
  --transform=./node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.js

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.

None yet

6 participants