Skip to content

Commit 1b12e2c

Browse files
committed
merge master
2 parents baa51f2 + 9f1e909 commit 1b12e2c

File tree

109 files changed

+2417
-788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2417
-788
lines changed

.ado/publish.js

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
// Used to publish this fork of react-native
2+
// Publish it as an attached tar asset to the GitHub release for general consumption, since we can't publish this to the npmjs npm feed
3+
4+
const fs = require("fs");
5+
const path = require("path");
6+
const execSync = require("child_process").execSync;
7+
8+
function exec(command) {
9+
try {
10+
console.log(`Running command: ${command}`);
11+
return execSync(command, {
12+
stdio: "inherit"
13+
});
14+
} catch (err) {
15+
process.exitCode = 1;
16+
console.log(`Failure running: ${command}`);
17+
throw err;
18+
}
19+
}
20+
21+
function doPublish() {
22+
const publishBranchName = process.env.publishBranchName;
23+
24+
const tempPublishBranch = `publish-${Date.now()}`;
25+
26+
const pkgJsonPath = path.resolve(__dirname, "../package.json");
27+
let pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf8"));
28+
29+
let releaseVersion = pkgJson.version;
30+
31+
const versionGroups = /(.*-microsoft\.)([0-9]*)/.exec(releaseVersion);
32+
if (versionGroups) {
33+
releaseVersion = versionGroups[1] + (parseInt(versionGroups[2]) + 1);
34+
} else {
35+
if (releaseVersion.indexOf("-") === -1) {
36+
releaseVersion = releaseVersion + "-microsoft.0";
37+
} else {
38+
console.log("Invalid version to publish");
39+
exit(1);
40+
}
41+
}
42+
43+
pkgJson.version = releaseVersion;
44+
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
45+
console.log(`Updating package.json to version ${releaseVersion}`);
46+
47+
exec(`git checkout -b ${tempPublishBranch}`);
48+
49+
exec(`git add ${pkgJsonPath}`);
50+
exec(`git commit -m "Applying package update to ${releaseVersion}`);
51+
exec(`git tag v${releaseVersion}`);
52+
exec(`git push origin HEAD:${tempPublishBranch} --follow-tags --verbose`);
53+
exec(`git push origin tag v${releaseVersion}`);
54+
55+
// -------- Generating Android Artifacts with JavaDoc
56+
exec("gradlew installArchives");
57+
58+
// undo uncommenting javadoc setting
59+
exec("git checkout ReactAndroid/gradle.properties");
60+
61+
// Configure npm to publish to internal feed
62+
const npmrcPath = path.resolve(__dirname, "../.npmrc");
63+
const npmrcContents = `registry=https:${
64+
process.env.publishnpmfeed
65+
}/registry/\nalways-auth=true`;
66+
console.log(`Creating ${npmrcPath} for publishing:`);
67+
console.log(npmrcContents);
68+
fs.writeFileSync(npmrcPath, npmrcContents);
69+
70+
exec(`npm publish`);
71+
exec(`del ${npmrcPath}`);
72+
73+
// Push tar to GitHub releases
74+
exec(`npm pack`);
75+
76+
const npmTarPath = path.resolve(
77+
__dirname,
78+
`../react-native-${releaseVersion}.tgz`
79+
);
80+
const assetUpdateUrl = `https://uploads.github.com/repos/Microsoft/react-native/releases/{id}/assets?name=react-native-${releaseVersion}.tgz`;
81+
const authHeader =
82+
"Basic " + new Buffer(":" + process.env.githubToken).toString("base64");
83+
const userAgent = "Microsoft-React-Native-Release-Agent";
84+
85+
let uploadReleaseAssetUrl = "";
86+
exec("npm install request@^2.69.0 --no-save");
87+
88+
const request = require("request");
89+
90+
const uploadTarBallToRelease = function() {
91+
request.post(
92+
{
93+
url: uploadReleaseAssetUrl,
94+
headers: {
95+
"User-Agent": userAgent,
96+
Authorization: authHeader,
97+
"Content-Type": "application/octet-stream"
98+
},
99+
formData: {
100+
file: fs.createReadStream(npmTarPath)
101+
}
102+
},
103+
function(err, res, body) {
104+
if (err) {
105+
console.error(err);
106+
process.exitCode = 1;
107+
throw err;
108+
}
109+
110+
var formattedResponse = JSON.parse(body);
111+
112+
if (formattedResponse.errors) {
113+
process.exitCode = 1;
114+
console.error(formattedResponse.errors);
115+
throw formattedResponse.errors;
116+
}
117+
118+
exec(`del ${npmTarPath}`);
119+
exec(`git checkout ${publishBranchName}`);
120+
exec(`git pull origin ${publishBranchName}`);
121+
exec(`git merge ${tempPublishBranch} --no-edit`);
122+
exec(
123+
`git push origin HEAD:${publishBranchName} --follow-tags --verbose`
124+
);
125+
exec(`git branch -d ${tempPublishBranch}`);
126+
exec(`git push origin --delete -d ${tempPublishBranch}`);
127+
}
128+
);
129+
};
130+
131+
const createReleaseRequestBody = {
132+
tag_name: `v${releaseVersion}`,
133+
target_commitish: tempPublishBranch,
134+
name: `v${releaseVersion}`,
135+
body: `v${releaseVersion}`,
136+
draft: false,
137+
prerelease: true
138+
};
139+
console.log('createReleaseRequestBody: ' + JSON.stringify(createReleaseRequestBody, null, 2));
140+
141+
request.post(
142+
{
143+
url: "https://github.com/api/repos/Microsoft/react-native/releases",
144+
headers: {
145+
"User-Agent": userAgent,
146+
Authorization: authHeader
147+
},
148+
json: true,
149+
body: createReleaseRequestBody
150+
},
151+
function(err, res, body) {
152+
if (err) {
153+
console.log(err);
154+
throw new Error("Error fetching release id.");
155+
}
156+
157+
console.log("Created GitHub Release: " + JSON.stringify(body, null, 2));
158+
uploadReleaseAssetUrl = assetUpdateUrl.replace(/{id}/, body.id);
159+
uploadTarBallToRelease();
160+
}
161+
);
162+
}
163+
164+
doPublish();

