Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix nodejs 12 #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zsp042 wants to merge 7 commits into ElementUI:master
base: master
Choose a base branch
Loading
from renwu-cool:master
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/element-theme
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ program
.option('-o --out [outPath]', 'output path', function (out) {config.out = out})
.option('-m --minimize', 'compressed file', function (minimize) {config.minimize = minimize !== false})
.option('-c --config [filePath]', 'variables file', function (c) {config.config = c})
.option('-b --browsers <items>', 'set browsers', function (browsers) {config.browsers = browsers.split(',')})
.option('-b --browsers <items>', 'set browsers', function (browsers) {
config.overrideBrowserslist = browsers.split(',')
})
.parse(process.argv)

check()
Expand Down
62 changes: 31 additions & 31 deletions index.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
var gulp = require('gulp')
var series = require('run-sequence').use(gulp)
var task = require('./lib/task')
var vars = require('./lib/gen-vars')
var config = require('./lib/config')
var gulp = require("gulp");
var series = require("gulp4-run-sequence").use(gulp);
var task = require("./lib/task");
var vars = require("./lib/gen-vars");
var config = require("./lib/config");

var build = function(opts) {
return function() {
return task.build(Object.assign(opts, {message: 'build element theme'}))
}
}
var build = function(opts) {
return function() {
return task.build(Object.assign(opts, {message: "build element theme" }));
};
};

var fonts = function(opts) {
return function() {
return task.fonts(Object.assign(opts, {message: 'build theme font'}))
}
}
var fonts = function(opts) {
return function() {
return task.fonts(Object.assign(opts, {message: "build theme font" }));
};
};

exports.init = function(filePath) {
filePath = {}.toString.call(filePath) === '[object String]' ? filePath : ''
vars.init(filePath)
}
exports.init = function(filePath) {
filePath = {}.toString.call(filePath) === "[object String]" ? filePath : "";
vars.init(filePath);
};

exports.watch = function(opts) {
gulp.task('build', build(opts))
exports.run(opts)
gulp.watch(opts.config || config.config, ['build'])
}
exports.watch = function(opts) {
gulp.task("build", build(opts));
exports.run(opts);
gulp.watch(opts.config || config.config, ["build"]);
};

exports.run = function(opts, cb) {
gulp.task('build', build(opts))
gulp.task('fonts', fonts(opts))
if (typeof cb === 'function') {
return series('build', 'fonts', cb);
exports.run = function(opts, cb) {
gulp.task("build", build(opts));
gulp.task("fonts", fonts(opts));
if (typeof cb === "function") {
return series("build", "fonts", cb);
}
return series('build', 'fonts');
}
return series("build", "fonts");
};
4 changes: 2 additions & 2 deletions lib/config.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try {
} catch (err) {}

var config = Object.assign({
browsers: ['ie > 9', 'last 2 versions'],
overrideBrowserslist: ['last 2 versions'],
out: './theme',
config: './element-variables.scss',
theme: 'element-theme-chalk',
Expand All @@ -18,6 +18,6 @@ exports.themePath = path.resolve(process.cwd(), './node_modules/' + config.theme
exports.out = config.out
exports.config = config.config
exports.minimize = config.minimize
exports.browsers = config.browsers
exports.overrideBrowserslist = config.overrideBrowserslist
exports.components = config.components
exports.themeName = config.theme
18 changes: 11 additions & 7 deletions lib/task.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ var autoprefixer = require('gulp-autoprefixer')
var cssmin = require('gulp-cssmin')
var config = require('./config')

exports.fonts = function(opts) {
exports.fonts = function(opts) {
var spin = ora(opts.message).start()
var stream = gulp.src(path.resolve(config.themePath, './src/fonts/**'))
.pipe((opts.minimize || config.minimize) ? cssmin({showLog: false}) : nop())
.pipe((opts.minimize || config.minimize) ? cssmin({
showLog: false
}) : nop())
.pipe(gulp.dest(path.resolve(opts.out || config.out, './fonts')))
.on('end', function() {
.on('end', function() {
spin.succeed()
})

return stream
}

exports.build = function(opts) {
exports.build = function(opts) {
var spin = ora(opts.message).start()
var stream
var components
Expand All @@ -36,12 +38,14 @@ exports.build = function (opts) {
stream = gulp.src([opts.config || config.config, path.resolve(config.themePath, './src/' + cssFiles + '.scss')])
.pipe(sass.sync())
.pipe(autoprefixer({
browsers: config.browsers,
overrideBrowserslist: config.overrideBrowserslist,
cascade: false
}))
.pipe((opts.minimize || config.minimize) ? cssmin({showLog: false}) : nop())
.pipe((opts.minimize || config.minimize) ? cssmin({
showLog: false
}) : nop())
.pipe(gulp.dest(opts.out || config.out))
.on('end', function() {
.on('end', function() {
spin.succeed()
})

Expand Down
18 changes: 9 additions & 9 deletions package.json
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "element-theme",
"version": "2.0.1",
"version": "2.0.2",
"description": "Theme generator cli tool for Element",
"bin": {
"element-theme": "./bin/element-theme",
Expand Down Expand Up @@ -44,17 +44,17 @@
"element-theme-chalk": "*"
},
"dependencies": {
"commander": "^2.9.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^4.0.0",
"gulp-cssmin": "^0.1.7",
"commander": "^4.0.1",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
"gulp-cssmin": "^0.2.0",
"gulp-nop": "0.0.3",
"gulp-sass": "^3.1.0",
"ora": "^0.3.0",
"run-sequence": "^1.2.2"
"gulp-sass": "^4.0.2",
"gulp4-run-sequence": "^1.0.0",
"ora": "^4.0.3"
},
"devDependencies": {
"element-theme-chalk": "^2.0.0-alpha.1",
"xo": "^0.17.0"
"xo": "^0.25.3"
}
}
Loading

AltStyle によって変換されたページ (->オリジナル) /