diff --git a/packages/browser/package.json b/packages/browser/package.json index 768c3d96b150..3f83bb8fd7c7 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "estree-walker": "^3.0.3", - "magic-string": "^0.30.1", + "magic-string": "^0.30.4", "sirv": "^2.0.3" }, "devDependencies": { diff --git a/packages/browser/src/node/esmInjector.ts b/packages/browser/src/node/esmInjector.ts index 6b2da38f6198..6b8b1b77b0f0 100644 --- a/packages/browser/src/node/esmInjector.ts +++ b/packages/browser/src/node/esmInjector.ts @@ -268,6 +268,6 @@ export function injectVitestModule(code: string, id: string, parse: (code: strin return { ast, code: s.toString(), - map: s.generateMap({ hires: true, source: id }), + map: s.generateMap({ hires: 'boundary', source: id }), } } diff --git a/packages/coverage-v8/package.json b/packages/coverage-v8/package.json index 8680d7954f43..1dfec142568b 100644 --- a/packages/coverage-v8/package.json +++ b/packages/coverage-v8/package.json @@ -51,7 +51,7 @@ "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^4.0.1", "istanbul-reports": "^3.1.5", - "magic-string": "^0.30.1", + "magic-string": "^0.30.4", "picocolors": "^1.0.0", "std-env": "^3.3.3", "test-exclude": "^6.0.0", diff --git a/packages/coverage-v8/src/provider.ts b/packages/coverage-v8/src/provider.ts index 56853b15f95d..bb22a7958ba2 100644 --- a/packages/coverage-v8/src/provider.ts +++ b/packages/coverage-v8/src/provider.ts @@ -261,7 +261,7 @@ function removeViteHelpersFromSourceMaps(source: string | undefined, map: Encode sourceWithoutHelpers.replaceAll(VITE_EXPORTS_LINE_PATTERN, '\n') const mapWithoutHelpers = sourceWithoutHelpers.generateMap({ - hires: true, + hires: 'boundary', }) // A merged source map where the first one excludes helpers diff --git a/packages/vitest/package.json b/packages/vitest/package.json index 2878e61161d5..00186753bb20 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -157,7 +157,7 @@ "chai": "^4.3.10", "debug": "^4.3.4", "local-pkg": "^0.4.3", - "magic-string": "^0.30.1", + "magic-string": "^0.30.4", "pathe": "^1.1.1", "picocolors": "^1.0.0", "std-env": "^3.3.3", diff --git a/packages/vitest/src/node/hoistMocks.ts b/packages/vitest/src/node/hoistMocks.ts index 8be08c13620a..4baa2742ca5a 100644 --- a/packages/vitest/src/node/hoistMocks.ts +++ b/packages/vitest/src/node/hoistMocks.ts @@ -188,6 +188,6 @@ export function hoistMocks(code: string, id: string, parse: (code: string, optio return { ast, code: s.toString(), - map: s.generateMap({ hires: true, source: id }), + map: s.generateMap({ hires: 'boundary', source: id }), } } diff --git a/packages/vitest/src/node/plugins/ssrReplacer.ts b/packages/vitest/src/node/plugins/ssrReplacer.ts index 0df70d5fb189..a6940752523f 100644 --- a/packages/vitest/src/node/plugins/ssrReplacer.ts +++ b/packages/vitest/src/node/plugins/ssrReplacer.ts @@ -30,7 +30,7 @@ export function SsrReplacerPlugin(): Plugin { return { code: s.toString(), map: s.generateMap({ - hires: true, + hires: 'boundary', // Remove possible query parameters, e.g. vue's "?vue&type=script&src=true&lang.ts" source: cleanUrl(id), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5124a1b9450..1e3ca72c1775 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -967,8 +967,8 @@ importers: specifier: ^3.0.3 version: 3.0.3 magic-string: - specifier: ^0.30.1 - version: 0.30.1 + specifier: ^0.30.4 + version: 0.30.4 sirv: specifier: ^2.0.3 version: 2.0.3 @@ -1062,8 +1062,8 @@ importers: specifier: ^3.1.5 version: 3.1.5 magic-string: - specifier: ^0.30.1 - version: 0.30.1 + specifier: ^0.30.4 + version: 0.30.4 picocolors: specifier: ^1.0.0 version: 1.0.0 @@ -1362,8 +1362,8 @@ importers: specifier: ^0.4.3 version: 0.4.3 magic-string: - specifier: ^0.30.1 - version: 0.30.1 + specifier: ^0.30.4 + version: 0.30.4 pathe: specifier: ^1.1.1 version: 1.1.1 @@ -5696,14 +5696,14 @@ packages: resolution: {integrity: sha512-Rt4O1mXlPEDVxvjsHLgbtHVdUXYK9C1/6ThpQnt7FaXIjUOsI6qhHYMgALhNnlIMZffag44lXd6Dqgx3xALbpQ==} dependencies: '@esbuild-kit/core-utils': 2.3.0 - get-tsconfig: 4.6.2 + get-tsconfig: 4.7.2 dev: true /@esbuild-kit/cjs-loader@2.4.0: resolution: {integrity: sha512-DBBCiHPgL2B/elUpvCDhNHXnlZQ9sfO2uyt1OJyAXKT41beQEFY4OxZ6gwS+ZesRCbZ6JV8M7GEyOPkjv8kdIw==} dependencies: '@esbuild-kit/core-utils': 3.0.0 - get-tsconfig: 4.6.2 + get-tsconfig: 4.7.2 dev: true /@esbuild-kit/core-utils@2.3.0: @@ -5724,14 +5724,14 @@ packages: resolution: {integrity: sha512-N9dPKAj8WOx6djVnStgILWXip4fjDcBk9L7azO0/uQDpu8Ee0eaL78mkN4Acid9BzvNAKWwdYXFJZnsVahNEew==} dependencies: '@esbuild-kit/core-utils': 2.3.0 - get-tsconfig: 4.6.2 + get-tsconfig: 4.7.2 dev: true /@esbuild-kit/esm-loader@2.5.0: resolution: {integrity: sha512-ySs0qOsiwj+hsgZM9/MniGdvfa9/WzqfFuIia8/5gSUPeIQIX2/tG91QakxPFOR35VFiwTB7wCiHtiS6dc6SkA==} dependencies: '@esbuild-kit/core-utils': 3.0.0 - get-tsconfig: 4.6.2 + get-tsconfig: 4.7.2 dev: true /@esbuild/android-arm64@0.17.18: @@ -6303,7 +6303,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 chalk: 4.1.2 jest-message-util: 27.5.1 jest-util: 27.5.1 @@ -6324,7 +6324,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.8.1 @@ -6361,7 +6361,7 @@ packages: dependencies: '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 jest-mock: 27.5.1 dev: true @@ -6378,7 +6378,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@sinonjs/fake-timers': 8.1.0 - '@types/node': 20.8.2 + '@types/node': 18.16.19 jest-message-util: 27.5.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -6407,7 +6407,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -6531,7 +6531,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 '@types/yargs': 16.0.5 chalk: 4.1.2 dev: true @@ -8930,7 +8930,7 @@ packages: devalue: 4.3.2 esm-env: 1.0.0 kleur: 4.1.5 - magic-string: 0.30.0 + magic-string: 0.30.4 mime: 3.0.0 sade: 1.8.1 set-cookie-parser: 2.6.0 @@ -9621,7 +9621,7 @@ packages: /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 20.8.2 + '@types/node': 18.16.19 dev: true /@types/resolve@1.20.2: @@ -9945,7 +9945,7 @@ packages: colorette: 2.0.20 consola: 3.1.0 fast-glob: 3.3.0 - magic-string: 0.30.1 + magic-string: 0.30.4 pathe: 1.1.1 perfect-debounce: 1.0.0 transitivePeerDependencies: @@ -9967,7 +9967,7 @@ packages: colorette: 2.0.20 consola: 3.1.0 fast-glob: 3.3.0 - magic-string: 0.30.1 + magic-string: 0.30.4 pathe: 1.1.1 perfect-debounce: 1.0.0 transitivePeerDependencies: @@ -10009,7 +10009,7 @@ packages: '@unocss/core': 0.53.4 css-tree: 2.3.1 fast-glob: 3.3.0 - magic-string: 0.30.1 + magic-string: 0.30.4 postcss: 8.4.29 dev: true @@ -10124,7 +10124,7 @@ packages: '@unocss/transformer-directives': 0.53.4 chokidar: 3.5.3 fast-glob: 3.3.0 - magic-string: 0.30.1 + magic-string: 0.30.4 vite: 4.4.10(@types/node@18.16.19)(less@4.1.3) transitivePeerDependencies: - rollup @@ -10144,7 +10144,7 @@ packages: '@unocss/transformer-directives': 0.53.4 chokidar: 3.5.3 fast-glob: 3.3.0 - magic-string: 0.30.1 + magic-string: 0.30.4 vite: 4.4.10(@types/node@18.16.19)(less@4.1.3) transitivePeerDependencies: - rollup @@ -18336,7 +18336,7 @@ packages: '@jest/environment': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -18472,7 +18472,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 jest-mock: 27.5.1 jest-util: 27.5.1 jsdom: 16.7.0 @@ -18490,7 +18490,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 jest-mock: 27.5.1 jest-util: 27.5.1 dev: true @@ -18534,7 +18534,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@types/graceful-fs': 4.1.5 - '@types/node': 20.8.2 + '@types/node': 18.16.19 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -18574,7 +18574,7 @@ packages: '@jest/source-map': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 chalk: 4.1.2 co: 4.6.0 expect: 27.5.1 @@ -18654,7 +18654,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 dev: true /jest-pnp-resolver@1.2.3(jest-resolve@27.5.1): @@ -18715,7 +18715,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 chalk: 4.1.2 emittery: 0.8.1 graceful-fs: 4.2.10 @@ -18780,7 +18780,7 @@ packages: resolution: {integrity: sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@types/node': 20.8.2 + '@types/node': 18.16.19 graceful-fs: 4.2.10 dev: true @@ -18831,7 +18831,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 chalk: 4.1.2 ci-info: 3.8.0 graceful-fs: 4.2.10 @@ -18868,7 +18868,7 @@ packages: dependencies: '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.8.2 + '@types/node': 18.16.19 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 27.5.1 @@ -19838,26 +19838,12 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /magic-string@0.30.0: - resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - /magic-string@0.30.1: resolution: {integrity: sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - /magic-string@0.30.2: - resolution: {integrity: sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - /magic-string@0.30.4: resolution: {integrity: sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==} engines: {node: '>=12'} @@ -25773,7 +25759,7 @@ packages: '@rollup/pluginutils': 5.0.2(rollup@3.29.4) '@vueuse/core': 10.2.1(vue@3.3.4) local-pkg: 0.4.3 - magic-string: 0.30.1 + magic-string: 0.30.4 minimatch: 9.0.1 unimport: 3.0.7(rollup@3.29.4) unplugin: 1.3.1 @@ -25824,7 +25810,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.3.0 local-pkg: 0.4.3 - magic-string: 0.30.2 + magic-string: 0.30.4 minimatch: 9.0.3 resolve: 1.22.3 unplugin: 1.3.2 @@ -25853,7 +25839,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.3.0 local-pkg: 0.4.3 - magic-string: 0.30.2 + magic-string: 0.30.4 minimatch: 9.0.3 resolve: 1.22.3 unplugin: 1.3.2