Skip to content

Commit aff30a8

Browse files
committed
Merge pull request #1 from noyobo/dev
jsx files use es6module
2 parents 966d598 + 3023c80 commit aff30a8

17 files changed

+58
-330
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
node_modules/
21
lib/
2+
assets/index.css
3+
34
.sass-cache/
45
bower_components/
6+
node_modules/
57
site/
8+
*.log
9+
.idea

assets/index.css

Lines changed: 0 additions & 265 deletions
This file was deleted.

examples/picker.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder

examples/simple-visible.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder

examples/simple.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder

gulpfile.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ function getResolve() {
2424
return resolve
2525
}
2626

27-
gulp.task('jsx', ['clean:site'], function() {
27+
gulp.task('jsx', ['clean:lib'], function() {
2828
return gulp.src(['src/**/*.jsx', 'src/**/*.js'])
29-
.pipe(react())
29+
.pipe(react({
30+
es6module: true
31+
}))
3032
.pipe(babel())
3133
.pipe(gulp.dest('lib'))
3234
})
@@ -53,7 +55,7 @@ gulp.task('clean:lib', function(done) {
5355

5456
gulp.task('examples', ['clean:site', 'jsx'], function() {
5557
return gulp
56-
.src(['./examples/*.*'])
58+
.src(['./examples/*.jsx', './examples/*.js'])
5759
.pipe(jsx2example())
5860
.pipe(gulp.dest('site/examples/'))
5961
})

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./src/');

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-colors-picker",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "color-picker ui component for react",
55
"main": "lib/index.js",
66
"keywords": [
@@ -31,8 +31,8 @@
3131
},
3232
"scripts": {
3333
"build": "gulp build",
34-
"start": "gulp build && node --harmony node_modules/.bin/rc-server",
35-
"depoly": "gulp build && gh-pages -d site"
34+
"start": "node --harmony node_modules/.bin/rc-server",
35+
"deploy": "gulp build && gh-pages -d site"
3636
},
3737
"license": "MIT",
3838
"devDependencies": {

src/Alpha.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'use strict';
22

3-
const React = require('react');
4-
const Colr = require('colr');
5-
const event = require('eventlistener');
6-
const prefixClsFn = require('./utils/prefixClsFn');
3+
import React from 'react';
4+
import Colr from 'colr';
5+
import event from 'eventlistener';
6+
import prefixClsFn from './utils/prefixClsFn';
77

88
const colr = new Colr();
99

1010
function rgbaColor(r, g, b, a) {
1111
return 'rgba(' + [r, g, b, a / 100].join(',') + ')';
1212
}
1313

14-
class Alpha extends React.Component{
14+
export default class Alpha extends React.Component{
1515
constructor(props) {
1616
super(props);
1717
this.state = {
@@ -132,5 +132,3 @@ Alpha.defaultProps = {
132132
customColor: '#f00',
133133
onAlphaChange: function() {}
134134
};
135-
136-
module.exports = Alpha;

src/Board.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
'use strict';
2-
const Colr = require('colr');
3-
const React = require('react');
4-
const event = require('eventlistener');
5-
let prefixClsFn = require('./utils/prefixClsFn');
2+
import Colr from 'colr';
3+
import React from 'react';
4+
import event from 'eventlistener';
5+
import prefixClsFn from './utils/prefixClsFn';
66

77
let colr = new Colr();
88

99
const width = 200;
1010
const height = 150;
1111

12-
class Board extends React.Component {
12+
export default class Board extends React.Component {
1313
constructor(props) {
1414
super(props);
1515

@@ -228,4 +228,3 @@ Board.defaultProps = {
228228
hue: 0,
229229
prefixCls: 'react-colors-picker-board'
230230
};
231-
module.exports = Board;

0 commit comments

Comments
 (0)