open-index/open-npm huggingface dataset:
npm package: @sidekick-coder/compositor
Description: Utilities to implement compositions functions
Author: henrique
Latest version: 0.1.3

# Compositor

Functions & utilities to create compositions functions, with typescript friendly interfaces

## Compose

This function merge objects and functions into a single object with the correct type inference


### Simple usage

```ts
const addRole = (ctx: any) => ({
    role: ctx,name === 'Jonny' ? 'admin' : 'customer'
})

const addIsAdmin = (ctx: any) => ({
    isAdmin: () => ctx.name === 'Jonny'
})

const makeUser = (name: string) => compose([addRole, addIsAdmin])

const user = makeUser('Johnny')

user.name // string
user.role // string
user.isAdmin // () => boolean

```

### Promises
```ts
const addRole = async (ctx: any) => ({
    role: ctx,name === 'Jonny' ? 'admin' : 'customer'
})

const addIsAdmin = async (ctx: any) => ({
    isAdmin: () => ctx.name === 'Jonny'
})

const makeUser = (name: string) => compose.async([addRole, addIsAdmin])

const user = await makeUser('Johnny')

user.name // string
user.role // string

```

## Chain 

This function if to contruct chainable functions with custom methods, useful to create factories and similar patterns

```ts
import { createChain, compose } from 'compositor'
import * as v from 'valibot'
import express from 'express'

const app = express()

interface Request<C extends Context> extends Chain<C> {
    params<T extends Record<string, any>>(entrise: v.ObjectEntries): Request<C & { params: v.InferOutput<ObjectSchema<T, undefined>> }>
    query<T extends Record<string, any>>(entries: v.ObjectEntries): Request<C & { query: v.InferOutput<ObjectSchema<T, undefined>> }>
    handle(cb: (ctx: C) => void): void
}

const request = (method: string, path: string) = () => {
    const chain = createChain<Context, Request<Context>>({
        params(entries) {
            return chain.use((ctx) => ({ params: v.parse(v.object(entries), ctx.request.params) }))
        },
        query(entries) {
            return chain.use(() => ({ query: v.parse(v.object(entries), ctx.request.query) }))
        },
        handle(cb) {
            app[method](path, (request, response) => {
                const ctx = compose([{ request, response }, ...chain.modifiers])

                cb(ctx)
            })
        }
    })

    return chain

}

request('get', '/user')
    .params({
        id: v.number()
    })
    .query({
        name: v.string()
    })
    .handle(({ query, params }) => {
        console.log(params.id) // number
        console.log(query.name) // string

        ctx.response.json({ ok: true, name: query.name, id: params.id })
    })
```
npm package: @sidekick-coder/lab
Description: A developer-friendly CLI for managing and running typed commands globally, eliminating the hassle of node_modules in every project
Author: Henrique
Latest version: 2.1.6

# @sidekick-coder/lab

A developer-friendly CLI for managing and running commands globally

- No need for `node_modules` but still keeps type safety
- Modular commands with lab.mjs files 
- Default modules for common tasks

## Installation

You can install globally using npm:

```sh
npm install -g @sidekick-coder/lab
```

Or use it directly with npx (no install required):

```sh
npx @sidekick-coder/lab [command]
```

## Usage

After installing globally, run the CLI with:

```sh
lab [command]
```

Or, if using npx:

```sh
npx @sidekick-coder/lab [command]
```

## Setting up an Alias

To make it easier to use, you can set up a shell alias. Add the following to your shell profile (e.g., `.bashrc`, `.zshrc`, or PowerShell `$PROFILE`):

### Bash/Zsh
```sh
# npx
alias lab="npx @sidekick-coder/lab"

# global install 
alias lab="node $(npm root -g)/@sidekick-coder/lab/index.js"
```

### PowerShell
```powershell
# npx
function lab {
    npx '@sidekick-coder/lab' @args
}

# gloabl install 
function lab {
    $root = npm root -g
    $path = Join-Path -Path $root -ChildPath "@sidekick-coder/lab/index.js"

    node $path @args
}
```

Now you can use `lab` as a shortcut for the CLI.

## Labs

Labs are modular JavaScript files that extend the CLI with custom subcommands. You can initialize a new lab in your project with:

```sh
lab init [name]
```

This generates a `tsconfig.json`, a `lab.mjs` entry point, and a sample command.

A typical `lab.mjs` registers your lab and its subcommands:

```js
import { createCommander } from '@lab/core/commander/index.js'
import { defineLab } from '@lab/utils/index.js'
import { resolve } from 'path'

export default defineLab({
    name: 'my-lab',
    setup(lab) {
        const commander = createCommander({
            bin: `${lab.commander.bin} my-lab`,
        })
        commander.addFolder(resolve(import.meta.dirname, './commands'))
        lab.commander.addSubCommander('my-lab', commander)
    },
})
```

You can register labs globally by adding their paths to your home config file (e.g., `~/.lab/config.yml`):

```yaml
labs:
  - /absolute/path/to/my-lab.mjs
  - /absolute/path/to/another-lab.mjs
```

For more details, see the full [Lab Registration Guide](docs/lab.md).

## License

MIT
npm package: @sidekick/analyser-common
Description: Handles input for analysers. Also defines the protocol which other programs can follow - no dependencies on JS
Author: We Are Sidekick Ltd.
Latest version: 1.0.2

# analyser-common

[![Build Status](https://travis-ci.org/sidekickcode/analyser-common.svg?branch=master)](https://travis-ci.org/sidekickcode/analyser-common)

Module that provides `stdin` input in a pre-defined way to a Sidekick analyser.

Provides analysers with a `setup` object that contains:

 - config (any configuration file contents for the analyser, e.g. .eslintrc file contents)
 - contents (the contents of the file to be analysed)
 - filePath (the file path of the file to be analysed)

You can easily write your own analysers for use with [Sidekick](https://sidekickcode.com).
Sidekick analysers can be written in any language; all you need to do is accept input via `stdin` and provide output via `stdout`.

## Installation

```sh
npm install --save @sidekick/analyser-common
```

## Usage

```sh
var sidekickAnalyser = require("@sidekick/analyser-common");
sidekickAnalyser(function(setup){
  //run the analyser
});
```
npm package: @sidekick/git-helpers
Description: git helpers that work with the git CLI. Probably only useful if you've got the same constraints as SK: x-platform without native deps
Author: Tim Ruffles
Latest version: 1.2.0

# sidekick-git-helpers

[![Build Status](https://travis-ci.org/sidekickcode/sidekick-git-helpers.svg?branch=master)](https://travis-ci.org/sidekickcode/sidekick-git-helpers)

git helpers that work with the git CLI. Probably only useful if you've got the same constraints as SK: x-platform without native deps.

Promise based API;

## Installation

```sh
npm install --save sidekick-git-helpers
```

## Usage

```sh
var helpers = require("sidekick-git-helpers");

helpers.findRootGitRepo(process.cwd())
.then((r) => console.log(`the enclosing git repo is: ${r}`))
.catch((e) => console.error(e));
```
npm package: @sidekickicons/react
Description: <p align="center">   <a href="https://heroicons.com" target="_blank">     <picture>       <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-dark.svg">       <source media="(prefers-
Latest version: 0.15.0

<p align="center">
  <a href="https://heroicons.com" target="_blank">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-dark.svg">
      <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-light.svg">
      <img alt="Heroicons" width="315" height="117" style="max-width: 100%" src="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-light.svg">
    </picture>
  </a>
</p>

Fanmade icons to complement [Heroicons](https://github.com/tailwindlabs/heroicons).

## Basic Usage

First, install `@sidekickicons/react` from npm:

```sh
npm install @sidekickicons/react
```

Now each icon can be used alongside Heroicons and imported individually as a React component:

```js
import { CrownIcon } from '@sidekickicons/react/24/solid'
import { BeakerIcon } from '@heroicons/react/24/solid'

function MyComponent() {
  return (
    <div>
      <CrownIcon className="size-6 text-blue-500" />
      <BeakerIcon className="size-6 text-green-500" />
    </div>
  )
}
```

Import the icons from their respective directory:

- 24x24 outline: `@sidekickicons/react/24/outline`
- 24x24 solid: `@sidekickicons/react/24/solid`
- 20x20 solid: `@sidekickicons/react/20/solid`
- 16x16 solid: `@sidekickicons/react/16/solid`

Icons use an upper camel case naming convention and are always suffixed with the word `Icon`.

[Browse the full list of icon names on UNPKG &rarr;](https://unpkg.com/browse/@sidekickicons/react/24/outline/)

## License

This library is MIT licensed.
npm package: @sidekickicons/svelte
Description: Svelte package that combines [Heroicons](https://github.com/tailwindlabs/heroicons) and [Sidekickicons](https://github.com/ndri/sidekickicons).
Latest version: 0.15.0

# sidekickicons-svelte

Svelte package that combines [Heroicons](https://github.com/tailwindlabs/heroicons) and [Sidekickicons](https://github.com/ndri/sidekickicons).

Browse all icons at [sidekickicons.com](https://sidekickicons.com/).

This package requires Svelte 5.19.0 or later.

## Usage

First, install `@sidekickicons/svelte` from npm:

```bash
pnpm install @sidekickicons/svelte
```

Now each icon can be imported and used in Svelte components. Since there is no official Svelte package for Heroicons, the `@sidekickicons/svelte` package includes Heroicons as well.

```svelte
<script lang="ts">
  import { CrownIcon, BeakerIcon } from '@sidekickicons/svelte/24/solid'
</script>

<div>
  <CrownIcon class="text-blue-500" />
  <BeakerIcon class="text-green-500" />
</div>
```

Import the icons from their respective directory:

- 24x24 outline: `@sidekickicons/svelte/24/outline`
- 24x24 solid: `@sidekickicons/svelte/24/solid`
- 20x20 solid: `@sidekickicons/svelte/20/solid`
- 16x16 solid: `@sidekickicons/svelte/16/solid`

Icons use an upper camel case naming convention and are always suffixed with the word `Icon`.

[Browse the full list of icon names on UNPKG &rarr;](https://app.unpkg.com/@sidekickicons/svelte/files/dist/24/outline)

The imported components are simple Svelte components that accept the `class` prop. The component already includes the `size-6`, `size-5`, or `size-4` class, so the `class` adds any additional classes you want to apply.

## Building

If you want to build the library yourself, you can do so by running:

```bash
pnpm build
```

This downloads the latest versions of Heroicons and Sidekickicons into `optimized/`, converts them into Svelte components, and saves them in the `src/lib` directory.

## License

This library is MIT licensed along with both Heroicons and Sidekickicons. You can find license files for all projects in this repository:

- [LICENSE](LICENSE)
- [HEROICONS-LICENSE](HEROICONS-LICENSE)
- [SIDEKICKICONS-LICENSE](SIDEKICKICONS-LICENSE)
npm package: @sidekickicons/vue
Description: <p align="center">   <a href="https://heroicons.com" target="_blank">     <picture>       <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-dark.svg">       <source media="(prefers-
Latest version: 0.15.0

<p align="center">
  <a href="https://heroicons.com" target="_blank">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-dark.svg">
      <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-light.svg">
      <img alt="Heroicons" width="315" height="117" style="max-width: 100%" src="https://raw.githubusercontent.com/ndri/sidekickicons/HEAD/.github/logo-light.svg">
    </picture>
  </a>
</p>

Fanmade icons to complement [Heroicons](https://github.com/tailwindlabs/heroicons).

## Basic Usage

First, install `@sidekickicons/vue` from npm:

```sh
npm install @sidekickicons/vue
```

Now each icon can be used alongside Heroicons and imported individually as a Vue component:

```vue
<template>
  <div>
    <CrownIcon class="size-6 text-blue-500" />
    <BeakerIcon class="size-6 text-green-500" />
  </div>
</template>

<script setup>
import { CrownIcon } from '@sidekickicons/vue/24/solid'
import { BeakerIcon } from '@heroicons/vue/24/solid'
</script>
```

Import the icons from their respective directory:

- 24x24 outline: `@sidekickicons/vue/24/outline`
- 24x24 solid: `@sidekickicons/vue/24/solid`
- 20x20 solid: `@sidekickicons/vue/20/solid`
- 16x16 solid: `@sidekickicons/vue/16/solid`

Icons use an upper camel case naming convention and are always suffixed with the word `Icon`.

[Browse the full list of icon names on UNPKG &rarr;](https://unpkg.com/browse/@sidekickicons/vue/24/outline/)

## License

This library is MIT licensed.