Skip to content
Draft
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 .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# vite-plus preview build registry bridge (auto-added by vp)
registry=https://registry-bridge.viteplus.dev/
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"@types/node": "^24.13.1",
"@types/semver": "^7.7.1",
"@types/serve-handler": "^6.1.4",
"@vitest/coverage-v8": "^4.1.8",
"@vitest/ui": "^4.1.8",
"@vitest/coverage-v8": "catalog:",
"@vitest/ui": "catalog:",
"@vue/consolidate": "1.0.0",
"conventional-changelog": "^7.2.0",
"conventional-changelog-angular": "^8.3.1",
Expand Down Expand Up @@ -88,7 +88,8 @@
"tslib": "^2.8.1",
"typescript": "~5.6.2",
"vite": "catalog:",
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.22",
"vite-plus": "^0.1.22"
"vitest": "catalog:",
"vite-plus": "catalog:",
"@vitest/browser-playwright": "catalog:"
}
}
4 changes: 2 additions & 2 deletions packages-private/local-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"scripts": {
"dev": "node ./setup/vite.js",
"build": "vite build -c vite.prod.config.ts",
"build": "vp build -c vite.prod.config.ts",
"prepreview": "cd ../ && pnpm run build runtime-vapor -f esm-bundler",
"preview": "pnpm run build && vite preview -c vite.prod.config.ts"
"preview": "pnpm run build && vp preview -c vite.prod.config.ts"
},
"dependencies": {
"@vueuse/core": "^11.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages-private/local-playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from 'vite'
import { defineConfig } from 'vite-plus'
import Inspect from 'vite-plugin-inspect'
import { DevPlugin } from './setup/dev'
import Vue from '@vitejs/plugin-vue'
Expand Down
2 changes: 1 addition & 1 deletion packages-private/vapor-e2e-test/__tests__/e2eUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Locator, page, userEvent } from 'vitest/browser'
import { type Locator, page, userEvent } from 'vite-plus/test/browser'

export const css = (css: string) => page.getByCSS(css)
export const html = (selector: string) => css(selector).element().innerHTML
Expand Down
2 changes: 1 addition & 1 deletion packages-private/vapor-e2e-test/__tests__/setupBrowser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Locator, locators } from 'vitest/browser'
import { type Locator, locators } from 'vite-plus/test/browser'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the import has been migrated from 'vitest/browser' to 'vite-plus/test/browser', please also update the module augmentation on line 13 from declare module 'vitest/browser' to declare module 'vite-plus/test/browser'. This ensures that the custom selectors (like getByCSS) are correctly typed when importing from 'vite-plus/test/browser'.


locators.extend({
getByCSS(css: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages-private/vapor-e2e-test/__tests__/todomvc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { userEvent } from 'vitest/browser'
import { userEvent } from 'vite-plus/test/browser'
import { createVaporApp } from 'vue'
import App from '../todomvc/App.vue'
import 'todomvc-app-css/index.css'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createVaporApp, next, nextTick, vaporInteropPlugin } from 'vue'
import { expect } from 'vitest'
import { expect } from 'vite-plus/test'
import App from '../transition-group/App.vue'
import '../../../packages/vue/__tests__/e2e/style.css'
import {
Expand Down
3 changes: 2 additions & 1 deletion packages-private/vapor-e2e-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"connect": "^3.7.0",
"sirv": "^2.0.4",
"vite": "catalog:",
"vue": "workspace:*"
"vue": "workspace:*",
"vitest": "catalog:"
}
}
6 changes: 3 additions & 3 deletions packages-private/vite-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
"dev": "vp dev",
"build": "vp build",
"serve": "vp preview"
},
"devDependencies": {
"@vitejs/plugin-vue": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/__tests__/compileScript.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { vi } from 'vitest'
import { vi } from 'vite-plus/test'
import { BindingTypes } from '@vue/compiler-core'
import {
assertCode,
Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/__benchmarks__/computed.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench, describe } from 'vitest'
import { bench, describe } from 'vite-plus/test'
import type { ComputedRef, Ref } from '../src'
import { computed, effect, ref } from '../dist/reactivity.esm-browser.prod'

Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/__benchmarks__/effect.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench, describe } from 'vitest'
import { bench, describe } from 'vite-plus/test'
import type { Ref } from '../src'
import { effect, ref } from '../dist/reactivity.esm-browser.prod'

Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/__benchmarks__/reactiveArray.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench } from 'vitest'
import { bench } from 'vite-plus/test'
import {
effect,
reactive,
Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/__benchmarks__/reactiveMap.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench } from 'vitest'
import { bench } from 'vite-plus/test'
import type { ComputedRef } from '../src'
import { computed, reactive } from '../dist/reactivity.esm-browser.prod'

Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/__benchmarks__/reactiveObject.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench } from 'vitest'
import { bench } from 'vite-plus/test'
import { reactive } from '../dist/reactivity.esm-browser.prod'

bench('create reactive obj', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/__benchmarks__/ref.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench, describe } from 'vitest'
import { bench, describe } from 'vite-plus/test'
import { ref } from '../dist/reactivity.esm-browser.prod'

describe('ref', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/__tests__/apiOptions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @vitest-environment jsdom
*/
import type { Mock } from 'vitest'
import type { Mock } from 'vite-plus/test'
import {
type TestElement,
computed,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/__tests__/apiWatch.bench.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { nextTick, ref, watch, watchEffect } from '../src'
import { bench } from 'vitest'
import { bench } from 'vite-plus/test'

bench('create watcher', () => {
const v = ref(100)
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-dom/__tests__/customElement.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MockedFunction } from 'vitest'
import type { MockedFunction } from 'vite-plus/test'
import {
type HMRRuntime,
type Ref,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-dom/__tests__/customizedBuiltIn.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MockInstance } from 'vitest'
import type { MockInstance } from 'vite-plus/test'
import { h, render } from '@vue/runtime-dom'

describe('customized built-in elements support', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-vapor/__tests__/bench/block.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench, describe } from 'vitest'
import { bench, describe } from 'vite-plus/test'
import { shallowRef } from '@vue/reactivity'
import {
type Block,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-vapor/__tests__/bench/setClass.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench, describe } from 'vitest'
import { bench, describe } from 'vite-plus/test'
import { setClass, setClassName } from '../../src/dom/prop'

type TargetElement = HTMLElement & {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-vapor/__tests__/customElement.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MockedFunction } from 'vitest'
import type { MockedFunction } from 'vite-plus/test'
import type { VaporElement } from '../src/apiDefineCustomElement'
import { VaporSlotFlags } from '@vue/shared'
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
withVaporDirectives,
} from '../../src'
import { nextTick, watchEffect } from '@vue/runtime-dom'
import type { Mock } from 'vitest'
import type { Mock } from 'vite-plus/test'

describe('custom directive', () => {
it('should work', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-vapor/__tests__/directives/vShow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
template,
} from '../../src'
import { type VShowElement, nextTick, ref } from 'vue'
import { describe, expect, test } from 'vitest'
import { describe, expect, test } from 'vite-plus/test'
import { makeRender } from '../_utils'

const define = makeRender()
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-vapor/__tests__/if.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../src'
import { nextTick, ref } from '@vue/runtime-dom'
import { VaporBlockShape, VaporIfFlags } from '@vue/shared'
import type { Mock } from 'vitest'
import type { Mock } from 'vite-plus/test'
import { compile, ifFlags, makeRender } from './_utils'
import { setElementText } from '../src/dom/prop'
import type { DynamicFragment } from '../src/fragment'
Expand Down
2 changes: 1 addition & 1 deletion packages/server-renderer/__tests__/createBuffer.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench, describe } from 'vitest'
import { bench, describe } from 'vite-plus/test'

import { createBuffer as _createBuffer } from '../src/render'

Expand Down
2 changes: 1 addition & 1 deletion packages/server-renderer/__tests__/unrollBuffer.bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bench, describe } from 'vitest'
import { bench, describe } from 'vite-plus/test'

import { type SSRBuffer, createBuffer } from '../src/render'
import { unrollBuffer as _unrollBuffer } from '../src/renderToString'
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-compat/__tests__/instance.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Mock } from 'vitest'
import type { Mock } from 'vite-plus/test'
import Vue from '@vue/compat'
import type { Slots } from '../../runtime-core/src/componentSlots'
import { Text } from '../../runtime-core/src/vnode'
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/__tests__/e2e/e2eBrowserUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cdp } from 'vitest/browser'
import { cdp } from 'vite-plus/test/browser'

export const E2E_TIMEOUT: number = 30 * 1000

Expand Down
2 changes: 1 addition & 1 deletion packages/vue/__tests__/e2e/trusted-types.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { once } from 'node:events'
import { createServer } from 'node:http'
import path from 'node:path'
import { beforeAll } from 'vitest'
import { beforeAll } from 'vite-plus/test'
import serveHandler from 'serve-handler'

import { E2E_TIMEOUT, setupPuppeteer } from './e2eUtils'
Expand Down
3 changes: 3 additions & 0 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,8 @@
"typescript": {
"optional": true
}
},
"devDependencies": {
"vitest": "catalog:"
}
}
Loading
Loading