Skip to content

Commit 57a9eaf

Browse files
committed
site update & icons update
2 parents ba93c49 + 3239117 commit 57a9eaf

File tree

9 files changed

+179
-113
lines changed

9 files changed

+179
-113
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# These are supported funding model platforms
22

33
github: # [tangjinzhou]
4-
patreon: # Replace with a single Patreon username
54
open_collective: ant-design-vue
5+
patreon: tangjinzhou
66
ko_fi: # Replace with a single Ko-fi username
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
88
custom: # Replace with a single custom sponsorship URL

antd-tools/cli/run.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@ program.on('--help', () => {
1313

1414
program.parse(process.argv);
1515

16+
function runTask(toRun) {
17+
const metadata = { task: toRun };
18+
// Gulp >= 4.0.0 (doesn't support events)
19+
const taskInstance = gulp.task(toRun);
20+
if (taskInstance === undefined) {
21+
gulp.emit('task_not_found', metadata);
22+
return;
23+
}
24+
const start = process.hrtime();
25+
gulp.emit('task_start', metadata);
26+
try {
27+
taskInstance.apply(gulp);
28+
metadata.hrDuration = process.hrtime(start);
29+
gulp.emit('task_stop', metadata);
30+
gulp.emit('stop');
31+
} catch (err) {
32+
err.hrDuration = process.hrtime(start);
33+
err.task = metadata.task;
34+
gulp.emit('task_err', err);
35+
}
36+
}
37+
1638
const task = program.args[0];
1739

1840
if (!task) {
@@ -22,5 +44,5 @@ if (!task) {
2244

2345
require('../gulpfile');
2446

25-
gulp.start(task);
47+
runTask(task);
2648
}

antd-tools/gulpfile.js

Lines changed: 119 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,10 @@ function tag() {
145145
execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`);
146146
execSync(`git tag ${version}`);
147147
execSync(
148-
`git push https://${
149-
process.env.GITHUB_TOKEN
150-
}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
148+
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
151149
);
152150
execSync(
153-
`git push https://${
154-
process.env.GITHUB_TOKEN
155-
}@github.com/vueComponent/ant-design-vue.git master:master`,
151+
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git master:master`,
156152
);
157153
console.log('tagged');
158154
}
@@ -204,24 +200,30 @@ function githubRelease(done) {
204200
});
205201
}
206202

207-
gulp.task('tag', done => {
208-
tag();
209-
githubRelease(done);
210-
});
203+
gulp.task(
204+
'tag',
205+
gulp.series(done => {
206+
tag();
207+
githubRelease(done);
208+
}),
209+
);
211210

212-
gulp.task('check-git', done => {
213-
runCmd('git', ['status', '--porcelain'], (code, result) => {
214-
if (/^\?\?/m.test(result)) {
215-
return done(`There are untracked files in the working tree.\n${result}
211+
gulp.task(
212+
'check-git',
213+
gulp.series(done => {
214+
runCmd('git', ['status', '--porcelain'], (code, result) => {
215+
if (/^\?\?/m.test(result)) {
216+
return done(`There are untracked files in the working tree.\n${result}
216217
`);
217-
}
218-
if (/^([ADRM]| [ADRM])/m.test(result)) {
219-
return done(`There are uncommitted changes in the working tree.\n${result}
218+
}
219+
if (/^([ADRM]| [ADRM])/m.test(result)) {
220+
return done(`There are uncommitted changes in the working tree.\n${result}
220221
`);
221-
}
222-
return done();
223-
});
224-
});
222+
}
223+
return done();
224+
});
225+
}),
226+
);
225227

226228
function publish(tagString, done) {
227229
let args = ['publish', '--with-antd-tools'];
@@ -265,86 +267,105 @@ function pub(done) {
265267
});
266268
}
267269

268-
gulp.task('dist', ['compile'], done => {
269-
dist(done);
270-
});
271-
gulp.task('compile', ['compile-with-es'], done => {
272-
compile().on('finish', function() {
273-
done();
274-
});
275-
});
276-
gulp.task('compile-with-es', done => {
277-
compile(false).on('finish', function() {
278-
done();
279-
});
280-
});
281-
282-
gulp.task('pub', ['check-git', 'compile'], done => {
283-
if (!process.env.GITHUB_TOKEN) {
284-
console.log('no GitHub token found, skip');
285-
} else {
286-
pub(done);
287-
}
288-
});
289-
290-
gulp.task('pub-with-ci', done => {
291-
if (!process.env.NPM_TOKEN) {
292-
console.log('no NPM token found, skip');
293-
} else {
294-
const github = new GitHub();
295-
github.authenticate({
296-
type: 'oauth',
297-
token: process.env.GITHUB_TOKEN,
298-
});
299-
const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line
300-
.toString()
301-
.match(/github.com[:/](.+)\/(.+)\.git/);
302-
const getLatestRelease = github.repos.getLatestRelease({
303-
owner,
304-
repo,
305-
});
306-
const getCommits = github.repos.getCommits({
307-
owner,
308-
repo,
309-
per_page: 1,
270+
gulp.task(
271+
'compile-with-es',
272+
gulp.series(done => {
273+
compile(false).on('finish', function() {
274+
done();
310275
});
311-
Promise.all([getLatestRelease, getCommits]).then(([latestRelease, commits]) => {
312-
const preVersion = latestRelease.data.tag_name;
313-
const { version } = packageJson;
314-
const [_, newVersion] = commits.data[0].commit.message.trim().match(/bump (.+)/) || []; // eslint-disable-line
315-
if (
316-
compareVersions(version, preVersion) === 1 &&
317-
newVersion &&
318-
newVersion.trim() === version
319-
) {
320-
gulp.run('pub', err => {
321-
err && console.log('err', err);
322-
done();
323-
});
324-
} else {
325-
console.log('donot need publish' + version);
326-
}
276+
}),
277+
);
278+
279+
gulp.task(
280+
'compile',
281+
gulp.series('compile-with-es', done => {
282+
compile().on('finish', function() {
283+
done();
327284
});
328-
}
329-
});
285+
}),
286+
);
330287

331-
function reportError() {
332-
console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'));
333-
console.log(chalk.bgRed('!! `npm publish` is forbidden for this package. !!'));
334-
console.log(chalk.bgRed('!! Use `npm run pub` instead. !!'));
335-
console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'));
336-
}
288+
gulp.task(
289+
'dist',
290+
gulp.series('compile', done => {
291+
dist(done);
292+
}),
293+
);
294+
295+
gulp.task(
296+
'pub',
297+
gulp.series('check-git', 'compile', done => {
298+
if (!process.env.GITHUB_TOKEN) {
299+
console.log('no GitHub token found, skip');
300+
} else {
301+
pub(done);
302+
}
303+
}),
304+
);
305+
306+
gulp.task(
307+
'pub-with-ci',
308+
gulp.series(done => {
309+
if (!process.env.NPM_TOKEN) {
310+
console.log('no NPM token found, skip');
311+
} else {
312+
const github = new GitHub();
313+
github.authenticate({
314+
type: 'oauth',
315+
token: process.env.GITHUB_TOKEN,
316+
});
317+
const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line
318+
.toString()
319+
.match(/github.com[:/](.+)\/(.+)\.git/);
320+
const getLatestRelease = github.repos.getLatestRelease({
321+
owner,
322+
repo,
323+
});
324+
const getCommits = github.repos.getCommits({
325+
owner,
326+
repo,
327+
per_page: 1,
328+
});
329+
Promise.all([getLatestRelease, getCommits]).then(([latestRelease, commits]) => {
330+
const preVersion = latestRelease.data.tag_name;
331+
const { version } = packageJson;
332+
const [_, newVersion] = commits.data[0].commit.message.trim().match(/bump (.+)/) || []; // eslint-disable-line
333+
if (
334+
compareVersions(version, preVersion) === 1 &&
335+
newVersion &&
336+
newVersion.trim() === version
337+
) {
338+
gulp.run('pub', err => {
339+
err && console.log('err', err);
340+
done();
341+
});
342+
} else {
343+
console.log('donot need publish' + version);
344+
}
345+
});
346+
}
347+
}),
348+
);
337349

338-
gulp.task('guard', done => {
339-
const npmArgs = getNpmArgs();
340-
if (npmArgs) {
341-
for (let arg = npmArgs.shift(); arg; arg = npmArgs.shift()) {
342-
if (/^pu(b(l(i(sh?)?)?)?)?$/.test(arg) && npmArgs.indexOf('--with-antd-tools') < 0) {
343-
reportError();
344-
done(1);
345-
return;
350+
gulp.task(
351+
'guard',
352+
gulp.series(done => {
353+
function reportError() {
354+
console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'));
355+
console.log(chalk.bgRed('!! `npm publish` is forbidden for this package. !!'));
356+
console.log(chalk.bgRed('!! Use `npm run pub` instead. !!'));
357+
console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'));
358+
}
359+
const npmArgs = getNpmArgs();
360+
if (npmArgs) {
361+
for (let arg = npmArgs.shift(); arg; arg = npmArgs.shift()) {
362+
if (/^pu(b(l(i(sh?)?)?)?)?$/.test(arg) && npmArgs.indexOf('--with-antd-tools') < 0) {
363+
reportError();
364+
done(1);
365+
return;
366+
}
346367
}
347368
}
348-
}
349-
done();
350-
});
369+
done();
370+
}),
371+
);

components/dropdown/style/index.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@
161161
&,
162162
.@{dropdown-prefix-cls}-menu-submenu-arrow-icon {
163163
color: @disabled-color;
164+
background-color: @component-background;
165+
cursor: not-allowed;
164166
}
165167
}
166168
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
4141
"commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS",
4242
"codecov": "codecov",
43-
"prettier": "node ./scripts/prettier.js"
43+
"prettier": "node ./scripts/prettier.js",
44+
"postinstall": "node scripts/postinstall || echo \"ignore\""
4445
},
4546
"repository": {
4647
"type": "git",
@@ -109,7 +110,7 @@
109110
"fetch-jsonp": "^1.1.3",
110111
"fs-extra": "^7.0.0",
111112
"glob": "^7.1.2",
112-
"gulp": "^3.9.1",
113+
"gulp": "^4.0.1",
113114
"gulp-babel": "^7.0.0",
114115
"gulp-strip-code": "^0.1.4",
115116
"highlight.js": "^9.12.0",
@@ -132,6 +133,7 @@
132133
"minimist": "^1.2.0",
133134
"mkdirp": "^0.5.1",
134135
"mockdate": "^2.0.2",
136+
"node-emoji": "^1.10.0",
135137
"nprogress": "^0.2.0",
136138
"optimize-css-assets-webpack-plugin": "^5.0.1",
137139
"postcss": "^7.0.6",
@@ -172,7 +174,7 @@
172174
"webpackbar": "^3.1.5"
173175
},
174176
"dependencies": {
175-
"@ant-design/icons": "^1.1.15",
177+
"@ant-design/icons": "^2.1.0",
176178
"@ant-design/icons-vue": "^1.0.1",
177179
"add-dom-event-listener": "^1.0.2",
178180
"array-tree-filter": "^2.1.0",

site/components/geektime.vue

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,46 @@
11
<template>
2-
<div id="geektime">
2+
<div id="geektime" v-show="visible">
33
<a
44
href="https://time.geekbang.org/course/intro/163?code=KHKYcoBU6vZa8nMglg7AWfDxxi3BWrz9INAzAY3umPk%3D"
55
target="_blank"
66
>
77
<img
8-
width="150"
8+
width="170"
99
alt="Vue 实战教程"
10-
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1554903088531-assets/web-upload/c496a156-aabc-4a9b-8cb6-a7a6617706ce.jpeg"
10+
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1562230861353-assets/web-upload/2fab2df7-5cc9-4791-b344-a97da29eb400.jpeg"
1111
>
1212
</a>
13-
</div>
13+
<div v-if="isMobile" class="close" @click="visible=false">
14+
<a-icon type="close"></a-icon>
15+
</div>
16+
</div>
1417
</template>
1518

1619
<script>
1720
export default {
18-
21+
props: ['isMobile'],
22+
data() {
23+
return {
24+
visible: true
25+
}
26+
}
1927
};
2028
</script>
2129

22-
<style lang="less">
30+
<style lang="less" scoped>
2331
#geektime {
2432
position: fixed;
2533
bottom: 15px;
2634
right: 15px;
35+
.close {
36+
position: absolute;
37+
text-align: center;
38+
top: -8px;
39+
right: -8px;
40+
font-size: 16px;
41+
padding: 15px;
42+
color: #6e3041;
43+
}
2744
}
2845
</style>
2946

site/components/layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export default {
304304
</div>
305305
</a-locale-provider>
306306
{ name.indexOf('back-top') === -1 ? <a-back-top /> : null }
307-
{ isCN && <Geektime /> }
307+
{ isCN && <Geektime isMobile={isMobile} /> }
308308
</div>
309309
);
310310
},

0 commit comments

Comments
 (0)