Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,43 @@ jobs:
path: dist
if-no-files-found: error

compatibility:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sv: ['0.13.1', '0.17.1', '1.0.0', '1.0.1']
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 11.27.1

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 24
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build published entry point
run: pnpm build

- name: Install CLI version under test
run: pnpm add --save-dev sv@${{ matrix.sv }}

- name: Test published entry point
run: pnpm test:compatibility

release:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
needs: [build, compatibility]
permissions:
contents: read
id-token: write
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pnpm demo-add

## run the tests
pnpm test

## test the published entry point against the installed sv version
pnpm build
pnpm test:compatibility
```

## Key things to note
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ Or integrate MSW add-in into an existing project with this one:
npx sv add @msw/sveltekit
```

## CLI compatibility

Supports `sv` versions `>=0.13.1 <2.0.0`. The published add-on is tested against
`0.13.1`, `0.17.1`, `1.0.0`, and `1.0.1`. Its `sv-utils` dependency is bundled.

Older `sv` versions may show a major-version compatibility warning even though
they are supported: the CLI checks a single major version rather than the full
peer dependency range. Use `npx sv@latest add @msw/sveltekit` to avoid that warning.

## What you get

- `msw` added as a dev dependency.
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "vitest run",
"test:compatibility": "node --test tests/compatibility.test.mjs",
"release": "release publish"
},
"exports": {
Expand All @@ -40,16 +41,16 @@
},
"homepage": "https://github.com/mswjs/sveltekit",
"peerDependencies": {
"sv": "^0.13.0"
"sv": "^1.0.0 || >=0.13.1 <1.0.0"
},
"devDependencies": {
"@ossjs/release": "^0.11.2",
"@playwright/test": "^1.63.0",
"@sveltejs/sv-utils": "^0.3.3",
"@sveltejs/sv-utils": "^1.0.0",
"@types/node": "^26.6.3",
"oxlint": "^1.85.0",
"prettier": "^3.9.9",
"sv": "^0.17.1",
"sv": "^1.0.1",
"tsdown": "^0.23.0",
"vitest": "^5.0.2"
}
Expand Down
46 changes: 35 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading