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: support package.json missing name property #1766

Merged
merged 1 commit into from
Mar 26, 2021

Conversation

JamesPatrickGill
Copy link
Member

What does this PR do?

This is to fix a bug where package.json without name property would throw an error.

@JamesPatrickGill JamesPatrickGill requested review from a team as code owners March 25, 2021 13:28
let dependencies = packageJson.dependencies;
if (options.dev) {
dependencies = { ...dependencies, ...packageJson.devDependencies };
}
if (isEmpty(dependencies)) {
return new Promise((resolve) =>
resolve({
name: packageJson.name,
name: packageJson.name || 'unnamed-package',
Copy link
Contributor

Choose a reason for hiding this comment

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

is this the default name we use elsewhere in Snyk?
could you write a test to assert this fallback behaviour?

@aviadhahami aviadhahami force-pushed the fix/unnamed-package-json branch from cb15efe to 5da3171 Compare March 25, 2021 14:02
@JamesPatrickGill JamesPatrickGill force-pushed the fix/unnamed-package-json branch from 5da3171 to 9d31b97 Compare March 26, 2021 11:31
This is to fix a bug where package.json without name property would throw an error.
@JamesPatrickGill JamesPatrickGill force-pushed the fix/unnamed-package-json branch from 9d31b97 to c8738d5 Compare March 26, 2021 12:13
@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2021

Expected release notes (by @JamesPatrickGill)

fixes:
support package.json missing name property (c8738d5)

others (will not be included in Semantic-Release notes):
target node14.4.0 instead of node14 to fix build (1ce0d11)
iac smoke tests to be less explicit (2d6cd7e)
fix broken IaC smoke test (259c263)
remove now-redundant and excessively complex acceptance tests (20d560b)
refactor and improve testing (afdf3b3)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

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.

2 participants