feat: add --example none, --replace-directory, and --skip-git options#668
Closed
gabrielmoreira wants to merge 3 commits intocallstack:mainfrom
Closed
feat: add --example none, --replace-directory, and --skip-git options#668gabrielmoreira wants to merge 3 commits intocallstack:mainfrom
--example none, --replace-directory, and --skip-git options#668gabrielmoreira wants to merge 3 commits intocallstack:mainfrom
Conversation
--example none, --replace-directory, and --skip-git options to create-react-native-library--example none, --replace-directory, and --skip-git options to create-react-native-library
--example none, --replace-directory, and --skip-git options to create-react-native-library--example none, --replace-directory, and --skip-git options
Author
|
Hi folks! This PR is a small, focused change with three simple commits. If someone could take a quick look, I'd really appreciate it! |
satya164
requested changes
Dec 4, 2024
Member
satya164
left a comment
There was a problem hiding this comment.
Thanks for the PR. I'd like to make following changes:
- To match the convention for booleans, instead of
skip-git, add agitboolean option, and default it to true. To disable git, user would be able to pass--no-git - I'd remove
replace-directoryoption. I'd like to avoid additional option for this since you can just delete the folder beforehand in your code.
9ca6093 to
72a579c
Compare
0b45375 to
7799977
Compare
Member
|
Closing as it's stale |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-libraryto support a tooling (qdk) setup I'm working on.Summary of Changes:
--example noneoption: Allows creating libraries without an example app.--replace-directoryoption: Enables overwriting the template in an existing directory, using a similar option name as in the React Native CLI.--skip-gitoption: 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-libraryto 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 initoptions, 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.