Commit Graph
1179 Commits
Author SHA1 Message Date
Michał Pierzchała b4b9d077ea chore: setup CircleCI 2018-11-09 11:17:06 +01:00
Mike Grabowski 2beef9f25a Merge pull request #18 from thymikee/jest-babel-7
feat: use @babel/register instead of metro-babel-register
2018-11-09 02:15:07 -08:00
Michał Pierzchała ca2653ac33 add class properties transform 2018-11-08 23:58:45 +01:00
Michał Pierzchała bd10d94316 use @babel/register instead of metro-babel-register 2018-11-08 23:49:49 +01:00
Michał Pierzchała 3396cf8a7d chore: use babel7 for tests 2018-11-08 23:47:48 +01:00
Mike Grabowski dc20ec46c1 Fix typo 2018-11-08 15:45:11 +01:00
Mike Grabowski d63276a1a5 Release new version 2018-11-08 15:42:08 +01:00
Mike Grabowski b354d4f515 Make Flow pass 2018-11-08 15:41:07 +01:00
Mike Grabowski 55a4323960 Simplify Jest transformer 2018-11-08 15:35:47 +01:00
Mike Grabowski 11471680b0 Release a new version 2018-11-08 11:15:52 +01:00
Mike Grabowski c391af5f80 Small clean up 2018-11-08 11:06:33 +01:00
Mike Grabowski 09150a1270 Add bin property to the CLI 2018-11-08 11:02:09 +01:00
Mike Grabowski daa70be368 Fix test ignore paths 2018-11-07 14:48:27 +01:00
Mike Grabowski 9e6d069677 Make Jest tests run 2018-11-07 14:46:26 +01:00
Mike Grabowski c7b2b3d0b0 Make CLI run detached from React Native 2018-11-07 14:35:07 +01:00
Mike Grabowski cddfd756ae Merge pull request #15 from react-native-community/feat/reb
Feat/reb
2018-11-06 08:02:46 -08:00
Mike Grabowski 4e24d3287b Use resolve 2018-11-06 17:01:08 +01:00
Mike Grabowski be9e6c139d Replace paths to correctly point to a template folder 2018-11-06 17:01:01 +01:00
Mike Grabowski d8fb550f60 Fix init command lookup of package.json 2018-11-06 17:00:54 +01:00
Mike Grabowski 38e6c2ef68 Fix small issue related to the detection of RN folder 2018-11-06 17:00:33 +01:00
Mike Grabowski 2623bf1a82 Support requring React Native paths outside of the CLI 2018-11-06 17:00:27 +01:00
Kacper Wiszczuk 46b128ca43 Make local-cli run 2018-11-06 17:00:04 +01:00
Mike Grabowski 23218bb1b1 Add 'packages/local-cli/' from commit '0cae21561a14af6a8aecce7527e2cf252f053417'
git-subtree-dir: packages/local-cli
git-subtree-mainline: 62e07d1dc0
git-subtree-split: 0cae21561a
2018-11-06 16:46:00 +01:00
Mike Grabowski 62e07d1dc0 Remove local-cli 2018-11-06 16:45:48 +01:00
Mike Grabowski b73159b229 Use resolve 2018-11-06 15:43:46 +01:00
Mike Grabowski e370f8fce2 Replace paths to correctly point to a template folder 2018-11-06 15:42:22 +01:00
Mike Grabowski dc5ba80144 Fix init command lookup of package.json 2018-11-06 15:35:17 +01:00
Mike Grabowski fe2c8b707f Merge pull request #13 from react-native-community/global-cli
Fix small issue related to the detection of RN folder
2018-11-06 05:06:46 -08:00
Mike Grabowski efa0ea7fbd Fix small issue related to the detection of RN folder 2018-11-06 14:06:12 +01:00
Mike Grabowski 04302654a4 Merge pull request #11 from react-native-community/global-cli
Support requring React Native paths outside of the CLI
2018-11-06 04:58:31 -08:00
Mike Grabowski 9940e8c9db Support requring React Native paths outside of the CLI 2018-11-06 13:57:25 +01:00
Mike Grabowski 8aaff8ca52 Merge pull request #10 from react-native-community/global-cli
Make local-cli run
2018-11-06 03:15:38 -08:00
Kacper Wiszczuk b02fb8232e Make local-cli run 2018-11-06 12:13:01 +01:00
Tnarita0000 0cae21561a Fix no-shadow eslint warning & remove var (#22124)
Summary:
Fixes `no-shadow` warning for `local-cli/link/ios/getGroup.js`  and remove `var` declaration keyword.
```
react-native/local-cli/link/ios/getGroup.js
  13:23  warning  'group' is already declared in the upper scope  no-shadow
```

- [x] Check `npm run flow`
- [x] Check `npm run flow-check-ios`
- [x] Check `npm run flow-check-android`
- [x] Check `npm run lint`

N/A
Pull Request resolved: https://github.com/facebook/react-native/pull/22124

Differential Revision: D12929717

Pulled By: TheSavior

fbshipit-source-id: 10f8269ae7a0e61f4d0ec6fe710889c3a7c90b3b
2018-11-05 14:02:02 -08:00
Ignacio Olaciregui 1d8c28ab5c Remove unused variables (#22097)
Summary:
Fix unused variable ESLint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22097

Differential Revision: D12919249

Pulled By: TheSavior

fbshipit-source-id: f680fa7277c58cf685e70dfb911753a30fe01c1d
2018-11-04 10:41:46 -08:00
Spencer Ahrens 7021a78955 lint autofixes
Summary: `find js/react-native-github | xargs arc lint -a`

Reviewed By: yungsters

Differential Revision: D12902940

fbshipit-source-id: fd1158f7a0ec322cf89bc4f727943bff4600b399
2018-11-02 12:44:59 -07:00
Sam Goldman 8dcde09006 Deploy Flow v0.85 to xplat/js
Reviewed By: fishythefish

Differential Revision: D12898653

fbshipit-source-id: 2ed11ce569600fe4c12528939a350dd827c9a29a
2018-11-02 00:28:28 -07:00
Ignacio Olaciregui a6c7a764bf Fix linting issues (#22062)
Summary:
Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes.

I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input.
Pull Request resolved: https://github.com/facebook/react-native/pull/22062

Differential Revision: D12889447

Pulled By: TheSavior

fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50
2018-11-01 14:29:16 -07:00
Ignacio Olaciregui a7ee8f2e80 Remove undefined value on init cli command (#22045)
Summary:
Fixes `undefined` description message when running `react-native init --help` on an existing React Native project.
Pull Request resolved: https://github.com/facebook/react-native/pull/22045

Differential Revision: D12878956

Pulled By: TheSavior

fbshipit-source-id: ede329ca88a02013a6c2f75f1b762d89eacdb34f
2018-10-31 21:12:31 -07:00
Dulmandakh 01761f961f gradle repo priority (#22041)
Summary:
Changed gradle repo list to have consistent priority. mavenLocal is top priority because it requires manual setup, also won't conflict with other repos.
Pull Request resolved: https://github.com/facebook/react-native/pull/22041

Differential Revision: D12871549

Pulled By: hramos

fbshipit-source-id: c86730fde956dca77174c6454fdcb005a5eec8a9
2018-10-31 14:32:38 -07:00
Tim Yung 9ff9e28b94 RN: Missing Copyright Headers
Summary: Adds copyright headers to all files that are missing them.

Reviewed By: hramos

Differential Revision: D12837494

fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
2018-10-31 01:37:26 -07:00
Ely Alvarado e96d238799 Prepend passed sourceExts to default ones and pass them to metro (#21855)
Summary:
Fixes react-native start not using passed --sourceExts #21854
Pull Request resolved: https://github.com/facebook/react-native/pull/21855

Differential Revision: D12840358

Pulled By: rafeca

fbshipit-source-id: 4ee09341b5128d83274a39d8d01c13749efaa78b
2018-10-30 15:18:34 -07:00
Alexandre Kirszenberg 123ae9a885 Update the Delta/HMR format
Summary:
Makes the delta bundle data structures more consistent.

The changes are as follows:
* There are now two types of JSON bundles that can be downloaded from the delta endpoint. Base bundles (`Bundle` type), and Delta bundles (`DeltaBundle` type).
* The `reset` boolean is renamed to `base`.
* `pre` and `post` properties are now strings.
* Only `Bundle` can define `pre` and `post` properties.
* The `delta` property is renamed to `modules`.
* Deleted modules are now listed inside of the `deleted` property, which is only defined by `DeltaBundle`.

Reviewed By: mjesun

Differential Revision: D10446831

fbshipit-source-id: 40e229a2811d48950f0bad8dd341ece189089e9b
2018-10-29 08:58:30 -07:00
Avik Chaudhuri bb638dbcea @allow-large-files flow 0.84 xplat deploy
Reviewed By: samwgoldman

Differential Revision: D10851695

fbshipit-source-id: 951c628844bbbc7331d4e75f62485db88e5ba7c4
2018-10-25 18:16:30 -07:00
Sunny Luo 6b181d6733 Make google repo priority higher than jcenter (#21910)
Summary:
Fixes https://github.com/facebook/react-native/issues/21907#issuecomment-432319128 and prevent similar issues happening again
Pull Request resolved: https://github.com/facebook/react-native/pull/21910

Differential Revision: D10842256

Pulled By: hramos

fbshipit-source-id: f4abaa1c8ff8df6f0fb57b1bad745f4df9da7143
2018-10-24 14:45:21 -07:00
Michał Pierzchała 49c2669e90 use requireActual and requireMock from jest instead of require (#21849)
Summary:
A while back Jest introduced `jest.requireActual` and `jest.requireMock` which are aliases to `require.requireActual` and `require.requireMock`. We believe that users should use official Jest API and are planning to deprecate the latter.
Pull Request resolved: https://github.com/facebook/react-native/pull/21849

Differential Revision: D10448849

Pulled By: TheSavior

fbshipit-source-id: 34fffde97f48c26098c74ee222a56d99071703a6
2018-10-18 15:32:15 -07:00
Marc Horowitz 4f56c255dc Ensure HelloWorld xcodeproj template works
Summary: The only thing extra that we need to do is to include `JavaScriptCore.framework` inside the HelloWorld.xcodeproj file.

Reviewed By: hramos

Differential Revision: D9893035

fbshipit-source-id: 2a29d1fd645eafa2e09109ad14d09f812dfa2601
2018-10-18 01:06:25 -07:00
Ely Alvarado 71bffda65b Allow specifying iOS version for run-ios with simulator option (#19079)
Summary:
Fixes #19069

The --simulator option for the run-ios command now can take an optional
iOS version between parenthesis to further match the desired simulator.
This is useful if you have installed simulators for different iOS
versions and you want to run the app in an especific one. Example:

react-native run-ios --simulator "iPhone 6s (9.3)"

Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

Updated tests for the findMatchingSimulator function to include test cases specifying iOS version, and tested on the command line in my app to make sure it has the expected behavior.

[CLI] [ENHANCEMENT] [{/runIOS/findMatchingSimulator.js}] - run-ios command with the --simulator option now allows specifying the iOS version to run an specific simulator if you have multiple versions of the simulator installed. Example: `react-native run-ios --simulator "iPhone 6s (9.3)"`.
Pull Request resolved: https://github.com/facebook/react-native/pull/19079

Differential Revision: D10432487

Pulled By: hramos

fbshipit-source-id: efa50d798b79d83bfe357ee17967a56c7c003bee
2018-10-17 13:25:39 -07:00
Marshall Roch cb9e92564f @allow-large-files [flow] update to v0.83
Reviewed By: fishythefish

Differential Revision: D10362346

fbshipit-source-id: 0f4cc9977cfaa947e3b23112dd1cf482642e2319
2018-10-13 01:32:48 -07:00
Rafael Oleza 80f7bbea2e Remove sinon dependency
Summary:
This diff removes the `sinon` dependency from `metro` and `react-native-github`. It was only used in a handful of tests and having to learn and remember another mocking API just for these cases was not worth it IMO.

While doing the migration, most of the things that `sinon` provides can be done with `jest` in a very similar (and user friendly) way.

I've found, though, two small things that are more user friendly with `sinon`. I'm documenting them here because it may be worth adding them to jest:

With `sinon`:

```
stub.throws(new Error('foo'));
```

With `jest`:

```
mock.mockImplementation(() => {
  throw new Error('foo');
});
```

Taking into account that `jest` has a `mockRejectedValue` method for mocks (to return a rejected promise) I don't see any reason why it does not have a `mockThrowError` method.

With `sinon`:

```
expect(mock1.calledBefore(mock2)).toBeTruthy();
```

With `jest`:

```
expect(mock1.mock.invocationCallOrder[0]).toBeLessThan(
  mock2.mock.invocationCallOrder[0],
);
```

There's a community matcher that adds this matcher in `jest-extended`: https://github.com/jest-community/jest-extended#tohavebeencalledbefore, but we're not using `jest-extended` in `xplat/js`.

Reviewed By: jeanlauliac

Differential Revision: D10238331

fbshipit-source-id: 5441125b69596ad85bf8f56d203cfd20759bc358
2018-10-10 13:02:12 -07:00