Skip to content

Commit d080b5d

Browse files
committed
add: initail
0 parents commit d080b5d

File tree

15 files changed

+303
-0
lines changed

15 files changed

+303
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
bower_components
3+
coverage
4+
npm-debug.log
5+
yarn.lock
6+
package-lock.json
7+
.DS_Store
8+
.idea
9+
.vscode

.npmignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.idea
2+
.DS_Store
3+
**/npm-debug.log
4+
**/node_modules
5+
test
6+
__tests__
7+
src
8+
build
9+
gulpfile.js
10+
11+
.editorconfig
12+
.npmrc
13+
.prettoerrc

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
2+
package-lock=false

.prettierrc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"trailingComma": "none",
3+
"arrowParens": "always",
4+
"printWidth": 100,
5+
"bracketSpacing": true,
6+
"jsxBracketSameLine": true,
7+
"tabWidth": 2,
8+
"semi": true,
9+
"singleQuote": true,
10+
"overrides": [
11+
{
12+
"files": ["*.json", ".eslintrc", ".tslintrc", ".prettierrc", ".tern-project"],
13+
"options": {
14+
"parser": "json",
15+
"tabWidth": 2
16+
}
17+
},
18+
{
19+
"files": "*.{css,sass,scss,less}",
20+
"options": {
21+
"parser": "postcss",
22+
"tabWidth": 2
23+
}
24+
},
25+
{
26+
"files": "*.ts",
27+
"options": {
28+
"parser": "typescript"
29+
}
30+
},
31+
{
32+
"files": "*.md",
33+
"options": {
34+
"trailingComma": "none",
35+
"tabWidth": 2,
36+
"parser": "json"
37+
}
38+
}
39+
]
40+
}

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 afei <1290657123@qq.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# react-markdown-props
2+
> Generate markdown properties string.
3+
4+
## installation
5+
```shell
6+
npm install -S @feizheng/react-markdown-props
7+
```
8+
9+
## usage
10+
```js
11+
// codes
12+
```
13+
14+
## resources
15+
- https://github.com/reactjs/react-docgen

__tests__/basic.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const reactMarkdownProps = require('../src');
2+
3+
describe('Basic test', () => {
4+
test('test development', () => {
5+
6+
console.log(reactMarkdownProps('__tests__/components/index.js'));
7+
8+
// expect(true).toBe(true);
9+
});
10+
});

__tests__/components/index.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React, { Component } from 'react';
2+
import ReactDOM from 'react-dom';
3+
import PropTypes from 'prop-types';
4+
import classNames from 'classnames';
5+
import noop from '@feizheng/noop';
6+
import objectAssign from 'object-assign';
7+
8+
const CLASS_NAME = 'boilerplate-react-component';
9+
10+
export default class BoilerplateReactComponent extends Component {
11+
static displayName = CLASS_NAME;
12+
static version = '__VERSION__';
13+
static propTypes = {
14+
/**
15+
* The extended className for component.
16+
*/
17+
className: PropTypes.string,
18+
/**
19+
* Default value.
20+
*/
21+
value: PropTypes.object,
22+
/**
23+
* The change handler.
24+
*/
25+
onChange: PropTypes.func
26+
};
27+
28+
static defaultProps = {
29+
value: null,
30+
onChange: noop
31+
};
32+
33+
constructor(inProps) {
34+
super(inProps);
35+
this.state = {};
36+
}
37+
38+
_onClick = (e) => {
39+
console.log('click me!');
40+
};
41+
42+
render() {
43+
const { className, ...props } = this.props;
44+
return (
45+
<div data-component={CLASS_NAME} className={classNames(CLASS_NAME, className)} {...props}>
46+
<p>
47+
<button onClick={this._onClick} className="icon-play">
48+
PLAY
49+
</button>
50+
</p>
51+
<p>Hello React!!</p>
52+
</div>
53+
);
54+
}
55+
}

build/clean.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(function() {
2+
3+
'use strict';
4+
5+
const gulp = require('gulp');
6+
const $ = require('gulp-load-plugins')({
7+
pattern: ['gulp-*', 'gulp.*', 'del']
8+
});
9+
10+
//clean
11+
gulp.task('clean', function() {
12+
return $.del('dist');
13+
});
14+
15+
}());

0 commit comments

Comments
 (0)