From 9dc2d71199021c62ad8926555c0313d3b1bd6995 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 24 Oct 2024 01:39:38 +0000 Subject: [PATCH 1/6] chore(release): v2.5.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d7b77729..81b3cd284 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "msw", - "version": "2.5.0", + "version": "2.5.1", "description": "Seamless REST/GraphQL API mocking library for browser and Node.js.", "main": "./lib/core/index.js", "module": "./lib/core/index.mjs", From 16c7c1020311c23815c9e00131edccaf717abbe5 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Sun, 27 Oct 2024 09:58:35 +0100 Subject: [PATCH 2/6] docs: add decision on linting the worker script (#2333) --- decisions/linting-worker-script.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 decisions/linting-worker-script.md diff --git a/decisions/linting-worker-script.md b/decisions/linting-worker-script.md new file mode 100644 index 000000000..c8473ad6b --- /dev/null +++ b/decisions/linting-worker-script.md @@ -0,0 +1,9 @@ +# Linting the worker script + +When linting your application, you may encounter warnings or errors originating from the `mockServiceWorker.js` script. Please refrain from opening pull requests to add the `ignore` pragma comments to the script itself. + +## Solution + +**Make sure that the worker script is ignored by your linting tools**. The worker script isn't a part of your application's code but a static asset. It must be ignored during linting and prettifying in the same way all your static assets in `/public` are ignored. Please configure your tools respectively. + +If there are warnings/errors originating from the worker script, it's likely your public directory is not ignored by your linting tools. You may consider ignoring the entire public directory if that suits your project's conventions. From e9b0636c2c50c2aa9fc8d522469fbd96cfd7ccf0 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Sun, 27 Oct 2024 11:06:01 +0100 Subject: [PATCH 3/6] fix: enable provenance for publishing (#2334) --- .github/workflows/release.yml | 3 +++ release.config.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ed8349f9..e90648388 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,9 @@ on: jobs: release: runs-on: macos-latest + permissions: + contents: read + id-token: write steps: - name: Checkout uses: actions/checkout@v3 diff --git a/release.config.json b/release.config.json index 112b4ae97..8a27b7be2 100644 --- a/release.config.json +++ b/release.config.json @@ -2,7 +2,7 @@ "profiles": [ { "name": "latest", - "use": "pnpm publish --no-git-checks" + "use": "NPM_CONFIG_PROVENANCE=true pnpm publish --no-git-checks" } ] } From e32b64d7dd25fa98a9db9865a2dcb7001973aab2 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Sun, 27 Oct 2024 10:12:07 +0000 Subject: [PATCH 4/6] chore(release): v2.5.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81b3cd284..27bae7a81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "msw", - "version": "2.5.1", + "version": "2.5.2", "description": "Seamless REST/GraphQL API mocking library for browser and Node.js.", "main": "./lib/core/index.js", "module": "./lib/core/index.mjs", From 64d02b7bb40b24498757f03e3f8db52c709f5426 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Sun, 27 Oct 2024 15:11:10 +0100 Subject: [PATCH 5/6] chore: publish preview versions (#2335) --- .github/workflows/auto.yml | 2 + .github/workflows/ci.yml | 4 +- .github/workflows/compat.yml | 4 +- .github/workflows/lock-closed-issues.yml | 19 ++++++++ .github/workflows/release-preview.yml | 60 ++++++++++++++++++++++++ .github/workflows/release.yml | 9 ++-- .github/workflows/smoke-test.yml | 6 +-- .github/workflows/typescript-nightly.yml | 6 +-- decisions/releases.md | 6 ++- 9 files changed, 101 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/lock-closed-issues.yml create mode 100644 .github/workflows/release-preview.yml diff --git a/.github/workflows/auto.yml b/.github/workflows/auto.yml index 41dcf1438..72f2ba2a1 100644 --- a/.github/workflows/auto.yml +++ b/.github/workflows/auto.yml @@ -1,5 +1,7 @@ name: auto + on: [push] + jobs: cancel-previous-workflows: runs-on: macos-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0fa59640..312b5e3b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: runs-on: macos-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 diff --git a/.github/workflows/compat.yml b/.github/workflows/compat.yml index c331792d5..25ccd9296 100644 --- a/.github/workflows/compat.yml +++ b/.github/workflows/compat.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 diff --git a/.github/workflows/lock-closed-issues.yml b/.github/workflows/lock-closed-issues.yml new file mode 100644 index 000000000..0f50a7b50 --- /dev/null +++ b/.github/workflows/lock-closed-issues.yml @@ -0,0 +1,19 @@ +name: locked-closed-issues + +on: + schedule: + - cron: '0 0 * * *' + +permissions: + issues: write + +jobs: + action: + runs-on: macos-latest + steps: + - uses: dessant/lock-threads@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-inactive-days: '14' + issue-lock-reason: '' + process-only: 'issues' diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml new file mode 100644 index 000000000..6fa1d8dc8 --- /dev/null +++ b/.github/workflows/release-preview.yml @@ -0,0 +1,60 @@ +name: release + +on: + pull_request_review: + types: [submitted] + workflow_dispatch: + +jobs: + check: + # Trigger the permissions check whenever someone approves a pull request. + # They must have the write permissions to the repo in order to + # trigger preview package publishing. + if: github.event.review.state == 'approved' + runs-on: ubuntu-latest + outputs: + has-permissions: ${{ steps.checkPermissions.outputs.require-result }} + steps: + - name: Check permissions + id: checkPermissions + uses: actions-cool/check-user-permission@v2 + with: + require: 'write' + + preview: + # The approving user must pass the permissions check + # to trigger the preview publish. + needs: check + if: needs.check.outputs.has-permissions == 'true' + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 8.15.6 + + - name: Install dependencies + run: pnpm install + + - name: Install Playwright browsers + run: pnpm exec playwright install + + - name: Lint + run: pnpm lint + + - name: Build + run: pnpm build + + - name: Tests + run: pnpm test + + - name: Publish preview + run: pnpm dlx pkg-pr-new@0.0 publish --compact --pnpm --comment=update diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e90648388..6a0bbfccb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,19 +13,20 @@ jobs: id-token: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GH_ADMIN_TOKEN }} - - name: Setup Node.js - uses: actions/setup-node@v3 + - name: Set up Node.js + uses: actions/setup-node@v4 with: node-version: 18 always-auth: true registry-url: https://registry.npmjs.org - - uses: pnpm/action-setup@v4 + - name: Set up pnpm + uses: pnpm/action-setup@v4 with: version: 8.15.6 diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 18b124ffa..e98d4acad 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -15,14 +15,14 @@ jobs: runs-on: macos-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 - - name: Set up PNPM + - name: Set up pnpm uses: pnpm/action-setup@v4 with: version: 8.15.6 diff --git a/.github/workflows/typescript-nightly.yml b/.github/workflows/typescript-nightly.yml index 9449cd3ba..a292f12bb 100644 --- a/.github/workflows/typescript-nightly.yml +++ b/.github/workflows/typescript-nightly.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest steps: - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 @@ -37,10 +37,10 @@ jobs: if: ${{ needs.compare.outputs.latest_version != needs.compare.outputs.rc_version }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 diff --git a/decisions/releases.md b/decisions/releases.md index 42dc3ead2..8a7a0d813 100644 --- a/decisions/releases.md +++ b/decisions/releases.md @@ -4,9 +4,13 @@ MSW uses the [Release](https://github.com/ossjs/release) library to automate its ## Release schedule -The next version of the library releases automatically **every 3 days**. +The next version of **the library releases automatically every day**. We do our best to choose the optimal release window to accumulate multiple changes under a single release. We do deviate from the release schedule in emergency cases, like when a critical issue has been fixed and needs an immediate release. > [!IMPORTANT] > Please do not ping the library maintainers to release a new version of MSW. Be patient and wait for the automated release to happen. Subscribe to any issue or pull request you are interested in, and you will be notified whenever it gets released. + +## Preview releases + +This repository is configured to **release work-in-progress pull requests** using [okg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new). Once the pull request in question is approved, it will automatically be published to a temporary registry. Follow the instructions in the automated comment to install the work-in-progress version of the package. From 562fac96fb5ba1da950bba170ecb05f5156be938 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Sun, 27 Oct 2024 15:15:15 +0100 Subject: [PATCH 6/6] chore: rename release preview job to prevent confusion --- .github/workflows/release-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml index 6fa1d8dc8..c094269d5 100644 --- a/.github/workflows/release-preview.yml +++ b/.github/workflows/release-preview.yml @@ -1,4 +1,4 @@ -name: release +name: release-preview on: pull_request_review: @@ -21,7 +21,7 @@ jobs: with: require: 'write' - preview: + publish: # The approving user must pass the permissions check # to trigger the preview publish. needs: check