Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ask to use recommended template #564

Merged
merged 34 commits into from
Jun 20, 2024
Merged

feat: ask to use recommended template #564

merged 34 commits into from
Jun 20, 2024

Conversation

atlj
Copy link
Collaborator

@atlj atlj commented Jun 12, 2024

Summary

This is an effort to implement a recommended template. See the Golden Template RFC for context.

This adds a new parameter called --with-recommended-options and the corresponding question to the CLI.
Here's how the CLI prompt looks like:
Screenshot 2024-06-12 at 17 07 18

This also adds the text (Recommended) at the end of the recommended options (View + Module with backward compats and Kotlin + Obj-c at the moment).

Test plan

A. Happy Path

  1. Run create-react-native-library and answer the mail address, git repo, etc. questions.
  2. Make sure the CLI asks Do you want to customize the library type and languages?.
  3. Select Use recommended defaults.
  4. Wait until the library is generated and make sure the library is a view + module, kotlin + objective-c library.

B. Pick Customize

  1. Run create-react-native-library and answer the mail address, git repo, etc. questions.
  2. Make sure the CLI asks Do you want to customize the library type and languages?.
  3. Select Customize.
  4. Make sure the Fabric view and Turbo module with backward compat option has the (Recommended) text.

C. Pass --with-recommended-options

  1. Run create-react-native-library with --with-recommended-options parameter.
  2. Make sure the library doesn't ask you about library or type selection.
  3. Make sure the generated library uses the golden template.

D. Pass --with-recommended-options with bad parameters

  1. Run create-react-native-library with --with-recommended-options and --type module-view-new.
  2. Make sure it emits an error.

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small comments

packages/create-react-native-library/src/index.ts Outdated Show resolved Hide resolved
packages/create-react-native-library/src/index.ts Outdated Show resolved Hide resolved
@atlj atlj requested a review from satya164 June 13, 2024 13:15
Copy link
Contributor

@szymonrybczak szymonrybczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally! 🚀

Base automatically changed from @atlj/golden-template to main June 20, 2024 10:15
@satya164 satya164 merged commit 71f3874 into main Jun 20, 2024
1 of 18 checks passed
@satya164 satya164 deleted the @atlj/golden-cli branch June 20, 2024 10:16
satya164 added a commit that referenced this pull request Jul 2, 2024
satya164 added a commit that referenced this pull request Jul 2, 2024
atlj added a commit that referenced this pull request Jul 19, 2024
This is an effort to implement a recommended template. See the [Golden
Template
RFC](react-native-community/discussions-and-proposals#721)
for context.

This adds a new parameter called `--with-recommended-options` and the
corresponding question to the CLI.
Here's how the CLI prompt looks like:
![Screenshot 2024-06-12 at 17 07
18](https://github.com/callstack/react-native-builder-bob/assets/23079646/9567f352-2e46-4073-a5b6-f30f1d97b49d)

This also adds the text `(Recommended)` at the end of the recommended
options (View + Module with backward compats and Kotlin + Obj-c at the
moment).

1. Run `create-react-native-library` and answer the mail address, git
repo, etc. questions.
2. Make sure the CLI asks `Do you want to customize the library type and
languages?`.
3. Select `Use recommended defaults`.
4. Wait until the library is generated and make sure the library is a
view + module, kotlin + objective-c library.

1. Run `create-react-native-library` and answer the mail address, git
repo, etc. questions.
2. Make sure the CLI asks `Do you want to customize the library type and
languages?`.
3. Select `Customize`.
4. Make sure the `Fabric view and Turbo module with backward compat`
option has the `(Recommended)` text.

1. Run `create-react-native-library` with `--with-recommended-options`
parameter.
2. Make sure the library doesn't ask you about library or type
selection.
3. Make sure the generated library uses the golden template.

1. Run `create-react-native-library` with `--with-recommended-options`
and `--type module-view-new`.
2. Make sure it emits an error.

---------

Co-authored-by: Satyajit Sahoo <[email protected]>
atlj added a commit that referenced this pull request Sep 17, 2024
This is an effort to implement a recommended template. See the [Golden
Template
RFC](react-native-community/discussions-and-proposals#721)
for context.

This adds a new parameter called `--with-recommended-options` and the
corresponding question to the CLI.
Here's how the CLI prompt looks like:
![Screenshot 2024-06-12 at 17 07
18](https://github.com/callstack/react-native-builder-bob/assets/23079646/9567f352-2e46-4073-a5b6-f30f1d97b49d)

This also adds the text `(Recommended)` at the end of the recommended
options (View + Module with backward compats and Kotlin + Obj-c at the
moment).

1. Run `create-react-native-library` and answer the mail address, git
repo, etc. questions.
2. Make sure the CLI asks `Do you want to customize the library type and
languages?`.
3. Select `Use recommended defaults`.
4. Wait until the library is generated and make sure the library is a
view + module, kotlin + objective-c library.

1. Run `create-react-native-library` and answer the mail address, git
repo, etc. questions.
2. Make sure the CLI asks `Do you want to customize the library type and
languages?`.
3. Select `Customize`.
4. Make sure the `Fabric view and Turbo module with backward compat`
option has the `(Recommended)` text.

1. Run `create-react-native-library` with `--with-recommended-options`
parameter.
2. Make sure the library doesn't ask you about library or type
selection.
3. Make sure the generated library uses the golden template.

1. Run `create-react-native-library` with `--with-recommended-options`
and `--type module-view-new`.
2. Make sure it emits an error.

---------

Co-authored-by: Satyajit Sahoo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants