open-index/open-npm huggingface dataset:
npm package: @ripple-ts/adapter
Description: Shared adapter primitives for Ripple metaframework adapters
Author: Dominic Gannaway
Latest version: 0.3.8

# @ripple-ts/adapter

[![npm version](https://img.shields.io/npm/v/%40ripple-ts%2Fadapter?logo=npm)](https://www.npmjs.com/package/@ripple-ts/adapter)
[![npm downloads](https://img.shields.io/npm/dm/%40ripple-ts%2Fadapter?logo=npm&label=downloads)](https://www.npmjs.com/package/@ripple-ts/adapter)

Shared adapter primitives for Ripple metaframework adapters.

This package contains common runtime helpers and shared type contracts used by
environment-specific adapters like:

- `@ripple-ts/adapter-node`
- `@ripple-ts/adapter-bun`

## Exports

- `DEFAULT_PORT`
- `DEFAULT_HOSTNAME`
- `internal_server_error_response()`
- `run_next_middleware()`
- `serveStatic()`
- `MIME_TYPES`
- `get_mime_type()`
- `is_hashed_asset()`
- `get_static_cache_control()`

Type exports:

- `FetchHandler`
- `AdapterCoreOptions`
- `NextMiddleware`
- `ServeResult`
- `ServeStaticOptions`

## License

MIT
npm package: @ripple-ts/adapter-bun
Description: Bun adapter for Ripple metaframework (Web Request/Response bridge)
Author: Dominic Gannaway
Latest version: 0.3.8

# @ripple-ts/adapter-bun

[![npm version](https://img.shields.io/npm/v/%40ripple-ts%2Fadapter-bun?logo=npm)](https://www.npmjs.com/package/@ripple-ts/adapter-bun)
[![npm downloads](https://img.shields.io/npm/dm/%40ripple-ts%2Fadapter-bun?logo=npm&label=downloads)](https://www.npmjs.com/package/@ripple-ts/adapter-bun)

Bun adapter for Ripple metaframework apps.

It exposes the same `serve(fetch_handler, options?)` contract as
`@ripple-ts/adapter-node`, backed by `Bun.serve`.

## Installation

```bash
pnpm add @ripple-ts/adapter-bun
# or
npm install @ripple-ts/adapter-bun
# or
yarn add @ripple-ts/adapter-bun
```

## Usage

```js
import { serve } from '@ripple-ts/adapter-bun';

const app = serve(async (request) => {
  const url = new URL(request.url);

  if (url.pathname === '/health') {
    return new Response('ok');
  }

  return new Response('Hello from Ripple adapter-bun!', {
    headers: { 'content-type': 'text/plain; charset=utf-8' },
  });
});

app.listen(3000);
```

## API

### `serve(fetch_handler, options?)`

- `fetch_handler`:
  `(request: Request, platform?: any) => Response | Promise<Response>`
- `options.port` (default: `3000`)
- `options.hostname` (default: `localhost`)
- `options.static` (default: `{ dir: 'public' }`): serves static files before
  middleware/handler
  - `options.static.dir` (default: `public`, resolved from `process.cwd()`)
  - `options.static.prefix` (default: `/`)
  - `options.static.maxAge` (default: `86400`)
  - `options.static.immutable` (default: `false`)
  - set `options.static = false` to disable automatic static serving
- `options.middleware` (optional):
  `(request, server, next) => Response | Promise<Response> | void`

Returns:

- `listen(port?)`: starts Bun server and returns the Bun server instance
- `close()`: stops the current Bun server instance

### `serveStatic(dir, options?)`

Creates a Bun middleware that serves static assets from `dir`.

- `options.prefix` (default: `/`)
- `options.maxAge` (default: `86400`)
- `options.immutable` (default: `false`)

## Notes

- Requires Bun runtime (`Bun.serve`).
- Static file logic and MIME type mappings are shared from `@ripple-ts/adapter`.
- `platform` passed to `fetch_handler` contains `{ bun_server }`.
- Unhandled errors return `500 Internal Server Error`.

## License

MIT
npm package: @ripple-ts/adapter-node
Description: Node.js adapter for Ripple metaframework (Web Request/Response bridge)
Author: Dominic Gannaway
Latest version: 0.3.8

# @ripple-ts/adapter-node

[![npm version](https://img.shields.io/npm/v/%40ripple-ts%2Fadapter-node?logo=npm)](https://www.npmjs.com/package/@ripple-ts/adapter-node)
[![npm downloads](https://img.shields.io/npm/dm/%40ripple-ts%2Fadapter-node?logo=npm&label=downloads)](https://www.npmjs.com/package/@ripple-ts/adapter-node)

Node.js adapter for Ripple metaframework apps.

It bridges Node's `IncomingMessage`/`ServerResponse` API to Web
`Request`/`Response`, so your server handler can use standard Fetch APIs.

## Installation

```bash
pnpm add @ripple-ts/adapter-node
# or
npm install @ripple-ts/adapter-node
# or
yarn add @ripple-ts/adapter-node
```

## Usage

```js
import { serve } from '@ripple-ts/adapter-node';

const app = serve(async (request) => {
  const url = new URL(request.url);

  if (url.pathname === '/health') {
    return new Response('ok');
  }

  return new Response('Hello from Ripple adapter-node!', {
    headers: { 'content-type': 'text/plain; charset=utf-8' },
  });
});

app.listen(3000);
```

## API

### `serve(fetch_handler, options?)`

Creates an HTTP server adapter.

- `fetch_handler`:
  `(request: Request, platform?: any) => Response | Promise<Response>`
- `options.port` (default: `3000`)
- `options.hostname` (default: `localhost`)
- `options.static` (default: `{ dir: 'public' }`): serves static files before
  middleware/handler
  - `options.static.dir` (default: `public`, resolved from `process.cwd()`)
  - `options.static.prefix` (default: `/`)
  - `options.static.maxAge` (default: `86400`)
  - `options.static.immutable` (default: `false`)
  - set `options.static = false` to disable automatic static serving
- `options.middleware` (optional): Node-style middleware called before
  `fetch_handler`

Returns:

- `listen(port?)`: starts the server and returns Node `Server`
- `close()`: closes the server

### `serveStatic(dir, options?)`

Creates a Node middleware that serves static assets from `dir`.

- `options.prefix` (default: `/`)
- `options.maxAge` (default: `86400`)
- `options.immutable` (default: `false`)

## Middleware

If middleware sends the response (`res.end()` / `res.headersSent`), the fetch
handler is skipped.

```js
import { serve } from '@ripple-ts/adapter-node';

const app = serve(async () => new Response('from handler'), {
  middleware(req, res, next) {
    if (req.url === '/legacy') {
      res.statusCode = 200;
      res.setHeader('content-type', 'text/plain; charset=utf-8');
      res.end('from middleware');
      return;
    }

    next();
  },
});

app.listen(3000);
```

## Notes

- Static file logic and MIME type mappings are shared from `@ripple-ts/adapter`.
- `x-forwarded-proto` and `x-forwarded-host` are respected when constructing the
  request URL.
- Request bodies are streamed for non-`GET`/`HEAD` methods.
- Multiple `set-cookie` headers are forwarded correctly.
- Unhandled errors return `500 Internal Server Error`.

## License

MIT
npm package: @ripple-ts/cli
Description: Interactive CLI tool for creating Ripple applications
Author: Ripple Team
Latest version: 0.3.8

# @ripple-ts/cli

[![npm version](https://img.shields.io/npm/v/%40ripple-ts%2Fcli?logo=npm)](https://www.npmjs.com/package/@ripple-ts/cli)
[![npm downloads](https://img.shields.io/npm/dm/%40ripple-ts%2Fcli?logo=npm&label=downloads)](https://www.npmjs.com/package/@ripple-ts/cli)

Interactive CLI tool for creating and managing Ripple applications.

To create a Ripple app with simpler syntax, you can also use `create-ripple`
package.

## Installation

You can run it directly without installing:

```bash
npx @ripple-ts/cli <command>
```

---

## Available Commands

### `create`

Create a new Ripple application using the interactive mode:

```bash
npx @ripple-ts/cli create
```

Or use with arguments:

- `project-name`: Optional. Name of the project to create
- `-p, --package-manager <pm>`: Package manager to use - npm, yarn, pnpm (default:
  npm)
- `--template <template>`: Choose a predefined template (default and currently
  only option: basic)
- `--yes` or `-y`: Skip all prompts and use defaults
- `--no-git`: Skip initializing a Git repository

Example:

```bash
npx @ripple-ts/cli create my-app --yes --no-git
```

---

### More commands are coming soon...

---

## Features

- 🎯 **Interactive prompts** – Guides you step by step through project setup
- 📁 **Template selection** – Choose from predefined templates
- ✅ **Project validation** – Ensures valid project names
- 🎨 **Beautiful CLI** – Colored output with progress indicators
- ⚡ **Fast setup** – Quickly scaffold new Ripple projects

---

## Templates

### Basic

A minimal Ripple application with:

- Vite for development and building
- TypeScript support
- Prettier for code formatting
- Basic project structure

---

## Usage Notes

- The CLI requires **explicit subcommands** (`create`).
- Running `npx @ripple-ts/cli` without a subcommand will display the help message.
- Use `create-ripple` for simpler syntax.

---

## Requirements

- Node.js 20.0.0 or higher

---

## License

MIT
npm package: @ripple-ts/prettier-plugin
Description: Ripple plugin for Prettier
Author: Dominic Gannaway
Latest version: 0.3.8

# @ripple-ts/prettier-plugin

[![npm version](https://img.shields.io/npm/v/%40ripple-ts%2Fprettier-plugin?logo=npm)](https://www.npmjs.com/package/@ripple-ts/prettier-plugin)
[![npm downloads](https://img.shields.io/npm/dm/%40ripple-ts%2Fprettier-plugin?logo=npm&label=downloads)](https://www.npmjs.com/package/@ripple-ts/prettier-plugin)

A Prettier plugin for formatting [Ripple](https://github.com/Ripple-TS/ripple)
`.ripple` files.
npm package: @ripple-ts/typescript-plugin
Description: TypeScript plugin for Ripple
Author: Dominic Gannaway
Latest version: 0.3.8

# @ripple-ts/typescript-plugin

[![npm version](https://img.shields.io/npm/v/%40ripple-ts%2Ftypescript-plugin?logo=npm)](https://www.npmjs.com/package/@ripple-ts/typescript-plugin)
[![npm downloads](https://img.shields.io/npm/dm/%40ripple-ts%2Ftypescript-plugin?logo=npm&label=downloads)](https://www.npmjs.com/package/@ripple-ts/typescript-plugin)

TypeScript plugin for Ripple that provides language support for `.ripple` files.

## Usage

### VS Code

**If you're using VS Code with the Ripple extension, you don't need to configure
this plugin!** The Ripple language server handles everything automatically.

### Other Editors or Standalone Usage

For editors that don't use the Ripple language server (like WebStorm, Sublime
Text, or command-line `tsc`), add this plugin to your `tsconfig.json`:

```json
{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "ripple",
    "plugins": [
      {
        "name": "@ripple-ts/typescript-plugin"
      }
    ]
  }
}
```

## What it does

This plugin:

- Registers `.ripple` files as a recognized TypeScript language
- Transforms Ripple syntax to TypeScript for type checking
- Integrates with Volar for virtual code generation and source mapping

## Architecture Note

This plugin uses Volar's TypeScript plugin system. When configured in
`tsconfig.json`, TypeScript's tsserver will load this plugin and create a language
service instance.

The Ripple VS Code extension uses a language server instead, which provides the
same functionality plus additional features like diagnostics and formatting. Both
can coexist (they create separate instances), but you only need one.