.ado/publish.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# This file defines the Android PR build steps used during the CI loop
2+
name: $(Date:yyyyMMdd).$(Rev:.r)
3+
4+
trigger: none # will disable CI builds entirely
5+
6+
pr:
7+
- master
8+
9+
jobs:
10+
- job: RNGithubPublish
11+
displayName: React-Native GitHub Publish
12+
pool:
13+
name: OE Standard Pool
14+
demands: ['Agent.OS -equals Windows_NT', 'ANDROID_NDK', 'OnPrem -equals False']
15+
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
16+
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
17+
steps:
18+
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
19+
clean: true # whether to fetch clean each time
20+
fetchDepth: 2 # the depth of commits to ask Git to fetch
21+
lfs: false # whether to download Git-LFS files
22+
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
23+
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
24+
25+
- task: CmdLine@2
26+
displayName: npm install
27+
inputs:
28+
script: npm install
29+
30+
- task: NuGetCommand@2
31+
displayName: NuGet restore
32+
inputs:
33+
command: restore
34+
restoreSolution: ReactAndroid/packages.config
35+
feedsToUse: config
36+
#vstsFeed: # Required when feedsToUse == Select
37+
#includeNuGetOrg: true # Required when feedsToUse == Select
38+
nugetConfigPath: ReactAndroid/NuGet.Config
39+
#externalFeedCredentials: # Optional
40+
#noCache: false
41+
#disableParallelProcessing: false
42+
restoreDirectory: packages/
43+
verbosityRestore: Detailed # Options: quiet, normal, detailed
44+
#packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' # Required when command == Push
45+
#nuGetFeedType: 'internal' # Required when command == Push# Options: internal, external
46+
#publishVstsFeed: # Required when command == Push && NuGetFeedType == Internal
47+
#publishPackageMetadata: true # Optional
48+
#allowPackageConflicts: # Optional
49+
#publishFeedCredentials: # Required when command == Push && NuGetFeedType == External
50+
#verbosityPush: 'Detailed' # Options: quiet, normal, detailed
51+
#packagesToPack: '**/*.csproj' # Required when command == Pack
52+
#configuration: '$(BuildConfiguration)' # Optional
53+
#packDestination: '$(Build.ArtifactStagingDirectory)' # Optional
54+
#versioningScheme: 'off' # Options: off, byPrereleaseNumber, byEnvVar, byBuildNumber
55+
#includeReferencedProjects: false # Optional
56+
#versionEnvVar: # Required when versioningScheme == ByEnvVar
57+
#majorVersion: '1' # Required when versioningScheme == ByPrereleaseNumber
58+
#minorVersion: '0' # Required when versioningScheme == ByPrereleaseNumber
59+
#patchVersion: '0' # Required when versioningScheme == ByPrereleaseNumber
60+
#packTimezone: 'utc' # Required when versioningScheme == ByPrereleaseNumber# Options: utc, local
61+
#includeSymbols: false # Optional
62+
#toolPackage: # Optional
63+
#buildProperties: # Optional
64+
#basePath: # Optional
65+
#verbosityPack: 'Detailed' # Options: quiet, normal, detailed
66+
#arguments: # Required when command == Custom
67+
68+
- task: CmdLine@1
69+
displayName: 'npm auth'
70+
inputs:
71+
filename: npm
72+
arguments: 'config set $(publishnpmfeed)/registry/:_authToken $(npmTokenOffice)'
73+
74+
- task: CmdLine@2
75+
displayName: Do Publish
76+
inputs:
77+
script: node .ado/publish.js
78+
79+
- task: CmdLine@1
80+
displayName: 'npm unauth'
81+
inputs:
82+
filename: npm
83+
arguments: 'config set $(publishnpmfeed)/registry/:_authToken XXXXX'
84+

.flowconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
.*/Libraries/polyfills/.*
2424

2525
; Ignore metro
26-
; .*/node_modules/metro/.*
26+
.*/node_modules/metro/.*
27+
.*/node_modules/metro-config/src/configTypes.flow.js.flow
28+
29+
; Ignore rn-cli.config.js
30+
<PROJECT_ROOT>/rn-cli.config.js
2731

2832
; These should not be required directly
2933
; require from fbjs/lib instead: require('fbjs/lib/invariant')

.github/CODEOWNERS

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
Libraries/Animated/* @janicduplessis
2-
Libraries/NativeAnimation/* @janicduplessis
3-
Libraries/Image/* @shergin
4-
Libraries/Text/* @shergin
5-
React/Base/* @shergin
6-
React/Views/* @shergin
7-
React/Modules/* @shergin
8-
React/CxxBridge/* @mhorowitz
9-
ReactAndroid/src/main/java/com/facebook/react/animated/* @janicduplessis
10-
**/*.md @hramos
11-
package.json @hramos
12-
local-cli/core/* @grabbou @kureev
13-
local-cli/link/* @grabbou @kureev
14-
local-cli/unlink/* @grabbou @kureev
1+
** @acoates-ms

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
GitHub Issues in the `facebook/react-native` repository are used exclusively for tracking bugs in React Native.
1+
GitHub Issues in the `Microsoft/react-native` repository are used exclusively for tracking bugs in the Microsoft/React Native fork. If the issue concerns Facebook's react-native, submit the issue to facebook/react-native.
22

33
Please take a look at the issue templates at https://github.com/facebook/react-native/issues/new/choose before submitting a new issue. Following one of the issue templates will ensure maintainers can route your request efficiently. Thanks!

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,25 @@
1-
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
2-
Help us understand your motivation by explaining why you decided to make this change.
3-
4-
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
5-
6-
_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
7-
8-
Test Plan:
9-
----------
10-
Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
11-
12-
Changelog:
13-
----------
14-
Help reviewers and the release process by writing your own changelog entry. When the change doesn't impact React Native developers, it may be ommitted from the changelog for brevity. See below for an example.
15-
16-
[CATEGORY] [TYPE] - Message
1+
# :warning: Make sure you are targeting Microsoft/react-native for your PR :warning:
2+
(then delete these lines)
173

184
<!--
5+
We are working on reducing the diff between Facebook's public version of react-native, and our Microsoft/react-native. Long term, we want to remove the need for our version and only depend on Facebook's react-native. In order to move in the right direction, new changes should be examined to ensure that we are doing the right thing.
196
20-
CATEGORY may be:
21-
22-
- [General]
23-
- [iOS]
24-
- [Android]
25-
26-
TYPE may be:
27-
28-
- [Added] for new features.
29-
- [Changed] for changes in existing functionality.
30-
- [Deprecated] for soon-to-be removed features.
31-
- [Removed] for now removed features.
32-
- [Fixed] for any bug fixes.
33-
- [Security] in case of vulnerabilities.
7+
If you are making a new change then one of the following should be done:
8+
- Consider if it is possible to achieve the desired behavior without making a change to react-native. Often a change can be made in a layer above react-native instead.
9+
- Create a corresponding PR against [react-native on GitHub](https://github.com/facebook/react-native)
10+
**Note:** Ideally you would wait for GitHub feedback before submitting to ISS, since we want to ensure that ISS doesn't deviate from GitHub.
11+
-->
3412

35-
For more detail, see https://keepachangelog.com/en/1.0.0/#how
13+
#### Please select one of the following
14+
- [ ] I am removing an existing difference between facebook/react-native and Microsoft/react-native :thumbsup:
15+
- [ ] I am cherry-picking a change from Facebook's react-native into Microsoft/react-native :thumbsup:
16+
- [ ] I am making a fix / change for the macOS implementation of react-native
17+
- [ ] I am making a change required for Microsoft usage of react-native
3618

37-
MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.
19+
#### Description of changes
3820

39-
EXAMPLES:
21+
(give an overview)
4022

41-
[General] [Added] - Add snapToOffsets prop to ScrollView component
42-
[General] [Fixed] - Fix various issues in snapToInterval on ScrollView component
43-
[iOS] [Fixed] - Fix crash in RCTImagePicker
23+
#### Focus areas to test
4424

45-
-->
25+
(optional)

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ DerivedData
1919
*.hmap
2020
*.ipa
2121
*.xcuserstate
22-
project.xcworkspace
22+
# exclude project.xcworkspace except for xcshareddata/WorkspaceSettings.xcsettings
23+
project.xcworkspace/*
24+
**/project.xcworkspace/contents.xcworkspacedata
25+
**/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
2326

