Skip to content

Swapped adm-zip out for zip.js#6018

Draft
Amndeep7 wants to merge 2 commits intomasterfrom
swap-zip-dep
Draft

Swapped adm-zip out for zip.js#6018
Amndeep7 wants to merge 2 commits intomasterfrom
swap-zip-dep

Conversation

@Amndeep7
Copy link
Copy Markdown
Contributor

adm-zip was causing issues such as the following

 warning  in ../../node_modules/adm-zip/util/fileSystem.js

Module not found: Error: Can't resolve 'original-fs' in '/Users/amann/work/auto/dependency-track-mapper/heimdall2/node_modules/adm-zip/util'

which was causing heimdall to have runtime errors and not display itself properly. This had been throwing warnings before but had started to actually cause this runtime problem when making other changes so I decided to fix it.

Easiest thing to do was to replace it wholesale. Sidebenefit is that I found zip.js which has built-in types so we have that benefit.

The only problem is that it is not a commonjs dependency so we have to do a dynamic import which is a bit ugly due to the lack of top level await that we're currently suffering from. I'm working on getting us able to use that functionality, but that shouldn't be a blocker for this pr.

Also I cleaned up the files we touched a little bit.

Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
@Amndeep7 Amndeep7 requested a review from georgedias July 23, 2024 06:03
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 New Code Smells (required ≤ 0)
5 New Bugs (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@Amndeep7
Copy link
Copy Markdown
Contributor Author

Currently failing the frontend tests due to node not finding the TransformStream object for some reason even though node supports it as of v18. It works fine on my machine but that's cause it's a browser running the frontend code. I need to see if we need a polyfill or if I can muck with stuff to get node to work properly.

@Amndeep7 Amndeep7 marked this pull request as draft July 23, 2024 06:23
@Amndeep7 Amndeep7 linked an issue Jul 31, 2024 that may be closed by this pull request
Signed-off-by: Amndeep Singh Mann <amann@mitre.org>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
5 New Bugs (required ≤ 0)
2 New Code Smells (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

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.

Should look into a replacement lib to handle zip files

1 participant