Skip to content

Commit 3ad9b03

Browse files
committed
chore: upgrade safe pkgs
1 parent fc24934 commit 3ad9b03

File tree

3 files changed

+1065
-625
lines changed

3 files changed

+1065
-625
lines changed

src/Serilog.Ui.Web/package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,60 +15,60 @@
1515
},
1616
"dependencies": {
1717
"@fontsource/mononoki": "^5.1.0",
18-
"@mantine/core": "^7.13.2",
19-
"@mantine/dates": "^7.13.2",
20-
"@mantine/hooks": "^7.13.2",
21-
"@mantine/notifications": "^7.13.2",
22-
"@tabler/icons-react": "^3.19.0",
23-
"@tanstack/react-query": "^5.59.8",
18+
"@mantine/core": "^7.16.1",
19+
"@mantine/dates": "^7.16.1",
20+
"@mantine/hooks": "^7.16.1",
21+
"@mantine/notifications": "^7.16.1",
22+
"@tabler/icons-react": "^3.29.0",
23+
"@tanstack/react-query": "^5.64.2",
2424
"dayjs": "^1.11.13",
25-
"jose": "^5.9.3",
25+
"jose": "^5.9.6",
2626
"react": "^18.3.1",
2727
"react-dom": "^18.3.1",
28-
"react-hook-form": "^7.53.0",
28+
"react-hook-form": "^7.54.2",
2929
"react-router-dom": "^6.26.2",
30-
"xml-formatter": "^3.6.3"
30+
"xml-formatter": "^3.6.4"
3131
},
3232
"devDependencies": {
33-
"@faker-js/faker": "^9.0.3",
33+
"@faker-js/faker": "^9.4.0",
3434
"@testing-library/dom": "^10.4.0",
35-
"@testing-library/jest-dom": "^6.5.0",
36-
"@testing-library/react": "^16.0.1",
37-
"@testing-library/user-event": "^14.5.2",
38-
"@types/node": "^22.7.5",
35+
"@testing-library/jest-dom": "^6.6.3",
36+
"@testing-library/react": "^16.2.0",
37+
"@testing-library/user-event": "^14.6.1",
38+
"@types/node": "^22.10.10",
3939
"@types/react": "^18.3.11",
4040
"@types/react-dom": "^18.3.0",
41-
"@vitejs/plugin-react-swc": "^3.7.1",
41+
"@vitejs/plugin-react-swc": "^3.7.2",
4242
"@vitest/coverage-istanbul": "^2.1.2",
4343
"@vitest/ui": "^2.1.2",
44-
"@welldone-software/why-did-you-render": "^8.0.3",
44+
"@welldone-software/why-did-you-render": "^10.0.1",
4545
"eslint": "^8.57.0",
46-
"eslint-config-prettier": "^9.1.0",
46+
"eslint-config-prettier": "^10.0.1",
4747
"eslint-plugin-html": "^8.1.2",
4848
"eslint-plugin-import": "^2.31.0",
49-
"eslint-plugin-jsx-a11y": "^6.10.0",
50-
"eslint-plugin-prettier": "^5.2.1",
51-
"eslint-plugin-promise": "^7.1.0",
52-
"eslint-plugin-react": "^7.37.1",
53-
"eslint-plugin-react-hooks": "^4.6.2",
54-
"eslint-plugin-testing-library": "^6.3.0",
49+
"eslint-plugin-jsx-a11y": "^6.10.2",
50+
"eslint-plugin-prettier": "^5.2.3",
51+
"eslint-plugin-promise": "^7.2.1",
52+
"eslint-plugin-react": "^7.37.4",
53+
"eslint-plugin-react-hooks": "^5.1.0",
54+
"eslint-plugin-testing-library": "^7.1.1",
5555
"eslint-plugin-vitest": "^0.5.4",
5656
"eslint-plugin-vitest-globals": "^1.5.0",
57-
"happy-dom": "^15.10.2",
58-
"msw": "^2.4.9",
59-
"postcss": "^8.4.47",
57+
"happy-dom": "^16.7.2",
58+
"msw": "^2.7.0",
59+
"postcss": "^8.5.1",
6060
"postcss-preset-mantine": "^1.17.0",
6161
"postcss-simple-vars": "^7.0.1",
62-
"prettier": "^3.3.3",
62+
"prettier": "^3.4.2",
6363
"prettier-plugin-organize-imports": "^4.1.0",
6464
"shiki": "^1.22.0",
6565
"testing-library-selector": "^0.3.1",
66-
"typescript": "^5.6.3",
67-
"typescript-eslint": "^8.8.1",
66+
"typescript": "^5.7.3",
67+
"typescript-eslint": "^8.21.0",
6868
"vite": "^5.4.8",
6969
"vite-plugin-checker": "^0.8.0",
7070
"vite-plugin-mkcert": "^1.17.6",
71-
"vite-tsconfig-paths": "^5.0.1",
71+
"vite-tsconfig-paths": "^5.1.4",
7272
"vitest": "^2.1.2",
7373
"vitest-sonar-reporter": "^2.0.0"
7474
},

src/Serilog.Ui.Web/src/mockServiceWorker.js

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* - Please do NOT serve this file on production.
99
*/
1010

11-
const PACKAGE_VERSION = '2.4.9'
12-
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
11+
const PACKAGE_VERSION = '2.7.0'
12+
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
1313
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
1414
const activeClientIds = new Set()
1515

@@ -62,7 +62,12 @@ self.addEventListener('message', async function (event) {
6262

6363
sendToClient(client, {
6464
type: 'MOCKING_ENABLED',
65-
payload: true,
65+
payload: {
66+
client: {
67+
id: client.id,
68+
frameType: client.frameType,
69+
},
70+
},
6671
})
6772
break
6873
}
@@ -155,6 +160,10 @@ async function handleRequest(event, requestId) {
155160
async function resolveMainClient(event) {
156161
const client = await self.clients.get(event.clientId)
157162

163+
if (activeClientIds.has(event.clientId)) {
164+
return client
165+
}
166+
158167
if (client?.frameType === 'top-level') {
159168
return client
160169
}
@@ -183,12 +192,26 @@ async function getResponse(event, client, requestId) {
183192
const requestClone = request.clone()
184193

185194
function passthrough() {
186-
const headers = Object.fromEntries(requestClone.headers.entries())
195+
// Cast the request headers to a new Headers instance
196+
// so the headers can be manipulated with.
197+
const headers = new Headers(requestClone.headers)
198+
199+
// Remove the "accept" header value that marked this request as passthrough.
200+
// This prevents request alteration and also keeps it compliant with the
201+
// user-defined CORS policies.
202+
const acceptHeader = headers.get('accept')
203+
if (acceptHeader) {
204+
const values = acceptHeader.split(',').map((value) => value.trim())
205+
const filteredValues = values.filter(
206+
(value) => value !== 'msw/passthrough',
207+
)
187208

188-
// Remove internal MSW request header so the passthrough request
189-
// complies with any potential CORS preflight checks on the server.
190-
// Some servers forbid unknown request headers.
191-
delete headers['x-msw-intention']
209+
if (filteredValues.length > 0) {
210+
headers.set('accept', filteredValues.join(', '))
211+
} else {
212+
headers.delete('accept')
213+
}
214+
}
192215

193216
return fetch(requestClone, { headers })
194217
}

0 commit comments

Comments
 (0)