2427
# Gradle
2528
/build/

CHANGELOG.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
{
2-
"name": "@microsoft/react-native",
2+
"name": "react-native",
33
"entries": [
4+
{
5+
"version": "0.0.2",
6+
"tag": "react-native_v0.0.2",
7+
"date": "Wed, 06 Mar 2019 05:43:46 GMT",
8+
"comments": {
9+
"patch": [
10+
{
11+
"comment": "Rename microsoft react-native",
12+
"author": "Andrew Coates (REDMOND) <[email protected]>",
13+
"commit": "0c0c2e0fa8762dda21b96ec3031a90450a45607f"
14+
}
15+
]
16+
}
17+
},
418
{
519
"version": "0.3.9",
620
"tag": "@microsoft/react-native_v0.3.9",

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# Change Log - @microsoft/react-native
1+
# Change Log - react-native
22

3-
This log was last generated on Tue, 05 Mar 2019 20:54:55 GMT and should not be manually modified.
3+
This log was last generated on Wed, 06 Mar 2019 05:43:46 GMT and should not be manually modified.
4+
5+
## 0.0.2
6+
Wed, 06 Mar 2019 05:43:46 GMT
7+
8+
### Patches
9+
10+
- Rename microsoft react-native
411

512
## 0.3.9
613
Tue, 05 Mar 2019 20:54:55 GMT

0 commit comments

Comments
 (0)