uxcore-select2
Advanced tools
Comparing version 0.1.11 to 0.1.12
106
gulpfile.js
// https://github.com/gulpjs/gulp/tree/master/docs | ||
var gulp = require('gulp'); | ||
var fs = require('fs'); | ||
var inquirer = require('inquirer'); | ||
var spawn = require('cross-spawn'); | ||
var file = require('html-wiring'); | ||
var colors = require('colors/safe'); | ||
colors.setTheme({ | ||
info: ['bold', 'green'] | ||
}); | ||
var pkg = JSON.parse(file.readFileAsString('package.json')); | ||
var versionCompare = function(a, b) { | ||
var aArr = a.split('.'); | ||
var bArr = b.split('.'); | ||
var larger = false; | ||
for (var i = 0; i < 3; i++) { | ||
if (parseInt(aArr[i]) === parseInt(bArr[i])) { | ||
} | ||
else { | ||
larger = parseInt(aArr[i]) > parseInt(bArr[i]); | ||
break; | ||
} | ||
} | ||
return larger; | ||
} | ||
var webpack = require('webpack'); | ||
@@ -11,2 +37,5 @@ | ||
// https://www.npmjs.com/package/gulp-babel | ||
var babel = require('gulp-babel'); | ||
// https://www.npmjs.com/package/gulp-less | ||
@@ -24,2 +53,5 @@ var less = require('gulp-less'); | ||
// https://www.npmjs.com/package/gulp-es3ify | ||
var es3ify = require("gulp-es3ify"); | ||
gulp.task('pack_demo', function(cb) { | ||
@@ -35,2 +67,15 @@ webpack(require('./webpack.dev.js'), function (err, stats) { | ||
gulp.task('pack_build', function(cb) { | ||
gulp.src(['./src/**/*.js']) | ||
.pipe(babel({ | ||
presets: ['react', 'es2015-loose', 'stage-1'], | ||
plugins: ['add-module-exports'] | ||
})) | ||
.pipe(es3ify()) | ||
.pipe(gulp.dest('build')) | ||
.on('end', function() { | ||
cb(); | ||
}) | ||
}); | ||
gulp.task('less_demo', function(cb) { | ||
@@ -81,1 +126,62 @@ gulp.src(['./demo/**/*.less']) | ||
}); | ||
gulp.task('default', ['pack_build'], function() { | ||
}); | ||
gulp.task('publish', ['pack_build'], function() { | ||
setTimeout(function() { | ||
var questions = [ | ||
{ | ||
type: 'input', | ||
name: 'version', | ||
message: 'please enter the package version to publish (should be xx.xx.xx)', | ||
default: pkg.version, | ||
validate: function(input) { | ||
if (/\d+\.\d+\.\d+/.test(input)) { | ||
if (versionCompare(input, pkg.version)) { | ||
return true; | ||
} | ||
else { | ||
return "the version you entered should be larger than now" | ||
} | ||
} | ||
else { | ||
return "the version you entered is not valid" | ||
} | ||
} | ||
}, | ||
{ | ||
type: 'input', | ||
name: 'branch', | ||
message: 'which branch you want to push', | ||
default: 'master' | ||
}, | ||
{ | ||
type: 'input', | ||
name: 'npm', | ||
message: 'which npm you want to publish', | ||
default: 'npm', | ||
validate: function(input) { | ||
if (/npm/.test(input)) { | ||
return true; | ||
} | ||
else { | ||
return "it seems not a valid npm" | ||
} | ||
} | ||
} | ||
]; | ||
inquirer.prompt(questions, function(answers) { | ||
pkg.version = answers.version; | ||
file.writeFileFromString(JSON.stringify(pkg, null, ' '), 'package.json'); | ||
console.log(colors.info('#### Git Info ####')); | ||
spawn.sync('git', ['add', '.'], {stdio: 'inherit'}); | ||
spawn.sync('git', ['commit', '-m', 'ver. ' + pkg.version], {stdio: 'inherit'}); | ||
spawn.sync('git', ['push', 'origin', answers.branch], {stdio: 'inherit'}); | ||
console.log(colors.info('#### Npm Info ####')); | ||
spawn.sync(answers.npm, ['publish'], {stdio: 'inherit'}); | ||
}) | ||
}, 0) | ||
}); |
@@ -5,2 +5,6 @@ # History | ||
## 0.1.12 | ||
`CHANGED` update scaffold | ||
## 0.1.11 | ||
@@ -7,0 +11,0 @@ |
109
package.json
{ | ||
"name": "uxcore-select2", | ||
"version": "0.1.11", | ||
"description": "select ui component for react", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"dev": "gulp server", | ||
"build": "webpack --config webpack.build.js", | ||
"deploy": "git subtree push --prefix build origin gh-pages" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:uxcore/select.git" | ||
}, | ||
"bugs": { | ||
"url": "http://github.com/uxcore/select/issues" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"react-pagination", | ||
"react-select", | ||
"select" | ||
], | ||
"devDependencies": { | ||
"babel-core": "^5.6.18", | ||
"babel-loader": "^5.3.1", | ||
"browser-sync": "~2.8.2", | ||
"console-polyfill": "~0.2.1", | ||
"es5-shim": "~4.1.10", | ||
"gulp": "~3.9.0", | ||
"gulp-concat": "~2.6.0", | ||
"gulp-just-replace": "~1.0.2", | ||
"gulp-less": "~3.0.3", | ||
"gulp-sourcemaps": "~1.5.2", | ||
"jquery": "~1.11.3", | ||
"jsonp": "^0.2.0", | ||
"react": "~0.14.0", | ||
"react-dom": "~0.14.0", | ||
"uxcore-kuma": "~1.2.0", | ||
"webpack": "^1.12.6" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.1.2", | ||
"object-assign": "^2.0.0", | ||
"rc-select": "~5.7.0" | ||
}, | ||
"author": "", | ||
"contributors": [], | ||
"license": "MIT" | ||
} | ||
"name": "uxcore-select2", | ||
"version": "0.1.12", | ||
"description": "select ui component for react", | ||
"main": "build/index.js", | ||
"scripts": { | ||
"dev": "gulp server", | ||
"build": "webpack --config webpack.build.js", | ||
"deploy": "git subtree push --prefix build origin gh-pages" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:uxcore/select.git" | ||
}, | ||
"bugs": { | ||
"url": "http://github.com/uxcore/select/issues" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"react-pagination", | ||
"react-select", | ||
"select" | ||
], | ||
"devDependencies": { | ||
"babel-core": "~6.4.0", | ||
"babel-loader": "~6.2.1", | ||
"babel-plugin-add-module-exports": "~0.1.2", | ||
"babel-preset-es2015-loose": "~7.0.0", | ||
"babel-preset-react": "~6.3.13", | ||
"babel-preset-stage-1": "~6.3.13", | ||
"browser-sync": "~2.11.0", | ||
"colors": "^1.1.2", | ||
"console-polyfill": "~0.2.1", | ||
"cross-spawn": "^2.1.5", | ||
"es3ify-loader": "~0.1.0", | ||
"es5-shim": "~4.1.10", | ||
"gulp": "~3.9.0", | ||
"gulp-babel": "~6.1.1", | ||
"gulp-concat": "~2.6.0", | ||
"gulp-es3ify": "0.0.0", | ||
"gulp-just-replace": "~1.0.2", | ||
"gulp-less": "~3.0.3", | ||
"gulp-sourcemaps": "~1.5.2", | ||
"html-wiring": "~1.2.0", | ||
"inquirer": "^0.12.0", | ||
"jquery": "~1.11.3", | ||
"jsonp": "^0.2.0", | ||
"react": "~0.14.0", | ||
"react-dom": "~0.14.0", | ||
"uxcore-kuma": "~1.2.0", | ||
"webpack": "^1.12.6" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.1.2", | ||
"object-assign": "^4.0.0", | ||
"rc-select": "~5.7.0" | ||
}, | ||
"author": "", | ||
"contributors": [], | ||
"license": "MIT" | ||
} |
@@ -52,3 +52,7 @@ --- | ||
|getPopupContainer| 弹出的菜单渲染在哪个容器中 | function(trigger:Node):Node | function(){return document.body;}| | ||
|dropdownMatchSelectWidth|dropdown 部分是否和 select 部分同宽| boolean | true | | ||
|dropdownClassName | dropdown 部分的定制类名 | string | - | | ||
|notFoundContent | 未找到选项时的提示文案 | string | not found | | ||
### Option props | ||
@@ -55,0 +59,0 @@ |参数|说明|类型|默认值| |
@@ -8,19 +8,2 @@ let RcSelect = require('rc-select'); | ||
} | ||
// componentDidUpdate() { | ||
// var me = this; | ||
// var haveOpened = me.haveOpened; | ||
// me.haveOpened = false; | ||
// if (haveOpened) { | ||
// React.render(me.getDropdownElement(), (function() { | ||
// if (!me.dropdownContainer) { | ||
// me.dropdownContainer = document.createElement('div'); | ||
// me.dropdownContainer.className = 'uxcore'; | ||
// document.body.appendChild(me.dropdownContainer); | ||
// } | ||
// return me.dropdownContainer; | ||
// })()); | ||
// } | ||
// super.componentDidUpdate(); | ||
// me.haveOpened = haveOpened; | ||
// } | ||
} | ||
@@ -27,0 +10,0 @@ Select2.displayName = 'Select2'; |
@@ -32,2 +32,12 @@ var fs = require('fs'); | ||
{ | ||
test: /\.js(x)*$/, | ||
// uxcore以外的modules都不需要经过babel解析 | ||
exclude: function (path) { | ||
var isNpmModule = !!path.match(/node_modules/); | ||
var isUxcore = !!path.match(/node_modules[\/\\](@ali[\/\\])?uxcore/); | ||
return isNpmModule & !isUxcore; | ||
}, | ||
loader: 'es3ify-loader' | ||
}, | ||
{ | ||
@@ -38,6 +48,12 @@ test: /\.js(x)*$/, | ||
var isNpmModule = !!path.match(/node_modules/); | ||
var isUxcore = !!path.match(/node_modules\/uxcore/) || !!path.match(/node_modules\/@ali\/uxcore/); | ||
var isUxcore = !!path.match(/node_modules[\/\\](@ali[\/\\])?uxcore/); | ||
return isNpmModule & !isUxcore; | ||
}, | ||
loader: 'babel-loader?stage=1' | ||
loader: 'babel-loader', | ||
query: { | ||
presets: ['react', 'es2015-loose', 'stage-1'], | ||
plugins: [ | ||
'add-module-exports' | ||
] | ||
} | ||
} | ||
@@ -58,4 +74,5 @@ ] | ||
__PRO__: false // 生产环境 | ||
}) | ||
}), | ||
new webpack.optimize.DedupePlugin() | ||
] | ||
}; |
Sorry, the diff of this file is not supported yet
28075
16
436
69
27
- Removedobject-assign@2.1.1(transitive)
Updatedobject-assign@^4.0.0