Skip to content

Commit

Permalink
docs(@liuli-util/i18next-dts-gen): 更新文档,调整示例与详细说明的顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
rxliuli committed Jun 20, 2021
1 parent 680a2f6 commit 5b59991
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
24 changes: 13 additions & 11 deletions libs/i18next-dts-gen/README.ZH_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ i18next 的 typescript 类型定义生成器,可以从多个语言翻译 json

## 使用

```shell
$ i18next-dts-gen -h
Usage: bin [options] [command]

Options:
-h, --help display help for command
> 这个 cli 本身国际化配置的类型定义生成也是由 cli 完成的(自举)
Commands:
gen [options] 根据 json 生成 .d.ts 类型定义
help [command] display help for command
```shell
i18next-dts-gen gen --input src/__tests__/i18n # 扫描这个目录下的 json 文件并生成 index.d.ts 类型定义
```

示例
详情

```shell
i18next-dts-gen gen --input src/__tests__/i18n # 扫描这个目录下的 json 文件并生成 index.d.ts 类型定义
$ ts-node src/bin.ts -h
Usage: bin [options]

根据 json 生成 .d.ts 类型定义

Options:
-i, --input <input...> 包含一或多个翻译文件的目录
-w, --watch 是否使用监视模式
-h, --help display help for command
```

## 动机
Expand Down
24 changes: 13 additions & 11 deletions libs/i18next-dts-gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ i18next's typescript type definition generator can generate type definitions fro

## Use

```shell
$ i18next-dts-gen -h
Usage: bin [options] [command]

Options:
-h, --help display help for command
> The type definition generation of the international configuration of cli itself is also done by cli (bootstrapping)
Commands:
gen [options] Generate .d.ts type definition from json
help [command] display help for command
```shell
i18next-dts-gen gen --input src/i18n # Scan this directory for json files and generate index.d.ts type definitions
```

Example
Detail

```shell
i18next-dts-gen gen --input src/__tests__/i18n # Scan this directory for json files and generate index.d.ts type definitions
$ ts-node src/bin.ts -h
Usage: bin [options]

Generate .d.ts type definitions from json

Options:
-i, --input <input...> Directory containing one or more translation files
-w, --watch Whether to use watch mode
-h, --help display help for command
```

## Motivation
Expand Down

0 comments on commit 5b59991

Please sign in to comment.