open-index/open-npm huggingface dataset:
npm package: @morglod/di-ioc
Description: No decorators, no metadata   Clean Dependency Injection   <sub><sup>*even no changes in original code*</sup></sub>
Author: morglod
Latest version: 1.0.2

# Clean DIIoC

No decorators, no metadata  
Clean Dependency Injection  
<sub><sup>*even no changes in original code*</sup></sub>

* Everything is typed
* Context supported
* Tags supported

## Example

We got interfaces
```ts
interface Warrior {
    fight(): string;
    sneak(): string;
}

interface Weapon {
    hit(): string;
}

interface ThrowableWeapon {
    throw(): string;
}
```

Append with
```ts
const di = new ContainerDI<{
    warrior: Warrior,
    weapon: Weapon,
    throwableWeapon: ThrowableWeapon
}>();
```

We  got implementations
```ts
class Katana implements Weapon {
    public hit() {
        return "cut!";
    }
}

export class Shuriken implements ThrowableWeapon {
    public throw() {
        return "hit!";
    }
}

export class Ninja implements Warrior {
    private _katana: Weapon;
    private _shuriken: ThrowableWeapon;

    constructor(
        katana: Weapon,
        shuriken: ThrowableWeapon,
    ) {
        this._katana = katana;
        this._shuriken = shuriken;
    }

    public fight() { return this._katana.hit(); }
    public sneak() { return this._shuriken.throw(); }
}
```

Append with
```ts
di.setCtor('weapon', Katana);
di.setCtor('throwableWeapon', Shuriken);

di.set('warrior', () => new Ninja(
    di.pick('weapon'),
    di.pick('throwableWeapon')
));
```

Now use
```ts
const warrior = di.create('warrior');

console.log(warrior.sneak(), warrior.fight());
```

## Singletone

```ts
// declare
interface ILogger {
    log(msg: string): void;
}

const di = new ContainerDI<{
    logger: ILogger,
}>();

// bind implementation
class Logger implements ILogger {
    log(msg: string): void {
        console.log(msg);
    }
}
di.set('logger', () => new Logger);

// use it as singletone

const logger = di.singletone('logger');
logger.log('hello');

const logger = di.singletone('logger');
logger.log('world');
```

# OOP version

`@morglod/di-ioc/lib/oop`

* Decorators
* Everything is typed
* Context supported
* Tags supported

## Example

Define interfaces

```ts
export interface Weapon {
    hit(): string;
}

export const Weapon = diBase<Weapon>();
```

Implementation

```ts
@diImpl(Weapon)
export class Katana {
    hit() {
        return 'cut!';
    }
}
```

Main

```ts
const weapon = diPick(Weapon);
weapon.hit() === 'cut!';
```

## Example with tags

Implementation

```ts
@diImpl(Weapon)
export class Katana {
    hit() {
        return 'cut!';
    }
}

@diImpl(Weapon, 'mock')
export class FakeKatana {
    hit() {
        return 'fake cut!';
    }
}
```

Main

```ts
// Pick mock version
const fakeWeapon = diPick(Weapon, 'mock');

// Set fallback tag when no tag specified
diSetDefaultTag(Weapon, 'mock');
const fakeWeapon = diPick(Weapon);

// Everytime use tag=mock, even if other tag specified
diSetForceTag(Weapon, 'mock');
const fakeWeapon = diPick(Weapon, 'anyTag');
```
npm package: @morglod/jsondb
Description: straightforward json db implementation
Author: morglod
Latest version: 0.0.6

# @morglod/jsondb

Super simple file db for cli tools / utils.  
It syncs changes from fs & changes from program.

```
npm i @morglod/jsondb
```

```ts
const counterDB = new JsonDB(
    // path
    'example_counter.json',

    // initial data
    () => ({ counter: 0 })
);

await counterDB.init();

setInterval(() => {
    counterDB.commit(cur => {
        cur.counter++;
    });
}, 1000);
```

