gulpfile: use bundled sass-embedded

This commit is contained in:
liushuyu 2023-02-03 16:04:15 -07:00
parent 56a127fc29
commit abb3cd13be
5 changed files with 145 additions and 39 deletions

View File

@ -3,8 +3,7 @@
echo -e '\e[1m\e[36m========== Installing gulp & dependencies ==========\e[0m'
yarn install
# Install dependencies one-by-one to avoid race-conditions
yarn --cwd ./scripts/shared-hugo-scripts/wiki/
yarn --cwd ./scripts/shared-hugo-scripts/compatdb/
yarn --cwd ./scripts/shared-hugo-scripts/
yarn hugo version
echo -e '\e[1m\e[36m========== Starting gulp deploy task ===============\e[0m'
if [[ -n "${EPHEMERAL_BASE_URL}" ]]; then

View File

@ -8,15 +8,25 @@ const browserSync = require('browser-sync').create();
const concat = require('gulp-concat');
const parallel = require('concurrent-transform');
const imageResize = require('gulp-image-resize');
const path = require('path');
function findSassBinary() {
const modulePath = require.resolve(
`sass-embedded-${process.platform}-${process.arch}/` +
'dart-sass-embedded/dart-sass-embedded' +
(process.platform === 'win32' ? '.bat' : '')
);
return path.dirname(modulePath);
}
gulp.task('scripts:games', function (callback) {
exec('yarn install && node app.js', { cwd: './scripts/shared-hugo-scripts/compatdb/' }, function (err, stdout, stderr) {
exec('yarn run compatdb', { cwd: './scripts/shared-hugo-scripts/' }, function (err, stdout, stderr) {
callback(err);
});
});
gulp.task('scripts:wiki', function (callback) {
exec('yarn install && node app.js', { cwd: './scripts/shared-hugo-scripts/wiki/' }, function (err, stdout, stderr) {
exec('yarn run wiki', { cwd: './scripts/shared-hugo-scripts/' }, function (err, stdout, stderr) {
callback(err);
});
});
@ -55,12 +65,14 @@ gulp.task('assets:fonts', function(){
});
gulp.task('hugo', (callback) => {
const sassPath = findSassBinary();
process.env.PATH = `${process.env.PATH}:${sassPath}`;
import('hugo-bin').then((hugo) => {
exec(hugo.default + ' -s ./site/ -d ../build/ -v --gc', (err, stdout, stderr) => {
console.log(stdout);
callback(err);
});
});
}).catch(err => callback(err));
});
gulp.task('final:serve', function(done) {

View File

@ -26,7 +26,8 @@
"merge-stream": "^2.0.0",
"minimist": "^1.2.7",
"postcss": "^8.4",
"sass": "^1.57.1"
"sass": "^1.57.1",
"sass-embedded": "^1.57.1"
},
"hugo-bin": {
"buildTags": "extended"

@ -1 +1 @@
Subproject commit 56a47f9e9e327c45a57c53fde43b3f9bbcadb4d5
Subproject commit e22d9896a3d67f5395707a252ff887e55642e0ea

158
yarn.lock
View File

@ -227,9 +227,9 @@ async-each-series@0.1.1:
integrity sha512-p4jj6Fws4Iy2m0iCmI2am2ZNZCgbdgE+P8F/8csmn2vx7ixXrO2zGcuNsD46X5uZSVecmkEy/M06X2vG8KD6dQ==
async-each@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf"
integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==
version "1.0.5"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.5.tgz#6eea184b2df0ec09f3deebe165c97c85c911d7b8"
integrity sha512-5QzqtU3BlagehwmdoqwaS2FBQF2P5eL6vFqXwNsb5jwoEsmtfAXg1ocFvW7I6/gGLFhBMKwcMwZuy7uv/Bo9jA==
async-settle@^1.0.0:
version "1.0.0"
@ -468,14 +468,14 @@ browser-sync@^2.27.11:
yargs "^17.3.1"
browserslist@^4.0.0, browserslist@^4.16.6, browserslist@^4.21.4:
version "4.21.4"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987"
integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==
version "4.21.5"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7"
integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==
dependencies:
caniuse-lite "^1.0.30001400"
electron-to-chromium "^1.4.251"
node-releases "^2.0.6"
update-browserslist-db "^1.0.9"
caniuse-lite "^1.0.30001449"
electron-to-chromium "^1.4.284"
node-releases "^2.0.8"
update-browserslist-db "^1.0.10"
bs-recipes@1.3.4:
version "1.3.4"
@ -500,6 +500,11 @@ buffer-alloc@^1.2.0:
buffer-alloc-unsafe "^1.1.0"
buffer-fill "^1.0.0"
buffer-builder@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/buffer-builder/-/buffer-builder-0.2.0.tgz#3322cd307d8296dab1f604618593b261a3fade8f"
integrity sha512-7VPMEPuYznPSoR21NE1zvd2Xna6c/CloiZCfcMXR1Jny6PjX0N4Nsa38zcBFo/FMK+BlA+FLKbJCQ0i2yxp+Xg==
buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
@ -592,10 +597,10 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001400:
version "1.0.30001446"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001446.tgz#6d4ba828ab19f49f9bcd14a8430d30feebf1e0c5"
integrity sha512-fEoga4PrImGcwUUGEol/PoFCSBnSkA9drgdkxXkJLsUBOnJ8rs3zDv6ApqYXGQFOyMPsjh79naWhF4DAxbF8rw==
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001449:
version "1.0.30001450"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001450.tgz#022225b91200589196b814b51b1bbe45144cf74f"
integrity sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew==
caw@^2.0.1:
version "2.0.1"
@ -1282,10 +1287,10 @@ ee-first@1.1.1:
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
electron-to-chromium@^1.4.251:
version "1.4.284"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592"
integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==
electron-to-chromium@^1.4.284:
version "1.4.286"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.286.tgz#0e039de59135f44ab9a8ec9025e53a9135eba11f"
integrity sha512-Vp3CVhmYpgf4iXNKAucoQUDcCrBQX3XLBtwgFqP9BUXuucgvAV9zWp1kYU7LL9j4++s9O+12cb3wMtN4SJy6UQ==
emoji-regex@^8.0.0:
version "8.0.0"
@ -1914,6 +1919,11 @@ gm@^1.14.2:
cross-spawn "^4.0.0"
debug "^3.1.0"
google-protobuf@^3.11.4:
version "3.21.2"
resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.2.tgz#4580a2bea8bbb291ee579d1fefb14d6fa3070ea4"
integrity sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==
got@^8.3.1:
version "8.3.2"
resolved "https://registry.yarnpkg.com/got/-/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937"
@ -2070,6 +2080,11 @@ has-ansi@^2.0.0:
dependencies:
ansi-regex "^2.0.0"
has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
has-property-descriptors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861"
@ -2225,9 +2240,9 @@ immutable@^3:
integrity sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==
immutable@^4.0.0:
version "4.2.2"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.2.2.tgz#2da9ff4384a4330c36d4d1bc88e90f9e0b0ccd16"
integrity sha512-fTMKDwtbvO5tldky9QZ2fMX7slR0mYpY5nbnFWYp0fOzDhHqhgIw9KoYgxLWsoNTS9ZHGauHj18DTyEw6BK3Og==
version "4.2.3"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.2.3.tgz#a203cdda37a5a30bc351b982a1794c1930198815"
integrity sha512-IHpmvaOIX4VLJwPOuQr1NpeBr2ZG6vpIj3blsLVxXRWJscLioaJRStqC+NcBsLeCDsnGlPpXd5/WZmnE7MbsKA==
import-lazy@^3.1.0:
version "3.1.0"
@ -2921,10 +2936,10 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"
node-releases@^2.0.6:
version "2.0.8"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae"
integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==
node-releases@^2.0.8:
version "2.0.9"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.9.tgz#fe66405285382b0c4ac6bcfbfbe7e8a510650b4d"
integrity sha512-2xfmOrRkGogbTK9R6Leda0DGiXeY3p2NJpy4+gNCffdUvV6mdEJnaDEic1i3Ec2djAo8jWYoJMR5PB0MSMpxUA==
nopt@~1.0.10:
version "1.0.10"
@ -3868,6 +3883,13 @@ rxjs@^5.5.6:
dependencies:
symbol-observable "1.0.1"
rxjs@^7.4.0:
version "7.8.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4"
integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==
dependencies:
tslib "^2.1.0"
safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
@ -3890,10 +3912,70 @@ safe-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sass@^1.57.1:
sass-embedded-darwin-arm64@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.57.1.tgz#dfafd46eb3ab94817145e8825208ecf7281119b5"
integrity sha512-O2+LwLS79op7GI0xZ8fqzF7X2m/m8WFfI02dHOdsK5R2ECeS5F62zrwg/relM1rjSLy7Vd/DiMNIvPrQGsA0jw==
resolved "https://registry.yarnpkg.com/sass-embedded-darwin-arm64/-/sass-embedded-darwin-arm64-1.57.1.tgz#01559f86574b49f77e02845ebb3cd84ce992bfc3"
integrity sha512-YSfrLZkM2HdXETQdSznv2DN2GdkmBNWLAlHfDWe0toSEIB2C2YGuoqHYZtl6PBYqu8k8FH4TDyct8VzoIa+rMw==
sass-embedded-darwin-x64@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded-darwin-x64/-/sass-embedded-darwin-x64-1.57.1.tgz#608c1215e3435280c19083fe13c7beb9673c56a9"
integrity sha512-xq2Au8CRLHQ+MqH2p8gQn9rYGtfQ8voCWMRz7klYmmh5kXHFjefG3opPPB8mJeSc3SIqE35SQxQEIhUbsxozpg==
sass-embedded-linux-arm64@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded-linux-arm64/-/sass-embedded-linux-arm64-1.57.1.tgz#4bea3be3186153b6f85b84c2862f8770d8bc766b"
integrity sha512-R0GqVqf0xEhQ5nDbj7vqmKw+/1kqiURNBl0pD4uv4inBed2YKg+7agn7Y5XE5GUWbgOz7ubjL2kt4Glr7K7xeA==
sass-embedded-linux-arm@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded-linux-arm/-/sass-embedded-linux-arm-1.57.1.tgz#908b9deeaba90ccf6bcafe66176077b07b10fb2d"
integrity sha512-s+roBIgiQSg8124JmYmiSw4THWRvkF2BOclBZCb+OFLa8ZTak2WZdGs0PhqkMmZypxQ7cewh9ts+sOWN24yIrw==
sass-embedded-linux-ia32@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded-linux-ia32/-/sass-embedded-linux-ia32-1.57.1.tgz#d4c5d13a0a3e076f2f8e0ae0fc0a6e34f7f39d43"
integrity sha512-gKqMpfcjrW4S1m+cuRn88oUkr/HMv48CqyCHnfGCsrkTpIft33a1ZKW2jWm09rwmR0g/G6yGstoQO0iHWJWxuQ==
sass-embedded-linux-x64@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded-linux-x64/-/sass-embedded-linux-x64-1.57.1.tgz#be984e98d487f22d27aaf0c205d020f4a446e63f"
integrity sha512-AI6CrcuLWP22RXhVrZUN2JfdQ7YdFR30dA4twYwp/Q4hUfj85dJrVD5ORi8G04haMWPOQiFV6pBcMgzpiY2Bog==
sass-embedded-win32-ia32@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded-win32-ia32/-/sass-embedded-win32-ia32-1.57.1.tgz#27564307f306d4385b2a745d587baa0f3649ed84"
integrity sha512-s7EhJLG9AnJNBga3I+W0rk6y/1n/i0XD34rvqR3yJgBhNKkI5rVCxFN7FAcGR50vQQbCO1MrUCmuVvld+2qvyQ==
sass-embedded-win32-x64@1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded-win32-x64/-/sass-embedded-win32-x64-1.57.1.tgz#3665c36a4b4840df57f78cd1ed5ddf21b7ea5614"
integrity sha512-b/Kgz7ADPTlPITk8e47Zf3eiuXlTGhi/eWsAoesUmkjR7jayvFNLHPhThgiRAxkzT6UlWI3Dzr+E3OBqUjegEg==
sass-embedded@^1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass-embedded/-/sass-embedded-1.57.1.tgz#2f689cf83ab72896e938f4a31e13758da65de938"
integrity sha512-O0s796x76bRSJIdmJ4lrK+zJLtF3XeP+0tbJzR4NAPSDnWqHLk2boUYSdfx4DnF4x9rGmcVlMWFE8UvnLMNCmw==
dependencies:
buffer-builder "^0.2.0"
google-protobuf "^3.11.4"
immutable "^4.0.0"
rxjs "^7.4.0"
supports-color "^8.1.1"
optionalDependencies:
sass-embedded-darwin-arm64 "1.57.1"
sass-embedded-darwin-x64 "1.57.1"
sass-embedded-linux-arm "1.57.1"
sass-embedded-linux-arm64 "1.57.1"
sass-embedded-linux-ia32 "1.57.1"
sass-embedded-linux-x64 "1.57.1"
sass-embedded-win32-ia32 "1.57.1"
sass-embedded-win32-x64 "1.57.1"
sass@^1.57.1:
version "1.58.0"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.58.0.tgz#ee8aea3ad5ea5c485c26b3096e2df6087d0bb1cc"
integrity sha512-PiMJcP33DdKtZ/1jSjjqVIKihoDc6yWmYr9K/4r3fVVIEDAluD0q7XZiRKrNJcPK3qkLRF/79DND1H5q1LBjgg==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
@ -4339,6 +4421,13 @@ supports-color@^2.0.0:
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==
supports-color@^8.1.1:
version "8.1.1"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
dependencies:
has-flag "^4.0.0"
supports-preserve-symlinks-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
@ -4516,6 +4605,11 @@ trim-repeated@^1.0.0:
dependencies:
escape-string-regexp "^1.0.2"
tslib@^2.1.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
@ -4539,9 +4633,9 @@ typedarray@^0.0.6:
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
typescript@^4.6.2:
version "4.9.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
ua-parser-js@1.0.2:
version "1.0.2"
@ -4631,7 +4725,7 @@ upath@^1.1.1:
resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894"
integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==
update-browserslist-db@^1.0.9:
update-browserslist-db@^1.0.10:
version "1.0.10"
resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3"
integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==