diff --git a/.ado/continuous.yml b/.ado/continuous.yml index d2bfb9de04..fd5988b169 100644 --- a/.ado/continuous.yml +++ b/.ado/continuous.yml @@ -2,11 +2,13 @@ name: RNW CI $(Date:yyyyMMdd).$(Rev:r) schedules: - cron: "0 11 * * *" # 11AM Daily UTC (3AM Daily PST) - displayName: Nightly master publish build + displayName: Nightly main branch publish build branches: include: + - main - master + trigger: none # will disable CI builds entirely pr: none diff --git a/.ado/integrate-rn.yaml b/.ado/integrate-rn.yaml index d951457d1a..63e8ddedd5 100644 --- a/.ado/integrate-rn.yaml +++ b/.ado/integrate-rn.yaml @@ -36,7 +36,7 @@ jobs: - script: yarn build displayName: yarn build - - script: git checkout -b integrate-${{ parameters.reactNativeVersion }} origin/master + - script: git checkout -b integrate-${{ parameters.reactNativeVersion }} origin/main displayName: Create a new branch - script: yarn integrate-rn ${{ parameters.reactNativeVersion }} --reportPath "$(Agent.TempDirectory)\integration-report.md" --color @@ -105,6 +105,6 @@ jobs: - powershell: | $headers = @{'Accept'='application/vnd.github.v3+json'; 'Authorization'='Token $(githubAuthToken)'} - $body = '{"head": "integrate-${{ parameters.reactNativeVersion }}", "base": "master", "title": "${{ parameters.commitTitle}}"}' + $body = '{"head": "integrate-${{ parameters.reactNativeVersion }}", "base": "main", "title": "${{ parameters.commitTitle}}"}' Invoke-WebRequest -Method Post -Headers $headers -Body $body https://api.github.com/repos/microsoft/react-native-windows/pulls displayName: Create PR diff --git a/.ado/publish.yml b/.ado/publish.yml index 7817a88325..ec9fa7e019 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -88,12 +88,12 @@ jobs: - template: templates/component-governance.yml - script: npx --no-install beachball publish $(SkipNpmPublishArgs) $(SkipGitPushPublishArgs) --branch origin/$(Build.SourceBranchName) -n $(npmAuthToken) -yes -m "applying package updates ***NO_CI***" --bump-deps --access public --no-git-tags - displayName: Beachball Publish (Master Branch) - condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master')) + displayName: Beachball Publish (Main Branch) + condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'main')) - script: npx --no-install beachball publish $(SkipNpmPublishArgs) $(SkipGitPushPublishArgs) --branch origin/$(Build.SourceBranchName) -n $(npmAuthToken) -yes -m "applying package updates ***NO_CI***" --bump-deps --access public displayName: Beachball Publish (Stable Branch) - condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'master')) + condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main')) # Beachball reverts to local state after publish, but we want the updates it added - script: git pull origin ${{ variables['Build.SourceBranchName'] }} @@ -101,7 +101,7 @@ jobs: - script: npx --ignore-existing @rnw-scripts/create-github-releases --yes --authToken $(githubAuthToken) displayName: Create GitHub Releases for New Tags (Stable Branch) - condition: and(succeeded(), ${{ not(parameters.skipGitPush) }}, ${{ ne(variables['Build.SourceBranchName'], 'master') }} ) + condition: and(succeeded(), ${{ not(parameters.skipGitPush) }}, ${{ ne(variables['Build.SourceBranchName'], 'main') }} ) - template: templates/set-version-vars.yml parameters: @@ -111,7 +111,7 @@ jobs: - job: DeployBotCoordinator displayName: Deploy @rnw-bots/coordinator - condition: eq(variables['Build.SourceBranchName'], 'master') + condition: eq(variables['Build.SourceBranchName'], 'main') dependsOn: RnwNpmPublish pool: vmImage: $(VmImage) diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index 19d265d70b..cfec6a8c79 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -3,6 +3,7 @@ name: $(Date:yyyyMMdd).$(Rev:r) trigger: none # will disable CI builds entirely pr: + - main - master - "*-stable" diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 6d35badc31..ed64c30fe5 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -9,7 +9,7 @@ assignees: '' diff --git a/README.md b/README.md index e116bcd441..c802790e1a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- + React Native for Windows is released under the MIT license. @@ -16,7 +16,7 @@

