open-index/open-npm huggingface dataset:
npm package: @lewebsimple/ui
Description: Vue 3 component library
Author: Pascal Martineau
Latest version: 0.1.1

# (Yet another) Vue 3 component library

This project is an open source collection of Vue 3 components based on Tailwind CSS.

## Installation

Add the library to your project using the package manager of your choice:

```sh
npm install @lewebsimple/ui
pnpm add @lewebsimple/ui
yarn add @lewebsimple/ui
```

Configure Tailwind with the default preset in `tailwind.config.js`:
```js
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["node_modules/@lewebsimple/ui/src/**/*.{js,ts,vue}"],
  presets: [require("@lewebsimple/ui/tailwind-preset")],
  // ...
};
```

## Usage

Install globally as a Vue 3 plugin to register all components:

```ts
import { createApp } from "vue"
import ui from "@lewebsimple/ui";

const app = createApp({});

app.use(ui);
```

Or import components individually:

```ts
import { Alert } from "@lewebsimple/ui";
```
npm package: @lewiiiis/lexical-headless
Description: This package contains Headless helpers and functionality for Lexical.
Latest version: 0.4.5

# `@lewiiiis/lexical-headless`

This package allows you to use interact with Lexical in a headless environment (one that does not rely on DOM, e.g. for Node.js environment), and use its
main features like editor.update(), editor.registerNodeTransform(), editor.registerUpdateListener()
to create, update or traverse state.

```js
const { createHeadlessEditor } = require('@lewiiiis/lexical-headless');

const editor = createHeadlessEditor({
  nodes: [],
  onError: () => {},
});

editor.update(() => {
  $getRoot().append(
    $createParagraphNode().append(
      $createTextNode('Hello world')
    )
  )
});
```

Any plugins that do not rely on DOM could also be used. Here's an example of how
you can convert lexical editor state to markdown on server:
```js
const { createHeadlessEditor } = require('@lewiiiis/lexical-headless');
const { $convertToMarkdownString, TRANSFORMERS } = require('@lewiiiis/lexical-markdown');

app.get('article/:id/markdown', await (req, res) => {
  const editor = createHeadlessEditor({
    nodes: [],
    onError: () => {},
  });

  const articleEditorStateJSON = await loadArticleBody(req.query.id);
  editor.setEditorState(editor.parseEditorState(articleEditorStateJSON));  

  editor.update(() => {
    const markdown = $convertToMarkdownString(TRANSFORMERS);
    res.send(markdown);
  });
});

```
npm package: @lewiiiis/lexical-history
Description: This package contains selection history helpers for Lexical.
Latest version: 0.4.5

# `@lewiiiis/lexical-history`

This package contains history helpers for Lexical.

### Methods

#### `registerHistory`

Registers necessary listeners to manage undo/redo history stack and related editor commands. It returns `unregister` callback that cleans up all listeners and should be called on editor unmount.

```js
function registerHistory(
  editor: LexicalEditor,
  externalHistoryState: HistoryState,
  delay: number,
): () => void
```

### Commands

History package handles `UNDO_COMMAND`, `REDO_COMMAND` and `CLEAR_HISTORY_COMMAND` commands. It also triggers `CAN_UNDO_COMMAND` and `CAN_REDO_COMMAND` commands when history state is changed. These commands could be used to work with history state:

```jsx
import {UNDO_COMMAND, REDO_COMMAND} from '@lewiiiis/lexical';

<Toolbar>
  <Button onClick={() => editor.dispatchCommand(UNDO_COMMAND)}>Undo</Button>
  <Button onClick={() => editor.dispatchCommand(REDO_COMMAND)}>Redo</Button>
</Toolbar>;
```
npm package: @lewiiiis/lexical-html
Description: This package contains HTML helpers and functionality for Lexical.
Latest version: 0.4.5

# `@lewiiiis/lexical-html`

# HTML
This package exports utility functions for converting `Lexical` -> `HTML` and `HTML` -> `Lexical`. These same functions are also used in the `lexical-clipboard` package for copy and paste.

