Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@sourcegraph/codeintellify
Advanced tools
This library manages all of the inputs (mouse/keyboard events, location changes, hover information, and hover actions) necessary to display hover tooltips on with a code view. All together, this makes it easier to add code intelligence to code views on the web. Used in Sourcegraph.
You need to provide your own UI component (referred to as the HoverOverlay) that actually displays this information and exposes these actions to the user.
createHoverifier()
to create a Hoverifier
object (there should only be one on the page, to have only one HoverOverlay shown).hoverStateUpdates
that a consumer can subscribe to, which emits all data needed to render the HoverOverlayhoverifier.hoverify()
, passing the position events coming from findPositionsFromEvents()
.hoverify()
returns a Subscription
that will "unhoverify" the code view again if unsubscribed fromyarn
yarn test
# Helpful options:
yarn test -- --single-run # Don't rerun on changes
yarn test -- --browsers Chrome # Only run in Chrome
Development is done by running tests. Karma is used to run Mocha tests in the browser. You can debug by opening http://localhost:9876/debug.html in a browser while the test running is active. The tests will rerun automatically when files are changed.
You can run specific tests by adding .only
to describe
or it
calls.
Releases are done automatically in CI when commits are merged into master by analyzing Conventional Commit Messages.
After running yarn
, commit messages will be linted automatically when committing.
You may have to rebase a branch before merging to ensure it has a proper commit history.
Term | Definition |
---|---|
Code view | The DOM element that contains all the line elements |
Line number element | The DOM element that contains the line number label for that line |
Code element | The DOM element that contains the code for one line |
Diff part | The part of the diff, either base, head or both (if the line didn't change). Each line belongs to one diff part, and therefor to a different commit ID and potentially different file path. |
Hover overlay | Also called tooltip |
hoverify | To attach all the listeners needed to a code view so that it will display overlay on hovers and clicks. |
unhoverify | To unsubscribe from the Subscription returned by hoverifier.hoverify() . Removes all event listeners from the code view again and hides the hover overlay if it was triggered by the unhoverified code view. |
FAQs
Adds code intelligence to code views on the web
We found that @sourcegraph/codeintellify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.