-![Hero Image with Logo](https://github.com/microsoft/react-native-windows/raw/master/.github/hero2.png) +![Hero Image with Logo](https://github.com/microsoft/react-native-windows/raw/main/.github/hero2.png) > See the official [React Native website](https://reactnative.dev/) for an introduction to React Native. @@ -54,7 +54,7 @@ Search the [existing issues](https://github.com/microsoft/react-native-windows/i - Ensure the [appropriate template](https://github.com/microsoft/react-native-windows/issues/new/choose) is used when filing your issue(s). ## Contributing -See [Contributing guidelines](https://github.com/microsoft/react-native-windows/blob/master/docs/contributing.md) for how to setup your fork of the repo and start a PR to contribute to React Native for Windows. +See [Contributing guidelines](https://github.com/microsoft/react-native-windows/blob/main/docs/contributing.md) for how to setup your fork of the repo and start a PR to contribute to React Native for Windows. [good first issue](https://github.com/microsoft/react-native-windows/labels/good%20first%20issue) and [help wanted](https://github.com/microsoft/react-native-windows/labels/help%20wanted) are great starting points for PRs. diff --git a/change/@rnw-scripts-promote-release-88b19d76-15eb-4c7f-9900-85ae25f4b5df.json b/change/@rnw-scripts-promote-release-88b19d76-15eb-4c7f-9900-85ae25f4b5df.json new file mode 100644 index 0000000000..960155513c --- /dev/null +++ b/change/@rnw-scripts-promote-release-88b19d76-15eb-4c7f-9900-85ae25f4b5df.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Prepare files for default branch rename", + "packageName": "@rnw-scripts/promote-release", + "email": "dannyvv@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-134e4457-80ac-403b-bfa3-6631ba19f340.json b/change/react-native-windows-134e4457-80ac-403b-bfa3-6631ba19f340.json new file mode 100644 index 0000000000..9f86d45adb --- /dev/null +++ b/change/react-native-windows-134e4457-80ac-403b-bfa3-6631ba19f340.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Prepare files for default branch rename", + "packageName": "react-native-windows", + "email": "dannyvv@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/docs/branch-setup.md b/docs/branch-setup.md index 61be77ac9f..2d71868dcb 100644 --- a/docs/branch-setup.md +++ b/docs/branch-setup.md @@ -51,27 +51,27 @@ Before starting to contribute changes, please setup your upstream repository to ## Making code changes and creating a pull request -Create a branch from your fork and start making the code changes. We recommend using [**SourceTree**](https://www.sourcetreeapp.com/) for working in your repo. Once you are happy with the changes, and want to merge them to the main **microsoft/react-native-windows** project, create a pull request from your branch directly to "microsoft/react-native-windows master". +Create a branch from your fork and start making the code changes. We recommend using [**SourceTree**](https://www.sourcetreeapp.com/) for working in your repo. Once you are happy with the changes, and want to merge them to the main **microsoft/react-native-windows** project, create a pull request from your branch directly to "microsoft/react-native-windows main". Members on the **microsoft/react-native-windows** core team will help merge your changes. -## Merging upstream master into your fork master +## Merging upstream main branch into your fork's main branch -From time to time, your fork will get out of sync with the upstream remote. Use the following commands to get the master branch of your fork up to date. +From time to time, your fork will get out of sync with the upstream remote. Use the following commands to get the main branch of your fork up to date. ``` > git fetch upstream -> git checkout master -> git pull upstream master +> git checkout main +> git pull upstream main > git push ``` -### Merging upstream master into your current branch +### Merging upstream main into your current branch Use these commands instead if you would like to update your *current* branch in your fork from the upstream remote. ``` > git fetch upstream -> git pull upstream master +> git pull upstream main > git push ``` diff --git a/docs/contributing.md b/docs/contributing.md index e0ce40aa9d..07708db835 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -4,7 +4,7 @@ If this is your first time, below are some more detailed steps for getting your ### Setting up your branch for changes -For each bug or task you complete, it is recommended that you start with a fresh branch. If you have any lingering changes in your current branch that you want to save, go ahead and commit them. If you are just beginning, then you are good to go. On github, navigate to your repository which should be forked from microsoft/react-native-windows. If you haven't already created a fork, follow the steps in **[Git branch Setup](branch-setup.md)**. Above the list of files is a dropdown that should say master. Use the dropdown to create a new branch and name is according to what you will be working on. (I.e. DropdownHighlight, CleanUpExamples, etc). Now you have created a new branch. +For each bug or task you complete, it is recommended that you start with a fresh branch. If you have any lingering changes in your current branch that you want to save, go ahead and commit them. If you are just beginning, then you are good to go. On github, navigate to your repository which should be forked from microsoft/react-native-windows. If you haven't already created a fork, follow the steps in **[Git branch Setup](branch-setup.md)**. Above the list of files is a dropdown that should say 'main'. Use the dropdown to create a new branch and name is according to what you will be working on. (I.e. DropdownHighlight, CleanUpExamples, etc). Now you have created a new branch. **SourceTree:** If you are using SourceTree you will want your branch to show up in SourceTree so you can commit changes to your branch. It takes time for it to show up automatically, so you can make it show by running `git remote update origin –prune` in your command prompt from the root. Once you see your new branch in SourceTree under Remotes on the left navigation pane, double click on your branch to check it out locally. A dialog will come up and the default settings should be fine, click Ok. @@ -35,7 +35,7 @@ Run `yarn format` in the repository's root directory if you're making C++ change Run `yarn lint:fix` if making JS/TS changes. ### Provide changelog information -Run `yarn change --branch upstream/master` in the root of the repo. +Run `yarn change --branch upstream/main` in the root of the repo. ### Creating a Pull Request diff --git a/docs/e2e-testing.md b/docs/e2e-testing.md index 5d2da10b12..bd65a7163c 100644 --- a/docs/e2e-testing.md +++ b/docs/e2e-testing.md @@ -70,7 +70,7 @@ If you have access to the AzureDevOps pipeline you'll be able to see test failur Here are the artifacts that are produced during the build: - error screenshots of the app when a test failed - test run XML - this contains some information like the name of the wdio test that failed and the JS stack -- tree dump outputs - you can compare these to the masters to see if there is a the difference responsible for the test failing. +- tree dump outputs - you can compare these to the output of the main branch to see if there is a the difference responsible for the test failing. - crash dumps of the e2e test app (ReactUWPTestApp) You can access these by going to the AzureDevOps run for your PR and clicking on the artifacts link: @@ -83,7 +83,7 @@ Then you can access crash dumps under the `ReactUWPTestAppTreeDump\CrashDumps` f You can get the symbols from the `appxsym` (just download it and rename it to `.zip`): ![SymbolsPackage](img/e2e-syms.png) - The `ReactUWPTestAppTreeDump` folder will also contain any tree dump outputs that were produced that did not match the masters. + The `ReactUWPTestAppTreeDump` folder will also contain any tree dump outputs that were produced that did not match the main branch. ## Architecture diff --git a/docs/managedCodeGen.md b/docs/managedCodeGen.md index 28f21fef02..2f33659fbc 100644 --- a/docs/managedCodeGen.md +++ b/docs/managedCodeGen.md @@ -9,7 +9,7 @@ In earlier versions of react-native-windows managed modules registered themselve Doing it at build time should result in developers seeing all errors up front, rather than only seeing errors for the code being tested. And the runtime cost is not incurred every single time. ## How it works -This change adds a new targets file that is imported from the [CSharpLib.targets](https://github.com/microsoft/react-native-windows/blob/master/vnext/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets) and [CSharpApp.targets](https://github.com/microsoft/react-native-windows/blob/master/vnext/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets). That will enable the codegen for managed projects. +This change adds a new targets file that is imported from the [CSharpLib.targets](https://github.com/microsoft/react-native-windows/blob/main/vnext/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets) and [CSharpApp.targets](https://github.com/microsoft/react-native-windows/blob/main/vnext/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets). That will enable the codegen for managed projects. Those targets will collect all the C# source files, assembly references and defines from the app (or library) and invoke the CodeGen tool to generate a C# file. This is very similar to how the translation of Xaml to csharp code behind files works. The generated C# file will contain a class called `ReactPackageProvider` in the default namespace of your project. The generate class implements `Microsoft.ReactNative.IReactPackageProvider`. The implementation of the generated class will: @@ -27,7 +27,7 @@ When building the apps that are checked in to our repo for testing, we have to r ## Turning on/off Currently the feature is behind an MSBuild property `$(ReactNativeCodeGenEnabled)`. -The default at the moment is false, it is only turned on for a single project for now which is the [SampleLibraryCS.csproj](https://github.com/microsoft/react-native-windows/blob/master/packages/sample-apps/windows/SampleLibraryCS/SampleLibraryCS.csproj) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. +The default at the moment is false, it is only turned on for a single project for now which is the [SampleLibraryCS.csproj](https://github.com/microsoft/react-native-windows/blob/main/packages/sample-apps/windows/SampleLibraryCS/SampleLibraryCS.csproj) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. ## MSBuild/NuGet Complications MSBuild and NuGet spent a long time fighting me in mixing a NetCoreApp3.1 executable and WinRT apps in the same solution and the same build. ProjectReferences cannot be used so I had to use the `` task directly in the targets and it was tricky making it build from both the customer apps as well as our main build solution and unittest (Microsoft.ReactNative.sln). In the end there are a few hacks in place to make this work. diff --git a/docs/monorepo.md b/docs/monorepo.md index 5581bcf730..9162e1bb75 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -1,11 +1,11 @@ # Monorepo details for react-native-windows -react-native-windows is a monorepo with several [packages](https://github.com/microsoft/react-native-windows/tree/master/packages) and uses monorepo management tools to install, build, and publish. This page is all about what tools we use to manage this monorepo and some technical details, aimed at folks who are contributing to react-native-windows. +react-native-windows is a monorepo with several [packages](https://github.com/microsoft/react-native-windows/tree/main/packages) and uses monorepo management tools to install, build, and publish. This page is all about what tools we use to manage this monorepo and some technical details, aimed at folks who are contributing to react-native-windows. # Installation of npm dependencies -react-native-windows uses [yarn workspaces](https://legacy.yarnpkg.com/en/docs/workspaces/) to install all react-native-windows npm dependencies. See "workspaces" prop inside [package.json](https://github.com/microsoft/react-native-windows/blob/master/package.json). +react-native-windows uses [yarn workspaces](https://legacy.yarnpkg.com/en/docs/workspaces/) to install all react-native-windows npm dependencies. See "workspaces" prop inside [package.json](https://github.com/microsoft/react-native-windows/blob/main/package.json). # Lage Build -react-native-windows uses [lage](https://microsoft.github.io/lage/) to build all the "non-native" parts of react-native-windows. See "scripts" prop inside [package.json](https://github.com/microsoft/react-native-windows/blob/master/package.json). Also see [laga.config.js](https://github.com/microsoft/react-native-windows/blob/master/lage.config.js). +react-native-windows uses [lage](https://microsoft.github.io/lage/) to build all the "non-native" parts of react-native-windows. See "scripts" prop inside [package.json](https://github.com/microsoft/react-native-windows/blob/main/package.json). Also see [laga.config.js](https://github.com/microsoft/react-native-windows/blob/main/lage.config.js). # Beachball publishing TODO - add details diff --git a/packages/@rnw-scripts/promote-release/src/promoteRelease.ts b/packages/@rnw-scripts/promote-release/src/promoteRelease.ts index c2b3981f2f..19d245894e 100644 --- a/packages/@rnw-scripts/promote-release/src/promoteRelease.ts +++ b/packages/@rnw-scripts/promote-release/src/promoteRelease.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. * * This script automatically changes files to prepare to move a release from - * one stage to another. E.g. going from a release in our master branch to a + * one stage to another. E.g. going from a release in our main branch to a * preview release in a stable branch, promoting a preview to latest, or moving * latest to legacy. * @@ -53,8 +53,8 @@ type ReleaseType = 'preview' | 'latest' | 'legacy'; console.log('Updating package versions...'); await updatePackageVersions(`${argv.rnVersion}.0-preview.0`); - console.log('Setting packages published from master as private...'); - await markMasterPackagesPrivate(); + console.log('Setting packages published from main branch as private...'); + await markMainBranchPackagesPrivate(); } console.log('Committing changes...'); @@ -209,16 +209,16 @@ async function updatePackageVersions(version: string) { } /** - * Sets all packages that are published from our master branch as private, to + * Sets all packages that are published from our main branch as private, to * avoid bumping and publishing them from our stable branch. Beachball will * ensure we do not depend on any of these in our published packages. */ -async function markMasterPackagesPrivate() { - const masterPublishedPackages = await enumerateRepoPackages( +async function markMainBranchPackagesPrivate() { + const mainBranchPublishedPackages = await enumerateRepoPackages( async pkg => !pkg.json.promoteRelease && !pkg.json.private, ); - for (const pkg of masterPublishedPackages) { + for (const pkg of mainBranchPublishedPackages) { await pkg.assignProps({private: true}); } } diff --git a/packages/README.md b/packages/README.md index 7a50375838..021d84810d 100644 --- a/packages/README.md +++ b/packages/README.md @@ -7,8 +7,8 @@ Several packages are organized into specific package scopes: - `@office-iss`: Office internal packages - `@react-native`: Copies of private upstream packages already using the `@react-native` scope. E.g. `@react-native/tester` for the RNTester package. - `@react-native-windows`: Internal packages used by react-native-windows itself. Versioned and published alongside RNW. -- `@rnw-bots`: Bot infrastructure for the react-native-windows repo. Published as part of the master branch. -- `@rnw-scripts`: Scripts for repository tooling. Published as part of the master branch. +- `@rnw-bots`: Bot infrastructure for the react-native-windows repo. Published as part of the main branch. +- `@rnw-scripts`: Scripts for repository tooling. Published as part of the main branch. ## Unscoped packages diff --git a/packages/e2e-test-app/README.md b/packages/e2e-test-app/README.md index daede65959..7a90db9dbb 100644 --- a/packages/e2e-test-app/README.md +++ b/packages/e2e-test-app/README.md @@ -2,4 +2,4 @@ This package is not published, and is just used to verify a standalone app -For information on how to run and debug this project, see [e2e-testing](https://github.com/microsoft/react-native-windows/blob/master/docs/e2e-testing.md). \ No newline at end of file +For information on how to run and debug this project, see [e2e-testing](https://github.com/microsoft/react-native-windows/blob/main/docs/e2e-testing.md). \ No newline at end of file diff --git a/vnext/proposals/readme.md b/vnext/proposals/readme.md index 2ebd71f681..657236a14b 100644 --- a/vnext/proposals/readme.md +++ b/vnext/proposals/readme.md @@ -20,7 +20,7 @@ The proposal process here takes its inspiration from the react-native-community 3. Author your proposal using the [proposal template](https://github.com/react-native-community/discussions-and-proposals/blob/master/proposals/0000-template.md). 4. When your proposal is ready for review: - * Open a new pull request to merge your proposal to the ```master``` branch + * Open a new pull request to merge your proposal to the ```main``` branch * Update the related issue(s) with a link to the proposal PR * Add the label - `Proposal` - to your PR so it shows up in the active proposals list.