[Full documentation can be found here.](https://lexical.dev/docs/concepts/serialization)

### Exporting
```js
// When converting to HTML you can pass in a selection object to narrow it
// down to a certain part of the editor's contents.
const htmlString = $generateHtmlFromNodes(editor, selection | null);
```

### Importing
First we need to parse the HTML string into a DOM instance.
```js
// In the browser you can use the native DOMParser API to parse the HTML string.
const parser = new DOMParser();
const dom = parser.parseFromString(htmlString, textHtmlMimeType);

// In a headless environment you can use a package such as JSDom to parse the HTML string.
const dom = new JSDOM(htmlString);
```
And once you have the DOM instance.
```js
const nodes = $generateNodesFromDOM(editor, dom);

// Once you have the lexical nodes you can initialize an editor instance with the parsed nodes.
const editor = createEditor({ ...config, nodes });

// Or insert them at a selection.
const selection = $getSelection();
selection.insertNodes(nodes);
```
npm package: @lewiiiis/lexical-markdown
Description: This package contains Markdown helpers and functionality for Lexical.
Latest version: 0.4.5

# `@lewiiiis/lexical-markdown`

This package contains markdown helpers for Lexical: import, export and shortcuts.

## Import and export
```js
import {
  $convertFromMarkdownString,
  $convertToMarkdownString,
  TRANSFORMERS,
} from '@lewiiiis/lexical-markdown';

editor.update(() => {
  const markdown = $convertToMarkdownString(TRANSFORMERS);
  ...
});

editor.update(() => {
  $convertFromMarkdownString(markdown, TRANSFORMERS);
});
```

It can also be used for initializing editor's state from markdown string. Here's an example with react `<RichTextPlugin>`
```jsx
<LexicalComposer initialConfig={{
  editorState: () => $convertFromMarkdownString(markdown, TRANSFORMERS)
}}>
  <RichTextPlugin />
</LexicalComposer>
```

## Shortcuts
Can use `<MarkdownShortcutPlugin>` if using React
```jsx
import { TRANSFORMERS } from '@lewiiiis/lexical-markdown';
import {MarkdownShortcutPlugin} from '@lewiiiis/lexical-react/LexicalMarkdownShortcutPlugin';

<LexicalComposer>
  <MarkdownShortcutPlugin transformers={TRANSFORMERS} />
</LexicalComposer>
```

Or `registerMarkdownShortcuts` to register it manually:
```js
import {
  registerMarkdownShortcuts,
  TRANSFORMERS,
} from '@lewiiiis/lexical-markdown';

const editor = createEditor(...);
registerMarkdownShortcuts(editor, TRANSFORMERS);
```

## Transformers
Markdown functionality relies on transformers configuration. It's an array of objects that define how certain text or nodes
are processed during import, export or while typing. `@lewiiiis/lexical-markdown` package provides set of built-in transformers:
```js
// Element transformers
UNORDERED_LIST
CODE
HEADING
ORDERED_LIST
QUOTE

// Text format transformers
BOLD_ITALIC_STAR
BOLD_ITALIC_UNDERSCORE
BOLD_STAR
BOLD_UNDERSCORE
INLINE_CODE
ITALIC_STAR
ITALIC_UNDERSCORE
STRIKETHROUGH

// Text match transformers
LINK
```

And bundles of commonly used transformers:
- `TRANSFORMERS` - all built-in transformers
- `ELEMENT_TRANSFORMERS` - all built-in element transformers
- `TEXT_FORMAT_TRANSFORMERS` - all built-in text format trasnformers
- `TEXT_MATCH_TRANSFORMERS` - all built-in text match trasnformers

Transformers are explicitly passed to markdown API allowing application-specific subset of markdown or custom transformers.

There're three types of transformers:

- **Element transformer** handles top level elements (lists, headings, quotes, tables or code blocks)
- **Text format transformer** applies text range formats defined in `TextFormatType` (bold, italic, underline, strikethrough, code, subscript and superscript)
- **Text match transformer** relies on matching leaf text node content

See `MarkdownTransformers.js` for transformer implementation examples
npm package: @lewiiiis/lexical-plain-text
Description: This package contains plain text helpers for Lexical.
Latest version: 0.4.5

# `@lewiiiis/lexical-plain-text`

This package provides a starting point for Lexical users by registering listeners for a set of basic commands that cover simple text-editing behavior such as entering text, deleting characters, copy + paste, or changing the selection with arrow keys.

You can use this package as a starting point, and then add additional command listeners to customize the functionality of your editor. If you want to add rich-text features, such as headings, blockquotes, or formatted text, you may want to consider using [@lewiiiis/lexical-rich-text](https://lexical.dev/docs/api/lexical-rich-text) instead.
npm package: @lewiiiis/lexical-react
Description: This package provides Lexical components and hooks for React applications.
Latest version: 0.5.6

# `@lewiiiis/lexical-react`

This package provides a set of components and hooks for Lexical that allow for text editing in React applications.

## Getting started

Install `lexical` and `@lewiiiis/lexical-react`:

```
npm install --save lexical @lewiiiis/lexical-react
```

Below is an example of a basic plain text editor using `lexical` and `@lewiiiis/lexical-react` ([try it yourself](https://codesandbox.io/s/lexical-plain-text-example-g932e)).

```jsx
import {$getRoot, $getSelection} from '@lewiiiis/lexical';
import {useEffect} from 'react';

import {LexicalComposer} from '@lewiiiis/lexical-react/LexicalComposer';
import {PlainTextPlugin} from '@lewiiiis/lexical-react/LexicalPlainTextPlugin';
import {ContentEditable} from '@lewiiiis/lexical-react/LexicalContentEditable';
import {HistoryPlugin} from '@lewiiiis/lexical-react/LexicalHistoryPlugin';
import {OnChangePlugin} from '@lewiiiis/lexical-react/LexicalOnChangePlugin';
import {useLexicalComposerContext} from '@lewiiiis/lexical-react/LexicalComposerContext';

const theme = {
  // Theme styling goes here
  ...
}

// When the editor changes, you can get notified via the
// LexicalOnChangePlugin!
function onChange(editorState) {
  editorState.read(() => {
    // Read the contents of the EditorState here.
    const root = $getRoot();
    const selection = $getSelection();

    console.log(root, selection);
  });
}

// Lexical React plugins are React components, which makes them
// highly composable. Furthermore, you can lazy load plugins if
// desired, so you don't pay the cost for plugins until you
// actually use them.
function MyCustomAutoFocusPlugin() {
  const [editor] = useLexicalComposerContext();

  

useEffect(() => {
    // Focus the editor when the effect fires!
    editor.focus();
  }, [editor]);

  return null;
}

// Catch any errors that occur during Lexical updates and log them
// or throw them as needed. If you don't throw them, Lexical will
// try to recover gracefully without losing user data.
function onError(error) {
  throw error;
}

function Editor() {
  const initialConfig = {
    namespace: 'MyEditor',
    theme,
    onError,
  };

return (
    <LexicalComposer initialConfig={initialConfig}>
      <LexicalPlainTextPlugin
        contentEditable={<LexicalContentEditable />}
        placeholder={<div>Enter some text...</div>}
      />
      <LexicalOnChangePlugin onChange={onChange} />
      <HistoryPlugin />
      <MyCustomAutoFocusPlugin />
    </LexicalComposer>
  );
}
```
npm package: @lewiiiis/lexical-rich-text
Description: This package contains rich text helpers for Lexical.
Latest version: 0.4.5

# `@lewiiiis/lexical-rich-text`

This package provides a starting point for Lexical users by registering listeners for a set of basic commands that cover simple text-editing behavior such as entering text, deleting characters, copy + paste, or changing the selection with arrow keys. It also provides default behavior for rich text features, such as headings, formatted, text and blockquotes.

You can use this package as a starting point, and then add additional command listeners to customize the functionality of your editor. If you don't want or need rich text functionality, you may want to consider using [@lewiiiis/lexical-plain-text](https://lexical.dev/docs/api/lexical-plain-text) instead.
npm package: @lewin671/lsp-client
Description: Universal LSP Client SDK for TypeScript
Author: Lewin671
Latest version: 0.1.3

# Universal LSP Client SDK

A TypeScript SDK for building Language Server Protocol (LSP) clients that run in any environment (Node.js, Browser, Electron, VS Code, etc.).

## Features

- **Universal**: Decoupled from VS Code API. Runs anywhere.
- **Type-Safe**: Built with TypeScript.
- **Pluggable Transports**: Support for Stdio, IPC, WebSocket, and custom transports.
- **Flexible Architecture**: Middleware, Plugins, and Host abstractions.

## Installation

```bash
npm install @lewin671/lsp-client
```

## Usage

### Basic Example

```typescript
import { LanguageClient, StdioTransport } from '@lewin671/lsp-client';

// 1. Create a transport (e.g., Stdio for a local server)
const transport = new StdioTransport('path/to/server-executable', ['--stdio']);

// 2. Initialize the client
const client = new LanguageClient({
    name: 'My Language Client',
    transport: transport,
    // ... other options
});

// 3. Start the client
await client.start();

// 4. Send a request
const result = await client.sendRequest('textDocument/hover', { ... });
```

## Architecture

See [Agents.md](./Agents.md) for architectural details.

## Development

### Build

```bash
npm install
npm run build
```

### Run Demo

```bash
npm run demo
```

## License

MIT
npm package: @lewinblog/api-core
Description: Api服务基础框架
Author: saodd
Latest version: 0.0.1

# @lewinblog/api-core

轻量的 TypeScript API 客户端基座。

- 用 `[Request, Response]` 定义接口类型
- 用路由表声明 `url` 和 `method`
- 用中间件接入 `fetch`、`axios` 或自定义 HTTP 实现

## 安装

```bash
npm install @lewinblog/api-core
npm install axios
```

## 快速开始

```ts
import { ApiService, dataApiMiddleware } from '@lewinblog/api-core';
import { fetchApiMiddleware } from '@lewinblog/api-core/fetch';
import { axiosApiMiddleware } from '@lewinblog/api-core/axios';

type BlogApi = {
  getTags: [never, string[]];
  createArticle: [{ title: string }, { id: string }];
};

const service = new ApiService<BlogApi>({
  getTags: { url: '/api/blog/tags', method: 'get' },
  createArticle: { url: '/api/blog/create', method: 'post' },
});
service.push(dataApiMiddleware); // 提取响应体中的data字段
service.push(fetchApiMiddleware); // 选择一种http中间件，或者你自己实现

const tags = await service.api.getTags();
const { id } = await service.api.createArticle({ title: 'Hello' });
```

`never` 表示无参数接口，所以 `service.api.getTags()` 会是无参调用。
npm package: @lewinblog/logger-core
Description: A composable logger with middleware pipeline for TypeScript applications.
Author: saodd
Latest version: 0.0.3

# @lewinblog/logger-core

一个轻量的日志核心库，设计重点是两件事：

- `Logger` 负责定义“如何产生日志”
- `LogMiddleware` 负责定义“日志如何被处理与输出”

## 核心接口

### `Logger`

`Logger` 是调用侧使用的统一入口，提供 `debug`、`info`、`warn`、`error` 四个方法。

```ts
import { ConsoleWriter, DefaultLogger, type Logger } from '@lewinblog/logger-core';

const logger: Logger = new DefaultLogger(new ConsoleWriter());
logger.use(new FooWriter()); // 也可以链式追加中间件
logger.info('app.boot', 'started', { env: 'prod' });
logger.error('app.api', new Error('request failed'), { requestId: 'req-1' });
```

约定说明：

- `prefix` 用来标识日志来源，建议按模块或场景命名，例如 `app.boot`、`user.login`
- `msg` 是给人直接阅读的消息文本
- `extra` 是结构化上下文，供中间件做过滤、增强或自定义输出
- `error` 接收 `unknown`，这样可以兼容任意异常值，而不强制依赖特定错误类型

### `LoggerMiddleware`

`LoggerMiddleware` 是日志处理链上的最小扩展单位。每条日志都会按顺序经过中间件的 `write` 方法。

```ts
import { ConsoleWriter, DefaultLogger, type LogEntry, type LoggerMiddleware } from '@lewinblog/logger-core';

class SkipDebugMiddleware implements LoggerMiddleware {
  write(entry: LogEntry): LogEntry | null {
    if (entry.level === 'DEBUG') {
      return null;
    }
    return entry;
  }
}

// 中间件即可作为构造参数传入，也可用 .use() 链式追加
const logger = new DefaultLogger(new SkipDebugMiddleware(), new ConsoleWriter());
// 或：
const logger2 = new DefaultLogger().use(new SkipDebugMiddleware()).use(new ConsoleWriter());
```

返回约定：

- 返回 `entry` 或修改后的新对象：继续传给下一个中间件
- 返回 `null`：终止整条链路，后续中间件不会再执行

## 设计原理

这个包采用“输入接口 + 中间件管道”的设计：

- `Logger` 只负责表达日志意图，不关心最终输出到哪里
- `LogMiddleware` 负责过滤、补充、格式化、转发等处理细节
- `LogBuilder` 负责把两者串起来，让日志沿着一条可组合的链路流动

这样做的结果是：

- 调用侧 API 很稳定
- 输出策略可以自由组合
- 过滤、格式化、落地控制台或其他目标时不需要改动业务调用代码

## 内置实现

当前包内置：

- `DefaultLogger`：把 `Logger` 调用转换成 `LogEntry` 并按顺序执行中间件链；支持构造时直接传入中间件
- `ConsoleWriter`：将日志格式化后输出到控制台；`extra` 以独立对象参数输出，在开发者工具中可展开查看
- `getExceptionExtra` / `buildErrorMessage`：辅助处理错误日志的结构化上下文与文本拼装
npm package: @lewinblog/nano-di
Description: A tiny explicit dependency injection container for TypeScript applications.
Author: saodd
Latest version: 0.0.2

# @lewinblog/nano-di

一个小而直接的 TypeScript 依赖注入容器。

它提供显式 token、同步和异步绑定、单例和瞬态作用域，以及基于构造参数 token 列表的类绑定。

与[inversify.js](https://inversify.io/)相比，这里不使用装饰器，不依赖`reflect-metadata`，遵循新的typescript装饰器规范，并且没有运行时类型检查。可以作为新时代的简单替代品。

## 安装

```bash
npm install @lewinblog/nano-di
```

## 用法

```ts
import { Container, createToken } from '@lewinblog/nano-di';

interface Logger {
  log(message: string): void;
}

class ConsoleLogger implements Logger {
  log(message: string): void {
    console.log(message);
  }
}

interface UserService {
  load(): void;
}

class DefaultUserService implements UserService {
  constructor(private readonly logger: Logger) {}

  load(): void {
    this.logger.log('load user');
  }
}

const LOGGER = createToken<Logger>('Logger');
const USER_SERVICE = createToken<UserService>('UserService');

const container = new Container();

container.bindClass(LOGGER, ConsoleLogger, [], 'singleton');
container.bindClass(USER_SERVICE, DefaultUserService, [LOGGER], 'singleton');

container.get(USER_SERVICE).load();
```

提供一个全局对象作为快捷方式:

```ts
import { container } from '@lewinblog/nano-di';
```

## API

- `createToken<T>(description)`
- `Container`
- `Container#bind(token, factory, scope?)`
- `Container#bindValue(token, value)`
- `Container#bindAsync(token, factory, scope?)`
- `Container#bindClass(token, ClassType, deps, scope?)`
- `Container#get(token)`
- `Container#getAsync(token)`
- `Container#lazy(token)`
- `Container#lazyAsync(token)`
- `Container#createChild()`