Skip to content

Commit

Permalink
chore: update magic-string to use "hires: boundary" (#4284)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Oct 10, 2023
1 parent ff93a57 commit 76607ea
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 57 deletions.
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/node/esmInjector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
}
}
2 changes: 1 addition & 1 deletion packages/coverage-v8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/coverage-v8/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/hoistMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
}
}
2 changes: 1 addition & 1 deletion packages/vitest/src/node/plugins/ssrReplacer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
86 changes: 36 additions & 50 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 76607ea

Please sign in to comment.