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

Update windows init commands to use --version flag for react-native version #13632

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
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
28 changes: 4 additions & 24 deletions .ado/templates/react-native-init-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,17 @@ steps:
configuration: Release

- ${{ if endsWith(parameters.template, '-app') }}:
- script: | # Change version of @react-native-community/template from 'nightly' to '$(reactNativeDevDependency)' - Windows #13446
npx --yes @react-native-community/cli@next init testcli --template @react-native-community/template@nightly
- script: |
npx --yes @react-native-community/cli@next init testcli --version $(reactNativeDevDependency)
displayName: Init new app project with @react-native-community/cli init
workingDirectory: $(Agent.BuildDirectory)

- script: | # Remove upgrade command - Windows #13446
call yarn install
call yarn add react@$(reactDevDependency)
call yarn add react-native@$(reactNativeDevDependency)
displayName: Fix app react-native dependency
workingDirectory: $(Agent.BuildDirectory)\testcli

- ${{ if and(endsWith(parameters.template, '-lib'), not(startsWith(parameters.template, 'old'))) }}:
- script: | # Change version of react-native from 'next' to '$(reactNativeDevDependency)' - Windows #13446
npx --yes create-react-native-library@latest --slug testcli --description testcli --author-name "React-Native-Windows Bot" --author-email [email protected] --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --type module-new --react-native-version next --example vanilla testcli
- script: |
npx --yes create-react-native-library@latest --slug testcli --description testcli --author-name "React-Native-Windows Bot" --author-email [email protected] --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --type module-new --react-native-version $(reactNativeDevDependency) --example vanilla testcli
displayName: Init new lib project with create-react-native-library
workingDirectory: $(Agent.BuildDirectory)

- script: | # Remove upgrade commands - Windows #13446
call yarn install
call yarn add react@$(reactDevDependency) --dev
call yarn add react-native@$(reactNativeDevDependency) --dev
displayName: Fix lib react-native dependency
workingDirectory: $(Agent.BuildDirectory)\testcli

- script: | # Remove upgrade commands - Windows #13446
call yarn install
call yarn add react@$(reactDevDependency)
call yarn add react-native@$(reactNativeDevDependency)
displayName: Fix example app react-native dependency
workingDirectory: $(Agent.BuildDirectory)\testcli\example
- ${{ elseif and(endsWith(parameters.template, '-lib'), startsWith(parameters.template, 'old')) }}:
- script: |
npx --yes [email protected] --package-name "testcli" testcli
Expand Down