flow-upgrade 2.7.2 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,6 @@ exports.default = runCodemods;
7
7
 
8
8
  var _fsExtra = _interopRequireDefault(require("fs-extra"));
9
9
 
10
- var _hermesTransform = require("hermes-transform");
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
12
  async function runCodemods(codemods, filePaths, options) {
@@ -25,7 +23,15 @@ async function runCodemods(codemods, filePaths, options) {
25
23
  let contents = originalContents;
26
24
 
27
25
  for (const codemod of codemods) {
28
- contents = await (0, _hermesTransform.transform)(contents, codemod.transform, options.prettierOptions);
26
+ if (typeof jest !== 'undefined') {
27
+ jest.resetModules();
28
+ }
29
+
30
+ const {
31
+ transform
32
+ } = require('hermes-transform');
33
+
34
+ contents = await transform(contents, codemod.transform, options.prettierOptions);
29
35
  }
30
36
 
31
37
  if (originalContents !== contents) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-upgrade",
3
- "version": "2.7.2",
3
+ "version": "2.9.0",
4
4
  "description": "A utility for upgrading your codebase to the latest version of Flow.",
5
5
  "engines": {
6
6
  "node": ">=14"
@@ -56,4 +56,4 @@
56
56
  "memfs": "^3.4.3",
57
57
  "prettier": "2.8.8"
58
58
  }
59
- }
59
+ }