Skip to content

Commit

Permalink
chore: update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 28, 2021
1 parent e6160a4 commit 6ec41a4
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 166 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
"background": {
"activeOnStart": true,
"beginsPattern": "vite",
"beginsPattern": "dev server running at",
"endsPattern": "ready in"
}
}
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"vue": "^3.2.24"
},
"devDependencies": {
"@antfu/eslint-config": "^0.14.1",
"@antfu/eslint-config": "^0.14.2",
"@iconify-json/carbon": "^1.0.12",
"@types/node": "^17.0.5",
"@unocss/reset": "^0.19.0",
"@unocss/reset": "^0.20.0",
"@vitejs/plugin-vue": "^2.0.1",
"eslint": "^8.5.0",
"pnpm": "^6.24.3",
"typescript": "^4.5.4",
"unocss": "^0.19.0",
"unocss": "^0.20.0",
"unplugin-vue-components": "^0.17.11",
"vitepress": "^0.20.10"
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"postinstall": "cd test/vue2 && npx pnpm i",
"lint": "eslint --ext .js,.vue,.ts .",
"lint:fix": "eslint --ext .js,.vue,.ts . --fix",
"release": "bumpp package.json packages/*/package.json --commit --push --tag && pnpm -r publish",
"release": "bumpp package.json packages/*/package.json --commit --push --tag && pnpm -r publish --access public",
"test": "vitest -r test/core --api",
"test:all": "cross-env CI=true pnpm -r --stream --filter !@vitest/monorepo run test --",
"test:ci": "cross-env CI=true pnpm -r --stream --filter !@vitest/monorepo --filter !@vitest/test-fails run test --",
Expand All @@ -23,7 +23,7 @@
"ui:dev": "vite packages/ui"
},
"devDependencies": {
"@antfu/eslint-config": "^0.14.1",
"@antfu/eslint-config": "^0.14.2",
"@antfu/ni": "^0.12.0",
"@rollup/plugin-alias": "^3.1.8",
"@rollup/plugin-commonjs": "^21.0.1",
Expand Down
7 changes: 2 additions & 5 deletions packages/ui/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { fileURLToPath } from 'url'
import { resolve } from 'pathe'
import sirv from 'sirv'

import type { Plugin } from 'vite'
import type { Vitest } from 'vitest/node'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const VitestUIPlugin = (vitest: Vitest): Plugin => {
export default (): Plugin => {
return {
name: 'vitest:ui',
apply: 'serve',
Expand All @@ -17,5 +14,5 @@ export const VitestUIPlugin = (vitest: Vitest): Plugin => {
dev: true,
}))
},
} as Plugin
}
}
31 changes: 14 additions & 17 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "@vitest/ui",
"//": "TODO: when it's ready",
"private": true,
"version": "0.0.118",
"description": "Vitest UI",
"description": "UI for Vitest",
"sideEffects": false,
"type": "module",
"exports": {
Expand All @@ -19,34 +17,33 @@
"dist"
],
"scripts": {
"dev:node": "rollup -c --watch node",
"dev:client": "vite",
"dev:ui": "run-p dev:node dev:client",
"build:node": "rollup -c",
"build": "rimraf dist && pnpm build:node && pnpm build:client",
"build:client": "vite build",
"build": "rimraf dist && pnpm build:node && pnpm build:client"
},
"peerDependencies": {
"vitest": "workspace:*"
"build:node": "rollup -c",
"dev:client": "vite",
"dev:node": "rollup -c --watch node",
"dev:ui": "run-p dev:node dev:client"
},
"dependencies": {
"@vitest/ws-client": "workspace:*",
"@vueuse/core": "^7.4.1",
"sirv": "^1.0.19",
"ws": "^8.4.0"
"sirv": "^1.0.19"
},
"devDependencies": {
"@types/codemirror": "^5.60.5",
"@types/ws": "^8.2.2",
"@unocss/reset": "^0.19.0",
"@unocss/reset": "^0.20.0",
"@vitejs/plugin-vue": "^2.0.1",
"@vitest/ws-client": "workspace:*",
"@vueuse/core": "^7.4.1",
"codemirror": "^5.65.0",
"codemirror-theme-vars": "^0.1.1",
"picocolors": "^1.0.0",
"rollup": "^2.62.0",
"unocss": "^0.19.0",
"unocss": "^0.20.0",
"unplugin-auto-import": "^0.5.5",
"unplugin-vue-components": "^0.17.11",
"vitest": "workspace:*"
},
"peerDependencies": {
"vitest": "workspace:*"
}
}
6 changes: 3 additions & 3 deletions packages/ws-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@vitest/ws-client",
"private": true,
"version": "0.0.118",
"description": "WebSocket client wrapper for communicating with Vitest",
"homepage": "https://github.com/antfu/vitest#readme",
"bugs": {
"url": "https://github.com/antfu/vitest/issues"
Expand Down Expand Up @@ -43,6 +44,5 @@
},
"engines": {
"node": ">=14.14.0"
},
"version": "0.0.118"
}
}
5 changes: 3 additions & 2 deletions packages/ws-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface VitestClientOptions {
reconnectTries?: number
reactive?: <T>(v: T) => T
ref?: <T>(v: T) => { value: T }
WebSocketConstructor?: typeof WebSocket
}

export interface VitestClient {
Expand All @@ -29,12 +30,12 @@ export function createClient(url: string, options: VitestClientOptions = {}) {
reconnectInterval = 2000,
reconnectTries = 10,
reactive = v => v,
// ref = v => ({ value: v }),
WebSocketConstructor = globalThis.WebSocket,
} = options

let tries = reconnectTries
const ctx = reactive({
ws: new WebSocket(url),
ws: new WebSocketConstructor(url),
state: new StateManager(),
waitForConnection,
reconnect,
Expand Down
Loading

0 comments on commit 6ec41a4

Please sign in to comment.