[WIP] Change require to imports #145
[WIP] Change require to imports #145Trancever wants to merge 3 commits intoreact-native-community:masterfrom
Conversation
thymikee
left a comment
There was a problem hiding this comment.
Thanks for doing this @Trancever! Apart from fixing tests, there's still a bunch of issues to address. But grat work overall :)
|
|
||
| module.exports = { | ||
| export default { | ||
| getAndroidAssetSuffix, |
There was a problem hiding this comment.
later on we can think about using named exports instead of this
| import childProcess from 'child_process'; | ||
| import path from 'path'; | ||
| import chalk from 'chalk'; | ||
| import helpers from './helpers'; |
There was a problem hiding this comment.
we run scripts through regular node, without ESM loader, so please revert that as it won't work now
| import child_process from 'child_process'; | ||
| import chalk from 'chalk'; | ||
| import prompt from 'prompt'; | ||
| import semver from 'semver'; |
There was a problem hiding this comment.
global-cli is not compiled with Babel, please revert changes here for now.
There was a problem hiding this comment.
And it's going to be deprecated anyway, so I'll just skip it.
| } | ||
|
|
||
| module.exports = cli; | ||
| export default cli; |
There was a problem hiding this comment.
please revert this export change as it breaks our public API for those using require syntax.
Instead of doing:
const rncli = require('@react-native-community/cli');They would have to do:
const rncli = require('@react-native-community/cli').default;because of Babel interop. The API however won't change for folks using import syntax, because it has this check built-in (both in Babel and TS afaik)
|
Thanks @thymikee for review. Will try to fix those issues as soon as possible |
|
@Trancever Let's compare our branches. My tests are all passing... |
|
@sidferreira Nice! Can you open PR with your changes? I think we should proceed with your version if you have it already working. |
|
Added as #150 |
Summary:
Fix for #114
Test Plan:
This is still work in progress since many tests are failing.