open-index/open-npm huggingface dataset:
npm package: @ssrx/adapter-tanstack-router
Description: This adapter allows you to use tanstack router with `@ssrx/vite`. It supports code splitting and asset pre-loading so long as you leverage the adjusted `lazyRouteComponent` function (see note at end of this readme).
Author: marbemac
Latest version: 0.0.1

# @ssrx/adapter-tanstack-router

This adapter allows you to use tanstack router with `@ssrx/vite`. It supports code splitting and asset pre-loading so
long as you leverage the adjusted `lazyRouteComponent` function (see note at end of this readme).

## Usage

```ts
import { tanstackRouterAdapter } from '@ssrx/adapter-tanstack-router';
import { ssrx } from '@ssrx/vite/plugin';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    // ... your other plugins

    ssrx({
      routerAdapter: tanstackRouterAdapter({
        // Override this default if needed.. the adapter expects your routes file to export the
        // route tree on this named export
        exportName: 'routeTree',
      }),
    }),
  ],
});
```

Note, the `lazyRouteComponent` included in `@tanstack/react-router` does not preserve the identity of the original
dynamic import when it assigns the preload property.

Import `lazyRouteComponent` from `@ssrx/adapter-tanstack-router` instead (or copy it into your project, it's a tiny
function).
npm package: @ssrx/plugin-tanstack-router
Description: ## Plugin
Author: marbemac
Latest version: 0.4.2

# @ssrx/plugin-tanstack-router

## Plugin

The runtime plugin is not yet implemented.

## Router Adapter

The router adapter allows you to use tanstack router with `@ssrx/vite`. It supports code splitting and asset pre-loading
so long as you leverage the adjusted `lazyRouteComponent` function (see note at end of this readme).

### Usage

```ts
import { tanstackRouterAdapter } from '@ssrx/plugin-tanstack-router/adapter';
import { ssrx } from '@ssrx/vite/plugin';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    // ... your other plugins

    ssrx({
      routerAdapter: tanstackRouterAdapter({
        // Override this default if needed.. the adapter expects your routes file to export the
        // route tree on this named export
        exportName: 'routeTree',
      }),
    }),
  ],
});
```

Note, the `lazyRouteComponent` included in `@tanstack/react-router` does not preserve the identity of the original
dynamic import when it assigns the preload property.

Use the below version in your project:

```tsx
/**
 * Adapted from https://github.com/TanStack/router/blob/main/packages/react-router/src/lazyRouteComponent.tsx
 *
 * The comp.preload property has been adjusted to maintain a reference to the orginal lazy import function.
 */
export function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(
  importer: () => Promise<T>,
  exportName?: TKey,
): T[TKey] extends (props: infer TProps) => any ? AsyncRouteComponent<TProps> : never {
  const load = importer;

  const lazyComp = React.lazy(async () => {
    const moduleExports = await load();
    const comp = moduleExports[exportName ?? 'default'];
    return {
      default: comp,
    };
  });

  (lazyComp as any).preload = load;

  return lazyComp as any;
}
```
npm package: @ssrx/streaming
Description: Exports a `injectToStream` function that gives the consumer several convenient hooks into the stream lifecycle.
Author: marbemac
Latest version: 0.3.1

# `@ssrx/streaming`

Exports a `injectToStream` function that gives the consumer several convenient hooks into the stream lifecycle.

Expects web streams, not node streams (however, can pass a node web stream in).

```tsx
import { injectIntoStream } from '@ssrx/streaming';
import { renderToReadableStream } from 'react-dom';

import { MyApp } from './app.tsx';

export const handler = (req: Request) => {
  const originalStream = renderToReadableStream(<MyApp />);

  let counter = 0;

  const stream = injectIntoStream(req, originalStream, {
    /**
     * Return a string to emit some HTML into the SSR stream just before the document's closing </head> tag.
     *
     * Called once per request.
     */
    emitToDocumentHead: async () => {
      return `<link href='foo.css' />`
    };

    /**
     * Return a string to emit into the SSR stream just before the rendering
     * framework (react, solid, etc) emits a chunk of the page.
     *
     * Called one or more times per request.
     */
    emitToDocumentBody: async () => {
      return `<script src='foo.js' />`
    };

    /**
     * Return a string to emit some HTML to the document body, after the client renderer's first flush.
     *
     * Called once per request.
     */
    emitToDocumentBody: async () => {
      counter += 1;

      return `<script>console.log('emitToDocumentBody number ${counter}')</script>`
    };

    /**
     * Runs when the stream is done processing.
     */
    onStreamComplete: () => {
      // cleanup, etc
    };
  })

  return new Response(stream, { headers: { 'content-type': 'text/html' } });
}
```
npm package: @ssrx/trpc-react-query
Description: Similar https://github.com/trpc/trpc/tree/main/packages/react-query, with the following major changes:
Author: marbemac
Latest version: 0.4.1

# @ssrx/trpc-react-query

Similar https://github.com/trpc/trpc/tree/main/packages/react-query, with the following major changes:

- Does not rely on global/react context - supports instanced use (for example in SSR where a fresh client per request is
  required).
- Scoped + typesafe `.$invalidate()` function on queries, e.g. `trpc.articles.$invalidate({ id })`.

**Example instantiation from a react-query client:**

```ts
import type { QueryClient } from '@tanstack/react-query';
import { createTRPCUntypedClient } from '@trpc/client';
import { type CreateTRPCQueryOptions, createTRPCReact } from '@ssrx/trpc-react-query';

export const createTrpc = ({
  queryClient,
  createTRPCQueryOptions,
}: {
  queryClient: QueryClient;
  options?: CreateTRPCQueryOptions;
}) => {
  const trpcClient = createTRPCUntypedClient();

  const trpc = createTRPCReact<TRouter>({
    client: trpcClient,
    queryClient,
    ...createTRPCQueryOptions,
  });

  return trpc;
};
```
npm package: @sssaicode/claude
Description: claude - SSSAiCode Claude Code
Author: sssaicode
Latest version: 1.1.11

# sssaicode - AI 代理工具

sssaicode 是一个强大的 AI 代理工具，为 Claude API 提供稳定可靠的代理服务。

## 核心特性

- 🛡️ **安全沙盒**: macOS 沙盒模式，保护文件系统安全
- 📊 **灵活配置**: 支持环境变量和配置文件
- 🔄 **自动更新**: 版本检查和自动更新功能

## 快速开始

### 安装

```bash
# 使用 npm 安装
npm install -g @sssaicode/claude

# 或使用国内镜像
npm install -g @sssaicode/claude --registry=https://registry.npmmirror.com
```

### 基本使用

```bash
# 首次运行会提示输入 Token
sssaicode

# 或使用环境变量指定 Token
export CLAUDE_CLIENT_TOKEN=your-token
claude

```

## Token 管理

sssaicode 采用智能的 Token 管理机制，按以下优先级获取 Token：

1. **环境变量** - `CLAUDE_CLIENT_TOKEN`
2. **配置文件** - `~/.claude/sssaicode.json`
3. **交互输入** - 提示用户输入并验证

### Token 验证流程

- 启动时自动验证 Token 有效性
- 无效 Token 会被拒绝并提示重新输入
- 有效 Token 自动保存到配置文件
- 支持服务端验证确保安全性

## 配置选项

### 命令行参数

```bash
claude [选项] [-- 目标命令 [参数...]]

选项:
  --help, -h         显示帮助信息
  --no-sandbox       禁用沙盒模式（macOS 默认启用）
  --raw              原始连接模式
```

### 环境变量

| 变量名 | 说明 | 默认值 |
|--------|------|--------|
| `CLAUDE_CLIENT_TOKEN` | 客户端认证 Token | 无 |
| `CLAUDE_NO_SANDBOX` | 设置为 1 禁用沙盒模式 | 无 |

### 配置文件

配置文件位置：`~/.claude/sssaicode.json`

```json
{
  "token": "your-client-token"
}
```

## 沙盒模式

在 macOS 系统上，sssaicode 默认启用沙盒模式以保护系统安全：

- 限制文件系统访问权限
- 仅允许访问当前工作目录
- 自动处理权限请求

```bash
# 禁用沙盒模式
claude --no-sandbox

# 或通过环境变量
CLAUDE_NO_SANDBOX=1 claude
```

## 使用示例

### 基础使用

```bash
# 使用已保存的 Token 启动
claude

# 首次使用，输入 Token
claude
# 提示: 请输入 CLAUDE_CLIENT_TOKEN: your-token
```

## 故障排查

### Token 相关问题

1. **Token 验证失败**
   - 确认 Token 输入正确
   - 检查网络连接
   - 验证服务器地址是否正确

2. **Token 不保存**
   - 检查 `~/.claude` 目录权限
   - 确认磁盘空间充足

### 启动问题

1. **沙盒模式问题**
   - 仅 macOS 支持沙盒模式
   - 使用 `--no-sandbox` 禁用


## License

MIT License - 详见 [LICENSE](LICENSE) 文件
npm package: @ssscccyyy/libuo
Description: A bundless TypeScript compiler using tsdown
Author: scy_public@outlook.com
Latest version: 1.0.5

# libuo

基于tsdown的默认bundless打包，支持tsdown.config.ts自定义配置

## Install

