Browse Source

update gulp script

pull/953/head
tanjinzhou 5 years ago
parent
commit
75dd9f6ceb
  1. 8
      antd-tools/gulpfile.js
  2. 12
      components/vc-slick/src/slider.js
  3. 4
      components/vc-tree-select/src/util.js
  4. 22
      scripts/gulpfile.js
  5. 24
      scripts/run.js

8
antd-tools/gulpfile.js

@ -145,14 +145,10 @@ function tag() {
execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`);
execSync(`git tag ${version}`);
execSync(
`git push https://${
process.env.GITHUB_TOKEN
}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
);
execSync(
`git push https://${
process.env.GITHUB_TOKEN
}@github.com/vueComponent/ant-design-vue.git master:master`,
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git master:master`,
);
console.log('tagged');
}

12
components/vc-slick/src/slider.js

@ -110,9 +110,7 @@ export default {
if (settings.centerMode) {
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
console.warn(
`slidesToScroll should be equal to 1 in centerMode, you are using ${
settings.slidesToScroll
}`,
`slidesToScroll should be equal to 1 in centerMode, you are using ${settings.slidesToScroll}`,
);
}
settings.slidesToScroll = 1;
@ -121,16 +119,12 @@ export default {
if (settings.fade) {
if (settings.slidesToShow > 1 && process.env.NODE_ENV !== 'production') {
console.warn(
`slidesToShow should be equal to 1 when fade is true, you're using ${
settings.slidesToShow
}`,
`slidesToShow should be equal to 1 when fade is true, you're using ${settings.slidesToShow}`,
);
}
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
console.warn(
`slidesToScroll should be equal to 1 when fade is true, you're using ${
settings.slidesToScroll
}`,
`slidesToScroll should be equal to 1 when fade is true, you're using ${settings.slidesToScroll}`,
);
}
settings.slidesToShow = 1;

4
components/vc-tree-select/src/util.js

@ -385,9 +385,7 @@ function processEntity(entity, wrapper) {
if (currentEntity) {
warning(
false,
`Conflict! value of node '${entity.key}' (${value}) has already used by node '${
currentEntity.key
}'.`,
`Conflict! value of node '${entity.key}' (${value}) has already used by node '${currentEntity.key}'.`,
);
}
wrapper.valueEntities[value] = entity;

22
scripts/gulpfile.js

@ -110,12 +110,18 @@ function copyHtml() {
);
}
gulp.task('_site', done => {
dist(() => {
gulp.task(
'_site',
gulp.series(done => {
dist(() => {
copyHtml();
done();
});
}),
);
gulp.task(
'copy-html',
gulp.series(() => {
copyHtml();
done();
});
});
gulp.task('copy-html', () => {
copyHtml();
});
}),
);

24
scripts/run.js

@ -13,6 +13,28 @@ program.on('--help', () => {
program.parse(process.argv);
function runTask(toRun) {
const metadata = { task: toRun };
// Gulp >= 4.0.0 (doesn't support events)
const taskInstance = gulp.task(toRun);
if (taskInstance === undefined) {
gulp.emit('task_not_found', metadata);
return;
}
const start = process.hrtime();
gulp.emit('task_start', metadata);
try {
taskInstance.apply(gulp);
metadata.hrDuration = process.hrtime(start);
gulp.emit('task_stop', metadata);
gulp.emit('stop');
} catch (err) {
err.hrDuration = process.hrtime(start);
err.task = metadata.task;
gulp.emit('task_err', err);
}
}
const task = program.args[0];
if (!task) {
@ -22,5 +44,5 @@ if (!task) {
require('./gulpfile');
gulp.start(task);
runTask(task);
}

Loading…
Cancel
Save