Prepare files for default branch rename (#7825)

* Prepare files for default branch rename

* Change files

* Adding marker
This commit is contained in:
dannyvv 2021-05-24 14:40:26 -07:00 коммит произвёл GitHub
Родитель 003602b90a
Коммит 6083bce7cd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
17 изменённых файлов: 56 добавлений и 39 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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)

Просмотреть файл

@ -3,6 +3,7 @@ name: $(Date:yyyyMMdd).$(Rev:r)
trigger: none # will disable CI builds entirely
pr:
- main
- master
- "*-stable"

2
.github/ISSUE_TEMPLATE/feature-request.md поставляемый
Просмотреть файл

@ -9,7 +9,7 @@ assignees: ''
<!-- This is a template for new feature or API proposals for React Native Windows. Use this to submit new API/component requests or behavior updates that are specific to Windows-only. For feature requests to React Native, go [here](https://github.com/react-native-community/discussions-and-proposals) instead.
It's fine if you don't have all the details for the template below: you can start with the Summary and Rationale. Read more about React Native for Windows proposal process [here](https://github.com/microsoft/react-native-windows/tree/master/vnext/proposals)
It's fine if you don't have all the details for the template below: you can start with the Summary and Rationale. Read more about React Native for Windows proposal process [here](https://github.com/microsoft/react-native-windows/tree/main/vnext/proposals)
Your request will be triaged by the RNW team according to this process: https://github.com/microsoft/react-native-windows/wiki/Triage-Process
-->

Просмотреть файл

@ -5,7 +5,7 @@
</p>
<p align="center">
<a href="https://github.com/microsoft/react-native-windows/blob/master/LICENSE">
<a href="https://github.com/microsoft/react-native-windows/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="React Native for Windows is released under the MIT license." />
</a>
<a href="https://www.npmjs.org/package/react-native-windows">
@ -16,7 +16,7 @@
</a>
</p>
![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.

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Prepare files for default branch rename",
"packageName": "@rnw-scripts/promote-release",
"email": "dannyvv@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Prepare files for default branch rename",
"packageName": "react-native-windows",
"email": "dannyvv@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -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
```

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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 `<MSBuild>` 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.

Просмотреть файл

@ -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

Просмотреть файл

@ -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});
}
}

Просмотреть файл

@ -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

Просмотреть файл

@ -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).
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).

Просмотреть файл

@ -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.