1 | # LeanCloud JavaScript SDK
|
2 |
|
3 | [![npm](https://img.shields.io/npm/v/leancloud-storage.svg?style=flat-square)](https://www.npmjs.com/package/leancloud-storage)
|
4 | ![gzip size](http://img.badgesize.io/leancloud/javascript-sdk/dist/dist/av-min.js.svg?compression=gzip&style=flat-square)
|
5 | [![Build Status](https://img.shields.io/travis/leancloud/javascript-sdk.svg?style=flat-square)](https://travis-ci.org/leancloud/javascript-sdk)
|
6 | [![Codecov](https://img.shields.io/codecov/c/github/leancloud/javascript-sdk.svg?style=flat-square)](https://codecov.io/github/leancloud/javascript-sdk)
|
7 | [![Known Vulnerabilities](https://snyk.io/test/github/leancloud/javascript-sdk/badge.svg?style=flat-square)](https://snyk.io/test/github/leancloud/javascript-sdk)
|
8 |
|
9 | JavaScript SDK for [LeanCloud](http://leancloud.cn/).
|
10 |
|
11 | ## 安装
|
12 |
|
13 | ```
|
14 | // npm 安装
|
15 | npm install leancloud-storage --save
|
16 | // npm 安装 2.x 版本
|
17 | npm install leancloud-storage@2 --save
|
18 | ```
|
19 |
|
20 | ## 文档
|
21 |
|
22 | - [安装文档](https://leancloud.cn/docs/sdk_setup-js.html)
|
23 | - [使用文档](https://leancloud.cn/docs/leanstorage_guide-js.html)
|
24 | - [API 文档](https://leancloud.github.io/javascript-sdk/docs/)
|
25 |
|
26 | ## 支持
|
27 |
|
28 | - 如果你发现了新的 bug,或者有新的 feature request,请新建一个 issue
|
29 | - 在使用过程中遇到了问题时
|
30 | - 如果你是商用版用户,请新建一个工单。
|
31 | - 也可以在 [论坛](https://forum.leancloud.cn/) 提问、讨论。
|
32 |
|
33 | ## 贡献
|
34 |
|
35 | 如果你希望为这个项目贡献代码,请按以下步骤进行:
|
36 |
|
37 | - `fork` 这个项目
|
38 | - `npm install` 安装相关依赖
|
39 | - 开发和调试
|
40 | - 确保测试全部通过 `npm run test`,浏览器环境打开 `test/test.html`
|
41 | - 提交并发起 `Pull Request`
|
42 |
|
43 | 项目的目录结构说明如下:
|
44 |
|
45 | ```
|
46 | ├── dist // 编译之后生成的文件将会在此目录下
|
47 | │ ├── av.js // 浏览器版本
|
48 | │ ├── av-min.js
|
49 | │ ├── av-weapp.js // 小程序版本
|
50 | │ ├── av-weapp-min.js
|
51 | │ ├── node // 目录中为生成的 nodejs 版本代码
|
52 | │ └── ...
|
53 | ├── src
|
54 | │ ├── index.js // node.js 环境入口文件
|
55 | │ └── ...
|
56 | └── test // 单元测试
|
57 | ```
|
58 |
|
59 | ## 发布流程
|
60 |
|
61 | 1. 遵循 semver 提升版本号
|
62 | - src/version.js
|
63 | - package.json
|
64 | 2. 对照 commit 历史写 changelog
|
65 | 3. 提交当前所有改动
|
66 | 4. 等待持续集成 pass
|
67 | 5. 使用 GitHub 基于 dist 分支发布一个 release
|
68 | 6. Fetch and checkout remote `dist` branch 并确认该提交的内容是即将发布的版本
|
69 | 7. npm publish(`npm publish`,需 npm 协作者身份),如果是 pre-release 版本需要带 next tag
|