Skip to content

Commit

Permalink
docs(docs): 增加首页和快速开始
Browse files Browse the repository at this point in the history
  • Loading branch information
sssssssugar committed Jun 23, 2021
1 parent dbbe0a6 commit 6bb7a10
Show file tree
Hide file tree
Showing 22 changed files with 483 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
4 changes: 4 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
esm: 'rollup',
cjs: 'rollup',
};
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/npm-debug.log*
/yarn-error.log
/yarn.lock
/package-lock.json

# production
/dist
/docs-dist

# misc
.DS_Store

# umi
.umi
.umi-production
.umi-test
.env.local

# ide
/.vscode
/.idea
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry = https://registry.npm.taobao.org

7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/*.svg
**/*.ejs
**/*.html
package.json
.umi
.umi-production
.umi-test
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
37 changes: 37 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'Taro-hooks',
favicon: '/image/logo.png',
logo: '/image/logo.png',
outputPath: 'docs-dist',
mode: 'site',
devServer: {
port: 12345,
},
dynamicImport: {},
exportStatic: {},
navs: [
null,
{
title: 'GitHub',
path: 'https://github.com/innocces/taro-hooks',
},
{
title: '更新日志',
path: 'https://github.com/innocces/taro-hooks/releases',
},
],
links: [{ rel: 'stylesheet', href: '/assets/style.css' }],
themeConfig: {
hd: {
// 根据不同的设备屏幕宽度断点切换高清方案
rules: [
{ maxWidth: 375, mode: 'vw', options: [100, 750] },
{ minWidth: 376, maxWidth: 750, mode: 'vw', options: [100, 1500] },
],
// 更多 rule 配置访问 https://github.com/umijs/dumi/blob/master/packages/theme-mobile/src/typings/config.d.ts#L7
},
},
// more config: https://d.umijs.org/config
});
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry "https://registry.npm.taobao.org"
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Taro-hooks

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)[![NPM version][image-1]][1] [![NPM downloads][image-2]][2][![node][image-3]][2][![license][image-4]][2]

## 简介

`Taro`而设计的`Hooks Library`.

## 文档

[传送门]()

## 使用案例

<table>
<tbody>
<tr>
<td align="center">
<a target="_blank" href="">
<img
width="32"
src=""
/>
<br>
<strong>Taro-hooks weapp</strong>
</a>
</td>
<td align="center">
<a target="_blank" href="">
<img
width="32"
style="vertical-align: -0.32em; margin-right: 8px;"
src=""
/>
<br>
<strong>Taro-hooks h5</strong>
</a>
</td>
</tr>
</tbody>
</table>

## 特性

- 全面匹配`Taro API`.
- 结合`ahooks`扩展常用`hook`.
- 完整的类型定义文件
- 更易用的方式

## 安装

```bash
$ npm i taro-hook --save
```

## 使用

```jsx
import { useEnv } from 'taro-hook';
```

## 参与贡献

```bash
$ git clone git@github.com:innocces/taro-hooks.git
$ cd taro-hooks
$ yarn
$ yarn start
```

会自动打开浏览器 - [http://localhost:12345](http://localhost:12345)
更多贡献详情见[官网文档]()

## 交流讨论

<img src="" alt="wechat code" width="300"/>

## License

[MIT](./LICENSE)

[1]: https://www.npmjs.com/package/taro-hooks
[2]: https://npmjs.org/package/taro-hooks
[image-1]: https://img.shields.io/npm/v/taro-hooks.svg?style=flat
[image-2]: https://img.shields.io/npm/dm/taro-hooks.svg?style=flat
[image-3]: https://img.shields.io/node/v/taro-hooks.svg?style=flat-square
[image-4]: https://img.shields.io/npm/l/taro-hooks.svg?style=flat-square
70 changes: 70 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
hero:
title: Taro-hooks
desc: 为 Taro 而设计的 Hooks Library
actions:
- text: 快速上手
link: /quick
features:
- icon: https://taro.zone/static/images/icon_community.svg
title: 全面匹配
desc: 对标Taro API开发
- icon: https://ahooks.js.org/logo.svg
title: 结合ahook
desc: 使用ahook拓展对应能力
- icon: https://taro.zone/static/images/icon_component.svg
title: 类型定义
desc: 使用typescript开发, 完整的类型定义方便开发
footer: Open-source MIT Licensed | Copyright © 2021<br />Powered by [taro-hooks](https://github.com/innocces/taro-hooks)
---

## 轻松使用

1. 安装依赖

```bash
$ npm i taro-hooks --save
```

2. 使用

```jsx | pure
import { useEnv } from 'taro-hooks';
```

## 使用案例

<table>
<tbody>
<tr>
<td align="center">
<a target="_blank" href="">
<img
width="32"
src="http://s"
/>
<br>
<strong>Taro-hooks weapp</strong>
</a>
</td>
<td align="center">
<a target="_blank" href="">
<img
width="32"
style="vertical-align: -0.32em; margin-right: 8px;"
src="http://s"
/>
<br>
<strong>Taro-hooks h5</strong>
</a>
</td>
</tr>
</tbody>
</table>

## 交流讨论

<div>
<img data-type="dingtalk" src="https://g" width="300" />
<img data-type="wechat" src="http://111" width="300" />
</div>
9 changes: 9 additions & 0 deletions docs/quick/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: FAQ
---

<Alert type="info">
整理部分常见问题, 帮助快速解决问题
</Alert>

### 1. 如何按需加载?
45 changes: 45 additions & 0 deletions docs/quick/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
nav:
title: 指南
order: 1
title: 介绍
---

## 什么是 Taro-hooks?

`Taro-hooks` - 一款对标`Taro API`开发的`Hooks Library`. 覆盖几乎所有`Taro API`以及方法.

## 特性

- 全面匹配`Taro API`.
- 结合`ahooks`扩展常用`hook`.
- 完整的类型定义文件
- 更易用的方式

## 快速上手

### 环境准备

需要准备[node](https://nodejs.org/en/)

```bash
$ node -v
# 确保node版本为12+
$ v12.22.1
```

### 脚手架初始化`Taro`

`Taro-hooks`是以`React`模板编写的. 所以仅适用于`React`.

```bash
$ npx @tarojs/cli init taro-hooks-app
# 选择react模板
$ cd taro-hooks-app
$ npm i taro-hooks --save
$ npm run dev:weapp --watch
```

### 构建及部署

参考[taro build](https://taro-docs.jd.com/taro/docs/config)
15 changes: 15 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"packages": ["packages/*"],
"command": {
"version": {
"allowBranch": "main",
"includeMergedTags": true
},
"publish": {
"registry": "https://registry.npmjs.org/"
}
},
"useWorkspaces": true,
"ignoreChanges": ["**/*.md", "**/es/*", "**/lib/*", "**/dist/*"],
"version": "0.0.0"
}
Loading

0 comments on commit 6bb7a10

Please sign in to comment.