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

refactor: use native fs promise-based API instead of promisify & fix formatting #2046

Merged
merged 5 commits into from May 17, 2023

Conversation

micalevisk
Copy link
Member

@micalevisk micalevisk commented Apr 23, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

  • there are few places where the callback version of native nodejs modules are used
  • I found one place in which a string concatenation for file path was used when we could use the cross-platform version

What is the new behavior?

  • replace those calls of fs. with their Promise-based API since they were introduced in nodejs v10.0.0
  • replace "${foo}/${bar}" with path.join(foo, bar) for cross-platform compatibility sake
  • add unit tests for PackageManagerFactory.find
  • run npm run format

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@micalevisk micalevisk changed the title refactor(lib): use native fs promise-based API instead of promisify refactor: use native fs promise-based API instead of promisify & formatting Apr 23, 2023
@micalevisk micalevisk changed the title refactor: use native fs promise-based API instead of promisify & formatting refactor: use native fs promise-based API instead of promisify & fix formatting Apr 23, 2023
@kamilmysliwiec kamilmysliwiec merged commit 6597e8d into nestjs:master May 17, 2023
1 check passed
@kamilmysliwiec
Copy link
Member

lgtm

@micalevisk micalevisk deleted the file-system-reader-refactor branch May 17, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants