fix(deps): @bobbywibowo/serve-static v0.18.0-alpha

align to versions used in express@4.18.1

additionally no longer always require() the package even when not needed
This commit is contained in:
Bobby 2022-05-08 13:03:24 +07:00
parent eeb1611b2a
commit 851eaacd8e
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09
3 changed files with 15 additions and 44 deletions

View File

@ -18,7 +18,6 @@ const NodeClam = require('clamscan')
const nunjucks = require('nunjucks') const nunjucks = require('nunjucks')
const path = require('path') const path = require('path')
const rateLimit = require('express-rate-limit') const rateLimit = require('express-rate-limit')
const serveStatic = require('@bobbywibowo/serve-static')
const { accessSync, constants } = require('fs') const { accessSync, constants } = require('fs')
// Check required config files // Check required config files
@ -158,7 +157,7 @@ const initServeStaticUploads = (opts = {}) => {
// serveStatic is provided with @bobbywibowo/serve-static, a fork of express/serve-static. // serveStatic is provided with @bobbywibowo/serve-static, a fork of express/serve-static.
// The fork allows specifying an async setHeaders function by the name preSetHeaders. // The fork allows specifying an async setHeaders function by the name preSetHeaders.
// It will await the said function before creating 'send' stream to client. // It will await the said function before creating 'send' stream to client.
safe.use('/', serveStatic(paths.uploads, opts)) safe.use('/', require('@bobbywibowo/serve-static')(paths.uploads, opts))
} else { } else {
safe.use('/', express.static(paths.uploads, opts)) safe.use('/', express.static(paths.uploads, opts))
} }

View File

@ -34,7 +34,7 @@
"full-upgrade": "rm -f ./yarn.lock && yarn" "full-upgrade": "rm -f ./yarn.lock && yarn"
}, },
"dependencies": { "dependencies": {
"@bobbywibowo/serve-static": "git+https://git@github.com/BobbyWibowo/serve-static#2cd43e81a9cb79aaa23286d0f63642de96368750", "@bobbywibowo/serve-static": "git+https://git@github.com/BobbyWibowo/serve-static#8030f1b3cb17cf75b69d7ead8db3e879f6fc992f",
"bcrypt": "~5.0.1", "bcrypt": "~5.0.1",
"blake3": "~2.1.7", "blake3": "~2.1.7",
"body-parser": "~1.20.0", "body-parser": "~1.20.0",

View File

@ -23,29 +23,29 @@
chalk "^2.0.0" chalk "^2.0.0"
js-tokens "^4.0.0" js-tokens "^4.0.0"
"@bobbywibowo/send@git+https://git@github.com/BobbyWibowo/send#c31558c3fc68d1f5061adfbc2600df5174e37c14": "@bobbywibowo/send@git+https://git@github.com/BobbyWibowo/send#3c648a7fda2e07f5414eecda3a983ed9d955e066":
version "0.17.2-alpha" version "0.18.0-alpha"
resolved "git+https://git@github.com/BobbyWibowo/send#c31558c3fc68d1f5061adfbc2600df5174e37c14" resolved "git+https://git@github.com/BobbyWibowo/send#3c648a7fda2e07f5414eecda3a983ed9d955e066"
dependencies: dependencies:
debug "2.6.9" debug "2.6.9"
depd "~1.1.2" depd "2.0.0"
destroy "~1.0.4" destroy "1.2.0"
encodeurl "~1.0.2" encodeurl "~1.0.2"
escape-html "~1.0.3" escape-html "~1.0.3"
etag "~1.8.1" etag "~1.8.1"
fresh "0.5.2" fresh "0.5.2"
http-errors "1.8.1" http-errors "2.0.0"
mime "1.6.0" mime "1.6.0"
ms "2.1.3" ms "2.1.3"
on-finished "~2.3.0" on-finished "2.4.1"
range-parser "~1.2.1" range-parser "~1.2.1"
statuses "~1.5.0" statuses "2.0.1"
"@bobbywibowo/serve-static@git+https://git@github.com/BobbyWibowo/serve-static#2cd43e81a9cb79aaa23286d0f63642de96368750": "@bobbywibowo/serve-static@git+https://git@github.com/BobbyWibowo/serve-static#8030f1b3cb17cf75b69d7ead8db3e879f6fc992f":
version "1.14.2-alpha" version "1.15.0-alpha"
resolved "git+https://git@github.com/BobbyWibowo/serve-static#2cd43e81a9cb79aaa23286d0f63642de96368750" resolved "git+https://git@github.com/BobbyWibowo/serve-static#8030f1b3cb17cf75b69d7ead8db3e879f6fc992f"
dependencies: dependencies:
"@bobbywibowo/send" "git+https://git@github.com/BobbyWibowo/send#c31558c3fc68d1f5061adfbc2600df5174e37c14" "@bobbywibowo/send" "git+https://git@github.com/BobbyWibowo/send#3c648a7fda2e07f5414eecda3a983ed9d955e066"
encodeurl "~1.0.2" encodeurl "~1.0.2"
escape-html "~1.0.3" escape-html "~1.0.3"
parseurl "~1.3.3" parseurl "~1.3.3"
@ -1758,7 +1758,7 @@ depd@2.0.0:
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
depd@^1.1.2, depd@~1.1.2: depd@^1.1.2:
version "1.1.2" version "1.1.2"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
@ -1768,11 +1768,6 @@ destroy@1.2.0:
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015"
integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==
destroy@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
detect-file@^1.0.0: detect-file@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7"
@ -3245,17 +3240,6 @@ http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0:
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
http-errors@1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c"
integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==
dependencies:
depd "~1.1.2"
inherits "2.0.4"
setprototypeof "1.2.0"
statuses ">= 1.5.0 < 2"
toidentifier "1.0.1"
http-errors@2.0.0: http-errors@2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3"
@ -4756,13 +4740,6 @@ on-finished@2.4.1, on-finished@^2.3.0:
dependencies: dependencies:
ee-first "1.1.1" ee-first "1.1.1"
on-finished@~2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
dependencies:
ee-first "1.1.1"
once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@ -6366,11 +6343,6 @@ statuses@2.0.1:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63"
integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==
"statuses@>= 1.5.0 < 2", statuses@~1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
stream-exhaust@^1.0.1: stream-exhaust@^1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d"