open-index/open-npm huggingface dataset:
npm package: @sourcegraph/event-positions
Description: Finds the positons of mouse events in dom elements.
Latest version: 1.0.4

# Event Positions

[![build](https://badge.buildkite.com/434abbf1e973ff68219e3b153d49c9354ebb2099fa368ee0e3.svg?branch=master)](https://buildkite.com/sourcegraph/event-positions)
[![codecov](https://codecov.io/gh/sourcegraph/event-positions/branch/master/graph/badge.svg?token=QmvTu3ZEPp)](https://codecov.io/gh/sourcegraph/event-positions)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

This is a small library used to determining the the positions that events happened at
in code views.

## Installation

```shell
npm install @sourcegraph/event-positions
```

## Usage

It is currently exposed as an [RxJs Operator](http://reactivex.io/rxjs/manual/overview.html#operators)

```javascript
import { findPositionsFromEvents } from 'event-positions'

observableOfDomElements
  .pipe(
    findPositionsFromEvents({
      ...props,
    })
  )
  .subscribe(positionEvent => console.log(positionEvent)) // { line: ..., character: ..., token: ... }
```
npm package: @sourcegraph/extension-api-classes
Description: Classes used by the Sourcegraph extension API
Latest version: 1.1.0

# @sourcegraph/extension-api-classes

[![npm](https://img.shields.io/npm/v/@sourcegraph/extension-api-classes.svg)](https://www.npmjs.com/package/@sourcegraph/extension-api-classes)
[![downloads](https://img.shields.io/npm/dt/@sourcegraph/extension-api-classes.svg)](https://www.npmjs.com/package/@sourcegraph/extension-api-classes)
[![build](https://travis-ci.org/sourcegraph/extension-api-classes.svg?branch=master)](https://travis-ci.org/sourcegraph/extension-api-classes)
[![codecov](https://codecov.io/gh/sourcegraph/extension-api-classes/branch/master/graph/badge.svg?token=k6ajjWygaW)](https://codecov.io/gh/sourcegraph/extension-api-classes)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Classes used by the Sourcegraph extension API

## Install

```
npm install @sourcegraph/extension-api-classes
# or
yarn add @sourcegraph/extension-api-classes
```

## Build

```
yarn
yarn build
```

## Test

```
yarn test
```

## Release

Releases are done automatically in CI when commits are merged into master by analyzing [Conventional Commit Messages](https://conventionalcommits.org/).
After running `yarn`, commit messages will be linted automatically when committing though a git hook.
The git hook can be circumvented for fixup commits with [git's `fixup!` autosquash feature](https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html), or by passing `--no-verify` to `git commit`.
You may have to rebase a branch before merging to ensure it has a proper commit history, or squash merge with a manually edited commit message that conforms to the convention.
npm package: @sourcegraph/extension-api-stubs
Description: Stubs for the Sourcegraph extension API to unit-test Sourcegraph extensions
Latest version: 1.6.2

# @sourcegraph/extension-api-stubs

[![npm](https://img.shields.io/npm/v/@sourcegraph/extension-api-stubs.svg)](https://www.npmjs.com/package/@sourcegraph/extension-api-stubs)
[![downloads](https://img.shields.io/npm/dt/@sourcegraph/extension-api-stubs.svg)](https://www.npmjs.com/package/@sourcegraph/extension-api-stubs)
[![master build status](https://img.shields.io/github/workflow/status/sourcegraph/extension-api-stubs/build/master?logo=github)](https://github.com/sourcegraph/extension-api-stubs/actions?query=branch%3Amaster)
[![codecov](https://codecov.io/gh/sourcegraph/extension-api-stubs/branch/master/graph/badge.svg?token=AhFNzoboTT)](https://codecov.io/gh/sourcegraph/extension-api-stubs)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## ⚠️ Deprecation notice

**Sourcegraph extensions have been deprecated with the September 2022 Sourcegraph
release. [Learn more](https://docs.sourcegraph.com/extensions/deprecation).**

The repo and the docs below are kept to support older Sourcegraph versions.

## Description

Stubs for the Sourcegraph extension API to unit-test Sourcegraph extensions

## Install

```
npm install @sourcegraph/extension-api-stubs
# or
yarn add @sourcegraph/extension-api-stubs
```

## Example

```ts
import mock from 'mock-require'
import { createStubSourcegraphAPI, createStubExtensionContext } from '@sourcegraph/extension-api-stubs'
const sourcegraph = createStubSourcegraphAPI()
// For modules importing Range/Location/Position/URI/etc
mock('sourcegraph', sourcegraph)

import * as sinon from 'sinon'
import { activate } from './extension'

describe('my extension', () => {
  it('should register a hover provider', async () => {
    const context = createStubExtensionContext()
    await activate(context)
    sinon.assert.calledOnce(sourcegraph.languages.registerHoverProvider)
    const provider = sourcegraph.languages.registerHoverProvider.args[0][1]
    const result = provider()
    // More assertions ...
  })
})
```

See the [Sinon documentation](https://sinonjs.org/) for more info on how to use the stubs.

## Build

```
yarn
yarn build
```

## Test

```
yarn test
```

## Release

Releases are done automatically in CI when commits are merged into master by analyzing [Conventional Commit Messages](https://conventionalcommits.org/).
After running `yarn`, commit messages will be linted automatically when committing though a git hook.
The git hook can be circumvented for fixup commits with [git's `fixup!` autosquash feature](https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html), or by passing `--no-verify` to `git commit`.
You may have to rebase a branch before merging to ensure it has a proper commit history, or squash merge with a manually edited commit message that conforms to the convention.