From 90a6a524363d7eece351f150ed6ffea2d246aeb7 Mon Sep 17 00:00:00 2001 From: Sean Morris <640101+seanmorris@users.noreply.github.com> Date: Sun, 26 Feb 2023 14:59:13 -0500 Subject: [PATCH 1/3] Maintain source mapping for merged sibling vars. --- .../src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/babel-plugin-transform-merge-sibling-variables/src/index.js b/packages/babel-plugin-transform-merge-sibling-variables/src/index.js index 968b248f1..f99d7e7d4 100644 --- a/packages/babel-plugin-transform-merge-sibling-variables/src/index.js +++ b/packages/babel-plugin-transform-merge-sibling-variables/src/index.js @@ -55,11 +55,15 @@ module.exports = function({ types: t }) { const { node } = path; + node.declarations.forEach(d => d.loc = d.loc || node.loc); + let sibling = path.getSibling(path.key + 1); let declarations = []; while (sibling.isVariableDeclaration({ kind: node.kind })) { + sibling.node.declarations.forEach(d => d.loc = d.loc || sibling.node.loc); + declarations = declarations.concat(sibling.node.declarations); sibling.remove(); From 96dff5d5d17a77b9f5a2287f484dedef192dc7d0 Mon Sep 17 00:00:00 2001 From: Sean Morris <640101+seanmorris@users.noreply.github.com> Date: Sun, 26 Feb 2023 15:23:26 -0500 Subject: [PATCH 2/3] Incrementing minor version. --- .../babel-plugin-transform-merge-sibling-variables/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-plugin-transform-merge-sibling-variables/package.json b/packages/babel-plugin-transform-merge-sibling-variables/package.json index 90584a9cd..f80de7da5 100644 --- a/packages/babel-plugin-transform-merge-sibling-variables/package.json +++ b/packages/babel-plugin-transform-merge-sibling-variables/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-merge-sibling-variables", - "version": "6.9.5", + "version": "6.9.6", "description": "Merge sibling variables into one.", "keywords": [ "babel-plugin" From cd7139d205a6c117ed48ef2987c2526c5100fb86 Mon Sep 17 00:00:00 2001 From: Sean Morris <640101+seanmorris@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:27:25 -0400 Subject: [PATCH 3/3] Revert "Incrementing minor version." This reverts commit 96dff5d5d17a77b9f5a2287f484dedef192dc7d0. --- .../babel-plugin-transform-merge-sibling-variables/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-plugin-transform-merge-sibling-variables/package.json b/packages/babel-plugin-transform-merge-sibling-variables/package.json index f80de7da5..90584a9cd 100644 --- a/packages/babel-plugin-transform-merge-sibling-variables/package.json +++ b/packages/babel-plugin-transform-merge-sibling-variables/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-merge-sibling-variables", - "version": "6.9.6", + "version": "6.9.5", "description": "Merge sibling variables into one.", "keywords": [ "babel-plugin"