open-index/open-npm huggingface dataset:
npm package: @michaelarestad/learnstorybook-design-system
Description: Storybook design systems tutorial
Author: Michael Arestad
Latest version: 0.2.0

# Storybook design system tutorial

The Storybook design system tutorial is a subset of the full [Storybook design system](https://github.com/storybookjs/design-system/), created as a learning resource for those interested in learning how to write and publish a design system using best in practice techniques.

Learn more in [Storybook tutorials](https://storybook.js.org/tutorials/).
npm package: @michaelayoub/ts-base-test
Description: Starter template for TS libraries
Author: Michael Ayoub
Latest version: 1.3.0

## Usage

Install dependencies and run scripts:

```bash
pnpm i
pnpm lint
pnpm test
pnpm build
```

> 🎯 **Built with [ts-base](https://github.com/bgub/ts-base)** — A TypeScript library starter template featuring Biome, Vitest, tsdown, and automated releases. Check out ts-base for a modern TypeScript project setup!
npm package: @michaelbataller/schematypes
Description: Mongoose Schema provider
Author: Michael C. Bataller
Latest version: 1.0.4

# SchemaConstructor

Started as a series of objects but got increasingly large to accommodate multiple requirements.

Somewhat looks like Joi, same usage.

## Usage

```ts
import { Schema } from "mongoose";
import { schemaTypes } from "_utils/database/schemaTypes.ts";

const SomeSchema = new Schema({
	someRequiredStringField: schemaTypes.string().required(),
	someRequiredObjectIdField: schemaTypes.objectId().ref(SomeModel),
});
```

Created by Michael with <3
npm package: @michaelbelgium/adonisjs-referral
Description: A user referral system for AdonisJS
Author: michaelbelgium.me,Michael V
Latest version: 1.0.0

# AdonisJS referrals

> A referral system for AdonisJS projects

This is a simple package that handles referrals on the back-end.

## Installation

Execute the following in the root of your adonisjs project:
```
node ace add @michaelbelgium/adonisjs-referral
```

This will:

* create a config file `config/referrals.ts`
* add a migration for 2 tables in the migration folder
* add the `referral_provider` to providers
* regsiter  `referred_middelware` as named middleware in your project
* add the `referral.link` route (`/referral/:code`)

Next is to migrate the 2 tables:
```
node ace migration:run
```

This will add table `referral_codes` and `referrals`

## Configuration

The configuration file has some options that can be edited. Each option has a comment in case you don't know what it does.

See [the stub file](https://github.com/MichaelBelgium/adonisjs-referral/blob/main/stubs/configs/referrals.stub) or the `config/referrals.ts` file after adding the package.

Before you're starting with referrals, make sure the configuration is absolutely correct.

## hasReferrals mixin

The LucidModel you've set in the `userModel` setting must have the `hasReferrals` mixin added.

For example if you have the `User` model set:
```TS
import { compose } from '@adonisjs/core/helpers'
import { hasReferrals } from '@michaelbelgium/adonisjs-referral'

export default class User extends compose(BaseModel, hasReferrals) {
  //...
}
```

This will add an `afterCreate` hook and a relationship to the model:

```TS
@hasOne(() => ReferralCode, { foreignKey: 'userId' })
declare referralCode: HasOne<typeof ReferralCode>

@afterCreate()
static async createReferralCode(model: ModelWithReferrals) {
  if (config.get<boolean>('referrals.referralCode.autoCreate', true)) {
    model.related('referralCode').create({})
  }
}
```

## Referrals vs referral codes

The package does **not** know when you want to assign a user (the referee) to the user who shared the referral link (the referrer). It's *your decision* as it could be after registering, after paying a subscription, when ever.

So while the package handles saving and creating of referral codes, you must add and assign referrals yourself. 

This is why, also for flexiblity, the `ReferralCode` and `Referral` model from the package can be used.

## Events

The package provides 2 events [you can listen to](https://docs.adonisjs.com/guides/digging-deeper/emitter).

* `referral:code_created`: emitted when a referral code is created
* `referral:visited`: emitted when a referral code is visited through the referral link.

## Middleware

You can use the `referred` middleware to only allow referred users on a route.

```TS
router.get('/only-referrals', async ({ }: HttpContext) => {
    return 'Hello referred user!'
}).middleware(middleware.referred())
```

The middleware basicly checks if the user has the referred cookie set. Will show unauthorized HTTP error when not having the cookie.
npm package: @michaelborde/electron-prebuilt-compile
Description: electron-prebuilt that automatically understands Babel + React + LESS
Author: Paul Betts
Latest version: 4.1.4

# electron-prebuilt-compile

electron-prebuilt-compile is a drop-in replacement for [electron-prebuilt](https://github.com/mafintosh/electron-prebuilt) that natively understands ES6 + React + LESS + some other languages, powered by [electron-compile](https://github.com/electronjs/electron-compile).

## Installation

Download and install the latest build of electron for your OS and add it to your projects `package.json` as a `devDependency`:

```
npm install electron-prebuilt-compile --save-dev
```

Now you can just run `electron` to run electron:

```
electron
```

Electron will now understand ES6/ES7 and React components out-of-the-box, even in inline HTML:

```html
<head>
  <link rel="stylesheet" type="text/less" href="main.less" />
</head>

<body id="host">
  <script type="application/javascript">
  import React from 'react';
  import ReactDOM from 'react-dom';
  import TodoApp from './components/TodoApp';
  
  ReactDOM.render(React.createComponent(TodoApp), document.getElementById('host'));
  </script>
</body>
</html>
```
npm package: @michaelboyles/formula
Description: Type-safe forms in React
Latest version: 0.0.10

[![Build status](https://github.com/michaelboyles/formula/actions/workflows/build.yml/badge.svg)](https://github.com/michaelboyles/formula/actions/workflows/build.yml)
[![Release version](https://img.shields.io/github/v/release/michaelboyles/formula?sort=semver)](https://github.com/michaelboyles/formula/releases)
[![MIT license](https://img.shields.io/github/license/michaelboyles/formula)](https://github.com/michaelboyles/formula/blob/develop/LICENSE)

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://github.com/michaelboyles/formula/raw/develop/docs/src/assets/logo-dark.svg">
  <img height="100" alt="Formula" src="https://github.com/michaelboyles/formula/raw/develop/docs/src/assets/logo-light.svg">
</picture>

Formula is a form management library for React (think Formik, RHF, TanStack Form). It's fully type-safe, performant and
has a small footprint.

[**📖 Read the docs**](https://michaelboyles.github.io/formula/)

## Usage

```text
npm install @michaelboyles/formula
```

```tsx
import { Checkbox, Input, TextArea, useForm } from "@michaelboyles/formula";

function NewBlogPostPage() {
    const form = useForm({
        initialValues: {
            title: "",
            content: "",
            isDraft: false
        },
        submit: post => createNewPost(post)
    });
    return (
        <form onSubmit={form.submit}>
            <Input field={form("title")} />
            <TextArea field={form("content")} />
            <label>
                Draft?
                <Checkbox field={form("isDraft")} />
            </label>
            <button type="submit">Create post</button>
        </form>
    )
}
```