Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 使用styleguide构建文档 #3

Merged
merged 6 commits into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"presets": [
["env", { "modules": false }]
["@babel/env", { "modules": false }]
],
"env": {
"test": {
"presets": [
["env", { "targets": { "node": "current" }}]
["@babel/env", { "targets": { "node": "current" }}]
]
}
},
"plugins": [
["transform-runtime", {
"polyfill": false,
["@babel/transform-runtime", {
"regenerator": true
}]
]
Expand Down
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# editorconfig.org
root = true

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

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
dist
docs/build
docs/index.html

# Editor directories and files
.idea
Expand All @@ -11,3 +14,4 @@ yarn-error.log*
*.ntvs*
*.njsproj
*.sln
.env
15 changes: 15 additions & 0 deletions .grenrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
"dataSource": "prs",
"prefix": "",
"ignoreLabels": ["duplicate", "help wanted", "invalid", "question", "wontfix"],
"ignoreIssuesWith": ["duplicate", "help wanted", "invalid", "question", "wontfix"],
"onlyMilestones": false,
"changelogFilename": "CHANGELOG.md",
"template": {
"issue": "- {{name}} [{{text}}]({{url}})"
},
"groupBy": {
"✨ New Features:": ["enhancement"],
"🐛 Bug Fixes:": ["bug"]
}
}
16 changes: 0 additions & 16 deletions .storybook/config.js

This file was deleted.

23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: node_js
node_js:
- lts/*
git:
depth: 3
install:
- yarn --frozen-lockfile
script:
- yarn build
cache: yarn
deploy:
- on:
branch: master
provider: pages
skip-cleanup: true
keep-history: true
local-dir: docs
github-token: $GITHUB_TOKEN
- on:
branch: master
provider: npm
email: levy9527@qq.com
api_key: $NPM_TOKEN
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# el-number-range

[![Build Status](https://travis-ci.com/FEMessage/el-number-range.svg?branch=master)](https://travis-ci.com/FEMessage/el-number-range)
[![NPM Download](https://img.shields.io/npm/dm/@femessage/el-number-range.svg)](https://www.npmjs.com/package/@femessage/el-number-range)
[![NPM Version](https://img.shields.io/npm/v/@femessage/el-number-range.svg)](https://www.npmjs.com/package/@femessage/el-number-range)
[![NPM License](https://img.shields.io/npm/l/@femessage/el-number-range.svg)](https://github.com/FEMessage/el-number-range/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/FEMessage/el-number-range/pulls)
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)

数字范围输入框组件

Expand All @@ -15,7 +17,7 @@
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Feature](#feature)
- [Documentation](#documentation)
- [Demo](#demo)
- [Install](#install)
- [Example](#example)
- [设置最大值](#%E8%AE%BE%E7%BD%AE%E6%9C%80%E5%A4%A7%E5%80%BC)
Expand All @@ -36,10 +38,9 @@

[⬆ Back to Top](#table-of-contents)

## Documentation
## Demo

- [online demo](https://femessage.github.io/el-number-range/storybook/)
- [full api doc](https://femessage.github.io/el-number-range/)
* [doc and online demo](https://femessage.github.io/el-number-range/)

[⬆ Back to Top](#table-of-contents)

Expand Down
6 changes: 4 additions & 2 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// rollup.config.js
import vue from 'rollup-plugin-vue'
import babel from 'rollup-plugin-babel'
import uglify from 'rollup-plugin-uglify-es'
import commonjs from 'rollup-plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import minimist from 'minimist'

const argv = minimist(process.argv.slice(2))
Expand All @@ -13,6 +14,7 @@ const config = {
exports: 'named'
},
plugins: [
commonjs(),
vue({
css: true,
compileTemplate: true
Expand All @@ -26,7 +28,7 @@ const config = {

// Only minify browser (iife) version
if (argv.format === 'iife') {
config.plugins.push(uglify())
config.plugins.push(terser())
}

export default config
17 changes: 17 additions & 0 deletions docs/basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
基本用法

```vue
<template>
<el-number-range v-model="range"/>
</template>
<script>
export default {
data() {
return {
range: []
}
}
}
</script>
```
1 change: 0 additions & 1 deletion docs/build/0.da69bbbf.js

This file was deleted.

128 changes: 0 additions & 128 deletions docs/build/bundle.360367b4.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.html

This file was deleted.

18 changes: 18 additions & 0 deletions docs/max.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
设置最大值

```vue
<template>
<el-number-range v-model="range" :max="max"></el-number-range>
</template>
<script>
export default {
data() {
return {
range: [],
max: 3333
}
}
}
</script>
```
18 changes: 18 additions & 0 deletions docs/min.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
设置最小值

```vue
<template>
<el-number-range v-model="range" :min="min"></el-number-range>
</template>
<script>
export default {
data() {
return {
range: [],
min: 20
}
}
}
</script>
```
Binary file removed docs/storybook/favicon.ico
Binary file not shown.
28 changes: 0 additions & 28 deletions docs/storybook/iframe.html

This file was deleted.

44 changes: 0 additions & 44 deletions docs/storybook/index.html

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

48 changes: 25 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,67 @@
"url": "https://github.com/FEMessage/el-number-range.git"
},
"keywords": ["vue", "sfc", "component"],
"files": ["src", "dist", "yarn.lock"],
"main": "dist/el-number-range.umd.js",
"module": "dist/el-number-range.esm.js",
"unpkg": "dist/el-number-range.min.js",
"browser": {
"./sfc": "src/el-number-range.vue"
},
"scripts": {
"styleguide": "vue-styleguidist server",
"story": "start-storybook -p 9001 -c .storybook",
"story:build": "build-storybook -c .storybook -o docs/storybook",
"dev": "vue-styleguidist server",
"doc": "vue-styleguidist build",
"test": "jest",
"build":
"npm run build:unpkg & npm run build:es & npm run build:umd & npm run doc & npm run story:build",
"npm run build:unpkg & npm run build:es & npm run build:umd & npm run doc",
"build:umd":
"rollup --config build/rollup.config.js --format umd --file dist/el-number-range.umd.js",
"build:es":
"rollup --config build/rollup.config.js --format es --file dist/el-number-range.esm.js",
"build:unpkg":
"rollup --config build/rollup.config.js --format iife --file dist/el-number-range.min.js",
"prepublishOnly": "npm run build",
"precommit": "pretty-quick --staged",
"postpublish": "git add docs && git add dist && git commit -a --amend"
},
"peerDependencies": {
"element-ui": "^2.4.9",
"vue": "^2.5.16"
"precommit": "pretty-quick --staged"
},
"devDependencies": {
"@storybook/vue": "^3.4.10",
"@babel/core": "^7.4.3",
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@vue/test-utils": "^1.0.0-beta.16",
"babel-jest": "^23.0.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-jest": "^24.7.1",
"babel-loader": "^8.0.5",
"element-ui": "^2.7.2",
"file-loader": "^3.0.1",
"glob": "^7.1.3",
"husky": "^0.14.3",
"jest": "^23.1.0",
"minimist": "^1.2.0",
"prettier": "1.12.1",
"pretty-quick": "^1.4.1",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-uglify-es": "0.0.1",
"rollup-plugin-vue": "^3.0.0",
"rollup": "^1.9.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-vue": "^4.7.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue": "^2.5.16",
"vue-jest": "^2.6.0",
"vue-styleguidist": "1.7.7",
"vue-jest": "^3.0.4",
"vue-loader": "^15.7.0",
"vue-styleguidist": "^3.11.4",
"vue-template-compiler": "^2.5.16",
"webpack": "^3.10.0"
"webpack": "^4.29.6"
},
"publishConfig": {
"access": "public"
},
"files": ["src", "dist", "yarn.lock"],
"jest": {
"moduleFileExtensions": ["js", "vue"],
"transform": {
"^.+\\.js$": "./node_modules/babel-jest",
"^.+\\.vue$": "./node_modules/vue-jest"
}
},
"vue-sfc-cli": "1.0.0",
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
Expand Down
Loading