feat: add --example none
, --replace-directory
, and --skip-git
options
#668
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! First, thank you for the work on Bob and create-react-native-library.
I've made a few modifications on
create-react-native-library
to support a tooling (qdk) setup I'm working on.Summary of Changes:
--example none
option: Allows creating libraries without an example app.--replace-directory
option: Enables overwriting the template in an existing directory, using a similar option name as in the React Native CLI.--skip-git
option: Prevents any git commands from running during template creation, also following a naming convention similar to the React Native CLI.Context:
In my tool (qdk), I have templates for different project structures, and one of these templates uses
create-react-native-library
to set up a React Native library project. The goal is to generate only the library code, without an example app, without interfering with the project git, and with the flexibility to overwrite an existing directory if it already contains some files.Thanks for considering these additions!
P.S.: By the way, the options added here follow a similar naming convention to
npx @react-native-community/cli init
options, for consistency.I also considered contributing an optional parameter to fix the version of
npx @react-native-community/cli@<<VERSION>> init
, but for my case, not creating the example app was more beneficial. The vanilla example was giving me errors during generation, even though it was working a few days ago. Fixing the version of create-react-library wasn’t enough.Additionally, I thought about adding an option to specify the package manager instead of trying to detect it. However, this would require more testing with various package managers, so I decided to hold off on that for now.