Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency sirv to v3 #18346

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"acorn@8.12.1": "patches/acorn@8.12.1.patch",
"chokidar@3.6.0": "patches/chokidar@3.6.0.patch",
"http-proxy@1.18.1": "patches/http-proxy@1.18.1.patch",
"sirv@2.0.4": "patches/sirv@2.0.4.patch"
"sirv@3.0.0": "patches/sirv@3.0.0.patch"
},
"peerDependencyRules": {
"allowedVersions": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"rollup-plugin-license": "^3.5.3",
"sass": "^1.79.4",
"sass-embedded": "^1.79.4",
"sirv": "^2.0.4",
"sirv": "^3.0.0",
"source-map-support": "^0.5.21",
"strip-ansi": "^7.1.0",
"strip-literal": "^2.1.0",
Expand Down
29 changes: 21 additions & 8 deletions patches/sirv@2.0.4.patch → patches/sirv@3.0.0.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/build.js b/build.js
index 0884d9ffaa24d0ae3ec020a6faff12b3125b2071..85b82c90346e829bbf723e913f282c80096df061 100644
index 0c6ed8e2c0949c93978dd1a244baa9bf2448e9b8..08a9347cfdca06e6a97077ea4582c5b0922ecb2d 100644
--- a/build.js
+++ b/build.js
@@ -35,7 +35,7 @@ function viaCache(cache, uri, extns) {
Expand Down Expand Up @@ -29,7 +29,7 @@ index 0884d9ffaa24d0ae3ec020a6faff12b3125b2071..85b82c90346e829bbf723e913f282c80

if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) {
diff --git a/build.mjs b/build.mjs
index c93bbe6bdfb7ad13ee20f0c44d80d6aacdd64087..3dc3e22f09abcae51aef7b75c34dc08b1f6e6abd 100644
index 3ad14d45630a8627b93842a04a96465120d3f223..8451277c015b56a7d2cb99aaee3a318d9c0893dd 100644
--- a/build.mjs
+++ b/build.mjs
@@ -35,7 +35,7 @@ function viaCache(cache, uri, extns) {
Expand Down Expand Up @@ -58,16 +58,29 @@ index c93bbe6bdfb7ad13ee20f0c44d80d6aacdd64087..3dc3e22f09abcae51aef7b75c34dc08b
if (!data) return next ? next() : isNotFound(req, res);

if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) {
diff --git a/sirv.d.ts b/sirv.d.ts
index c05040fc6ec504a1828a7badd39f669981acd0ee..e9597e8b5bf24613a09565f0e13024ae3ca8fa5e 100644
--- a/sirv.d.ts
+++ b/sirv.d.ts
@@ -19,6 +19,8 @@ declare module 'sirv' {
diff --git a/index.d.mts b/index.d.mts
index 8bfe364f1db2d1382c56a9b75a014579083cfa70..a8dfa1c473ff15c979bbfbc28c3630a12e222c3a 100644
--- a/index.d.mts
+++ b/index.d.mts
@@ -24,6 +24,8 @@ export interface Options {
gzip?: boolean;
onNoMatch?: (req: IncomingMessage, res: ServerResponse) => void;
setHeaders?: (res: ServerResponse, pathname: string, stats: Stats) => void;
+ /** patched */
+ shouldServe?: (absoluteFilePath: string) => void;
}

export default function (dir?: string, opts?: Options): RequestHandler;
diff --git a/index.d.ts b/index.d.ts
index 96cc63e7ee1ccdd7266e9193252b799068ef2e3c..9e298d627002cd0b073073aa13528b7492541b5b 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -25,6 +25,8 @@ declare namespace sirv {
gzip?: boolean;
onNoMatch?: (req: IncomingMessage, res: ServerResponse) => void;
setHeaders?: (res: ServerResponse, pathname: string, stats: Stats) => void;
+ /** patched */
+ shouldServe?: (absoluteFilePath: string) => void;
}
}

export default function(dir?: string, opts?: Options): RequestHandler;
2 changes: 1 addition & 1 deletion playground/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"preview": "vite preview"
},
"devDependencies": {
"sirv": "^2.0.4"
"sirv": "^3.0.0"
}
}
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.