## After external update hook

```ts
jsobDB.afterRead.push(currentData => {
    // ....
})
```
npm package: @morgothulhu/nexus-plugin-prisma
Description: <p align="center">   <img src="https://i.imgur.com/8qvElTM.png" width="300" align="center" />   <h1 align="center">@morgothulhu/nexus-plugin-prisma</h1> </p>
Author: Flavian Desverne
Latest version: 7.6.0

<p align="center">
  <img src="https://i.imgur.com/8qvElTM.png" width="300" align="center" />
  <h1 align="center">@morgothulhu/nexus-plugin-prisma</h1>
</p>

**NOTE: this plugin is now following the same package version as the Prisma framework it is linked/validated against. Will make things easier to track 👍**

This plugin has been upgraded to support **Prisma 4.0+**. Latest version of prisma supported: [Prisma 7.4.2](https://github.com/prisma/prisma/releases/tag/7.4.2)

---

**Note:** A [replacement](https://github.com/prisma/nexus-prisma/) for this library is under development and available in early preview. More details in [#1039](https://github.com/graphql-nexus/nexus-plugin-prisma/issues/1039). Since the Prisma team is no longer keeping this library up to date with new Prisma versions, we have forked it.

This plugin integrates [Prisma](https://www.prisma.io/) into [Nexus](https://nexusjs.org/). It gives you an API you to project fields from models defined in your Prisma schema into your GraphQL API. It also gives you an API to build GraphQL root fields that allow your API clients to query and mutate data.

You can find the [documentation on the Nexus website](https://nexusjs.org/docs/plugins/prisma/overview).

**Note2:** This package is a fork from [kenchi's](https://github.com/kenchi/nexus-plugin-prisma). Thank you for your support pre-prisma 4.0.

## Usage notes

### AWS Lambda packaging

Make sure to include `@prisma/internals` in your AWS Lambda packaged `node_modules` folder, in addition to the `@prisma/client` package.

To mitigate overall package size issues, remove all `libquery_engine-debian-openssl-1.1.x.so.node` files under `node_modules/@prisma` as they are not leveraged by AWS Lambda.

## Installation

```
npm install @morgothulhu/nexus-plugin-prisma
# OR
yarn add @morgothulhu/nexus-plugin-prisma
```

## Package management

### Build, test

> build

```
yarn
yarn build
```

> test

`yarn test`

If tests need snapshot updates, run `yarn test:run:rebaseSnapshots`

### Dependencies versioning

> update all packages

```
yarn update:all
```

### Windows pre-requisites

> Install SQLite3

(follow instructions from [here](http://sqlitetutorials.com/sqlite-installation.html))

## Interactive test run

> Windows 32 (as an example)

`.\node_modules\.bin\jest --forceExit --verbose=true --useStderr=true --silent=false -t "supports nested query with one id field" --watch`

`.\node_modules\.bin\jest --forceExit --verbose=true --useStderr=true --silent=false --watch ./tests/app.test.ts`

> validate sqlite install

```
[System.Environment]::SetEnvironmentVariable("DEBUG", "*")
cls ; .\node_modules\.bin\jest --forceExit --verbose --useStderr -t "supports custom resolver for t.crud" custom-
```
npm package: @morgs32/babel-plugin-inline-react-svg
Description: A babel plugin that optimizes and inlines SVGs for your react components.
Author: Jordan Gensler
Latest version: 1.1.0

# babel-plugin-inline-react-svg

Transforms imports to SVG files into React Components, and optimizes the SVGs with [SVGO](https://github.com/svg/svgo/).

For example, the following code...

```jsx
import React from 'react';
import CloseSVG from './close.svg';

const MyComponent = () => <CloseSVG />;
```

will be transformed into...

```jsx
import React from 'react';
const CloseSVG = () => <svg>{/* ... */}</svg>;

const MyComponent = () => <CloseSVG />;
```

## Installation

```
npm install --save-dev babel-plugin-inline-react-svg
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": [
    "inline-react-svg"
  ]
}
```

#### Options

- *`ignorePattern`* - A pattern that imports will be tested against to selectively ignore imports.
- *`caseSensitive`* - A boolean value that if true will require file paths to match with case-sensitivity. Useful to ensure consistent behavior if working on both a case-sensitive operating system like Linux and a case-insensitive one like OS X or Windows.
- *`svgo`* - svgo options (`false` to disable). Example:
```json
{
  "plugins": [
    [
      "inline-react-svg",
      {
        "svgo": {
          "plugins": [
            {
              "removeAttrs": { "attrs": "(data-name)" }
            },
            {
              "cleanupIDs": true
            }
          ]

        }
      }
    ]
  ]
}

```

### Via CLI

```sh
$ babel --plugins inline-react-svg script.js
```

### Via Node API


```javascript
require('@babel/core').transform('code', {
  plugins: [
    ['inline-react-svg', { filename: 'filename representing the code' }],
  ]
}) // => { code, map, ast };
```

---

Inspired by and code foundation provided by [react-svg-loader](https://github.com/boopathi/react-svg-loader).
npm package: @morgs32/razzle-plugin-scss
Description: Use SCSS/SASS with Razzle
Author: Ray Andrew
Latest version: 2.4.1

# razzle-plugin-scss

This package contains a plugin for using [SCSS/SASS](https://sass-lang.com/) with Razzle

## Usage in Razzle Projects

```bash
yarn add razzle-plugin-scss --dev
```

### With the default options

```js
// razzle.config.js

module.exports = {
  plugins: ['scss'],
};
```

---

### With custom options

```js
// razzle.config.js

module.exports = {
  plugins: [
    {
      name: 'scss',
      options: {
        postcss: {
          dev: {
            sourceMap: false,
          },
        },
      },
    }
  ],
};
```

## Options

Please remember that custom options will extends default options using `Object.assign`.
Array such as postcss.plugins __WILL NOT BE EXTENDED OR CONCATED__, it will override all default plugins.

---

### postcss: _object_

default

```js
{
  dev: {
    sourceMap: true,
    ident: 'postcss',
  },
  prod: {
    sourceMap: false,
    ident: 'postcss',
  },
  plugins: [
    PostCssFlexBugFixes,
    autoprefixer({
      browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'],
      flexbox: 'no-2009',
    }),
  ],
}
```

Set `dev` to add config to postcss in `development`.
Set `prod` to add config to postcss in `production`.

See [postcss loader options](https://github.com/postcss/postcss-loader#options) to override configs.

---

### sass: _object_

default

```js
{
  dev: {
    sourceMap: true,
    includePaths: [paths.appNodeModules],
  },
  prod: {
    sourceMap: false,
    includePaths: [paths.appNodeModules],
  },
}
```

Set `dev` to add config to postcss in `development`.
Set `prod` to add config to postcss in `production`.

See [node-sass options](https://github.com/sass/node-sass#options) to override configs.

---

### css: _object_

default

```js
{
  dev: {
    sourceMap: true,
    importLoaders: 1,
    modules: false,
  },
  prod: {
    sourceMap: false,
    importLoaders: 1,
    modules: false,
    minimize: true,
  },
}
```

Set `dev` to add config to postcss in `development`.
Set `prod` to add config to postcss in `production`.

See [css loader options](https://github.com/webpack-contrib/css-loader#options) to override configs.

---

#### style: _object_

default

```js
{}
```

Style loader only used in `development` environment.

See [style loader options](https://github.com/webpack-contrib/style-loader#options) to override configs.

#### resolveUrl: _object_

default

```js
{
  dev: {},
  prod: {},
}
```

Set `dev` to add config to postcss in `development`.
Set `prod` to add config to postcss in `production`.

See [resolve url loader options](https://github.com/bholloway/resolve-url-loader#options) to override configs.