Skip to content

Commit

Permalink
BREAKING CHANGE: Support MSW 2.0 (#122)
Browse files Browse the repository at this point in the history
* Breaking change: Support MSW 2.0

Co-authored-by: Gert Hengeveld <[email protected]>

* update example to use MSW 2.0 handlers

* temporarily disable tests in release workflow

* update jest config to pass tests

* fix path

* worker

* alias msw/native

* update peer dependency range

* upgrade example storybook

* fix: use conditional exports (#134)

* fix: use conditional exports

* chore: keep "dist" as build directory

* chore: remove custom webpackFinal config

* chore: prevent browser-style resolution in jsdom tests

* chore: remove old code

* chore: use "index.ts"

* fix: use environment-based tsconfig.json

* chore: remove unused imports

* fix: abstract "api.use()" to "applyRequestHandlers"

* read getWorker export

* add types for getWorker

---------

Co-authored-by: Yann Braga <[email protected]>

* bring back tests

* Filter requests that are not relevant to the user

* make sure to reset the handlers

* feat!(msw-addon): fix package exports and generate esm build (#138)

this updates conditional exports so that both types and dependencies can
be resolved.
this also migrates build to generating esm by default for a more
standards based packaging approach with strong support in modern tooling
like webpack and vite.

resolves #137

* fix(loader.ts): fix possible undefined (#141)

If msw is running in fallback mode, navigator.serviceWorker may not be defined.

* update auto

* update to yarn 4

* upgrade chromatic

* upgrade CI actions

* fix return types

* add yarn binary

* fix jest script

* fix chromatic script

* fix chromatic script

* update package.json files

* refactor tsup config

* remove unnecessary dependency

* temp: downgrade to yarn1

* export applyRequestHandlers

* update docs [skip ci]

* update tests

* upgrade to Storybook 8

* improve documentation on portable stories

* deprecate mswDecorator

* deprecate msw parameter as an array

* migrate docs example to vite (#128)

* migrate docs example to vite

* migrate from jest to vitest

* add rollup workaround

* migrate example to Typescript

---------

Co-authored-by: Gert Hengeveld <[email protected]>
Co-authored-by: Matthew Costabile <[email protected]>
Co-authored-by: Artem Zakharchenko <[email protected]>
Co-authored-by: Christian Murphy <[email protected]>
Co-authored-by: Alex Muñoz <[email protected]>
  • Loading branch information
6 people authored Apr 17, 2024
1 parent 0ff898a commit 4e94e82
Show file tree
Hide file tree
Showing 79 changed files with 154,026 additions and 12,230 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
run: yarn install --immutable

- name: Build addon
run: yarn workspace msw-storybook-addon build

- name: Publish to Chromatic
uses: chromaui/action@v1
uses: chromaui/action@latest
with:
workingDir: ./packages/docs
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitOnceUploaded: true
6 changes: 3 additions & 3 deletions .github/workflows/demo-tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: 'Tests for Demos'
on: push
jobs:
jest:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Build addon
run: yarn workspace msw-storybook-addon build
- name: Test Demos
run: yarn workspace msw-storybook-docs test --colors
run: yarn workspace msw-storybook-docs test
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Prepare repository
run: git fetch --unshallow --tags

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea

# Yarn berry
/**/.yarn/*
!/**/.yarn/releases
!/**/.yarn/plugins
!/**/.yarn/sdks
!/**/.yarn/versions
/**/.pnp.*
Loading

0 comments on commit 4e94e82

Please sign in to comment.