* chore: make `cleanup` async
Using `rimraf.sync` can cause `ENOTEMPTY` and `EBUSY` errors on Windows.
This can make the Windows CI to fail randomly. Changing to the async
method defaults to autoretry 3 times and thus avoiding this issues.
* chore: jest config
* chore: e2e tests use sync cleanup
* chore: pr feedback
* chore: revert timeout
* Update __e2e__/default.test.ts
* Update __e2e__/default.test.ts
Co-authored-by: Michał Pierzchała <[email protected]>
* Moved disabling logger at the top when user used config command
* Added e2e tests for config command
* Added config command output snapshot
* Updated config test snapshot
* Added project root replacement helper
* Removed default terminal program from snapshots
* Moved tests to jest folder and removed additional snapshot
* less snapshots; use raw serializer
* strip unnecessary parts of the snapshot
* Added tmp directory to regex which replaces project root before snapshot
* Added slash before passing testFolder for project root replacing helper
* Fixed problem with windows paths replacing
* CR fixes
Co-authored-by: Michał Pierzchała <[email protected]>
* Change `packageName` to `projectName` & add `projectPath` argument
* Add a way to specify a custom project path to init the app on
* Force the `init` command to create the project path recursively
* Add test for providing the project path on init
* Throw error if custom project path doesn’t exist and can’t be created
* Fix type error on `customProjectPath`
* Create directory before running the test with custom project path
* Use `mkdirp` to create project folder & Use `inquirer` to prompt for a directory replace
* Specify `directory` as an option
* Handle custom directory path after react logo
* Check if `ios` folder exists before trying to open it
* Update `init` tests
* Add `directory` type
* Remove unused `inquirer` from `init` test
* Only remove the project folder if it didn’t exist before running `init`
* Remove correct directory if it didn’t exist before `init`
* simplify
* make directory an argument instead of a flag
* update descriptions
* fix test
* use --directory after all
* address feedback; remove version handling from createFromTemplate
* flip the default
Summary:
---------
Historically, Android and iOS platform were hardcoded inside CLI and provided by default. Then, other packages could export additional platforms on top of it.
React Native as a platform was hardcoded in Metro configuration (default platforms, default extensions) and inside link. That means all new features were always developed with these platforms in mind, leaving others behind. We often used private APIs, which made things more complicated for 3rd party platform developers.
From this PR on, there's no longer concept of an out-of-tree platform inside of the CLI. In a follow up PR to React Native, I am going to configure iOS and Android platforms inside React Native, just like React Native Windows exposes Windows platform.
This will open room for improvements and should make it even easier for the CLI to welcome other platforms.