open-index/open-npm huggingface dataset:
npm package: @referee-fyi/client
Description: SDK for for the Referee FYI Integration API
Author: Brendan McGuire
Latest version: 1.0.2

# Referee FYI Client

SDK for the [Referee FYI Integration API](https://referee.fyi/api/swagger).

```ts
import { createClient } from "@referee-fyi/client";

const client = createClient({
  sku: "<sku>",
  authorization: {
    type: "bearer",
    token: "<integration token>",
  },
});

const verify = await client.verify();
if (!verify.data?.success) {
  console.error("Verification failed", verify.error);
}

const incidents = await client.getAllIncidents();
if (!incidents.data?.success) {
  console.error("Failed to get incidents", incidents.error);
} else {
  console.log("Incidents", incidents.data.data);
}

const asset = await client.getAsset({ id: "<asset id>" });
if (!asset.data?.success) {
  console.error("Failed to get asset", asset.error);
} else {
  console.log("Asset", asset.data.data);
}
```
npm package: @reference-ui/core
Description: Reference UI core
Latest version: 0.0.3

# @reference-ui/core

Reference UI CLI – design system build pipeline.

## Commands

### ref sync (default)

Build and sync the design system. Uses workers and the event bus.

### ref clean

Removes the output directory (`.reference-ui` by default, or `config.outDir`). Runs in the main thread only. Use before tests for a fresh state.

## Architecture

Workers run in separate threads ([Piscina](https://github.com/piscinajs/piscina)); they communicate via **BroadcastChannel**. The main thread wires flow; workers map events to handlers.

**Principle:** Logic in handler functions; worker file is wiring only.

### Event registry

`src/events.ts` – type union of all events. Each domain defines its slice; the event bus imports for typed `emit`/`on`.

```ts
// events.ts
export type Events = SyncEvents & VirtualEvents & WatchEvents
```

### workers.json ↔ Thread pool

The pool exposes `workers` (registry of all possible workers). Manifest keys map to `dist/cli/${name}/worker.mjs`. `workerEntries` feeds tsup. **Keys only** – values exist for tsup paths.

### Flow

1. Main thread bootstraps, wires flow in an events module.
2. Module inits spawn workers via `workers.runWorker(name, payload)`.
3. Workers subscribe with `on(...)`, return `KEEP_ALIVE` to stay alive.
4. Events flow via BroadcastChannel; all threads react.

---

## Module pattern

**Worker** = flat `on(event, handler)` list. **Logic** = handler functions in one file. **Orchestration** = events module (routing, emit).

**Layout:** `init.ts` (spawns worker), `worker.ts` (wiring only), `events.ts` (module event types).

### Worker

Flat list only. No conditionals, no branching. Multiple handlers per event is fine.

```ts
import { emit, on } from '../lib/event-bus'
import { KEEP_ALIVE } from '../lib/thread-pool'
import { copyAll } from './copy-all'

export default async function runVirtual(payload: VirtualWorkerPayload): Promise<never> {
  const handler = () => {
    copyAll(payload).catch((err) => console.error('[virtual] Copy failed:', err))
  }

  on('run:virtual:copy:all', handler)
  emit('virtual:ready')

  return KEEP_ALIVE
}
```

### Logic

Pure handler functions. They receive payloads; they emit events. No `on` here.

```ts
import { emit } from '../lib/event-bus'

export async function copyAll(payload: VirtualWorkerPayload): Promise<void> {
  // ... do work ...
  emit('virtual:complete')
}
```

### Event wiring (orchestration)

```ts
on('virtual:ready', () => emit('run:virtual:copy:all'))
on('watch:change', () => emit('run:virtual:copy:all'))
on('virtual:complete', () => emit('sync:complete'))
```

### Adding a module

1. Add to `workers.json`.
2. Create `worker.ts` (flat `on` list), logic file (handlers), `init.ts` (spawn).
3. Wire init in the command entry point.
4. Define new events in registry if needed.

See `src/virtual/` for a working example.
npm package: @reference-ui/lib
Description: Foundational design system package built on `@reference-ui/core`.
Latest version: 0.0.3

# @reference-ui/lib

Foundational design system package built on `@reference-ui/core`.

## Exports

- `@reference-ui/lib`: exports `baseSystem` for downstream `extends: [baseSystem]`
- `@reference-ui/lib/theme`: exports the plain theme objects used to build that system

## Usage

```bash
pnpm run sync   # Run ref sync once
pnpm run dev    # Watch mode
```

```ts
import { baseSystem } from '@reference-ui/lib'
import { colors, fonts } from '@reference-ui/lib/theme'
```
npm package: @referenceit/bos-components
Description: Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
Latest version: 0.0.21

# create-svelte

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npm init svelte

# create a new project in my-app
npm init svelte my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.