-
-
Notifications
You must be signed in to change notification settings - Fork 877
fix: Proper way of finding npm pack
filename
output.
#3460
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
base: main
Are you sure you want to change the base?
Conversation
the other branch which tried to solve this is here and my recommendation: #3259 (comment) |
That doesn't help much IMHO, because the JSON is part of other noisy output. So instead of one-line fix you will have to find JSON object and handle all error parsing. |
pretty sure in json mode it does a better job of obscuring the nonsense |
19d0b42 should do this, right? |
npm pack
output.npm pack
filename
output.
@asottile any chance to get this merged any soon? |
"devDependencies": { | ||
"typescript": "^5.3.0" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is going to make the test prohibitively slow -- can you make a faster example?
pkg = prefix.path(pkg.strip()) | ||
_, pkg, _ = cmd_output('npm', 'pack', '--json', cwd=prefix.prefix_dir) | ||
pkg_json = json.loads(pkg) | ||
pkg = prefix.path(pkg_json[0].get('filename')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.get
will "silently" fail when the key is missing -- use brackets to access keys in a dictionary
That will fix pollution of installation path with TypeScript output: