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

docs: add npx prefix before react-native command #2035

Merged

Conversation

szymonrybczak
Copy link
Collaborator

Summary:

Closes #2031

There are people who just copy and pastes commands from docs, and it is not allowed to have globally installed react-native package, so I synced every command in docs, warning and errors - to have npx prefix before react-native for those who just copy and pastes commands into terminal :)

Test Plan:

Just read it :)

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

@github-actions github-actions bot added the docs Documentation change label Jul 26, 2023
@liamjones
Copy link
Contributor

Considering what you said in the issue comment; should these all be react-native@latest as well?

@szymonrybczak
Copy link
Collaborator Author

Hm, yeah I wrote that, but I was wondering is it actually correct and I think we should only add @latest to init command - cc. @thymikee @kelset @cortinico please correct me if I'm wrong. (I know that this was discussed somewhere, but unfortunately I can't find this discussion)

@kelset
Copy link
Member

kelset commented Jul 26, 2023

init should be the only command to run with npx, and yes it should have the @-latest

see this PR for more details -> facebook/react-native-website#3732

@szymonrybczak
Copy link
Collaborator Author

init should be the only command to run with npx, and yes it should have the @-latest

Okay, thanks for information. I don't know if it is doable but I think we should somehow "block" running any command besides init outside of project - because it doesn't make sense to allow that.

cortinico
cortinico previously approved these changes Jul 27, 2023
@cortinico
Copy link
Member

only add @latest to init command - cc. @thymikee @kelset @cortinico please correct me if I'm wrong.

That's correct

@szymonrybczak
Copy link
Collaborator Author

szymonrybczak commented Aug 8, 2023

Update: I added yarn before every usage of react-native for users that just copy and pastes and I'll create additional PR to block usage of commands outside of React Native app (besides init command).

@szymonrybczak
Copy link
Collaborator Author

init should be the only command to run with npx, and yes it should have the @-latest

After internal talk with @thymikee, actually what is the reason behind this we should only use npx with init command? If I understand correctly if we're using npx react-native ... in project it should select correct version.

The problem is that when we're saying to users to use either npm / yarn to run commands, in case of npm there's a problem because user needs to add command to scripts field in package.json ;/ With yarn it is easier, because we can just do yarn react-native ... cc. @kelset

@szymonrybczak
Copy link
Collaborator Author

Hey, so after internal discussion, the conclusion is:

  • it is safe to use npx inside project, it'll select correct version of CLI,
  • when initialising project with init command we should add @latest to make sure user is using the latest CLI, not the cached one.

I updated this PR to match above requirements. cc. @kelset @cortinico mind looking at changes? 🙏

@thymikee thymikee merged commit d6ef225 into react-native-community:main Aug 19, 2023
6 checks passed
@thymikee
Copy link
Member

@huntie this modifies README of metro plugin slightly, please make sure to adjust this in the core

huntie added a commit to huntie/react-native that referenced this pull request Aug 21, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: 23d01b687bff73861964d1b3a718583be829e686
huntie added a commit to huntie/react-native that referenced this pull request Aug 21, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: 8f92a125aaa6c9268b716fdfa7fac3191c844eca
huntie added a commit to huntie/react-native that referenced this pull request Aug 21, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: fbaadec847667cd7153f455a6f40107bc9377d17
huntie added a commit to huntie/react-native that referenced this pull request Aug 21, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: fd755855cddb58bfa9006c7930227bd54816465c
huntie added a commit to huntie/react-native that referenced this pull request Aug 21, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: 28082b7cfb52eb80318ae9205f947e3d819ff6cb
huntie added a commit to huntie/react-native that referenced this pull request Aug 22, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: 4b0dd056c0a5df5f6ca47da9f07dcc45ea41834f
huntie added a commit to huntie/react-native that referenced this pull request Aug 22, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: e4aa3fbe49c1c0f9a5e04a42e653d96aa8b5619a
huntie added a commit to huntie/react-native that referenced this pull request Aug 22, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: da761433fb62eb2ff82a43898aec501a73c40f32
huntie added a commit to huntie/react-native that referenced this pull request Aug 22, 2023
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: 692d245d02c5880b30fa49b885aa599ced06cfd1
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Aug 22, 2023
Summary:
Pull Request resolved: #39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: 987280996938af35b752b998969ea112a15deb57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub bug template assumes globally installed react-native package
6 participants