Skip to content

Commit

Permalink
use yarn 4
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed May 2, 2024
1 parent cb27d28 commit 0f46268
Show file tree
Hide file tree
Showing 8 changed files with 14,418 additions and 157,098 deletions.
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.1.cjs

Large diffs are not rendered by default.

147,529 changes: 0 additions & 147,529 deletions .yarn/releases/yarn-classic.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-classic.cjs
yarnPath: .yarn/releases/yarn-4.2.1.cjs
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"devDependencies": {
"npm-run-all": "^4.1.5"
},
"packageManager": "yarn@4.1.1"
"packageManager": "yarn@4.2.1"
}
3 changes: 3 additions & 0 deletions packages/docs/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const config: StorybookConfig = {
return mergeConfig(config, {
resolve: {
preserveSymlinks: true,
alias: {
'msw-storybook-addon': join(__dirname, '../../msw-addon'),
},
},
plugins: [
// Workaround necessary because of a bug in Vite
Expand Down
1 change: 0 additions & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"chromatic": "^11.0.3",
"jsdom": "^23.0.0",
"msw": "^2.0.9",
"msw-storybook-addon": "link:../msw-addon",
"storybook": "^8.0.0",
"typescript": "^5.3.2",
"vite": "^4.1.0",
Expand Down
19 changes: 8 additions & 11 deletions packages/docs/public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
/* tslint:disable */

/**
* Mock Service Worker (2.2.4).
* Mock Service Worker.
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
* - Please do NOT serve this file on production.
*/

const INTEGRITY_CHECKSUM = '223d191a56023cd36aa88c802961b911'
const PACKAGE_VERSION = '2.2.14'
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()

Expand Down Expand Up @@ -48,7 +49,10 @@ self.addEventListener('message', async function (event) {
case 'INTEGRITY_CHECK_REQUEST': {
sendToClient(client, {
type: 'INTEGRITY_CHECK_RESPONSE',
payload: INTEGRITY_CHECKSUM,
payload: {
packageVersion: PACKAGE_VERSION,
checksum: INTEGRITY_CHECKSUM,
},
})
break
}
Expand Down Expand Up @@ -202,13 +206,6 @@ async function getResponse(event, client, requestId) {
return passthrough()
}

// Bypass requests with the explicit bypass header.
// Such requests can be issued by "ctx.fetch()".
const mswIntention = request.headers.get('x-msw-intention')
if (['bypass', 'passthrough'].includes(mswIntention)) {
return passthrough()
}

// Notify the client that a request has been intercepted.
const requestBuffer = await request.arrayBuffer()
const clientMessage = await sendToClient(
Expand Down Expand Up @@ -240,7 +237,7 @@ async function getResponse(event, client, requestId) {
return respondWithMock(clientMessage.data)
}

case 'MOCK_NOT_FOUND': {
case 'PASSTHROUGH': {
return passthrough()
}
}
Expand Down
Loading

0 comments on commit 0f46268

Please sign in to comment.