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

Add TypeScript typechecking to snaps-cli #2783

Merged
merged 13 commits into from
Oct 11, 2024
Merged

Add TypeScript typechecking to snaps-cli #2783

merged 13 commits into from
Oct 11, 2024

Conversation

ritave
Copy link
Member

@ritave ritave commented Oct 2, 2024

This PR adds support for Typescript checking in snaps-cli. It does so by using fork-ts-checker-webpack-plugin webpack plugin which runs TSC in a separate thread during webpack compilation.

fixes #2785

Copy link

socket-security bot commented Oct 2, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/highlight@7.24.7 environment +5 139 kB nicolo-ribaudo
npm/fork-ts-checker-webpack-plugin@9.0.2 environment, filesystem, shell +9 697 kB piotr-oles

🚮 Removed packages: npm/@babel/helper-validator-identifier@7.22.20, npm/@babel/highlight@7.23.4

View full report↗︎

Copy link

socket-security bot commented Oct 2, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/fork-ts-checker-webpack-plugin@9.0.2

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@ritave ritave marked this pull request as ready for review October 3, 2024 10:55
@ritave ritave requested a review from a team as a code owner October 3, 2024 10:55
Comment on lines +25 to +26
// TODO(ritave): Fix types in SnapInterface
await (ui as any).ok();
Copy link
Member

Choose a reason for hiding this comment

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

Why is this happening now?

Copy link
Member Author

@ritave ritave Oct 3, 2024

Choose a reason for hiding this comment

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

It was always happening, but jest doesn't check types. TSC run over test files and found those issues.

@ritave
Copy link
Member Author

ritave commented Oct 6, 2024

@SocketSecurity ignore npm/fork-ts-checker-webpack-plugin@9.0.2

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.45%. Comparing base (92bdf72) to head (f210f23).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2783   +/-   ##
=======================================
  Coverage   94.45%   94.45%           
=======================================
  Files         484      484           
  Lines       10334    10337    +3     
  Branches     1573     1575    +2     
=======================================
+ Hits         9761     9764    +3     
  Misses        573      573           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritave ritave force-pushed the ritave/typecheck branch 2 times, most recently from 62c8cc5 to bd1cf72 Compare October 9, 2024 13:08
@ritave ritave merged commit 1251f80 into main Oct 11, 2024
166 checks passed
@ritave ritave deleted the ritave/typecheck branch October 11, 2024 09:31
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.

Add support for TypeScript type-checking to snaps-cli
3 participants