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

Remove some deps #165

Merged
merged 4 commits into from
Feb 19, 2020
Merged

Remove some deps #165

merged 4 commits into from
Feb 19, 2020

Conversation

DarthHater
Copy link
Member

@DarthHater DarthHater commented Feb 19, 2020

In some usability testing, we saw a number of dependencies get blocked from downloading, and so this PR aims to remove them!

This pull request makes the following changes:

  • Removes packageurl-js, crafting our own purl was not too difficult (we were doing shades of it other places)
  • Removes parse-packagejson-name, the code for this package is MIT, so I've implemented the function and crafted it to be more TypeScript friendly, might need to add a source attribution to the license header as a result
  • Removes prettify-xml, as it seemed like this wasn't actually getting used! The mysteries of the world!

cc @bhamail / @DarthHater / @allenhsieh / @ken-duck

@DarthHater
Copy link
Member Author

Submitted a question to one of the dependencies authors since we basically copied and pasted their MIT licensed code: keithamus/parse-packagejson-name#13

Copy link
Contributor

@allenhsieh allenhsieh left a comment

Choose a reason for hiding this comment

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

LGTM! tried it with ossi and iq, and all tests passing.

* limitations under the License.
*/

export const toPurl = (name: string, version: string, group = ''): string => {
Copy link
Contributor

Choose a reason for hiding this comment

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

hahaha that's all there was to packageurl-js!

We left-pad'd ourselves! 🤣

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I get why they used it (why not? It's a package that does what they want), but it was simple enough to just implement.

@@ -302,4 +299,31 @@ export class CycloneDXSbomCreator {
}
return undefined;
}

private parsePackageJsonName(name: string): Result {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, super nice of them!

@DarthHater DarthHater merged commit 36d3bde into master Feb 19, 2020
@DarthHater DarthHater deleted the RemoveDeps branch February 19, 2020 17:32
DarthHater pushed a commit that referenced this pull request Feb 19, 2020
## [4.0.2](v4.0.1...v4.0.2) (2020-02-19)

### Bug Fixes

* Remove some deps ([#165](#165)) ([36d3bde](36d3bde))
@DarthHater
Copy link
Member Author

🎉 This PR is included in version 4.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants