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
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"generate-pwa-icons": "pwa-assets-generator"
},
"dependencies": {
"@vueuse/core": "^12.4.0",
"@vueuse/core": "^12.5.0",
"vue": "^3.5.12"
},
"devDependencies": {
"@iconify-json/carbon": "^1.2.5",
"@iconify-json/logos": "^1.2.4",
"@shikijs/transformers": "^1.27.2",
"@shikijs/vitepress-twoslash": "^1.27.2",
"@shikijs/transformers": "^1.29.1",
"@shikijs/vitepress-twoslash": "^1.29.1",
"@unocss/reset": "^0.65.4",
"@vite-pwa/assets-generator": "^0.2.6",
"@vite-pwa/vitepress": "^0.5.3",
Expand All @@ -32,8 +32,8 @@
"unplugin-vue-components": "^0.28.0",
"vite": "^5.2.8",
"vite-plugin-pwa": "^0.21.1",
"vitepress": "^1.5.0",
"vitepress-plugin-group-icons": "^1.3.4",
"vitepress": "^1.6.3",
"vitepress-plugin-group-icons": "^1.3.5",
"vitepress-plugin-tabs": "^0.5.0",
"workbox-window": "^7.3.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/in-source-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test:run": "vitest run"
},
"devDependencies": {
"typescript": "^5.5.4",
"typescript": "^5.7.3",
"vitest": "latest"
}
}
2 changes: 1 addition & 1 deletion examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"svelte": "^3.59.1",
"svelte-check": "^3.4.3",
"tslib": "^2.5.3",
"typescript": "^5.2.2",
"typescript": "^5.7.3",
"vite": "latest",
"vitest": "latest"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/typecheck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@types/node": "^20.11.5",
"@vitest/ui": "latest",
"typescript": "^5.2.2",
"typescript": "^5.7.3",
"vite": "latest",
"vitest": "latest"
},
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.0",
"@types/node": "^22.10.7",
"@types/node": "^22.10.9",
"@types/ws": "^8.5.13",
"@vitest/browser": "workspace:*",
"@vitest/coverage-istanbul": "workspace:*",
"@vitest/coverage-v8": "workspace:*",
"@vitest/ui": "workspace:*",
"bumpp": "^9.10.1",
"bumpp": "^9.10.2",
"changelogithub": "^0.13.11",
"esbuild": "^0.24.2",
"eslint": "^9.18.0",
"magic-string": "^0.30.17",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"rimraf": "^6.0.1",
"rollup": "^4.30.1",
"rollup": "^4.31.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-license": "^3.5.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
"dependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/user-event": "^14.6.0",
"@testing-library/user-event": "^14.6.1",
"@vitest/mocker": "workspace:*",
"@vitest/utils": "workspace:*",
"magic-string": "^0.30.17",
Expand All @@ -108,7 +108,7 @@
"flatted": "^3.3.2",
"ivya": "^1.1.1",
"mime": "^4.0.6",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"periscopic": "^4.0.2",
"playwright": "^1.49.1",
"playwright-core": "^1.49.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/coverage-istanbul/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@types/istanbul-lib-source-maps": "^4.0.4",
"@types/istanbul-reports": "^3.0.4",
"@types/test-exclude": "^6.0.2",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"vitest": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/coverage-v8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@types/istanbul-reports": "^3.0.4",
"@types/test-exclude": "^6.0.2",
"@vitest/browser": "workspace:*",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"v8-to-istanbul": "^9.3.0",
"vite-node": "workspace:*",
"vitest": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/mocker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@vitest/utils": "workspace:*",
"acorn-walk": "^8.3.4",
"msw": "^2.7.0",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"vite": "^5.4.0"
}
}
2 changes: 1 addition & 1 deletion packages/runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
},
"dependencies": {
"@vitest/utils": "workspace:*",
"pathe": "^2.0.1"
"pathe": "^2.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"dependencies": {
"@vitest/pretty-format": "workspace:*",
"magic-string": "^0.30.17",
"pathe": "^2.0.1"
"pathe": "^2.0.2"
},
"devDependencies": {
"@types/natural-compare": "^1.4.3",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/client/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ declare global {
const useCodeMirror: typeof import('./composables/codemirror')['useCodeMirror']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
const useCountdown: typeof import('@vueuse/core')['useCountdown']
const useCounter: typeof import('@vueuse/core')['useCounter']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVar: typeof import('@vueuse/core')['useCssVar']
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@vitest/utils": "workspace:*",
"fflate": "^0.8.2",
"flatted": "^3.3.2",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"sirv": "^3.0.0",
"tinyglobby": "^0.2.10",
"tinyrainbow": "^2.0.0"
Expand All @@ -69,14 +69,14 @@
"@vitest/runner": "workspace:*",
"@vitest/ws-client": "workspace:*",
"@vue/test-utils": "^2.4.6",
"@vueuse/core": "^12.4.0",
"@vueuse/core": "^12.5.0",
"ansi-to-html": "^0.7.2",
"birpc": "0.2.19",
"codemirror": "^5.65.18",
"codemirror-theme-vars": "^0.1.2",
"d3-graph-controller": "^3.0.11",
"d3-graph-controller": "^3.0.12",
"floating-vue": "^5.2.2",
"rollup": "^4.30.1",
"rollup": "^4.31.0",
"splitpanes": "^3.1.8",
"unocss": "^0.65.4",
"unplugin-auto-import": "^0.19.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"cac": "^6.7.14",
"debug": "^4.4.0",
"es-module-lexer": "^1.6.0",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"vite": "^5.0.0 || ^6.0.0"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"debug": "^4.4.0",
"expect-type": "^1.1.0",
"magic-string": "^0.30.17",
"pathe": "^2.0.1",
"pathe": "^2.0.2",
"std-env": "^3.8.0",
"tinybench": "^2.9.0",
"tinyexec": "^0.3.2",
Expand All @@ -186,7 +186,7 @@
"@types/istanbul-reports": "^3.0.4",
"@types/jsdom": "^21.1.7",
"@types/micromatch": "^4.0.9",
"@types/node": "^22.10.7",
"@types/node": "^22.10.9",
"@types/prompts": "^2.4.9",
"@types/sinonjs__fake-timers": "^8.1.5",
"acorn-walk": "^8.3.4",
Expand All @@ -196,8 +196,8 @@
"fast-glob": "3.3.3",
"find-up": "^6.3.0",
"flatted": "^3.3.2",
"get-tsconfig": "^4.8.1",
"happy-dom": "^16.6.0",
"get-tsconfig": "^4.10.0",
"happy-dom": "^16.7.2",
"jsdom": "^25.0.1",
"local-pkg": "^0.5.1",
"micromatch": "^4.0.8",
Expand Down
22 changes: 11 additions & 11 deletions packages/vitest/src/runtime/vm/commonjs-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ interface CommonjsExecutorOptions {

const _require = createRequire(import.meta.url)

interface PrivateNodeModule extends NodeModule {
interface PrivateNodeModule extends NodeJS.Module {
_compile: (code: string, filename: string) => void
}

const requiresCache = new WeakMap<NodeModule, NodeRequire>()
const requiresCache = new WeakMap<NodeJS.Module, NodeJS.Require>()

export class CommonjsExecutor {
private context: vm.Context
private requireCache = new Map<string, NodeModule>()
private requireCache = new Map<string, NodeJS.Module>()
private publicRequireCache = this.createProxyCache()

private moduleCache = new Map<string, VMModule | Promise<VMModule>>()
private builtinCache: Record<string, NodeModule> = Object.create(null)
private builtinCache: Record<string, NodeJS.Module> = Object.create(null)
private extensions: Record<
string,
(m: NodeModule, filename: string) => unknown
(m: NodeJS.Module, filename: string) => unknown
> = Object.create(null)

private fs: FileMap
Expand Down Expand Up @@ -135,7 +135,7 @@ export class CommonjsExecutor {
static _cache = executor.moduleCache
static _extensions = executor.extensions

static createRequire = (filename: string) => {
static createRequire = (filename: string | URL) => {
return executor.createRequire(filename)
}

Expand Down Expand Up @@ -169,17 +169,17 @@ export class CommonjsExecutor {
this.extensions['.json'] = this.requireJson
}

private requireJs = (m: NodeModule, filename: string) => {
private requireJs = (m: NodeJS.Module, filename: string) => {
const content = this.fs.readFile(filename);
(m as PrivateNodeModule)._compile(content, filename)
}

private requireJson = (m: NodeModule, filename: string) => {
private requireJson = (m: NodeJS.Module, filename: string) => {
const code = this.fs.readFile(filename)
m.exports = JSON.parse(code)
}

public createRequire = (filename: string) => {
public createRequire = (filename: string | URL) => {
const _require = createRequire(filename)
const require = ((id: string) => {
const resolved = _require.resolve(id)
Expand All @@ -189,7 +189,7 @@ export class CommonjsExecutor {
}
const module = new this.Module(resolved)
return this.loadCommonJSModule(module, resolved)
}) as NodeRequire
}) as NodeJS.Require
require.resolve = _require.resolve
Object.defineProperty(require, 'extensions', {
get: () => this.extensions,
Expand Down Expand Up @@ -220,7 +220,7 @@ export class CommonjsExecutor {

// very naive implementation for Node.js require
private loadCommonJSModule(
module: NodeModule,
module: NodeJS.Module,
filename: string,
): Record<string, unknown> {
const cached = this.requireCache.get(filename)
Expand Down
Loading
Loading