Skip to content

chore: upgrade magic-string #9292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2023
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
5 changes: 5 additions & 0 deletions .changeset/sour-rats-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

chore: upgrade magic-string to 0.30.4
2 changes: 1 addition & 1 deletion packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"estree-walker": "^3.0.3",
"is-reference": "^3.0.1",
"locate-character": "^3.0.0",
"magic-string": "^0.30.0",
"magic-string": "^0.30.4",
"periscopic": "^3.1.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ export async function test({ assert, css, js }) {
const sourcefile = 'input.svelte';
[
// TODO: get line and col num from input.svelte rather than hardcoding here
[css, '--keep-me', 13, 2],
// TODO: these should be 7, 2 and 10, 2
// we use locate_1 which means lines are 1-indexed and cols are 0-indexed
// each tab is 1 col
[css, '--done-replace-once', 6, 4],
[css, '--done-replace-twice', 9, 4]
].forEach(([where, content, line, column]) => {
[css, '--keep-me', null, 13, 2],
[css, '--done-replace-once', '--replace-me-once', 7, 2],
[css, '--done-replace-twice', '--replace-me-twice', 10, 2]
].forEach(([where, content, name, line, column]) => {
assert.deepEqual(
where.mapConsumer.originalPositionFor(where.locate_1(content)),
{
source: sourcefile,
name: null,
name,
line,
column
},
Expand Down
61 changes: 18 additions & 43 deletions pnpm-lock.yaml

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