open-index/open-npm huggingface dataset:
npm package: @labset-eslint/eslint-plugin
Description: collection of eslint rules needed to ensure ts open-source packages structure is consistent
Author: Hasnae R.
Latest version: 1.3.0

## eslint-plugin

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_eslint-plugin-license-notice&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_eslint-plugin-license-notice)
[![npm version](https://badge.fury.io/js/eslint-plugin-license-notice.svg)](https://badge.fury.io/js/eslint-plugin-license-notice)

A collection of eslint rules needed to ensure **labset** open-source packages are structured in a consistent way.

It comes with:

- `license-notice` rule to enforce all source files include the relevant license header notice

### install it

- with **npm**

```bash
npm install @labset-eslint/eslint-plugin --save-dev
```

- with **yarn**

```bash
yarn add @labset-eslint/eslint-plugin -D -W
```

### use it

- add the eslint plugin to your `.eslintrc.js`

```javascript
module.exports = {
    ...,
    plugins: [
        '@labset-eslint/eslint-plugin',
    ],
    rules: {
        '@labset-eslint/license-notice': [
            'error', {
                license: 'Apache-2.0',
                copyRightYear: '<year>',
                copyRightName: '<name>'
            }
        ]
    }
}
```
npm package: @labset/confluence-static-site
Description: confluence static site
Author: Hasnae R.
Latest version: 2.3.0

## confluence-static-site

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_confluence-static-site&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_confluence-static-site)
[![npm version](https://badge.fury.io/js/confluence-static-site.svg)](https://badge.fury.io/js/confluence-static-site)

### install it

- with **npm**

```bash
npm install @labset/confluence-static-site --save-dev
```

- with **yarn**

```bash
yarn add @labset/confluence-static-site -D
```

### configure your site

```bash
./node_modules/.bin/confsite env
./node_modules/.bin/confsite init-site <name>
```

it creates a `.env` file with the following properties

- `CONFLUENCE_SITE_NAME` : the Confluence cloud instance you want to generate a site from
- `CONFLUENCE_USERNAME` : the username to use to consume Confluence APIs
- `CONFLUENCE_API_TOKEN` : the user personal access token to consume Confluence APIs
- `TARGET_SITE` : the domain name of where your generated site will be hosted
- `TWITTER_SITE` : the twitter handle for seo purposes
- `GOOGLE_ANALYTICS_TRACKING_ID`: Google Analytics tracking id

```bash
./node_modules/.bin/confsite config
```

it creates a `.confluence-static-site.json` file with the following configuration

```json
{
  "title": "confluence-static-site",
  "iconUrl": "",
  "name": "space name",
  "theme": {
    "name": "confluence-static-site",
    "backgroundColor": "rgb(0, 102, 68)",
    "highlightColor": "#FFFFFF"
  }
}
```

### extract your site content

```bash
./node_modules/.bin/confsite extract <spaceKey>
./node_modules/.bin/confsite extract-emojis <spaceKey>
```

### build your site

```bash
./node_modules/.bin/confsite build <spaceKey>
./node_modules/.bin/confsite build <spaceKey> --serve # with webpack dev server
./node_modules/.bin/confsite build <spaceKey> --assets my-assets-folder # copy your assets to the site output assets (i.e. site logo ...)
```

### everything in the output directory

Once your content is extracted and the site is built, you will have an `output` directory created in
the root of your project folder with the following structure

```text
- output
    - site
        - <spaceKey>
            - articles
                - <blog-title-1>
                - <blog-title-2>
                - ...
            - assets
                - avatars
                - emojis
            - attachments
            - notes
                - <page-title-1>
                - <page-title-2>
                - ...
            - object-resolver
    - templates
```

What you need to deploy is the `output/site/<spaceKey>`

### deploy your site

- [ ] with GitHub pages
- [ ] with Google Firebase
npm package: @labset/confluence-website
Description: confluence website builder
Author: Hasnae R.
Latest version: 0.2.1

## confluence-website

### install it

- with **npm**

```bash
npm install @labset/confluence-website --save-dev
```

- with **yarn**

```bash
yarn add @labset/confluence-website -D
```

### configure your site

```bash
./node_modules/.bin/confluence-website init-env
```

it creates a `.env` file with the following properties

- `CONFLUENCE_SITE_NAME` : the Confluence cloud instance you want to generate a site from (**name**.atlassian.net)
- `CONFLUENCE_USERNAME` : the username to use to consume Confluence APIs
- `CONFLUENCE_API_TOKEN` : the user personal access token to consume Confluence APIs
- `CUSTOM_DOMAIN` : the domain name of where your generated site will be hosted

```bash
./node_modules/.bin/confluence-website init-site
```

it creates a `.confluence-website.json` file with the following configuration

```json
{
  "title": "confluence-website",
  "iconUrl": "",
  "name": "space name",
  "theme": {
    "name": "confluence-website",
    "backgroundColor": "rgb(0, 102, 68)",
    "highlightColor": "#FFFFFF"
  }
}
```

### extract your site content

```bash
./node_modules/.bin/confluence-website extract-space <spaceKey>
```

### build your site

```bash
./node_modules/.bin/confluence-website build-space <spaceKey>
```
npm package: @labset/eslint-plugin-license-notice
Description: eslint plugin to ensure license notice/header is included across your files
Author: Hasnae R.
Latest version: 1.1.0

## eslint-plugin-license-notice

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_eslint-plugin-license-notice&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_eslint-plugin-license-notice)
[![npm version](https://badge.fury.io/js/eslint-plugin-license-notice.svg)](https://badge.fury.io/js/eslint-plugin-license-notice)

Ensure all your source files include the relevant license header notice

### install it

- with **npm**

```bash
npm install eslint-plugin-license-notice --save-dev
```

- with **yarn**

```bash
yarn add eslint-plugin-license-notice -D -W
```

### use it

- add the eslint plugin to your `.eslintrc.js`

```javascript
module.exports = {
    ...,
    plugins: [
        'license-notice',
    ],
    rules: {
        'license-notice/include': [
            'error', {
                license: 'Apache-2.0',
                copyRightYear: '<year>',
                copyRightName: '<name>'
            }
        ]
    }
}
```
npm package: @labset/fs-directory
Description: utility to work with directories on the file system
Author: Hasnae R.
Latest version: 1.1.0

## fs-directory

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_fs-directory&metric=alert_status)](https://sonarcloud.io/dashboard?id=viqueen_fs-directory)
[![Known Vulnerabilities](https://snyk.io/test/github/viqueen/fs-directory/badge.svg?targetFile=package.json)](https://snyk.io/test/github/viqueen/fs-directory?targetFile=package.json)

---

## use it

```bash
npm install fs-directory --save
```

```javascript
import { listFiles } from "fs-directory";

const filters = {
  fileFilter: (entry) => entry.name.endsWith(".js"),
  directoryFilter: () => true,
};

const jsFiles = listFiles(process.cwd(), filters);
const allFiles = listFiles(process.cwd());
```

---

## develop it

### environment

- [NodeJS](https://nodejs.org/en/)
- optional: [nvm](https://github.com/nvm-sh/nvm)

### build it, test it, and format it

```bash
npm run build
npm test
npm run format
```
npm package: @labset/git-devbox
Description: git cli extensions
Author: Hasnae R.
Latest version: 3.5.0

## git-devbox

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_git-devbox&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_git-devbox)
[![Known Vulnerabilities](https://snyk.io/test/github/viqueen/git-devbox/badge.svg?targetFile=package.json)](https://snyk.io/test/github/viqueen/git-devbox?targetFile=package.json)

### install it

#### from stable

- with **homebrew** (preferred)

```bash
brew tap viqueen/git-devbox
brew install git-devbox
```

- with **npm** (not recommended)

```bash
npm install @labset/git-devbox -g
```

#### from source

```bash
git clone https://github.com/viqueen/git-devbox.git
cd git-devbox
npm install
npm link
```

### use it

#### working with branches

- list recent git branches that you've interacted with locally, select one to check it out

```bash
git recent
```

![git recent example](./docs/images/git-recent.png)

- list merged git branches that you still have locally, multi select the ones you want to delete

```bash
git merged
```

![git merged example](./docs/images/git-merged.png)

#### setup git workspaces

- start by some configuration

```bash
git devbox
```

it will add the following git global config entries

```text
devbox.workspaces.root          # where you want all your workspaces to be
devbox.workspaces.default       # your default workspace, i.e open-source vs work
devbox.github.username          # your github username
devbox.github.personal.token    # your github personal access token
```

- add a repo to your workspace

```bash
git workspace-add <urlConnection>         # adds to default workspace
git workspace-add <urlConnect> -w <name>  # adds to workspace with provided name
```

- view your workspace

```bash
git workspace             # describes default workspace
git workspace -w <name>   # describes workspace with provided name
```

- clone your entire workspace

```bash
git workspace-clone
git workspace-clone -w <name>
```

- sync workspace with GitHub, it requires GitHub username and token to be set when working with private repos

```bash
git sync-github --user <namespace>
git sync-github --org <namespace>
git sync-github --org <namespace> --archived  # include archived
git sync-github --user <namespace> --forked   # include forked
```
npm package: @labset/git-workspace
Description: git cli extensions
Author: Hasnae R.
Latest version: 1.0.0

## git-workspace

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_git-devbox&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_git-devbox)
[![Known Vulnerabilities](https://snyk.io/test/github/viqueen/git-devbox/badge.svg?targetFile=package.json)](https://snyk.io/test/github/viqueen/git-devbox?targetFile=package.json)

### install it

#### from stable

- with **homebrew** (preferred)

```bash
brew tap viqueen/git-devbox
brew install git-devbox
```

- with **npm** (not recommended)

```bash
npm install @labset/git-workspace -g
```

#### from source

```bash
git clone https://github.com/viqueen/git-workspace.git
cd git-workspace
npm install
npm link
```

### use it

#### working with branches

- list recent git branches that you've interacted with locally, select one to check it out

```bash
git recent
```

![git recent example](./docs/images/git-recent.png)

- list merged git branches that you still have locally, multi select the ones you want to delete

```bash
git merged
```

![git merged example](./docs/images/git-merged.png)

#### setup git workspaces

- start by some configuration

```bash
git workspace-config
```

it will add the following git global config entries

```text
git.workspaces.root                     # where you want all your workspaces to be
git.workspaces.default                  # your default workspace, i.e open-source vs work
git.workspaces.github.username          # your github username
git.workspaces.github.personal.token    # your github personal access token
```

- add a repo to your workspace

```bash
git workspace-add <urlConnection>         # adds to default workspace
git workspace-add <urlConnect> -w <name>  # adds to workspace with provided name
```

- view your workspace

```bash
git workspace             # describes default workspace
git workspace -w <name>   # describes workspace with provided name
```

- clone your entire workspace

```bash
git workspace-clone
git workspace-clone -w <name>
```

- sync workspace with GitHub, it requires GitHub username and token to be set when working with private repos

```bash
git sync-github                               # logged in user repos
git sync-github --user <namespace>
git sync-github --org <namespace>
git sync-github --org <namespace> --archived  # include archived
git sync-github --user <namespace> --forked   # include forked
```

- sync workspace with Bitbucket Cloud, it requires Bitbucket username and token to be configured

```bash
git sync-bitbucket --namespace <namespace>
```

- execute a script across your git workspace

```bash
git workspace-exec <script-file> [args...]
```
npm package: @labset/git-workspaces
Description: git workspace cli extensions
Author: Hasnae R.
Latest version: 4.2.2

## git-workspaces

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_git-devbox&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_git-devbox)
[![Known Vulnerabilities](https://snyk.io/test/github/viqueen/git-devbox/badge.svg?targetFile=package.json)](https://snyk.io/test/github/viqueen/git-devbox?targetFile=package.json)

### install it

#### from stable

- with **homebrew** (preferred)

```bash
brew tap viqueen/labset
brew install git-workspaces
```

- with **npm** (not recommended)

```bash
npm install @labset/git-workspaces -g
```

#### from source

```bash
git clone https://github.com/viqueen/git-workspaces.git
cd git-workspace
npm install
npm link
```

### use it

#### working with branches

- list recent git branches that you've interacted with locally, select one to check it out

```bash
git recent
```

![git recent example](./docs/images/git-recent.png)

- list merged git branches that you still have locally, multi select the ones you want to delete

```bash
git merged
git merged origin/master
```

![git merged example](./docs/images/git-merged.png)

- list squashed git branches that you still have locally, multi select the ones you want to delete

```bash
git squashed
git squashed origin/master
```

- list recent branches that you've interacted with, multi select the ones you want to delete

```bash
git tidy
```

#### setup git workspaces

- start by some configuration

```bash
git workspace-config
```

it will add the following git global config entries

```text
git.workspaces.root                     # where you want all your workspaces to be
git.workspaces.default                  # your default workspace, i.e open-source vs work
git.workspaces.github.username          # your github username
git.workspaces.github.personal.token    # your github personal access token
```

- add a repo to your workspace

```bash
git workspace-add <urlConnection>         # adds to default workspace
git workspace-add <urlConnect> -w <name>  # adds to workspace with provided name
```

- view your workspace

```bash
git workspace             # describes default workspace
git workspace -w <name>   # describes workspace with provided name
```

- clone your entire workspace

```bash
git workspace-clone
git workspace-clone -w <name>
```

- sync workspace with GitHub, it requires GitHub username and token to be set when working with private repos

```bash
git sync-github                               # logged in user repos
git sync-github --user <namespace>
git sync-github --org <namespace>
git sync-github --org <namespace> --archived  # include archived
git sync-github --user <namespace> --forked   # include forked
```

- sync workspace with Bitbucket Cloud, it requires Bitbucket username and token to be configured

```bash
git sync-bitbucket --namespace <namespace>
```

- execute a script across your git workspace

```bash
git workspace-exec <script-file> [args...]
```
npm package: @labset/leveldb-registry
Description: leveldb registry
Author: Hasnae R.
Latest version: 1.3.0

## leveldb-registry

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_leveldb-registry&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_leveldb-registry)
[![Known Vulnerabilities](https://snyk.io/test/github/viqueen/leveldb-registry/badge.svg?targetFile=package.json)](https://snyk.io/test/github/viqueen/leveldb-registry?targetFile=package.json)

### install it

- **npm**

```bash
npm install leveldb-registry --save
```

- **yarn**

```bash
yarn add leveldb-registry
```

### use it

```typescript
import { Identifiable, leveldbRegistry } from "leveldb-registry";

type User = Identifiable & {
  name: string;
};

const registry = leveldbRegistry<User>({
  localPath: ".example",
});

const user = await registry.add({ id: randomUUID(), name: "haz" });
const found = await registry.fetch(user.id);

const users = await registry.list();
const userIds = await registry.ids();
```
npm package: @labset/protoc-gen-graphql
Description: A protoc plugin to generate GraphQL schema from protobuf files
Author: Hasnae R.
Latest version: 1.0.0

## protoc-gen-graphql

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_protoc-gen-graphql&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=viqueen_protoc-gen-graphql)

Protoc plugin to generate GraphQL schema from protobuf schema.

### install it

#### from stable

- with **homebrew** (preferred)

```bash
brew tap viqueen/labset
brew install protoc-gen-graphql
```

- with **npm**

```bash
npm install @labset/protoc-gen-graphql -g
```

### development

#### environment

- **[nvm](https://github.com/nvm-sh/nvm)** to manage node versions.

```bash
brew install nvm
```

- **[yarn](https://yarnpkg.com/)** as node package manager

```bash
brew install yarn
```

#### house-keeping

- install dependencies

```bash
nvm install
yarn
```

- build it

```bash
yarn build
```

- format it

```bash
yarn format
```

- lint it

```bash
yarn lint
yarn lint --fix
```

- test it

```bash
yarn test
```
npm package: @labset/task-pool-executor
Description: task pool executor
Author: Hasnae R.
Latest version: 2.3.0

## task-pool-executor

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=viqueen_task-pool-executor&metric=alert_status)](https://sonarcloud.io/dashboard?id=viqueen_task-pool-executor)
[![Known Vulnerabilities](https://snyk.io/test/github/viqueen/task-pool-executor/badge.svg?targetFile=package.json)](https://snyk.io/test/github/viqueen/task-pool-executor?targetFile=package.json)

---

Provides a **simple** and a **cli progress** executor implementations to orchestrate a set of
asynchronous tasks

### install it

- **npm**

```bash
npm install @labset/task-pool-executor --save
```

- **yarn**

```bash
yarn add @labset/task-pool-executor
```

### use it

- simple task executor

```typescript
import { taskPoolExecutor } from "@labset/task-pool-executor";

const executor = taskPoolExecutor<string>({ maxConcurrent: 3 });
const task = {
  title: "my-task",
  run: () => Promise.resolve("done"),
};
executor.submit(task);

await executor.close();
```

- with cli progress support

```typescript
import {
  CliProgressRunContext,
  cliProgressTaskPoolExecutor,
} from "@labset/task-pool-executor";

const taskPool = cliProgressTaskPoolExecutor<string>();

const delayedTask = (millis: number, title: string) => {
  const run = (ctx?: CliProgressRunContext) =>
    new Promise<string>((resolve) => {
      const interval = setInterval(() => {
        ctx?.progress.increment();
      }, 8);
      const timeout = setTimeout(() => {
        clearInterval(interval);
        resolve("done");
      }, millis);
    });
  return { title, run };
};

const tasks = new Array(10)
  .fill(0)
  .map((_v, index) => delayedTask(2000, `task ${index}`));

const internal = async () => {
  tasks.forEach((t) => taskPool.submit(t));
  await delayedTask(8000, "running").run();
  await taskPool.close();
};

internal().then(console.info).catch(console.error);
```

![cli progress example](./docs/cli-progress-example.png)