Skip to content

Commit

Permalink
Make yarn and yarn jest react-native-codegen works on Windows wit…
Browse files Browse the repository at this point in the history
…h git (#34854)

Summary:
A few fixings to make `yarn jest react-native-doegen` works on Windows:

- ~~Add a `.gitignore` file to tell git not to track generated/temporary files.~~
- There is no `rm` on Windows, change it to `rimraf`.

I have been using it in the last 3 months and it works perfectly on Windows, otherwise I could not even build the code in my laptop.

## Changelog

[General] [Changed] - Make `yarn` and `yarn jest react-native-codegen` works on Windows with git

Pull Request resolved: #34854

Test Plan: `yarn jest react-native-codegen` passed

Reviewed By: cortinico

Differential Revision: D40059524

Pulled By: cortinico

fbshipit-source-id: e3cde2506c7d18c2b580099257637b90f4cb328c
  • Loading branch information
ZihanChen-MSFT authored and facebook-github-bot committed Oct 7, 2022
1 parent 370bbd7 commit c4f9556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react-native-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scripts": {
"build": "yarn clean && node scripts/build.js --verbose",
"clean": "rm -rf lib",
"clean": "rimraf lib",
"prepare": "yarn run build"
},
"license": "MIT",
Expand Down Expand Up @@ -38,6 +38,7 @@
"invariant": "^2.2.4",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"prettier": "^2.4.1"
"prettier": "^2.4.1",
"rimraf": "^3.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('RNCodegen.generate', () => {
beforeEach(() => {
jest.resetModules();
});

it('when type `all`, with default paths', () => {
jest.mock('fs', () => ({
existsSync: location => {
Expand Down

0 comments on commit c4f9556

Please sign in to comment.