flow-upgrade 2.40.0 → 2.41.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.
Files changed (2) hide show
  1. package/dist/runCodemods.js +23 -21
  2. package/package.json +1 -1
@@ -7,27 +7,29 @@ exports.default = runCodemods;
7
7
  var _fsExtra = _interopRequireDefault(require("fs-extra"));
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
9
  async function runCodemods(codemods, filePaths, options) {
10
- const results = await Promise.allSettled(filePaths.map(async filePath => {
11
- if (typeof require !== 'undefined' && require.cache) {
12
- Object.keys(require.cache).forEach(key => {
13
- if (key.includes('hermes-transform') || key.includes('prettier')) {
14
- delete require.cache[key];
10
+ for (const filePath of filePaths) {
11
+ try {
12
+ if (typeof require !== 'undefined' && require.cache) {
13
+ Object.keys(require.cache).forEach(key => {
14
+ if (key.includes('hermes-transform') || key.includes('prettier')) {
15
+ delete require.cache[key];
16
+ }
17
+ });
18
+ }
19
+ const originalContents = await _fsExtra.default.readFile(filePath, 'utf8');
20
+ let contents = originalContents;
21
+ for (const codemod of codemods) {
22
+ if (typeof jest !== 'undefined') {
23
+ jest.resetModules();
15
24
  }
16
- });
17
- }
18
- const originalContents = await _fsExtra.default.readFile(filePath, 'utf8');
19
- let contents = originalContents;
20
- for (const codemod of codemods) {
21
- if (typeof jest !== 'undefined') {
22
- jest.resetModules();
25
+ const {
26
+ transform
27
+ } = require('hermes-transform');
28
+ contents = await transform(contents, codemod.transform, options.prettierOptions);
29
+ }
30
+ if (originalContents !== contents) {
31
+ await _fsExtra.default.writeFile(filePath, contents, 'utf8');
23
32
  }
24
- const {
25
- transform
26
- } = require('hermes-transform');
27
- contents = await transform(contents, codemod.transform, options.prettierOptions);
28
- }
29
- if (originalContents !== contents) {
30
- await _fsExtra.default.writeFile(filePath, contents, 'utf8');
31
- }
32
- }));
33
+ } catch (error) {}
34
+ }
33
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-upgrade",
3
- "version": "2.40.0",
3
+ "version": "2.41.0",
4
4
  "description": "A utility for upgrading your codebase to the latest version of Flow.",
5
5
  "engines": {
6
6
  "node": ">=14"