diff --git a/.github/badges/.keep b/.github/badges/.keep new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/test-bages.yml b/.github/workflows/test-bages.yml new file mode 100644 index 0000000..afd4441 --- /dev/null +++ b/.github/workflows/test-bages.yml @@ -0,0 +1,33 @@ +name: Badges + +on: + push: + branches: ['master'] + +jobs: + badges: + name: Validation and Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Update badges + run: | + PACKAGE_VERSION=$(jq -r '.version' packages/extension/package.json) + TIMESTAMP=$(date +%s) + + echo $PACKAGE_VERSION + echo $TIMESTAMP + + curl -o .github/badges/extension-version.svg "https://img.shields.io/badge/extension_version-v$PACKAGE_VERSION-orange" + curl -o .github/badges/extension-release-date.svg "https://img.shields.io/date/$TIMESTAMP?label=last+release&color=green" + cat .github/badges/extension-version.svg + cat .github/badges/extension-release-date.svg + + git config --local user.name "github-actions[bot]" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git add .github/badges/extension-version.svg + git add .github/badges/extension-release-date.svg + git commit -m "Update extension version badge to $PACKAGE_VERSION" + git push \ No newline at end of file diff --git a/README.md b/README.md index f2dc1bc..823d6f2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ <p align="center"> <img src="media/chrome-devtools.svg" width="100" alt="DevTools logo" /> - <img src="media/msw-logo.svg" width="100" alt="Mock Service Worker logo" /> - <img src="media/chrome-extension.svg" width="100" alt="Chrome Web Store logo" /> + <a target="_blank" href="https://mswjs.io"> + <img src="media/msw-logo.svg" width="100" alt="Mock Service Worker logo" /> + </a> + <a target="_blank" href="https://chromewebstore.google.com/detail/jkclaelcdjjledfendcippjbhngkhkpm"> + <img src="media/chrome-extension.svg" width="100" alt="Chrome Web Store logo" /> + </a> </p> <h1 align="center">Mock Service Worker DevTools Extension</h1> @@ -72,15 +76,29 @@ setupWorker(...handlers).start({ }) ``` -### Install Chrome Extension +## Install Chrome Extension -Chrome Extension is not yet published to Chrome Web Store, because it's in waiting for review. +### Repository build -[](https://chrome.google.com/webstore/detail/jkclaelcdjjledfendcippjbhngkhkpm) +[](https://github.com/vkruglikov/msw-devtools-extension/releases/tag/%40msw-devtools%2Fextension%40latest) + + +You can install it downloading the build and [loading it as an unpacked extension](./packages/extension/README.md). + +> **⚠️ WARNING** +> If you chose to install the extension from the repository, you will need install `@msw-devtools/connect` with `--save-exact` flag to avoid version mismatch. -You can only install it downloading the build and [loading it as an unpacked extension](./packages/extension/README.md). +### Chrome Web Store -[](https://github.com/vkruglikov/msw-devtools-extension/releases/tag/%40msw-devtools%2Fextension%40latest) +[](https://chrome.google.com/webstore/detail/jkclaelcdjjledfendcippjbhngkhkpm) + + +> **⚠️ WARNING** +> Chrome Web Store version can be outdated because of the review process. +> +> If you want to install from the Chrome Web Store, you need to check the latest version in the repository and compare it with the Chrome Web Store version. +> +> We recommend using the latest build from the repository. ### Upload JSON Config to extension @@ -88,7 +106,9 @@ You can only install it downloading the build and [loading it as an unpacked ext ### See the demo -[@msw-devtools/demo](https://vkruglikov.github.io/msw-devtools-extension/) +At this page we have installed msw and initialized with the `createResponseResolver` function from `@msw-devtools/connect`. + +[msw-devtools.com](https://vkruglikov.github.io/msw-devtools-extension/) ## Roadmap Features 🚧