```shell
pnpm install @ssscccyyy/libuo
```

## Usage

```shell
libuo build
```

### Watch mode

```shell
libuo build -w
```

### options

```shell
$ libuo help build
Usage: libuo build [options]

打包项目默认使用bundless模式

Options:
  -e, --entry <...path>    入口文件 (default: "src/index.ts")
  -o, --output <path>      打包输出目录 (default: "dist")
  -f, --format <format>    输出格式 (es, esm, cjs) (default: "esm")
  -w, --watch              监听模式
  -c, --copy <...pattern>  复制文件到输出目录 (default: "src/**/*.{jpg,png,jpeg,svg,csv,ttf,json}")
  --cwd <cwd>              工作目录
  -b, --bundle             全打包模式
  -h, --help               display help for command
```
npm package: @sssmi/fork-vue-type-check
Description: a fork of a type checker for typescript written Vue components
Author: yanzhen@smartx.com
Latest version: 1.1.2

<p align="center">
  <img width="100px" height="100px" src="https://raw.githubusercontent.com/Yuyz0112/vue-type-check/master/assets/logo.png">
</p>

# vue-type-check

vue-type-check is a type checker for typescript written Vue components.

It provides both a CLI wrapper and a programmatically API which is easy to integrate with your current workflow.

## Features

- type checking template code.
- type checking script code.

## Usage

### CLI

```shell
Install: npm i -g vue-type-check

Usage: vue-type-check or vtc
Options:
  --workspace        path to your workspace, required
  --srcDir           path to the folder which contains your Vue components, will fallback to the workspace when not passed
  --onlyTemplate     whether to check the script code in a single file component
```

#### Example

We are going to check a simple Vue component with two type errors:

```vue
<template>
  <div id="app">
    <p>{{ msg }}</p>
  </div>
</template>

<script lang="ts">
import Vue from "vue";

export default Vue.extend({
  name: "app",
  data() {
    return {
      message: "Hello World!"
    };
  },
  methods: {
    printMessage() {
      console.log(this.message.toFixed(1));
    }
  }
});
</script>
```

![example.gif](https://raw.githubusercontent.com/Yuyz0112/vue-type-check/master/assets/vtc.gif)

### Programmatical API

```js
const { check } = require("vue-type-check");

(async () => {
  await check({
    workspace: PATH_TO_WORKSPACE,
    srcDir: PATH_TO_SRC_DIR,
    excludeDir: PATH_TO_EXCLUDE_DIR,
    onlyTemplate: TRUE_OR_FALSE,
    onlyTypeScript: TRUE_OR_FALSE
  });
})();
```

## How it works

Currently, the implementation is heavily based on vetur's awesome [interpolation feature](https://vuejs.github.io/vetur/interpolation.html).

If you are interested in the design decisions and the attempts on other approaches, they can be found in [this post](http://www.myriptide.com/vue-type-check/).
npm package: @ssssota/use-generator
Description: Hooks for using generator functions in React/Preact/SolidJS/Vue/Svelte
Latest version: 0.1.1

# use-generator

Hooks for using generator functions in React/Preact/SolidJS/Vue/Svelte.

Generator functions are a powerful way to manage state and side effects in a declarative way.

```ts
import { useGenerator } from '@ssssota/use-generator/react';
function *counter(): Generator<number, never, number> {
  let i = 0;
  while (true) {
    i += yield i;
  }
}
function useCounter() {
  const gen = useGenerator(counter);
  return {
    count: gen.value.value,
    increment: (step = 1) => gen.next(step),
    reset: () => gen.reset(),
  }
}
```

```ts
import { useGenerator } from '@ssssota/use-generator/svelte';
function* survey(): Generator<string, readonly [string, string], string> {
  const name = yield 'What is your name?';
  const age = yield `Hello ${name}, how old are you?`;
  return [name, age] as const;
}
function useSurvey() {
  const gen = useGenerator(survey);
  if (gen.value.done) return gen.value.value;
  return {
    question: gen.value.value,
    answer: (response: string) => gen.next(response),
    reset: () => gen.reset(),
  };
}
```

## Installation

```sh
npm install @ssssota/use-generator
```

## API

```ts
type GeneratorFunction<T = any, TReturn = any, TNext = unknown> = () => Generator<T, TReturn, TNext>;
const useGenerator: <T = unknown, TReturn = any, TNext = any>(fn: GeneratorFunction<T, TReturn, TNext>) => {
  readonly value: IteratorResult<T, TReturn>;
  next: (...args: [nextValue: TNext] | []) => void;
  return: (returnValue: TReturn) => void;
  throw: (error: any) => void;
  reset: () => void;
};
```

## LICENSE

MIT