Skip to content

Commit 29ca5f4

Browse files
donaldshenlevy9527
authored andcommitted
style: 用prettier规范模板样式 (#84)
1 parent 74fd641 commit 29ca5f4

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

templates/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ short description + sample image(png/gif/mp4)
1515
- [Features](#features)
1616
- [Links](#links)
1717
- [Install](#install)
18+
- [Contributing](#contributing)
1819
- [Contributors](#contributors)
1920
- [License](#license)
2021

templates/build/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import vue from 'rollup-plugin-vue'
33
import babel from 'rollup-plugin-babel'
44
import commonjs from 'rollup-plugin-commonjs'
5-
import { terser } from 'rollup-plugin-terser'
5+
import {terser} from 'rollup-plugin-terser'
66
import minimist from 'minimist'
77

88
const argv = minimist(process.argv.slice(2))

templates/package-json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
"type": "git",
99
"url": "https://github.com/{{ownerName}}/{{componentName}}.git"
1010
},
11-
"keywords": ["vue", "sfc", "component"],
12-
"files": ["src", "dist"],
11+
"keywords": [
12+
"vue",
13+
"sfc",
14+
"component"
15+
],
16+
"files": [
17+
"src",
18+
"dist"
19+
],
1320
"main": "dist/{{componentName}}.umd.js",
1421
"module": "dist/{{componentName}}.esm.js",
1522
"unpkg": "dist/{{componentName}}.min.js",
@@ -20,14 +27,10 @@
2027
"dev": "vue-styleguidist server",
2128
"test": "jest --verbose",
2229
"doc": "vue-styleguidist build",
23-
"build":
24-
"npm run build:unpkg & npm run build:es & npm run build:umd & npm run doc",
25-
"build:umd":
26-
"rollup --config build/rollup.config.js --format umd --file dist/{{componentName}}.umd.js",
27-
"build:es":
28-
"rollup --config build/rollup.config.js --format es --file dist/{{componentName}}.esm.js",
29-
"build:unpkg":
30-
"rollup --config build/rollup.config.js --format iife --file dist/{{componentName}}.min.js",
30+
"build": "npm run build:unpkg & npm run build:es & npm run build:umd & npm run doc",
31+
"build:umd": "rollup --config build/rollup.config.js --format umd --file dist/{{componentName}}.umd.js",
32+
"build:es": "rollup --config build/rollup.config.js --format es --file dist/{{componentName}}.esm.js",
33+
"build:unpkg": "rollup --config build/rollup.config.js --format iife --file dist/{{componentName}}.min.js",
3134
"stdver": "standard-version -m '[skip ci] chore(release): v%s'",
3235
"release": "gren release --override"
3336
},
@@ -42,6 +45,8 @@
4245
"glob": "^7.1.3",
4346
"husky": "1.3.1",
4447
"jest": "^24.8.0",
48+
"less": "^3.9.0",
49+
"less-loader": "^5.0.0",
4550
"lint-staged": "^8.1.0",
4651
"minimist": "^1.2.0",
4752
"prettier": "1.18.2",
@@ -53,8 +58,6 @@
5358
"standard-version": "^6.0.1",
5459
"stylelint": "^9.10.0",
5560
"stylelint-config-standard": "^18.2.0",
56-
"stylus": "^0.54.5",
57-
"stylus-loader": "^3.0.2",
5861
"vue": "^2.6.10",
5962
"vue-loader": "^15.7.1",
6063
"vue-styleguidist": "^3.16.3",
@@ -76,7 +79,7 @@
7679
}
7780
},
7881
"lint-staged": {
79-
"*.(js|md)": [
82+
"*.(js|md|json)": [
8083
"prettier --write",
8184
"git add"
8285
],

templates/src/component.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ export default {
1414
}
1515
</script>
1616

17-
<style lang="stylus">
18-
</style>
17+
<style lang="less"></style>

templates/styleguide.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const sections = (() => {
3131
sectionDepth: 2
3232
},
3333
...(faq ? [faq] : []),
34-
...(guides.length ? [{name: 'Guide', sections: guides}] : [])
34+
...(guides.length ? [{name: 'Guide', sections: guides, sectionDepth: 2}] : [])
3535
]
3636
})()
3737

@@ -59,8 +59,8 @@ module.exports = {
5959
loaders: ['style-loader', 'css-loader']
6060
},
6161
{
62-
test: /\.styl(us)?$/,
63-
loaders: ['vue-style-loader', 'css-loader', 'stylus-loader']
62+
test: /\.less$/,
63+
loaders: ['vue-style-loader', 'css-loader', 'less-loader']
6464
},
6565
{
6666
test: /\.(woff2?|eot|[ot]tf)(\?.*)?$/,

0 commit comments

Comments
 (0)