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 many JS vulns, fix tests #1775

Merged
merged 14 commits into from
Jul 14, 2022

Conversation

Stephen2
Copy link
Contributor

@Stephen2 Stephen2 commented May 27, 2022

  • fix: lint problem
  • fix: ignore malformed JSON file for FlowJS
  • fix: add missing @types/jest package
  • chore: update TypeScript version
  • chore: update all eslint deps
  • chore: update all Jest deps
  • chore: replace Jest config with jest.config.ts
  • fix: make root Jest tests ignore Example folders
  • chore: update css-select dep
  • chore: update css-tree to latest 1.x version
  • chore: upgrade ansi-regex to close JS vuln
  • chore: upgrade ejs to close JS vuln
  • chore: upgrade async to close JS vuln
  • chore: upgrade simple-plist to close JS vuln

Summary

Upgrades a ton of dependencies, closes JS vulns, gets lint & test working as intended. Only barely touches application code, due to TypeScript version upgrade and prettier upgrade.

Also makes yarn run test work again, by ignoring Example folders which aren't working right now.

Test Plan

I ensured that tsc, lint and test pass

@@ -227,7 +227,7 @@ function remeasure() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: all application code changes are as a result of yarn run lint --fix and not manually performed

@Stephen2 Stephen2 changed the title Update many JS vulns, fix tests Fix many JS vulns, fix tests May 27, 2022
@Stephen2
Copy link
Contributor Author

Need this library to be updated so I can close JS vulns that are blocking our build pipeline

@WoLewicki ?

@Stephen2
Copy link
Contributor Author

Stephen2 commented Jun 1, 2022

I've forked this project to https://github.com/MeritOpenSource/react-native-svg and will be looking into how to get this publishing to npm

The goal will be to keep this project on life support and at least close vulns and keep deps updated

Not necessary. Maintainer is busy but responsive

package.json Outdated Show resolved Hide resolved
@Stephen2 Stephen2 force-pushed the sp-update-css-select branch from 0c4533c to 8c6cb1b Compare June 1, 2022 20:56
@Stephen2 Stephen2 requested a review from WoLewicki June 1, 2022 20:57
},
"devDependencies": {
"@babel/core": "^7.18.2",
Copy link
Member

Choose a reason for hiding this comment

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

Could you briefly explain why all those newly added libs are necessary? I can see that @babel/plugin-syntax-flow, @babel/plugin-transform-react-jsx etc. were added. If there is a good reason behind it, I think it is probably ready to be merged then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, good question.

After updating the eslint related packages that already exist, yarn shows warnings about peer deps:

warning " > [email protected]" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
warning " > [email protected]" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
warning " > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".

So to resolve these warnings I've installed the peer deps as well using yarn add -D

Copy link
Member

Choose a reason for hiding this comment

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

Ok, the last thing that I am afraid of is updating the css-select and css-tree deps since it will directly affect the users of the library. Is it fixing any vulnerabilities? If not, maybe it should be added in some other PR in order not to mix things for lib developers with those of lib users. Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating css-select is important to close vulnerability (this is the original reason I need to make this PR)

GHSA-rp65-9cf3-cjxr

The dep tree is:
react-native-svg>css-select>nth-check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

css-tree we could undo, but I was thinking if tests pass why not update it while I'm doing all this other work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@WoLewicki please let me know your final decision here.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the delay, I think we can do it here, so it is ready to be merged 🎉 Thanks for your contribution!

@WoLewicki WoLewicki merged commit 2a44346 into software-mansion:main Jul 14, 2022
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