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

Upgrade sample readmes with new CLI commnads #951

Merged
merged 7 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/Calculator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ npm install
Once you have all of the dependencies installed, you can run the application with the following command:

```cmd
npx react-native run-windows
npx @react-native-coummunity/cli@latest run-windows
jonthysell marked this conversation as resolved.
Show resolved Hide resolved
```

The command will:
Expand Down
7 changes: 4 additions & 3 deletions samples/Calculator/cppwinrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ To upgrade this sample to the latest version of RNW:
```
3. Create a new React Native app and change version to version you want to upgrade to:
```cmd
npx react-native init Calculator --template "react-native@^0.72.0"
npx @react-native-community/cli@latest init Calculator --template @react-native-community/template@latest
```
4. Add Windows support:
```cmd
cd Calculator
npx react-native-windows-init --version latest --overwrite
yarn add react-native-windows@latest
npx @react-native-community/cli@latest init-windows --template old/uwp-cpp-app --overwrite
```
5. Rename the folder to cppwinrt
```
Expand All @@ -45,7 +46,7 @@ To upgrade this sample to the latest version of RNW:
```
7. Verify the new app builds and runs:
```
npx react-native run-windows
npx @react-native-coummunity/cli@latest run-windows
jonthysell marked this conversation as resolved.
Show resolved Hide resolved
```
8. Look at windows/Calculators/Package.appxmanifast and change the publisher name to "CN=React Native Windows Sample".
9. Update this readme with the new major version at the top.
7 changes: 4 additions & 3 deletions samples/Calculator/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ To upgrade this sample to the latest version of RNW:
```
3. Create a new React Native app and change version to version you want to upgrade to:
```cmd
npx react-native init Calculator --template "react-native@^0.72.0"
npx @react-native-community/cli@latest init Calculator --template @react-native-community/template@latest
```
4. Add Windows support:
```cmd
cd Calculator
npx react-native-windows-init --version latest --overwrite --language cs
yarn add react-native-windows@latest
npx @react-native-community/cli@latest init-windows --template old/uwp-cs-app --overwrite
```
5. Rename the folder to csharp
```
Expand All @@ -45,7 +46,7 @@ To upgrade this sample to the latest version of RNW:
```
7. Verify the new app builds and runs:
```
npx react-native run-windows
npx @react-native-coummunity/cli@latest run-windows
jonthysell marked this conversation as resolved.
Show resolved Hide resolved
```
8. Look at windows/Calculator/Package.appxmanifast and change the publisher name to "CN=React Native Windows Sample".
9. Update this readme with the new major version at the top.
2 changes: 1 addition & 1 deletion samples/NativeModuleSample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ npm install
Once you have all of the dependencies installed, you can build either module with following command (again, run within either the `cppwinrt` or `csharp` folder):

```cmd
npx react-native run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.vsproj"
npx @react-native-coummunity/cli@latest run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.vsproj"
jonthysell marked this conversation as resolved.
Show resolved Hide resolved
```

### Upgrade
Expand Down
7 changes: 5 additions & 2 deletions samples/NativeModuleSample/cppwinrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ To upgrade this sample to the latest version of RNW:
4. Upgrade `react-native` to that version:
```cmd
yarn upgrade react-native@VERSIONFROMLASTSTEP
5. Upgrade `react-native-windows` to the latest version:
```cmd
yarn upgrade react-native-windows@latest
```
4. Re-run the RNW CLI:
```cmd
npx react-native-windows-init --version latest --language cpp --projectType lib --overwrite
npx @react-native-community/cli@latest init-windows --template old/uwp-cpp-lib --overwrite
```
5. Restore these original native header files (representing the native module samples):
```
Expand Down Expand Up @@ -121,6 +124,6 @@ To upgrade this sample to the latest version of RNW:
```
8. Verify the updated sample builds:
```cmd
npx react-native run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.vcxproj"
npx @react-native-coummunity/cli@latest run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.vcxproj"
jonthysell marked this conversation as resolved.
Show resolved Hide resolved
```
9. Update the main readme with the new major version at the top.
8 changes: 6 additions & 2 deletions samples/NativeModuleSample/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ To upgrade this sample to the latest version of RNW:
```cmd
yarn upgrade react-native@VERSIONFROMLASTSTEP
```
5. Upgrade `react-native-windows` to the latest version:
```cmd
yarn upgrade react-native-windows@latest
```
4. Re-run the RNW CLI:
```cmd
npx react-native-windows-init --version latest --language cs --projectType lib --overwrite
npx @react-native-community/cli@latest init-windows --template old/uwp-cs-lib --overwrite
```
5. Restore these original native files (representing the native module samples):
```
Expand Down Expand Up @@ -80,6 +84,6 @@ To upgrade this sample to the latest version of RNW:
```
8. Verify the updated sample builds:
```cmd
npx react-native run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.csproj"
npx @react-native-coummunity/cli@latest run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.csproj"
jonthysell marked this conversation as resolved.
Show resolved Hide resolved
```
9. Update the main readme with the new major version at the top.
2 changes: 1 addition & 1 deletion samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ When new major versions of RNW are released (out of preview), the sample apps in

1. Delete the existing sample app folder.
2. Run the React Native CLI to create a new sample app with the same name.
3. Run the React Native Windows CLI to add Windows support.
3. Add RNW and run the RNW CLI to add Windows support.
4. Restore the original app code to override the "new project" app code.
5. Verify that the app still builds and runs.

Expand Down
Loading