Commit Graph
30 Commits
Author SHA1 Message Date
Michał Pierzchała 07a976127d fix: linking assets on Android (#231) 2019-03-14 10:32:34 +01:00
Michał Pierzchała 5564634044 chore: simplify commander/minimist usage (#209)
* chore: simplify commander/minimist usage

* feedback

* remove extra parse

* add options back

* rephrase comment

* remove excess whitespace
2019-03-11 16:28:05 +01:00
Drapich Piotr 885f2c28d4 chore: use @react-native-community/eslint-config (#205)
Summary:
---------

I changed @callstack/eslint-config to @react-native-community/eslint-config and fixed all lint issues.


Test Plan:
----------

Green CI
2019-03-05 20:52:51 +01:00
Michał Pierzchała 041b7d789e chore: bump flow to 0.94 (#200)
Summary:
---------

It's usually better to be on the latest available :D 

Test Plan:
----------

Green CI
2019-03-04 18:11:24 +01:00
Michał Pierzchała 06036f5473 feat: improve upgrade to use rn-diff-purge (#176)
Summary:
---------

Upgrading experience is a bit harsh for React Native. We either need to install global `react-native-git-upgrade` and try that, or patch projects manually using tools like [`rn-diff-purge`](https://github.com/pvinis/rn-diff-purge).

Since `rn-diff-purge` gets some recognition in RN core and website and it has an automated path of applying patches, I thought that it would be nice to use it in our `upgrade` command.

What the command does now:

1. Determine version to upgrade and run some validation checks
1. Fetch patch between current version and specified from [`rn-diff-purge`](https://github.com/pvinis/rn-diff-purge#version-changes) and rename diff app to current project name
	1. If the patch is empty, install RN and its peer deps
	1. Exit with success
1. Prepare for 3-way merge by creating temporary patch file and adding new git remote
1. Apply patch with a fallback to 3-way merge, exclude `package.json` because it will always be failing
1. Install RN and its peer deps
1. Cleanup temporary files and git remote
1. Exit with success

This PR is technically breaking change, so I'm cool with introducing a temporary new command or put old one behind a different name.

Test Plan:
----------

Added tests with various scenarios. 

Successfully upgrading to specified version:

<img width="648" alt="screenshot 2019-02-16 at 22 22 24" src="https://user-images.githubusercontent.com/5106466/52905364-75a84f00-3239-11e9-9c3a-d3612d194cbf.png">

Failed to fetch a non-existent diff:

<img width="680" alt="screenshot 2019-02-16 at 22 22 49" src="https://user-images.githubusercontent.com/5106466/52905365-75a84f00-3239-11e9-9e92-6fd410271151.png">

No upgrade needed:

<img width="904" alt="screenshot 2019-02-16 at 22 33 27" src="https://user-images.githubusercontent.com/5106466/52905501-4abefa80-323b-11e9-9fec-2e6a44ff09a4.png">

Dependency mismatch:

<img width="988" alt="screenshot 2019-02-16 at 22 36 04" src="https://user-images.githubusercontent.com/5106466/52905502-4abefa80-323b-11e9-92db-ed0d661e493c.png">

Upgrading to older version:

<img width="556" alt="screenshot 2019-02-16 at 22 39 50" src="https://user-images.githubusercontent.com/5106466/52905533-cfaa1400-323b-11e9-9685-d45e24cf0d97.png">
2019-02-22 16:30:24 +01:00
Mike Grabowski 83d6c78cda chore: Update Yarn lock 2019-02-13 15:00:27 +01:00
Michał Pierzchała 986fc35384 chore: remove npmlog dependency (#149) 2019-02-04 14:26:02 +01:00
Mike Grabowski 65eff59246 build: update xcode version to 2.0.0 (#147) 2019-02-04 13:16:37 +01:00
Mike Grabowski 2a180e0231 feat: allow setting different React Native path (#144)
* feat: allow setting different React Native path

* fix: remaining flow errors

* feat: remove dep on React Native

* chore: ignore error from init

* Update packages/cli/src/cliEntry.js

Co-Authored-By: grabbou <[email protected]>

* chore: explicitly disable eslint
2019-02-04 13:12:27 +01:00
Michał Pierzchała 56e890dc7f fix: normalize paths for Gradle on Windows (#130)
Summary:
---------

Fixes #129


Test Plan:
----------

I added a test that simulates Windows on POSIX machines, because we don't run our tests on Windows.
@cherniavskii can you test this on a Windows machine?
2019-01-28 17:36:18 +01:00
Michał Pierzchała fa3ae496c5 chore: upgrade Jest to v24 (#127)
Summary:
---------

Jest 24 is out at last!


Test Plan:
----------

Green
2019-01-25 17:04:10 +01:00
K. P. Sroka 1c181095c2 feat: Removes calls to process.pwd() in favor of using context.root (#116)
* feat: use ctx.root instead of process.cwd() in several commands

* test: upgrading patch version of jest to avoid worker system bug
2019-01-23 19:59:16 +01:00
Michał Pierzchała 61bc2882f5 chore: setup monorepo with Lerna (#109)
* chore: setup monorepo with lerna

* chore: move flow to root

* fix: lint

* chore: add watch command
2019-01-23 18:04:01 +01:00
Michał Pierzchała 3aac9df01c feat: build before publishing (#104)
* feat: build before publishing

* fix(tests): use jest.doMock instead of setMock

* chore: rename local-cli -> cli
2019-01-21 13:40:58 +01:00
Michał Pierzchała abc00a372b chore: ease work with monorepo with jest packages and global Flow 2019-01-11 17:37:25 +01:00
Kacper Wiszczuk c0780b8cab docs: Add CONTIBUTING.md (#69)
This PR includes:
- [x] - Adding `CONTRIBUTING.md`
- [x] - Setting up `husky` with `commitlint` to force meaningul commit messages

Fixes #62
2019-01-11 13:28:18 +01:00
Kacper Wiszczuk 9eba0f767e chore: Update yarn.lock (#66) 2019-01-09 18:23:36 +01:00
Mike Grabowski 861947180c Bump Metro dependency, use new Metro Transformer and remove old packages (#55) 2018-12-19 20:25:31 +01:00
Mike Grabowski 08962ecfc9 Add ESLint (#52)
* Fix skipped test for add file to project

* Add ESLint config and fix all the errors

* Use proper lint command

* Function is required here

* This file is unused

* Remove extraneous files and move utils to correct folders

* Add strict mode to global-cli again and use preset for other places

* Revert changes to debugger-ui for browser compatibility

* Revert changes in global-cli, package should run on older Node too
2018-12-19 17:49:48 +01:00
Mike Grabowski f344c9c4c9 Decouple Metro config from CLI config (#30)
* Initial commit - delete Metro-related config

* Rewrite of the config, part 2

* Finish adopting link & unlink to new config format

* Rewrite 'server' command and the way we load config

* Fix errors and make server run

* Use require.resolve

* Simplify runServer code

* Updates to the config

* Remove duplicate platforms

* Use real and unified project root

* Fix projectRoots

* Unifiy root paths

* Remove projectRoot from type

* Leave two todos for tomororw

* Use projectRoot to read the root

* Fix projectRoot and implement config again

* Improve Metro config

* Fix configuration again

* Fix remaining Flow issues inside bundle

* Fix two failing test suites

* Fix getDependencyConfig tests and use snapshots

* Remove console

* Fix remaining Jest tests

* Remove console.log

* Fix issues with link/unlink tested in production

* Add legacy config to avoid breaking changes

* Fix a typo

* Exclude React Native CLI from being linked

* Remove console.log from production code

* Update getCommands.js

* Update loadMetroConfig.js

* Update package.json

* Update package.json
2018-12-15 10:49:21 +01:00
Mike Grabowski f0576af072 Bump Metro and Flow dependencies 2018-12-03 14:06:41 +01:00
Michał Pierzchała 32c34e9051 fix: move @babel/core to deps (#23) 2018-11-09 06:50:16 -08:00
Mike Grabowski c9828efeb3 Remove extraneous plugins 2018-11-09 11:37:27 +01:00
Mike Grabowski 24afeda0d6 Small clean up and fix main start up script 2018-11-09 11:20:48 +01: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 b354d4f515 Make Flow pass 2018-11-08 15:41:07 +01:00
Mike Grabowski 9e6d069677 Make Jest tests run 2018-11-07 14:46:26 +01:00
Kacper Wiszczuk b02fb8232e Make local-cli run 2018-11-06 12:13:01 +01:00