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

fix: handle cases where no package.json and global deps #471

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

jordanshatford
Copy link
Collaborator

closes: #469

Copy link

codesandbox bot commented Apr 23, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Apr 23, 2024

🦋 Changeset detected

Latest commit: 40746f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hey-api-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 5:43am

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.85%. Comparing base (ab68dfa) to head (40746f9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #471      +/-   ##
==========================================
+ Coverage   79.74%   79.85%   +0.10%     
==========================================
  Files          75       75              
  Lines        6029     6060      +31     
  Branches      603      606       +3     
==========================================
+ Hits         4808     4839      +31     
  Misses       1220     1220              
  Partials        1        1              
Flag Coverage Δ
unittests 79.85% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work with Yarn?

@jordanshatford
Copy link
Collaborator Author

Will this work with Yarn?

Not sure, Would likely need to add another case. I dont have time to work on this more today, so you can merge or update if you need

@mrlubos mrlubos merged commit 09935b4 into main Apr 23, 2024
16 checks passed
@mrlubos mrlubos deleted the fix/handle-globally-installed branch April 23, 2024 06:43
@github-actions github-actions bot mentioned this pull request Apr 23, 2024
let dependencies: Dependencies = {};

// Attempt to get all globally installed pacakges.
const result = sync('npm', ['list', '-g', '--json', '--depth=0']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks usage in projects that have configured npm to be intercepted by corepack, and then using another package manager.

image

Test by doing corepack enable && corepack enable npm and corepack use yarn@4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SimenB, I think I'll just remove dependency checks, there are too many variants to consider given the value of this feature

Copy link
Contributor

@mrlubos mrlubos May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimenB this will be removed in v0.45.0, please let me know if that works for you once you try it out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, 0.45 works. Thanks!

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

Successfully merging this pull request may close these issues.

CLI fails if it cannot find a package.json
3 participants