open-index/open-npm huggingface dataset:
npm package: @outofgas/react-stream
Description: React hooks for the local workspace.
Latest version: 0.1.4

# @outofgas/react-stream

React hooks for the local workspace.

## Workspace usage

This package is intended for source-first usage inside the monorepo. Consumers should reference it with `"workspace:*"` and let the app bundler resolve the TypeScript source.

## Example

```tsx
import { useSubscribe } from "@outofgas/react-stream";

function Feed() {
  const state = useSubscribe({
    key: ["feed", "latest"],
    subscribe: async ({ onData, onError }) => {
      const socket = connectFeed();

      socket.onmessage = (event) => onData(JSON.parse(event.data));
      socket.onerror = () => onError(new Error("feed disconnected"));

      return {
        unsubscribe: () => socket.close(),
      };
    },
  });

  if (state.error) return <p>{state.error}</p>;
  if (!state.ready) return <p>Loading...</p>;

  return <pre>{JSON.stringify(state.data, null, 2)}</pre>;
}
```

## Tests

```bash
bun run --cwd packages/hooks test
```
npm package: @outofgas/starter
Description: An interactive CLI for bootstrapping a new project from one of the `outofgas-build` starter templates.
Latest version: 0.1.0

# starter

An interactive CLI for bootstrapping a new project from one of the `outofgas-build` starter templates.

## Included Templates

- `typescript-starter`
- `next-starter`
- `hono-starter`
- `bun-monorepo-starter`
- `expo-starter`

## What the CLI Does

The generator walks the user through 4 steps:

1. Select a starter template.
2. Enter a project name.
3. Clone the selected template into a new directory and remove the source `.git` history.
4. Detect the package manager from the template lockfile and install dependencies.

If the cloned project contains a `package.json`, the CLI also updates its `name` field to match the project name.

## Development

Install dependencies:

```bash
bun install
```

Run the build:

```bash
bun run build
```

Run the CLI locally:

```bash
bun run build
node dist/index.js
```

You can also run it as a binary after building:

```bash
./dist/index.js
```

## Example Flow

```text
Starter CLI
Step 1/4: Choose a template.
  1. TypeScript Starter
  2. Next Starter
  3. Hono Starter
  4. Bun Monorepo Starter
  5. Expo Starter

Template number: 2
Step 2/4: Name your project.
Project name (next-starter): my-app
```

After that, the CLI clones the selected repository into `./my-app`, removes the template's `.git` directory, updates `package.json` if present, and installs dependencies.

## Scripts

```bash
bun run build       # Build the CLI with tsup
bun run dev         # Rebuild on file changes
bun run test        # Run Vitest with coverage
bun run test:watch  # Run Vitest in watch mode
bun run lint        # Run Biome checks
bun run format      # Format files with Biome
```