Skip to content

Commit

Permalink
fix: add patch for 5to6
Browse files Browse the repository at this point in the history
  • Loading branch information
homer0 committed May 17, 2022
1 parent 9183c55 commit e819879
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"lint:all": "./utils/scripts/lint-all",
"docs": "./utils/scripts/docs",
"todo": "./utils/scripts/todo",
"prepare": "./utils/scripts/prepare"
"prepare": "./utils/scripts/prepare",
"postinstall": "./utils/scripts/postinstall"
},
"config": {
"cjs2esm": {
Expand Down
19 changes: 19 additions & 0 deletions patches/5to6-codemod+1.8.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/node_modules/5to6-codemod/transforms/exports.js b/node_modules/5to6-codemod/transforms/exports.js
index 55f2a19..fe4fd22 100644
--- a/node_modules/5to6-codemod/transforms/exports.js
+++ b/node_modules/5to6-codemod/transforms/exports.js
@@ -44,10 +44,10 @@ module.exports = function(file, api, options) {
})
filteredPaths.forEach(function (p, i) {
// aggregate all specifiers
- specifiers.push(j.exportSpecifier(
- j.identifier(p.value.right.name),
- j.identifier(p.value.right.name)
- ))
+ specifiers.push(j.exportSpecifier.from({
+ exported: j.identifier(p.value.right.name),
+ local: j.identifier(p.value.right.name),
+ }));

// replace the last module.exports.*
if (i === filteredPaths.length - 1) {
2 changes: 2 additions & 0 deletions utils/scripts/postinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash -e
patch-package

0 comments on commit e819879

Please sign in to comment.