open-index/open-npm huggingface dataset:
npm package: @sights/common
Description: This package contains a set of common utility functions and TypeScript types used by multiple @sights packages. It is not intended to be directly depended upon by an end-user project.
Latest version: 1.0.33

# @sights/common

This package contains a set of common utility functions and TypeScript types used by multiple @sights packages. It is not intended to be directly depended upon by an end-user project.
npm package: @sights/core
Description: A modern, headless platform application framework
Latest version: 1.0.33

# Sights

A headless [GraphQL](https://graphql.org/) ecommerce framework built on [Node.js](https://nodejs.org) with [Nest](https://nestjs.com/) with [TypeScript](http://www.typescriptlang.org/).

```bash
$ npm install @sights/core
```
npm package: @sigi-fork/devtool
Description: Connect sigi to redux devtool
Author: LongYinan
Latest version: 1.0.1

# `@sigi/devtool`

[Sigi documents](https://sigi.how)

## Usage

```ts
import { initDevtool } from '@sigi/devtool'
import { render } from 'react-dom'


render(...)

initDevtool()

```

Put `initDevtool` after render function.
npm package: @sigi-fork/di
Description: Dependencies injection library for sigi framework
Author: xiaomuzhu
Latest version: 1.0.1

# `@sigi/di`

[Sigi documents](https://sigi.how)

> Dependencies injection library

## Usage

### Basic

```ts
import { Injectable, InjectableFactory } from '@sigi/di'

@Injectable()
class Engine { }

@Injectable()
class Car {
  constructor(public engine: Engine) { }
}

const car = InjectableFactory.getInstance(Car)
expect(car).to.be.instanceof(Car)
expect(car.engine).to.be.instanceof(Engine)
```

### Value Provider

```ts
import { Inject, InjectionToken, Injectable, InjectableFactory, ValueProvider } from '@sigi/di'
import Axios from 'axios'

const token = new InjectionToken<Axios>('Axios client')

const provider: ValueProvider = {
  provide: token,
  useValue: Axios,
}

@Injectable({
  providers: [provider],
})
class HttpClient {
  constructor(@Inject(token) public axios: Axios) { }
}

const client = InjectableFactory.getInstance(HttpClient)
expect(client).to.be.instanceof(HttpClient)
expect(client.axios).to.equal(Axios)
```

### Factory Provider

```ts
import { Inject, InjectionToken, Injectable, InjectableFactory, FactoryProvider } from '@sigi/di'
import Axios from 'axios'

const token = new InjectionToken<Axios>('Axios client')
const baseURL = 'https://leetcode-cn.com/api'
const provider: FactoryProvider = {
  provide: token,
  useFactory: () => {
    return Axios.create({
      baseURL,
    })
  },
}

@Injectable({
  providers: [provider],
})
class HttpClient {
  constructor(@Inject(token) public axios: Axios) { }
}

const client = InjectableFactory.getInstance(HttpClient)
expect(client).to.be.instanceof(HttpClient)
expect(client.axios).to.equal(Axios) // baseURL of client.axios is 'https://leetcode-cn.com/api'
```

## Testing

### Override Provider by configureModule

```ts
function whatever() {
  return true
}

function replacement() {
  return false
}

const token = new InjectionToken<typeof whatever>('replacable')

const provider: ValueProvider = {
  useValue: replacement,
  provide: token,
}

@Injectable({
  providers: [provider],
})
class Service {
  constructor(@Inject(token) public dep: typeof whatever) {}
}

const testModule = Test.createTestingModule({ providers: [{ provide: token, useValue: replacement }] }).compile()
const service = testModule.getInstance(Service)
t.true(service instanceof Service)
t.is(service.dep, replacement)
t.false(service.dep())
```

### Override Provider by overrideProvider method

```ts
function whatever() {
  return true
}

function replacement() {
  return false
}

const token = new InjectionToken<typeof whatever>('replacabel')

const provider: ValueProvider = {
  useValue: replacement,
  provide: token,
}

@Injectable({
  providers: [provider],
})
class Service {
  constructor(@Inject(token) public dep: typeof whatever) {}
}

const testModule = Test.createTestingModule()
  .overrideProvider(token)
  .useValue(replacement)
  .compile()
const service = testModule.getInstance(Service)
t.true(service instanceof Service)
t.is(service.dep, replacement)
t.false(service.dep())
```
npm package: @sigi-fork/react-router
Description: React router intergration for sigi framework
Author: LongYinan
Latest version: 1.0.1

# `@sigi/react-router`

> React router intergration for sigi framework

## Usage

```ts
import { RouterModule } from '@sigi/react-router'

@Module('App')
export class AppModule extends EffectModule<{}> {
  constructor(private readonly router: RouterModule) {
    super()
  }

  @Effect()
  getUser(payload$: Observable<void>) {
    return payload$.pipe(
      exhaustMap(() => {
        service.getUser().pipe(
          mergeMap((res) => of(
            this.getActions().getUserResponse(res),
            this.router.push('/home')
          ))
        )
      })
    )
  }
}

```