Skip to content

Commit 44a4037

Browse files
committed
config improvement
1 parent bd5ba73 commit 44a4037

File tree

14 files changed

+90
-18
lines changed

14 files changed

+90
-18
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
10+
[{**.js,**.css,**.styl,.babelrc,package.json}]
11+
indent_size = 2
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[**.html]
17+
indent_size = 2
18+
19+
[.pre-commit]
20+
indent_style = space
21+
indent_size = 2

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!lib/
3+
!package.json
4+
!README.md

.pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
# Ensure all javascript files staged for commit pass standard code style
3+
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
4+
if [ $? -ne 0 ]; then exit 1; fi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
@TODO

demo/index.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
import React from 'react'
2-
import { storiesOf, action } from '@kadira/storybook'
2+
import {
3+
storiesOf
4+
// action
5+
} from '@kadira/storybook'
36
import Alert from '../src/'
47

58
storiesOf('Alert', module)
69
.add('with text', () => (
7-
<Alert prop='text' />
10+
<div>
11+
<Alert prop='xxx' />
12+
<button>test</button>
13+
</div>
814
))
915
.add('with long text', () => (
1016
<Alert prop='long text.......' />
1117
))
18+
.add('11111', () => (
19+
<Alert prop='1111.......' />
20+
))
1221

13-
storiesOf('Alert2', module)
22+
storiesOf('Table', module)
1423
.add('more example', () => (
1524
<Alert prop='more example' />
1625
))
1726
.add('more example', () => (
1827
<Alert prop='more example' />
1928
))
2029

21-
if (module.hot) {
22-
module.hot.accept();
23-
}
30+
storiesOf('Sug', module)
31+
.add('more example', () => (
32+
<Alert prop='more example' />
33+
))
34+
.add('more example', () => (
35+
<Alert prop='more example' />
36+
))

lib/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
._1W_PBhqheDoZ7jBEcfxzm0 {
2-
background: #eee;
2+
background: #efe;
33
border: 1px solid #aaa;
44
}

lib/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"description": "",
55
"main": "lib/index.js",
66
"scripts": {
7+
"hook": "[ -d .git ] && chmod +x .pre-commit && mkdir -p .git/hooks && ln -sf ../../.pre-commit .git/hooks/pre-commit && echo \"\\x1B[01;93mAdd git pre-commit hook successed.\\x1B[0m\" || echo \"\\x1B[31mWarning: Add git pre-commit hook failed.\\x1B[0m\"",
8+
"postinstall": "npm run hook",
79
"dev": "NODE_ENV=development start-storybook -p 9001",
810
"build": "NODE_ENV=production webpack --config ./webpack/webpack.config.prod.babel.js",
911
"update": "updtr",
10-
"test": "echo \"Error: no test specified\" && exit 1"
12+
"lint": "standard | snazzy",
13+
"test": "npm run lint && ava --require ./test/helpers/setup-test-env.js \"@(src|test)/**/*test.@(js|jsx)\" --verbose",
14+
"test:watch": "npm run test -- --watch --watch-extensions jsx"
1115
},
1216
"repository": {
1317
"type": "git",
@@ -76,7 +80,9 @@
7680
],
7781
"ignore": [
7882
"dist/",
79-
"mock/"
83+
"mock/",
84+
"lib/",
85+
".storybook/"
8086
]
8187
},
8288
"ava": {

0 commit comments

Comments
 (0)