From 1162f8bcff4d749f402e2edf60cb484255becffa Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 9 Feb 2022 13:23:29 +0900 Subject: [PATCH] feat(client): update fontawesome v6 and self-hosting Resolve #7475 --- CHANGELOG.md | 2 ++ gulpfile.js | 6 +++++- packages/backend/src/server/web/views/base.pug | 4 ++-- packages/client/package.json | 1 + packages/client/yarn.lock | 5 +++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aefe8528b..2b15c3a5ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ You should also include the user name that made the change. - networkチャート廃止 - クライアント: 自インスタンス情報ページでチャートを見れるように @syuilo - クライアント: デバイスの種類を手動指定できるように @syuilo +- クライアント: UIのアイコンを更新 @syuilo +- クライアント: UIのアイコンをセルフホスティングするように @syuilo - NodeInfo のユーザー数と投稿数の内容を見直す @xianonn ### Bugfixes diff --git a/gulpfile.js b/gulpfile.js index 3bc0b23bee..b7aa4e328e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -19,6 +19,10 @@ gulp.task('copy:client:fonts', () => gulp.src('./packages/client/node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/_client_dist_/fonts/')) ); +gulp.task('copy:client:fontawesome', () => + gulp.src('./packages/client/node_modules/@fortawesome/fontawesome-free/**/*').pipe(gulp.dest('./built/_client_dist_/fontawesome/')) +); + gulp.task('copy:client:locales', cb => { fs.mkdirSync('./built/_client_dist_/locales', { recursive: true }); @@ -50,7 +54,7 @@ gulp.task('build:backend:style', () => { }); gulp.task('build', gulp.parallel( - 'copy:client:locales', 'copy:backend:views', 'build:backend:script', 'build:backend:style', 'copy:client:fonts' + 'copy:client:locales', 'copy:backend:views', 'build:backend:script', 'build:backend:style', 'copy:client:fonts', 'copy:client:fontawesome' )); gulp.task('default', gulp.task('build')); diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 8e880bf04c..b8b733dd60 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -30,8 +30,8 @@ html link(rel='prefetch' href='https://xn--931a.moe/assets/info.jpg') link(rel='prefetch' href='https://xn--931a.moe/assets/not-found.jpg') link(rel='prefetch' href='https://xn--931a.moe/assets/error.jpg') - link(rel='preload' href='https://use.fontawesome.com/releases/v5.15.3/css/all.css' as='style') - link(rel='stylesheet' href='https://use.fontawesome.com/releases/v5.15.3/css/all.css') + link(rel='preload' href='/assets/fontawesome/css/all.css' as='style') + link(rel='stylesheet' href='/assets/fontawesome/css/all.css') title block title diff --git a/packages/client/package.json b/packages/client/package.json index 7bc74a1c17..cf4214e72b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@discordapp/twemoji": "13.1.0", + "@fortawesome/fontawesome-free": "6.0.0-beta3", "@syuilo/aiscript": "0.11.1", "@types/escape-regexp": "0.0.1", "@types/glob": "7.2.0", diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index 5670241442..e06e376bc5 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -130,6 +130,11 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@fortawesome/fontawesome-free@6.0.0-beta3": + version "6.0.0-beta3" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.0.0-beta3.tgz#120e4a158a0de983924ce151bc35f27de46398b7" + integrity sha512-4SqOuhC8tSLeQvbW1nDmq6T7+8vdSgHy/w7PRwCFzMQCbKuYFIir/3UuWsV1QblX1lt7SGlSgwbaCv9XhRt8HA== + "@hapi/hoek@^9.0.0": version "9.2.0" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.0.tgz#f3933a44e365864f4dad5db94158106d511e8131"