open-index/open-npm huggingface dataset:
npm package: @liuli-util/mdbook
Description: 一个 markdown => epub 的生成工具，对中文 markdown 渲染友好。
Latest version: 0.2.7

# mdbook

一个 markdown => epub 的生成工具，对中文 markdown 渲染友好。

## 使用

```sh
pnpm i -D @liuli-util/mdbook
#根据 readme.md 构建 epub 书籍到 dist/ 目录下
pnpm mdbook build -i ./readme.md -o dist/
```

## 配置

书籍配置写在 _readme.md_ yaml 元数据中，形如

```md
---
title: 第一卷 量子纠缠
author: Hieronym
rights: CC BY-NC-SA
description: 丘比承诺说人类总有一天也能到达那遥远的星空。但它们很明智地没有说出来，人类将会在那里遇到什么。
language: zh-CN
cover: './assets/cover.png'
sections:
  - 001-第一章-许愿.md
  - 002-第二章-幻影.md
  - 003-第三章-麻美观影记-上.md
  - 004-第四章-麻美观影记-下.md
  - 005-第五章：家人.md
  - 006-第六章-军队.md
  - 007-第七章-南方组.md
  - 008-第八章-政与教.md
  - 009-第九章-回声.md
  - 010-第十章-准将.md
  - 011-第十一章-以往生活的残骸.md
  - 012-第十二章-狩猎魔兽的人.md
  - 013-第十三章-不对等的信息.md
  - 014-第十四章-血缘.md
  - 015-第十五章-萨姆萨拉.md
  - 016-第十六章-属于天空的光芒.md
---

“上帝是不玩骰子的”

—— 阿尔伯特・爱因斯坦最常被引用的一句名言
```
npm package: @liuli-util/mdbook-sdk
Description: 一个生成 epub 的 lib，提供低级的 API 生成 epub 文件。如果需要从 markdown 生成 epub，请使用 [@liuli-util/mdbook](https://www.npmjs.com/package/@liuli-util/mdbook)。
Latest version: 0.1.2

# @liuli-util/mdbook-sdk

一个生成 epub 的 lib，提供低级的 API 生成 epub 文件。如果需要从 markdown 生成 epub，请使用 [@liuli-util/mdbook](https://www.npmjs.com/package/@liuli-util/mdbook)。
npm package: @liuli-util/mobx-vue3-hooks
Description: An inspiration: If we can use hooks like vue3 in react without manually managing dependencies, will life be better? So I spent a little time implementing several hooks functions commonly used in vue3 based on mobx.
Latest version: 0.4.0

# @liuli-util/mobx-vue3-hooks

## Introduction

An inspiration: If we can use hooks like vue3 in react without manually managing dependencies, will life be better? So I spent a little time implementing several hooks functions commonly used in vue3 based on mobx.

## Quick start

```tsx
import { defineComponent, useVRef, useVFn, useVComputed } from '@liuli-util/mobx-vue3-hooks'

const HelloWorld = defineComponent(() => {
  const state = useVRef(0)
  const computedValue = useVComputed(() => state.value * 2)

  const onInc = useVFn(() => {
    state.value++
  })
  return (
    <div>
      <button onClick={onInc}>Add</button>
      <div>{computedValue.value}</div>
    </div>
  )
})
```

## API

- `defineComponent`: Define a component
- `useVReactive`: Create a mutable state of an object type
- `useVRef`: create a primitive type of mutable state
- `useVComputed`: Create a calculated value
- `useVFn`: Create an ordinary function (in vue3, you only need to declare the ordinary function in the setup function)
- `useVWatchEffect`: Create a watch to monitor state changes and respond to them
- `useVWatch`: Same type as useVWatchEffect but allows to pass in dependencies. The difference from vue3 is that you must use a function instead of a value

> Source of inspiration: <https://github.com/RisingStack/react-easy-state#local-stores-in-function-components>, related discussion: <https://github.com/mobxjs/mobx/discussions/3209>
npm package: @liuli-util/monorepo-changelog
Description: 一个自动根据当前模块提交生成 changelog 的 cli 工具。
Latest version: 0.2.1

# @liuli-util/monorepo-changelog

## 简介

一个自动根据当前模块提交生成 changelog 的 cli 工具。

## 使用

```shell
#安装依赖
yarn add -D @liuli-util/monorepo-changelog
#生成日志
yarn changelog
```

## 格式

```md
# CHANGELOG

## <version>

<!--hash:<hash>-->

- commit 1
- commit 2
- others commit...

...other version
```

## FAQ

### 动机

由于我们采用了 commitlint 规范化 git 提交信息，所以也希望能够根据 git 信息自动生成 changelog。社区中虽然已有非常多的工具，但仍不能满足我们的需求。

我们的需求

- 根据当前模块的 git 提交历史生成 changelog
- 基于 git 提交的 type 进行分组

下面是调研的一些工具基本上都无法满足第一条，即设计时没有考虑在 monorepo 中的使用

- [changelog-version](https://github.com/AlbertoFdzM/changelog-version)
- [standard-version](https://github.com/conventional-changelog/standard-version)

### 如何兼容之前手写的 CHANGELOG

例如以前的 changelog 可能是这样的

```md
# CHANGELOG

## 0.1.0

- 实现基本功能
```

只需要在最后一个版本添加当时的 git commit hash 即可

```md
# CHANGELOG

## 0.1.0

<!--hash:ca27f54052240ac3a68ff3dbbe171107b8c4dc37-->

- 实现基本功能
```
npm package: @liuli-util/object
Description: 对象相关功能的函数库
Latest version: 3.5.1

# @liuli-util/object

> 对象相关功能的函数库

查看文档网站 [@liuli-util/object](https://liuli-utils.rxliuli.com/@liuli-util/object)

## 安装

使用 yarn:

```sh
yarn add @liuli-util/object
```

或者使用 npm:

```sh
npm install @liuli-util/object
```
npm package: @liuli-util/other
Description: 其它类型功能的函数库
Latest version: 3.5.0

# @liuli-util/other

> 其它类型功能的函数库

查看文档网站 [@liuli-util/other](https://liuli-utils.rxliuli.com/@liuli-util/other)

## 安装

使用 yarn:

```sh
yarn add @liuli-util/other
```

或者使用 npm:

```sh
npm install @liuli-util/other
```
npm package: @liuli-util/rollup-plugin-i18next-dts-gen
Description: ## Scenes
Latest version: 0.4.4

# @liuli-util/rollup-plugin-i18next-dts-gen

## Scenes

> [中文](https://github.com/rxliuli/liuli-tools/blob/master/libs/rollup-plugin-i18next-dts-gen/README.zh-CN.md)

We have some projects that need to use i18next to handle internationalization, but the use of typescript requires type definitions, so [@liuli-util/i18next-dts-gen](https://github.com/rxliuli/liuli-tools/blob/master/libs/i18next-dts-gen/README.md) is used to automatically generate .d.ts files. But later we found that this process can be integrated into the build, no need to start a separate terminal command, currently supports direct integration into the rollup/vite build process.

## Quick start

### Install

```sh
pnpm i -D i18next @liuli-util/rollup-plugin-i18next-dts-gen
```

### Add the translated json file under _src/i18n/_, add two examples below

```json
// src/i18n/en-US.json
{
  "hello": "hello world",
  "toggle": "Switch language"
}
```

```json
// src/i18n/zh-CN.json
{
  "hello": "Hello, world",
  "toggle": "Switch language"
}
```

### Configure `vite.config.ts`

```ts
import { defineConfig } from 'vite'
import { i18nextDtsGen } from '@liuli-util/rollup-plugin-i18next-dts-gen'

export default defineConfig({
  plugins: [
    i18nextDtsGen({
      dirs: ['src/i18n'],
    }),
  ],
})
```

### Start the local server

```sh
pnpm dev
```

You will find that the `index.d.ts` type definition is automatically generated in the _src/i18n/_ directory, roughly as follows

```ts
export type TranslateType = {
  hello: {
    value: 'hello world'
    params: [key: 'hello']
  }
  toggle: {
    value: 'Switch language'
    params: [key: 'toggle']
  }
}
```

Then you can use this type for prompting or verification. Below is the simplest example. For more detailed examples combining react, please refer to [rollup-plugin-i18next-dts-gen-example](https://github.com/rxliuli/liuli-tools/tree/master/examples/rollup-plugin-i18next-dts-gen-example).

```ts
/**
 * Get the translated text according to the key
 * @param args
 */
function t<K extends keyof TranslateType>(...args: T[K]['params']): T[K]['value'] {
  // @ts-ignore
  return i18next.t(args[0], args[1])
}

console.log(t('hello'))
```

## Configuration

```ts
export interface GenerateOptions {
  // Multiple i18n directories can be specified, and the json file will be scanned in each subdirectory and the corresponding .d.ts will be generated
  dirs: string[]
}
```
npm package: @liuli-util/rollup-plugin-tar
Description: 实现 tar 插件用以将打包后的目录打包为 tar 包，目前主要用于打包 joplin 插件，但也可以作为通用模块。
Latest version: 0.3.0

# @liuli-util/rollup-plugin-tar

## 简介

实现 tar 插件用以将打包后的目录打包为 tar 包，目前主要用于打包 joplin 插件，但也可以作为通用模块。

## 使用

```sh
yarn add -D @liuli-util/rollup-plugin-tar
```

然后在 rollup.config.js 中配置

```ts
tar({
  sourceDir: 'dist',
  destPath: 'test.tar',
})
```