open-index/open-npm huggingface dataset:
npm package: @reinvheels/jizx
Description: To install dependencies:
Latest version: 0.0.4

# jizx

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run src/index.tsx
```

This project was created using `bun init` in bun v1.1.30. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
npm package: @reionjs/cron
Description: Cron schedules, loader, and runner for Reion apps (app/cron/*.cron.ts)
Latest version: 0.0.3

# @reion/cron

Cron schedules and plugin for `reion`.

This package provides:
- A `createCronPlugin()` plugin that runs tasks from `app/cron/*.cron.ts`
- Manual task triggering via `ctx.schedule(name, payload, options?)`
- Schedule loader/runner utilities if you want low-level control

## Install

In this monorepo it is a workspace package.

For external usage:

```bash
bun add @reion/cron
```

`reion` is a peer dependency.

## Basic Usage

Add the plugin in `reion.config.ts`:

```ts
import type { ReionConfig } from "reion";
import { createCronPlugin } from "@reion/cron";

const config: ReionConfig = {
  plugins: [createCronPlugin()]
};

export default config;
```

## Disable Cron In Dev

If you want cron files to not run during `reion dev`:

```ts
plugins: [createCronPlugin({ disableDevCron: true })]
```

This only disables scheduled/background runs in dev mode. The plugin still keeps cron lookup available for manual `ctx.schedule(...)`.

## Cron File Format

Create files in `app/cron` with names ending in `.cron.ts` (or `.js`, `.mts`, `.mjs`).

Example:

```ts
import type { ScheduleDef, TaskContext } from "@reion/cron";

export const schedule: ScheduleDef = { every: "10s" };

export async function run(ctx: TaskContext) {
  console.log("cron run", ctx.payload);
}
```

Supported schedule styles:
- `{ every: "minute" }`
- `{ every: "hour" }`
- `{ every: "day", at: "09:30" }`
- `{ every: "week", day: "monday", at: "10:00" }`
- `{ every: "month", date: 1, at: "00:00" }`
- `{ every: "10s" }`, `{ every: "5m" }`, `{ every: "2h" }`, etc.

## Manual Trigger From Request Context

The plugin augments `ReionContext` with:

```ts
ctx.schedule(name, payload?, { delayMs?, at? })
```

Example:

```ts
await ctx.schedule("interval.example", { source: "api" }, { delayMs: 2000 });
```

`at` accepts:
- `Date`
- epoch milliseconds (`number`)
- Date-parsable string

## Exports

Top-level exports include:
- `createCronPlugin`
- `ScheduleDef`, `Schedule`, `TaskContext`, `TaskRunFn`, `LoadedTask`
- `loadSchedulesFromApp`, `scanScheduleFiles`, `createScheduleRunner`, `runScheduler`, and related helpers
npm package: @reionjs/vitest
Description: Vitest helpers for Reion: auto boot from reion.config, HTTP request client
Latest version: 0.0.1

# @reionjs/vitest

Vitest helpers for [Reion](https://github.com/reionjs/reion): boot a real HTTP server from `reion.config.*`, inject a small `request` client into tests, and tear down automatically.

## Install

```bash
bun add -d vitest @reionjs/vitest
```

Peer dependencies: `reion`, `vitest`.

## Setup with CLI

Use Reion CLI for automatic setup:

```bash
reion add -p @reionjs/vitest
```

This setup does:

- installs `@reionjs/vitest` (handled by `reion add`)
- installs `vitest` (unless you use `--skip-install`)
- creates `vitest.config.ts` if it does not exist
- sets `package.json` script: `"test": "vitest run"`

When creating `vitest.config.ts`, setup prompts whether to add alias config:

- optional `@` alias (`@` -> `./src`) for projects using tsconfig paths

If `vitest.config.ts` already exists, setup leaves it unchanged.

## Usage

```ts
import { describe, it, expect } from "@reionjs/vitest";

describe("API", () => {
  it("GET /api/hello", async ({ request }) => {
    const res = await request.get("/api/hello");
    expect(res.status).toBe(200);
  });
});
```

- Use **`describe` / `it` from this package** (not plain `vitest`) so the suite gets a Reion server from `process.cwd()` + `reion.config.*`.
- For custom setups, use **`createTestServer()`** and **`createRequestClient()`** directly.

See the docs: **Plugins → Vitest helpers**.

## Development

```bash
bun run build
bun run test
```