Skip to content

Commit

Permalink
chore: upgrade magic-string (#9292)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Oct 4, 2023
1 parent 9ffe07d commit 052d381
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 52 deletions.
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.

1 comment on commit 052d381

@vercel
Copy link

@vercel vercel bot commented on 052d381 Oct 4, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.