Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: mswjs
open_collective: mswjs
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: build

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

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

- 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: Lint
run: pnpm lint

- name: Format check
run: pnpm format:check

- name: Unit tests
run: pnpm test

- name: Build
run: pnpm build

- name: Upload build artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: build
path: dist
if-no-files-found: error

release:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}

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

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

- name: Set up Git user
run: |
git config user.name "Artem Zakharchenko"
git config user.email "kettanaito@gmail.com"

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

- name: Download build artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: build
path: dist

- name: Release
run: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
8 changes: 8 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": {
"correctness": "error",
"suspicious": "warn"
},
"ignorePatterns": ["dist", "demo", ".test-output"]
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
demo
.test-output
pnpm-lock.yaml
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"semi": false,
"useTabs": false,
"trailingComma": "all",
"singleQuote": true
}
40 changes: 25 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,52 @@
{
"name": "@msw/sveltekit",
"description": "sv add-on for Mock Service Worker",
"version": "0.0.1",
"description": "SvelteKit add-on for Mock Service Worker",
"version": "0.0.0",
"type": "module",
"license": "MIT",
"packageManager": "pnpm@11.5.2",
"scripts": {
"demo-create": "sv create demo --types ts --template minimal --no-add-ons --no-install",
"demo-add": "pnpm build && sv add file:../ --cwd demo --no-git-check --no-install",
"demo-add:ci": "pnpm build && sv add file:../=environments:browser,node --cwd demo --no-git-check --no-download-check --no-install",
"build": "tsdown",
"prepublishOnly": "npm run build",
"test": "vitest run"
"lint": "oxlint",
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "vitest run",
"release": "release publish"
},
"exports": {
".": "./dist/index.mjs"
},
"files": [
"dist"
],
"exports": {
".": {
"default": "./dist/index.mjs"
}
},
"publishConfig": {
"access": "public"
},
"keywords": [
"sv-add",
"svelte",
"sveltekit"
],
"repository": {
"type": "git",
"url": "https://github.com/mswjs/sveltekit"
},
"homepage": "https://github.com/mswjs/sveltekit",
"peerDependencies": {
"sv": "^0.13.0"
},
"devDependencies": {
"@ossjs/release": "^0.11.0",
"@playwright/test": "^1.59.1",
"@sveltejs/sv-utils": "^0.3.1",
"@types/node": "^25.5.2",
"oxlint": "^1.72.0",
"prettier": "^3.9.4",
"sv": "^0.16.2",
"tsdown": "^0.21.7",
"vitest": "^4.1.3"
},
"keywords": [
"sv-add",
"svelte",
"sveltekit"
]
}
}
Loading