include shrinkwrap in npm #1177

Massimo Melina committed Mar 4, 2026 at 13:34 UTC 84a9d26b9f2189b4296f35872883381e2f388e63
2 files changed +7 -5
package.json
+4 -3
@@ -28,7 +28,7 @@
28 "dist": "STASHED=; if ! git diff-index --quiet HEAD --; then git stash push -m 'dist' && STASHED=1; fi; CI=1 FORCE_COLOR=1 npm run dist-uncommitted || (EXIT_CODE=$?; [ -n \"$STASHED\" ] && git stash pop; exit $EXIT_CODE); [ -n \"$STASHED\" ] && git stash pop",
29 "dist-uncommitted": "npm audit --omit=dev --audit-level=moderate && rm -rf dist && npm run build-server && npm run test-with-server && (npm run build-frontend & npm run build-admin) && npm run test-ui && npm run dist-bin",
30 "dist-bin": "npm run dist-modules && npm run dist-bin-win && npm run dist-bin-linux && npm run dist-bin-linux-arm && npm run dist-bin-mac && npm run dist-bin-mac-arm",
31 - "dist-modules": "cp package*.json central.json README.md dist && cd dist && npm ci --omit=dev && cd .. && node scripts/prune_modules.js",
31 + "dist-modules": "cp package*.json central.json README.md dist && cd dist && npm ci --omit=dev && npm shrinkwrap && cd .. && node scripts/prune_modules.js",
32 "dist-bin-win": "cd dist && pkg . --public -C gzip -t node20-win-x64 && npx resedit-cli --in hfs.exe --icon 1,../hfs.ico --out hfs.exe && zip hfs-windows-x64-$(jq -r .version ../package.json).zip hfs.exe -r plugins && cd ..",
33 "dist-bin-mac-arm": "cd dist && pkg . --public -C gzip -t node20-macos-arm64 && zip hfs-mac-arm64-$(jq -r .version ../package.json).zip hfs -r plugins && cd ..",
34 "dist-bin-mac": "cd dist && pkg . --public -C gzip -t node20-macos-x64 && zip hfs-mac-x64-$(jq -r .version ../package.json).zip hfs -r plugins && cd ..",
@@ -45,6 +45,7 @@
45 },
46 "files": [
47 "central.json",
48 + "npm-shrinkwrap.json",
49 "src/*",
50 "admin/*",
51 "frontend/*",
@@ -90,8 +91,8 @@
91 "iconv-lite": "^0.7.0",
92 "immer": "^10.1.3",
93 "ip2location-nodejs": "^9.7.0",
93 - "koa": "^3.1.1",
94 - "koa-compress": "^5.1.1",
94 + "koa": "^3.1.2",
95 + "koa-compress": "^5.2.0",
96 "koa-mount": "^4.2.0",
97 "koa-session": "^7.0.2",
98 "limiter": "^3.0.0",
src/middlewares.ts
+3 -2
@@ -24,8 +24,9 @@ export const sessionDuration = defineConfig('session_duration', Number(process.e
24
25 export const gzipper = compress({
26 threshold: 2048,
27 - gzip: { flush: constants.Z_SYNC_FLUSH },
27 + gzip: { flush: constants.Z_SYNC_FLUSH }, // flush is necessary for SSE, at least in Chrome145
28 deflate: { flush: constants.Z_SYNC_FLUSH },
29 + zstd: { flush: constants.Z_SYNC_FLUSH },
30 br: false, // disable brotli
31 filter(type) {
32 return /text|javascript|style/i.test(type)
@@ -167,4 +168,4 @@ events.once('app', () => // wait for app to be defined
168 export const sessionMiddleware: Koa.Middleware = (ctx, next) => {
169 options.key = 'hfs_' + ctx.protocol
170 return internalSessionMw(ctx, next)
170 -}
\ No newline at end of file
171 +}