mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3aa86bea2 | ||
|
|
22e4c8e1e7 | ||
|
|
73afb97e89 | ||
|
|
f269c2d719 | ||
|
|
1c73abbbb6 | ||
|
|
43eaf3cc37 | ||
|
|
1de642af6a | ||
|
|
c37a83e206 | ||
|
|
9faa42ed7c | ||
|
|
87592fb5ca | ||
|
|
a510c2733f | ||
|
|
16a16cf361 | ||
|
|
cd8fa9d3e8 | ||
|
|
02cc3d329b | ||
|
|
0150836ea8 | ||
|
|
5f07417121 | ||
|
|
636f4c76b0 | ||
|
|
209bb94b9f | ||
|
|
4ad177efc7 | ||
|
|
f7a23a52a0 | ||
|
|
6db77b68c8 | ||
|
|
0eadbe7a9a | ||
|
|
20918b9911 | ||
|
|
2726b89f14 | ||
|
|
218b9cd97c | ||
|
|
a7d3ffee55 | ||
|
|
eede05c91b | ||
|
|
abe9633b42 | ||
|
|
f6895e9b53 | ||
|
|
8c2a667e26 | ||
|
|
007317128d | ||
|
|
e18cf90d71 | ||
|
|
07c454b2d2 |
@@ -710,6 +710,19 @@ jobs:
|
||||
# -------------------------
|
||||
# JOBS: Releases
|
||||
# -------------------------
|
||||
prepare_package_for_release:
|
||||
executor: reactnativeios
|
||||
steps:
|
||||
- checkout
|
||||
- run_yarn
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "1c:98:e0:3a:52:79:95:29:12:cd:b4:87:5b:41:e2:bb"
|
||||
- run:
|
||||
name: "Set new react-native version and commit changes"
|
||||
command: |
|
||||
node ./scripts/prepare-package-for-release.js
|
||||
|
||||
build_npm_package:
|
||||
parameters:
|
||||
publish_npm_args:
|
||||
@@ -843,6 +856,15 @@ workflows:
|
||||
|
||||
releases:
|
||||
jobs:
|
||||
# This job will trigger on pushes to release branch and commit a version tag to trigger `build_npm_package` for release
|
||||
- prepare_package_for_release:
|
||||
name: prepare_package_for_release
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- /^(\d+)\.(\d+)-stable$/
|
||||
|
||||
# This job will trigger when a version tag is pushed (by prepare_package_for_release)
|
||||
- build_npm_package:
|
||||
name: build_and_publish_npm_package
|
||||
publish_npm_args: --release
|
||||
|
||||
@@ -105,7 +105,6 @@ package-lock.json
|
||||
!/packages/rn-tester/Pods/__offline_mirrors__
|
||||
|
||||
# react-native-codegen
|
||||
/React/FBReactNativeSpec/FBReactNativeSpec
|
||||
/packages/react-native-codegen/lib
|
||||
/ReactCommon/react/renderer/components/rncore/
|
||||
/packages/rn-tester/NativeModuleExample/ScreenshotManagerSpec*
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.4)
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
activesupport (6.1.4.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
@@ -56,16 +56,16 @@ GEM
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.9)
|
||||
escape (0.0.4)
|
||||
ethon (0.14.0)
|
||||
ethon (0.15.0)
|
||||
ffi (>= 1.15.0)
|
||||
ffi (1.15.4)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.8.10)
|
||||
i18n (1.8.11)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.5.1)
|
||||
json (2.6.1)
|
||||
minitest (5.14.4)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
@@ -85,7 +85,7 @@ GEM
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.4.2)
|
||||
zeitwerk (2.5.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
@@ -97,4 +97,4 @@ RUBY VERSION
|
||||
ruby 2.7.4p191
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.28
|
||||
2.2.27
|
||||
|
||||
@@ -141,9 +141,9 @@ class Keyboard {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
|
||||
* @deprecated Use `remove` on the EventSubscription from `addListener`.
|
||||
*/
|
||||
removeEventListener<K: $Keys<KeyboardEventDefinitions>>(
|
||||
removeListener<K: $Keys<KeyboardEventDefinitions>>(
|
||||
eventType: K,
|
||||
listener: (...$ElementType<KeyboardEventDefinitions, K>) => mixed,
|
||||
): void {
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as React from 'react';
|
||||
import ScrollView from '../ScrollView';
|
||||
import * as ReactNativeTestTools from '../../../Utilities/ReactNativeTestTools';
|
||||
import ReactTestRenderer from 'react-test-renderer';
|
||||
import View from '../../View/View';
|
||||
import Text from '../../../Text/Text';
|
||||
const React = require('react');
|
||||
const ScrollView = require('../ScrollView');
|
||||
const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools');
|
||||
const ReactTestRenderer = require('react-test-renderer');
|
||||
const View = require('../../View/View');
|
||||
const Text = require('../../../Text/Text');
|
||||
|
||||
describe('<ScrollView />', () => {
|
||||
it('should render as expected', () => {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
exports.version = {
|
||||
major: 0,
|
||||
minor: 0,
|
||||
minor: 67,
|
||||
patch: 0,
|
||||
prerelease: null,
|
||||
prerelease: 'rc.6',
|
||||
};
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
*/
|
||||
|
||||
import type {PressEvent} from '../../Types/CoreEventTypes';
|
||||
import * as HoverState from '../HoverState';
|
||||
import Pressability from '../Pressability';
|
||||
import invariant from 'invariant';
|
||||
import nullthrows from 'nullthrows';
|
||||
import Platform from '../../Utilities/Platform';
|
||||
import UIManager from '../../ReactNative/UIManager';
|
||||
|
||||
const HoverState = require('../HoverState');
|
||||
const Pressability = require('../Pressability').default;
|
||||
const invariant = require('invariant');
|
||||
const nullthrows = require('nullthrows');
|
||||
const Platform = require('../../Utilities/Platform');
|
||||
const UIManager = require('../../ReactNative/UIManager');
|
||||
|
||||
// TODO: Move this util to a shared location.
|
||||
function getMock<TArguments: $ReadOnlyArray<mixed>, TReturn>(
|
||||
|
||||
@@ -21,11 +21,11 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(67),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: @"rc.6",
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -18,19 +18,11 @@
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
- (BOOL)isRTL;
|
||||
|
||||
/**
|
||||
* Should be used very early during app start up
|
||||
* Before the bridge is initialized
|
||||
*/
|
||||
@property (atomic, setter=allowRTL:) BOOL isRTLAllowed;
|
||||
|
||||
/**
|
||||
* Could be used to test RTL layout with English
|
||||
* Used for development and testing purpose
|
||||
*/
|
||||
@property (atomic, setter=forceRTL:) BOOL isRTLForced;
|
||||
|
||||
@property (atomic, setter=swapLeftAndRightInRTL:) BOOL doLeftAndRightSwapInRTL;
|
||||
- (BOOL)isRTLAllowed;
|
||||
- (void)allowRTL:(BOOL)value;
|
||||
- (BOOL)isRTLForced;
|
||||
- (void)forceRTL:(BOOL)value;
|
||||
- (BOOL)doLeftAndRightSwapInRTL;
|
||||
- (void)swapLeftAndRightInRTL:(BOOL)value;
|
||||
|
||||
@end
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
dispatch_once(&onceToken, ^{
|
||||
sharedInstance = [self new];
|
||||
[sharedInstance swapLeftAndRightInRTL:true];
|
||||
[sharedInstance allowRTL:true];
|
||||
});
|
||||
|
||||
return sharedInstance;
|
||||
@@ -41,6 +40,53 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should be used very early during app start up
|
||||
* Before the bridge is initialized
|
||||
* @return whether the app allows RTL layout, default is true
|
||||
*/
|
||||
- (BOOL)isRTLAllowed
|
||||
{
|
||||
NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:@"RCTI18nUtil_allowRTL"];
|
||||
if (value == nil) {
|
||||
return YES;
|
||||
}
|
||||
return [value boolValue];
|
||||
}
|
||||
|
||||
- (void)allowRTL:(BOOL)rtlStatus
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_allowRTL"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
/**
|
||||
* Could be used to test RTL layout with English
|
||||
* Used for development and testing purpose
|
||||
*/
|
||||
- (BOOL)isRTLForced
|
||||
{
|
||||
BOOL rtlStatus = [[NSUserDefaults standardUserDefaults] boolForKey:@"RCTI18nUtil_forceRTL"];
|
||||
return rtlStatus;
|
||||
}
|
||||
|
||||
- (void)forceRTL:(BOOL)rtlStatus
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_forceRTL"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
- (BOOL)doLeftAndRightSwapInRTL
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:@"RCTI18nUtil_makeRTLFlipLeftAndRightStyles"];
|
||||
}
|
||||
|
||||
- (void)swapLeftAndRightInRTL:(BOOL)value
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setBool:value forKey:@"RCTI18nUtil_makeRTLFlipLeftAndRightStyles"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
// Check if the current device language is RTL
|
||||
- (BOOL)isDevicePreferredLanguageRTL
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0-main
|
||||
VERSION_NAME=0.67.0-rc.6
|
||||
GROUP=com.facebook.react
|
||||
|
||||
POM_NAME=ReactNative
|
||||
|
||||
@@ -16,14 +16,20 @@ public class HermesExecutor extends JavaScriptExecutor {
|
||||
private static String mode_;
|
||||
|
||||
static {
|
||||
// libhermes must be loaded explicitly to invoke its JNI_OnLoad.
|
||||
SoLoader.loadLibrary("hermes");
|
||||
try {
|
||||
SoLoader.loadLibrary("hermes-executor-debug");
|
||||
mode_ = "Debug";
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
SoLoader.loadLibrary("hermes-executor-release");
|
||||
mode_ = "Release";
|
||||
loadLibrary();
|
||||
}
|
||||
|
||||
public static void loadLibrary() throws UnsatisfiedLinkError {
|
||||
if (mode_ == null) {
|
||||
// libhermes must be loaded explicitly to invoke its JNI_OnLoad.
|
||||
SoLoader.loadLibrary("hermes");
|
||||
try {
|
||||
SoLoader.loadLibrary("hermes-executor-debug");
|
||||
mode_ = "Debug";
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
SoLoader.loadLibrary("hermes-executor-release");
|
||||
mode_ = "Release";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.hermes.reactexecutor.HermesExecutor;
|
||||
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.bridge.JSBundleLoader;
|
||||
@@ -28,6 +29,7 @@ import com.facebook.react.devsupport.DevSupportManagerFactory;
|
||||
import com.facebook.react.devsupport.RedBoxHandler;
|
||||
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
|
||||
import com.facebook.react.devsupport.interfaces.DevSupportManager;
|
||||
import com.facebook.react.jscexecutor.JSCExecutor;
|
||||
import com.facebook.react.jscexecutor.JSCExecutorFactory;
|
||||
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
||||
import com.facebook.react.packagerconnection.RequestHandler;
|
||||
@@ -347,7 +349,7 @@ public class ReactInstanceManagerBuilder {
|
||||
try {
|
||||
// If JSC is included, use it as normal
|
||||
initializeSoLoaderIfNecessary(applicationContext);
|
||||
SoLoader.loadLibrary("jscexecutor");
|
||||
JSCExecutor.loadLibrary();
|
||||
return new JSCExecutorFactory(appName, deviceName);
|
||||
} catch (UnsatisfiedLinkError jscE) {
|
||||
// https://github.com/facebook/hermes/issues/78 shows that
|
||||
@@ -365,6 +367,7 @@ public class ReactInstanceManagerBuilder {
|
||||
|
||||
// Otherwise use Hermes
|
||||
try {
|
||||
HermesExecutor.loadLibrary();
|
||||
return new HermesExecutorFactory();
|
||||
} catch (UnsatisfiedLinkError hermesE) {
|
||||
// If we get here, either this is a JSC build, and of course
|
||||
|
||||
@@ -14,8 +14,13 @@ import com.facebook.react.bridge.ReadableNativeMap;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
@DoNotStrip
|
||||
/* package */ class JSCExecutor extends JavaScriptExecutor {
|
||||
/* package */ public class JSCExecutor extends JavaScriptExecutor {
|
||||
|
||||
static {
|
||||
loadLibrary();
|
||||
}
|
||||
|
||||
public static void loadLibrary() throws UnsatisfiedLinkError {
|
||||
SoLoader.loadLibrary("jscexecutor");
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 0,
|
||||
"minor", 0,
|
||||
"minor", 67,
|
||||
"patch", 0,
|
||||
"prerelease", null);
|
||||
"prerelease", "rc.6");
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 0;
|
||||
int32_t Minor = 67;
|
||||
int32_t Patch = 0;
|
||||
std::string_view Prerelease = "";
|
||||
std::string_view Prerelease = "rc.6";
|
||||
} ReactNativeVersion;
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
+6
-2
@@ -92,12 +92,14 @@ function getBinarySizesCollection(db) {
|
||||
* @param {firebase.firestore.CollectionReference<firebase.firestore.DocumentData>} collection
|
||||
* @param {string} sha The Git SHA used to identify the entry
|
||||
* @param {firebase.firestore.UpdateData} data The data to be inserted/updated
|
||||
* @param {string} branch The Git branch where this data was computed for
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
function createOrUpdateDocument(collectionRef, sha, data) {
|
||||
function createOrUpdateDocument(collectionRef, sha, data, branch) {
|
||||
const stampedData = {
|
||||
...data,
|
||||
timestamp: firestore.Timestamp.now(),
|
||||
branch,
|
||||
};
|
||||
const docRef = firestore.doc(collectionRef, sha);
|
||||
return firestore.updateDoc(docRef, stampedData).catch(async error => {
|
||||
@@ -115,14 +117,16 @@ function createOrUpdateDocument(collectionRef, sha, data) {
|
||||
* Returns the latest document in collection.
|
||||
*
|
||||
* @param {firebase.firestore.CollectionReference<firebase.firestore.DocumentData>} collection
|
||||
* @param {string} branch The Git branch for the data
|
||||
* @returns {Promise<firebase.firestore.DocumentData | undefined>}
|
||||
*/
|
||||
async function getLatestDocument(collectionRef) {
|
||||
async function getLatestDocument(collectionRef, branch) {
|
||||
try {
|
||||
const querySnapshot = await firestore.getDocs(
|
||||
firestore.query(
|
||||
collectionRef,
|
||||
firestore.orderBy('timestamp', 'desc'),
|
||||
firestore.where('branch', '==', branch),
|
||||
firestore.limit(1),
|
||||
),
|
||||
);
|
||||
|
||||
+67
-45
@@ -25,7 +25,7 @@ const datastore = require('./datastore');
|
||||
const {createOrUpdateComment} = require('./make-comment');
|
||||
|
||||
/**
|
||||
* Generates and submits a comment. If this is run on main branch, data is
|
||||
* Generates and submits a comment. If this is run on the main or release branch, data is
|
||||
* committed to the store instead.
|
||||
* @param {{
|
||||
'android-hermes-arm64-v8a'?: number;
|
||||
@@ -47,7 +47,7 @@ async function reportSizeStats(stats, replacePattern) {
|
||||
);
|
||||
const collection = datastore.getBinarySizesCollection(store);
|
||||
|
||||
if (GITHUB_REF === 'main') {
|
||||
if (GITHUB_REF === 'main' || GITHUB_REF.endsWith('-stable')) {
|
||||
// Ensure we only store numbers greater than zero.
|
||||
const validatedStats = Object.keys(stats).reduce((validated, key) => {
|
||||
const value = stats[key];
|
||||
@@ -58,63 +58,85 @@ async function reportSizeStats(stats, replacePattern) {
|
||||
validated[key] = value;
|
||||
return validated;
|
||||
}, {});
|
||||
|
||||
if (Object.keys(validatedStats).length > 0) {
|
||||
// Print out the new stats
|
||||
const document =
|
||||
(await datastore.getLatestDocument(collection, GITHUB_REF)) || {};
|
||||
const formattedStats = formatBundleStats(document, validatedStats);
|
||||
console.log(formattedStats);
|
||||
|
||||
await datastore.createOrUpdateDocument(
|
||||
collection,
|
||||
GITHUB_SHA,
|
||||
validatedStats,
|
||||
GITHUB_REF,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
const document = await datastore.getLatestDocument(collection);
|
||||
|
||||
const diffFormatter = new Intl.NumberFormat('en', {signDisplay: 'always'});
|
||||
const sizeFormatter = new Intl.NumberFormat('en', {});
|
||||
|
||||
// | Platform | Engine | Arch | Size (bytes) | Diff |
|
||||
// |:---------|:-------|:------------|-------------:|-----:|
|
||||
// | android | hermes | arm64-v8a | 9437184 | ±0 |
|
||||
// | android | hermes | armeabi-v7a | 9015296 | ±0 |
|
||||
// | android | hermes | x86 | 9498624 | ±0 |
|
||||
// | android | hermes | x86_64 | 9965568 | ±0 |
|
||||
// | android | jsc | arm64-v8a | 9236480 | ±0 |
|
||||
// | android | jsc | armeabi-v7a | 8814592 | ±0 |
|
||||
// | android | jsc | x86 | 9297920 | ±0 |
|
||||
// | android | jsc | x86_64 | 9764864 | ±0 |
|
||||
// | android | jsc | x86_64 | 9764864 | ±0 |
|
||||
// | ios | - | universal | 10715136 | ±0 |
|
||||
const comment = [
|
||||
'| Platform | Engine | Arch | Size (bytes) | Diff |',
|
||||
'|:---------|:-------|:-----|-------------:|-----:|',
|
||||
...Object.keys(stats).map(identifier => {
|
||||
const [size, diff] = (() => {
|
||||
const statSize = stats[identifier];
|
||||
if (!statSize) {
|
||||
return ['n/a', '--'];
|
||||
} else if (!(identifier in document)) {
|
||||
return [statSize, 'n/a'];
|
||||
} else {
|
||||
return [
|
||||
sizeFormatter.format(statSize),
|
||||
diffFormatter.format(statSize - document[identifier]),
|
||||
];
|
||||
}
|
||||
})();
|
||||
|
||||
const [platform, engineOrArch, ...archParts] = identifier.split('-');
|
||||
const arch = archParts.join('-') || engineOrArch;
|
||||
const engine = arch === engineOrArch ? '-' : engineOrArch; // e.g. 'ios-universal'
|
||||
return `| ${platform} | ${engine} | ${arch} | ${size} | ${diff} |`;
|
||||
}),
|
||||
'',
|
||||
`Base commit: ${document.commit}`,
|
||||
].join('\n');
|
||||
// For PRs, always compare vs main.
|
||||
const document =
|
||||
(await datastore.getLatestDocument(collection, 'main')) || {};
|
||||
const comment = formatBundleStats(document, stats);
|
||||
createOrUpdateComment(comment, replacePattern);
|
||||
}
|
||||
|
||||
await datastore.terminateStore(store);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the new bundle stats as compared to the latest stored entry.
|
||||
* @param {firebase.firestore.DocumentData} document the latest entry to compare against
|
||||
* @param {firebase.firestore.UpdateData} stats The stats to be formatted
|
||||
* @returns {string}
|
||||
*/
|
||||
function formatBundleStats(document, stats) {
|
||||
const diffFormatter = new Intl.NumberFormat('en', {signDisplay: 'always'});
|
||||
const sizeFormatter = new Intl.NumberFormat('en', {});
|
||||
|
||||
// | Platform | Engine | Arch | Size (bytes) | Diff |
|
||||
// |:---------|:-------|:------------|-------------:|-----:|
|
||||
// | android | hermes | arm64-v8a | 9437184 | ±0 |
|
||||
// | android | hermes | armeabi-v7a | 9015296 | ±0 |
|
||||
// | android | hermes | x86 | 9498624 | ±0 |
|
||||
// | android | hermes | x86_64 | 9965568 | ±0 |
|
||||
// | android | jsc | arm64-v8a | 9236480 | ±0 |
|
||||
// | android | jsc | armeabi-v7a | 8814592 | ±0 |
|
||||
// | android | jsc | x86 | 9297920 | ±0 |
|
||||
// | android | jsc | x86_64 | 9764864 | ±0 |
|
||||
// | android | jsc | x86_64 | 9764864 | ±0 |
|
||||
// | ios | - | universal | 10715136 | ±0 |
|
||||
const formatted = [
|
||||
'| Platform | Engine | Arch | Size (bytes) | Diff |',
|
||||
'|:---------|:-------|:-----|-------------:|-----:|',
|
||||
...Object.keys(stats).map(identifier => {
|
||||
const [size, diff] = (() => {
|
||||
const statSize = stats[identifier];
|
||||
if (!statSize) {
|
||||
return ['n/a', '--'];
|
||||
} else if (!(identifier in document)) {
|
||||
return [statSize, 'n/a'];
|
||||
} else {
|
||||
return [
|
||||
sizeFormatter.format(statSize),
|
||||
diffFormatter.format(statSize - document[identifier]),
|
||||
];
|
||||
}
|
||||
})();
|
||||
|
||||
const [platform, engineOrArch, ...archParts] = identifier.split('-');
|
||||
const arch = archParts.join('-') || engineOrArch;
|
||||
const engine = arch === engineOrArch ? '-' : engineOrArch; // e.g. 'ios-universal'
|
||||
return `| ${platform} | ${engine} | ${arch} | ${size} | ${diff} |`;
|
||||
}),
|
||||
'',
|
||||
`Base commit: ${document.commit || '<unknown>'}`,
|
||||
`Branch: ${document.branch || '<unknown>'}`,
|
||||
].join('\n');
|
||||
|
||||
return formatted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the file at specified path in bytes.
|
||||
* @param {fs.PathLike} path
|
||||
|
||||
+7
-75
@@ -13,42 +13,10 @@
|
||||
'use strict';
|
||||
|
||||
const babelRegisterOnly = require('metro-babel-register');
|
||||
const nullthrows = require('nullthrows');
|
||||
const createCacheKeyFunction = require('@jest/create-cache-key-function')
|
||||
.default;
|
||||
const t = require('@babel/types');
|
||||
const {statements} = require('@babel/template').default;
|
||||
|
||||
const importDefault = '__importDefault__';
|
||||
const importAll = '__importAll__';
|
||||
|
||||
// prelude
|
||||
const importPrelude = statements(`
|
||||
function ${importDefault}(moduleId) {
|
||||
const exports = require(moduleId);
|
||||
|
||||
if (exports && exports.__esModule) {
|
||||
return exports.default;
|
||||
}
|
||||
|
||||
return exports;
|
||||
};
|
||||
|
||||
function ${importAll}(moduleId) {
|
||||
const exports = require(moduleId);
|
||||
|
||||
if (exports && exports.__esModule) {
|
||||
return exports;
|
||||
}
|
||||
|
||||
return Object.assign({}, exports, {default: exports});
|
||||
};
|
||||
`);
|
||||
|
||||
const {
|
||||
transformSync: babelTransformSync,
|
||||
transformFromAstSync: babelTransformFromAstSync,
|
||||
} = require('@babel/core');
|
||||
const {transformSync: babelTransformSync} = require('@babel/core');
|
||||
const generate = require('@babel/generator').default;
|
||||
|
||||
const nodeFiles = new RegExp(
|
||||
@@ -73,13 +41,13 @@ module.exports = {
|
||||
}).code;
|
||||
}
|
||||
|
||||
let {ast} = transformer.transform({
|
||||
const {ast} = transformer.transform({
|
||||
filename: file,
|
||||
options: {
|
||||
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
|
||||
dev: true,
|
||||
enableBabelRuntime: false,
|
||||
experimentalImportSupport: true,
|
||||
experimentalImportSupport: false,
|
||||
globalPrefix: '',
|
||||
hot: false,
|
||||
inlineRequires: true,
|
||||
@@ -111,6 +79,10 @@ module.exports = {
|
||||
[require('@babel/plugin-transform-regenerator')],
|
||||
[require('@babel/plugin-transform-sticky-regex')],
|
||||
[require('@babel/plugin-transform-unicode-regex')],
|
||||
[
|
||||
require('@babel/plugin-transform-modules-commonjs'),
|
||||
{strict: false, allowTopLevelThis: true},
|
||||
],
|
||||
[require('@babel/plugin-transform-classes')],
|
||||
[require('@babel/plugin-transform-arrow-functions')],
|
||||
[require('@babel/plugin-transform-spread')],
|
||||
@@ -127,46 +99,6 @@ module.exports = {
|
||||
],
|
||||
});
|
||||
|
||||
// We're not using @babel/plugin-transform-modules-commonjs so
|
||||
// we need to add 'use strict' manually
|
||||
const directives = ast.program.directives;
|
||||
|
||||
if (
|
||||
ast.program.sourceType === 'module' &&
|
||||
(directives == null ||
|
||||
directives.findIndex(d => d.value.value === 'use strict') === -1)
|
||||
) {
|
||||
ast.program.directives = [
|
||||
...(directives || []),
|
||||
t.directive(t.directiveLiteral('use strict')),
|
||||
];
|
||||
}
|
||||
|
||||
// Postprocess the transformed module to handle ESM and inline requires.
|
||||
// We need to do this in a separate pass to avoid issues tracking references.
|
||||
const babelTransformResult = babelTransformFromAstSync(ast, src, {
|
||||
ast: true,
|
||||
retainLines: true,
|
||||
plugins: [
|
||||
[
|
||||
require('metro-transform-plugins').importExportPlugin,
|
||||
{importDefault, importAll},
|
||||
],
|
||||
[
|
||||
require('babel-preset-fbjs/plugins/inline-requires.js'),
|
||||
{inlineableCalls: [importDefault, importAll]},
|
||||
],
|
||||
],
|
||||
sourceType: 'module',
|
||||
});
|
||||
|
||||
ast = nullthrows(babelTransformResult.ast);
|
||||
|
||||
// Inject import helpers *after* running the inline-requires transform,
|
||||
// because otherwise it will assume they are user code and bail out of
|
||||
// inlining calls to them.
|
||||
ast.program.body.unshift(...importPrelude());
|
||||
|
||||
return generate(
|
||||
ast,
|
||||
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
|
||||
|
||||
+45
-9
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"private": true,
|
||||
"version": "1000.0.0",
|
||||
"version": "0.67.0-rc.6",
|
||||
"bin": "./cli.js",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "MIT",
|
||||
@@ -80,10 +79,6 @@
|
||||
"test-ios-e2e": "detox test -c ios.sim.release packages/rn-tester/e2e",
|
||||
"test-ios": "./scripts/objc-test.sh test"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/!(eslint-config-react-native-community)",
|
||||
"repo-config"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"react": "17.0.2"
|
||||
},
|
||||
@@ -116,11 +111,52 @@
|
||||
"stacktrace-parser": "^0.1.3",
|
||||
"use-subscription": "^1.0.0",
|
||||
"whatwg-fetch": "^3.0.0",
|
||||
"ws": "^6.1.4"
|
||||
"ws": "^6.1.4",
|
||||
"react-native-codegen": "^0.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-bin": "^0.162.0",
|
||||
"react": "17.0.2"
|
||||
"react": "17.0.2",
|
||||
"@babel/core": "^7.14.0",
|
||||
"@babel/generator": "^7.14.0",
|
||||
"@babel/template": "^7.0.0",
|
||||
"@babel/types": "^7.0.0",
|
||||
"@react-native-community/eslint-plugin": "*",
|
||||
"@reactions/component": "^2.0.2",
|
||||
"async": "^2.4.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-preset-fbjs": "^3.4.0",
|
||||
"clang-format": "^1.2.4",
|
||||
"connect": "^3.6.5",
|
||||
"coveralls": "^3.0.2",
|
||||
"detox": "16.7.2",
|
||||
"eslint": "7.12.0",
|
||||
"eslint-config-fb-strict": "^24.9.0",
|
||||
"eslint-config-fbjs": "2.1.0",
|
||||
"eslint-config-prettier": "^6.0.0",
|
||||
"eslint-plugin-babel": "^5.3.0",
|
||||
"eslint-plugin-eslint-comments": "^3.1.1",
|
||||
"eslint-plugin-flowtype": "2.50.3",
|
||||
"eslint-plugin-jest": "22.4.1",
|
||||
"eslint-plugin-jsx-a11y": "6.2.1",
|
||||
"eslint-plugin-prettier": "2.6.2",
|
||||
"eslint-plugin-react": "7.21.5",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-react-native": "3.10.0",
|
||||
"eslint-plugin-relay": "1.8.1",
|
||||
"jest": "^26.6.3",
|
||||
"jest-junit": "^10.0.0",
|
||||
"jscodeshift": "^0.11.0",
|
||||
"metro-babel-register": "0.66.2",
|
||||
"metro-transform-plugins": "^0.66.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"prettier": "1.19.1",
|
||||
"react-shallow-renderer": "16.14.1",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"shelljs": "^0.7.8",
|
||||
"signedsource": "^1.0.0",
|
||||
"ws": "^6.1.4",
|
||||
"yargs": "^15.3.1"
|
||||
},
|
||||
"detox": {
|
||||
"test-runner": "jest",
|
||||
@@ -159,4 +195,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,4 +52,5 @@ end
|
||||
|
||||
post_install do |installer|
|
||||
react_native_post_install(installer)
|
||||
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
||||
end
|
||||
|
||||
+523
-523
File diff suppressed because it is too large
Load Diff
@@ -11,13 +11,10 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.14.0",
|
||||
"@babel/generator": "^7.14.0",
|
||||
"@babel/template": "^7.0.0",
|
||||
"@babel/types": "^7.0.0",
|
||||
"@react-native-community/eslint-plugin": "*",
|
||||
"@reactions/component": "^2.0.2",
|
||||
"async": "^2.4.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-preset-fbjs": "^3.4.0",
|
||||
"clang-format": "^1.2.4",
|
||||
"connect": "^3.6.5",
|
||||
"coveralls": "^3.0.2",
|
||||
@@ -41,7 +38,6 @@
|
||||
"jest-junit": "^10.0.0",
|
||||
"jscodeshift": "^0.11.0",
|
||||
"metro-babel-register": "0.66.2",
|
||||
"metro-transform-plugins": "^0.66.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"prettier": "1.19.1",
|
||||
"react": "17.0.2",
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {
|
||||
parseVersion,
|
||||
getNextVersionFromTags,
|
||||
isTaggedLatest,
|
||||
isTaggedVersion,
|
||||
isReleaseBranch,
|
||||
} = require('../version-utils');
|
||||
|
||||
let execResult = null;
|
||||
jest.mock('shelljs', () => ({
|
||||
exec: () => {
|
||||
return {
|
||||
stdout: execResult,
|
||||
};
|
||||
},
|
||||
}));
|
||||
|
||||
describe('version-utils', () => {
|
||||
describe('isTaggedVersion', () => {
|
||||
it('should return true on pre-release versions', () => {
|
||||
execResult = 'v0.66.0-rc.3\nlatest\n\n';
|
||||
expect(isTaggedVersion('6c19dc3266b84f47a076b647a1c93b3c3b69d2c5')).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
it('should return true on release versions', () => {
|
||||
execResult = 'latest\nv0.66.2\n\n';
|
||||
expect(isTaggedVersion('6c19dc3266b84f47a076b647a1c93b3c3b69d2c5')).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
it('should return false when no tags', () => {
|
||||
execResult = '\n';
|
||||
expect(isTaggedVersion('6c19dc3266b84f47a076b647a1c93b3c3b69d2c5')).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
it('should return false on tags that are not versions', () => {
|
||||
execResult = 'latest\n0.someother-made-up-tag\n\n';
|
||||
expect(isTaggedVersion('6c19dc3266b84f47a076b647a1c93b3c3b69d2c5')).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isReleaseBranch', () => {
|
||||
it('should identify as release branch', () => {
|
||||
expect(isReleaseBranch('v0.66-stable')).toBe(true);
|
||||
expect(isReleaseBranch('0.66-stable')).toBe(true);
|
||||
expect(isReleaseBranch('made-up-stuff-stable')).toBe(true);
|
||||
});
|
||||
it('should not identify as release branch', () => {
|
||||
expect(isReleaseBranch('main')).toBe(false);
|
||||
expect(isReleaseBranch('pull/32659')).toBe(false);
|
||||
});
|
||||
});
|
||||
describe('isTaggedLatest', () => {
|
||||
it('it should identify commit as tagged `latest`', () => {
|
||||
execResult = '6c19dc3266b84f47a076b647a1c93b3c3b69d2c5\n';
|
||||
expect(isTaggedLatest('6c19dc3266b84f47a076b647a1c93b3c3b69d2c5')).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
it('it should not identify commit as tagged `latest`', () => {
|
||||
execResult = '6c19dc3266b84f47a076b647a1c93b3c3b69d2c5\n';
|
||||
expect(isTaggedLatest('6c19dc3266b8')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNextVersionFromTags', () => {
|
||||
it('should increment last stable tag', () => {
|
||||
execResult =
|
||||
'v0.66.3\nv0.66.2\nv0.66.1\nv0.66.0-rc.4\nv0.66.0-rc.3\nv0.66.0-rc.2\nv0.66.0-rc.1\nv0.66.0-rc.0';
|
||||
expect(getNextVersionFromTags('0.66-stable')).toBe('0.66.4');
|
||||
});
|
||||
|
||||
it('should find last prerelease tag and increment', () => {
|
||||
execResult =
|
||||
'v0.66.0-rc.4\nv0.66.0-rc.3\nv0.66.0-rc.2\nv0.66.0-rc.1\nv0.66.0-rc.0';
|
||||
expect(getNextVersionFromTags('0.66-stable')).toBe('0.66.0-rc.5');
|
||||
});
|
||||
|
||||
it('should return rc.0 version if no previous tags', () => {
|
||||
execResult = '\n';
|
||||
expect(getNextVersionFromTags('0.66-stable')).toBe('0.66.0-rc.0');
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseVersion', () => {
|
||||
it('should throw error if invalid match', () => {
|
||||
function testInvalidVersion() {
|
||||
parseVersion('<invalid version>');
|
||||
}
|
||||
expect(testInvalidVersion).toThrowErrorMatchingInlineSnapshot(
|
||||
`"You must pass a correctly formatted version; couldn't parse <invalid version>"`,
|
||||
);
|
||||
});
|
||||
|
||||
it('should parse pre-release version with .', () => {
|
||||
const {version, major, minor, patch, prerelease} = parseVersion(
|
||||
'0.66.0-rc.4',
|
||||
);
|
||||
expect(version).toBe('0.66.0-rc.4');
|
||||
expect(major).toBe('0');
|
||||
expect(minor).toBe('66');
|
||||
expect(patch).toBe('0');
|
||||
expect(prerelease).toBe('rc.4');
|
||||
});
|
||||
|
||||
it('should parse pre-release version with -', () => {
|
||||
const {version, major, minor, patch, prerelease} = parseVersion(
|
||||
'0.66.0-rc-4',
|
||||
);
|
||||
expect(version).toBe('0.66.0-rc-4');
|
||||
expect(major).toBe('0');
|
||||
expect(minor).toBe('66');
|
||||
expect(patch).toBe('0');
|
||||
expect(prerelease).toBe('rc-4');
|
||||
});
|
||||
|
||||
it('should parse stable version', () => {
|
||||
const {version, major, minor, patch, prerelease} = parseVersion('0.66.0');
|
||||
expect(version).toBe('0.66.0');
|
||||
expect(major).toBe('0');
|
||||
expect(minor).toBe('66');
|
||||
expect(patch).toBe('0');
|
||||
expect(prerelease).toBeUndefined();
|
||||
});
|
||||
it('should parse pre-release version from tag', () => {
|
||||
const {version, major, minor, patch, prerelease} = parseVersion(
|
||||
'v0.66.1-rc.4',
|
||||
);
|
||||
expect(version).toBe('0.66.1-rc.4');
|
||||
expect(major).toBe('0');
|
||||
expect(minor).toBe('66');
|
||||
expect(patch).toBe('1');
|
||||
expect(prerelease).toBe('rc.4');
|
||||
});
|
||||
|
||||
it('should parse stable version from tag', () => {
|
||||
const {version, major, minor, patch, prerelease} = parseVersion(
|
||||
'v0.66.0',
|
||||
);
|
||||
expect(version).toBe('0.66.0');
|
||||
expect(major).toBe('0');
|
||||
expect(minor).toBe('66');
|
||||
expect(patch).toBe('0');
|
||||
expect(prerelease).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should parse nightly fake version', () => {
|
||||
const {version, major, minor, patch, prerelease} = parseVersion('0.0.0');
|
||||
expect(version).toBe('0.0.0');
|
||||
expect(major).toBe('0');
|
||||
expect(minor).toBe('0');
|
||||
expect(patch).toBe('0');
|
||||
expect(prerelease).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should parse dryrun fake version', () => {
|
||||
const {version, major, minor, patch, prerelease} = parseVersion(
|
||||
'1000.0.0',
|
||||
);
|
||||
expect(version).toBe('1000.0.0');
|
||||
expect(major).toBe('1000');
|
||||
expect(minor).toBe('0');
|
||||
expect(patch).toBe('0');
|
||||
expect(prerelease).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -19,6 +19,7 @@
|
||||
const fs = require('fs');
|
||||
const {cat, echo, exec, exit, sed} = require('shelljs');
|
||||
const yargs = require('yargs');
|
||||
const {parseVersion} = require('./version-utils');
|
||||
|
||||
let argv = yargs
|
||||
.option('r', {
|
||||
@@ -33,6 +34,11 @@ let argv = yargs
|
||||
.option('v', {
|
||||
alias: 'to-version',
|
||||
type: 'string',
|
||||
})
|
||||
.option('l', {
|
||||
alias: 'latest',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
}).argv;
|
||||
|
||||
const nightlyBuild = argv.nightly;
|
||||
@@ -70,15 +76,16 @@ if (!nightlyBuild) {
|
||||
}
|
||||
}
|
||||
|
||||
// Generate version files to detect mismatches between JS and native.
|
||||
let match = version.match(/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/);
|
||||
if (!match) {
|
||||
echo(
|
||||
`You must pass a correctly formatted version; couldn't parse ${version}`,
|
||||
);
|
||||
let major,
|
||||
minor,
|
||||
patch,
|
||||
prerelease = -1;
|
||||
try {
|
||||
({major, minor, patch, prerelease} = parseVersion(version));
|
||||
} catch (e) {
|
||||
echo(e.message);
|
||||
exit(1);
|
||||
}
|
||||
let [, major, minor, patch, prerelease] = match;
|
||||
|
||||
fs.writeFileSync(
|
||||
'ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java',
|
||||
@@ -219,8 +226,9 @@ if (!nightlyBuild) {
|
||||
let remote = argv.remote;
|
||||
exec(`git push ${remote} v${version}`);
|
||||
|
||||
// Tag latest if doing stable release
|
||||
if (version.indexOf('rc') === -1) {
|
||||
// Tag latest if doing stable release.
|
||||
// This will also tag npm release as `latest`
|
||||
if (prerelease == null && argv.latest) {
|
||||
exec('git tag -d latest');
|
||||
exec(`git push ${remote} :latest`);
|
||||
exec('git tag latest');
|
||||
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* This script prepares a release package to be pushed to npm
|
||||
* It is run by CircleCI on a push to a release branch
|
||||
* It will:
|
||||
* * It updates the version in json/gradle files and makes sure they are consistent between each other (set-rn-version)
|
||||
* * Updates podfile for RNTester
|
||||
* * Commits changes and tags with the next version based off of last version tag.
|
||||
* This in turn will trigger another CircleCI job to publish to npm
|
||||
*/
|
||||
const {echo, exec, exit} = require('shelljs');
|
||||
const yargs = require('yargs');
|
||||
const {
|
||||
isReleaseBranch,
|
||||
isTaggedLatest,
|
||||
isTaggedVersion,
|
||||
getNextVersionFromTags,
|
||||
} = require('./version-utils');
|
||||
|
||||
const branch = process.env.CIRCLE_BRANCH;
|
||||
const currentCommit = process.env.CIRCLE_SHA1;
|
||||
|
||||
const argv = yargs.option('r', {
|
||||
alias: 'remote',
|
||||
default: 'origin',
|
||||
}).argv;
|
||||
|
||||
// We do this check to prevent a loop of commit in this script to trigger the job again.
|
||||
// I haven't figured out a way for CircleCI to filter out commits from CircleCI jobs
|
||||
if (isTaggedVersion(currentCommit)) {
|
||||
console.log(
|
||||
'Skip running prepare-package-for-release as this job was triggered from previous run of this script.',
|
||||
);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!isReleaseBranch(branch)) {
|
||||
console.error('This needs to be on a release branch');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Progress the version by 1 using existing git tags
|
||||
const version = getNextVersionFromTags(branch);
|
||||
|
||||
if (exec(`node scripts/set-rn-version.js --to-version ${version}`).code) {
|
||||
echo(`Failed to set React Native version to ${version}`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Release builds should commit the version bumps, and create tags.
|
||||
echo('Updating RNTester Podfile.lock...');
|
||||
if (exec('source scripts/update_podfile_lock.sh && update_pods').code) {
|
||||
echo('Failed to update RNTester Podfile.lock.');
|
||||
echo('Fix the issue, revert and try again.');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Check if this release has been tagged as latest
|
||||
const isLatest = isTaggedLatest(currentCommit);
|
||||
|
||||
// Make commit [0.21.0-rc] Bump version numbers
|
||||
if (exec(`git commit -a -m "[${version}] Bump version numbers"`).code) {
|
||||
echo('failed to commit');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Since we just committed, if `isLatest`, move the tag to commit we just made
|
||||
// This tag will also update npm release as `latest`
|
||||
if (isLatest) {
|
||||
exec('git tag -d latest');
|
||||
exec(`git push ${remote} :latest`);
|
||||
exec('git tag latest');
|
||||
exec(`git push ${remote} latest`);
|
||||
}
|
||||
|
||||
// Add tag v0.21.0-rc.1
|
||||
if (exec(`git tag v${version}`).code) {
|
||||
echo(
|
||||
`failed to tag the commit with v${version}, are you sure this release wasn't made earlier?`,
|
||||
);
|
||||
echo('You may want to rollback the last commit');
|
||||
echo('git reset --hard HEAD~1');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Push newly created tag
|
||||
let remote = argv.remote;
|
||||
exec(`git push ${remote} v${version}`);
|
||||
|
||||
exec(`git push ${remote} ${branch} --follow-tags`);
|
||||
|
||||
exit(0);
|
||||
+61
-77
@@ -10,7 +10,7 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* This script publishes a new version of react-native to NPM.
|
||||
* This script prepares a release version of react-native and may publish to NPM.
|
||||
* It is supposed to run in CI environment, not on a developer's machine.
|
||||
*
|
||||
* To make it easier for developers it uses some logic to identify with which
|
||||
@@ -49,11 +49,14 @@
|
||||
* If tag v0.XY.Z is present on the commit then publish to npm with version 0.XY.Z and no tag (npm will consider it latest)
|
||||
*/
|
||||
|
||||
/*eslint-disable no-undef */
|
||||
require('shelljs/global');
|
||||
const {exec, echo, exit, test} = require('shelljs');
|
||||
const yargs = require('yargs');
|
||||
const {parseVersion} = require('./version-utils');
|
||||
|
||||
let argv = yargs
|
||||
const buildTag = process.env.CIRCLE_TAG;
|
||||
const otp = process.env.NPM_CONFIG_OTP;
|
||||
|
||||
const argv = yargs
|
||||
.option('n', {
|
||||
alias: 'nightly',
|
||||
type: 'boolean',
|
||||
@@ -64,90 +67,60 @@ let argv = yargs
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
}).argv;
|
||||
|
||||
const nightlyBuild = argv.nightly;
|
||||
const dryRunBuild = argv.dryRun;
|
||||
const buildFromMain = nightlyBuild || dryRunBuild;
|
||||
const buildTag = process.env.CIRCLE_TAG;
|
||||
const otp = process.env.NPM_CONFIG_OTP;
|
||||
|
||||
let branchVersion = 0;
|
||||
if (buildFromMain) {
|
||||
branchVersion = 0;
|
||||
} else {
|
||||
if (!buildTag) {
|
||||
echo('Error: We publish only from git tags');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
let match = buildTag.match(/^v(\d+\.\d+)\.\d+(?:-.+)?$/);
|
||||
if (!match) {
|
||||
echo('Error: We publish only from release version git tags');
|
||||
exit(1);
|
||||
}
|
||||
[, branchVersion] = match;
|
||||
}
|
||||
// 0.33
|
||||
|
||||
// 34c034298dc9cad5a4553964a5a324450fda0385
|
||||
const currentCommit = exec('git rev-parse HEAD', {silent: true}).stdout.trim();
|
||||
|
||||
// Note: We rely on tagsWithVersion to be alphabetically sorted
|
||||
// [34c034298dc9cad5a4553964a5a324450fda0385, refs/heads/0.33-stable, refs/tags/latest, refs/tags/v0.33.1, refs/tags/v0.34.1-rc]
|
||||
const tagsWithVersion = exec(`git ls-remote origin | grep ${currentCommit}`, {
|
||||
const currentCommit = exec('git rev-parse HEAD', {
|
||||
silent: true,
|
||||
})
|
||||
.stdout.split(/\s/)
|
||||
// ['refs/tags/v0.33.0', 'refs/tags/v0.33.0-rc', 'refs/tags/v0.33.0-rc1', 'refs/tags/v0.33.0-rc2', 'refs/tags/v0.34.0']
|
||||
.filter(
|
||||
version =>
|
||||
!!version && version.indexOf(`refs/tags/v${branchVersion}`) === 0,
|
||||
)
|
||||
// ['refs/tags/v0.33.0', 'refs/tags/v0.33.0-rc', 'refs/tags/v0.33.0-rc1', 'refs/tags/v0.33.0-rc2']
|
||||
.filter(version => version.indexOf(branchVersion) !== -1)
|
||||
// ['0.33.0', '0.33.0-rc', '0.33.0-rc1', '0.33.0-rc2']
|
||||
.map(version => version.slice('refs/tags/v'.length));
|
||||
}).stdout.trim();
|
||||
const shortCommit = currentCommit.slice(0, 9);
|
||||
|
||||
if (!buildFromMain && tagsWithVersion.length === 0) {
|
||||
echo(
|
||||
'Error: Cannot find version tag in current commit. To deploy to NPM you must add tag v0.XY.Z[-rc] to your commit',
|
||||
);
|
||||
const rawVersion =
|
||||
// 0.0.0 triggers issues with cocoapods for codegen when building template project.
|
||||
dryRunBuild
|
||||
? '1000.0.0'
|
||||
: // For nightly we continue to use 0.0.0 for clarity for npm
|
||||
nightlyBuild
|
||||
? '0.0.0'
|
||||
: // For pre-release and stable releases, we use the git tag of the version we're releasing (set in bump-oss-version)
|
||||
buildTag;
|
||||
|
||||
let version,
|
||||
major,
|
||||
minor,
|
||||
prerelease = null;
|
||||
try {
|
||||
({version, major, minor, prerelease} = parseVersion(rawVersion));
|
||||
} catch (e) {
|
||||
echo(e.message);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
let releaseVersion;
|
||||
if (dryRunBuild) {
|
||||
releaseVersion = `${version}-${shortCommit}`;
|
||||
} else if (nightlyBuild) {
|
||||
// 2021-09-28T05:38:40.669Z -> 20210928-0538
|
||||
const dateIdentifier = new Date()
|
||||
.toISOString()
|
||||
.slice(0, -8)
|
||||
.replace(/[-:]/g, '')
|
||||
.replace(/[T]/g, '-');
|
||||
releaseVersion = `${version}-${dateIdentifier}-${shortCommit}`;
|
||||
} else {
|
||||
releaseVersion = version;
|
||||
}
|
||||
|
||||
if (buildFromMain) {
|
||||
releaseVersion = '0.0.0';
|
||||
|
||||
if (nightlyBuild) {
|
||||
releaseVersion += '-';
|
||||
// 2021-09-28T05:38:40.669Z -> 20210928-0538
|
||||
releaseVersion += new Date()
|
||||
.toISOString()
|
||||
.slice(0, -8)
|
||||
.replace(/[-:]/g, '')
|
||||
.replace(/[T]/g, '-');
|
||||
}
|
||||
|
||||
releaseVersion += `-${currentCommit.slice(0, 9)}`;
|
||||
// Bump version number in various files (package.json, gradle.properties etc)
|
||||
// Bump version number in various files (package.json, gradle.properties etc)
|
||||
// For stable, pre-release releases, we manually call bump-oss-version on release branch
|
||||
if (nightlyBuild || dryRunBuild) {
|
||||
if (
|
||||
exec(
|
||||
`node scripts/bump-oss-version.js --nightly --to-version ${releaseVersion}`,
|
||||
).code
|
||||
exec(`node scripts/set-rn-version.js --to-version ${releaseVersion}`).code
|
||||
) {
|
||||
echo('Failed to bump version number');
|
||||
exit(1);
|
||||
}
|
||||
} else if (tagsWithVersion[0].indexOf('-rc') === -1) {
|
||||
// if first tag on this commit is non -rc then we are making a stable release
|
||||
// '0.33.0'
|
||||
releaseVersion = tagsWithVersion[0];
|
||||
} else {
|
||||
// otherwise pick last -rc tag, indicates latest rc version due to alpha-sort
|
||||
// '0.33.0-rc2'
|
||||
releaseVersion = tagsWithVersion[tagsWithVersion.length - 1];
|
||||
}
|
||||
|
||||
// -------- Generating Android Artifacts with JavaDoc
|
||||
@@ -182,12 +155,24 @@ if (dryRunBuild) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// if version contains -rc, tag as prerelease
|
||||
// Running to see if this commit has been git tagged as `latest`
|
||||
const latestCommit = exec("git rev-list -n 1 'latest'", {
|
||||
silent: true,
|
||||
}).stdout.replace('\n', '');
|
||||
const isLatest = currentCommit === latestCommit;
|
||||
|
||||
const releaseBranch = `${major}.${minor}-stable`;
|
||||
|
||||
// Set the right tag for nightly and prerelease builds
|
||||
// If a release is not git-tagged as `latest` we use `releaseBranch` to prevent
|
||||
// npm from overriding the current `latest` version tag, which it will do if no tag is set.
|
||||
const tagFlag = nightlyBuild
|
||||
? '--tag nightly'
|
||||
: releaseVersion.indexOf('-rc') === -1
|
||||
? ''
|
||||
: '--tag next';
|
||||
: prerelease != null
|
||||
? '--tag next'
|
||||
: isLatest
|
||||
? '--tag latest'
|
||||
: `--tag ${releaseBranch}`;
|
||||
|
||||
// use otp from envvars if available
|
||||
const otpFlag = otp ? `--otp ${otp}` : '';
|
||||
@@ -199,4 +184,3 @@ if (exec(`npm publish ${tagFlag} ${otpFlag}`).code) {
|
||||
echo(`Published to npm ${releaseVersion}`);
|
||||
exit(0);
|
||||
}
|
||||
/*eslint-enable no-undef */
|
||||
|
||||
@@ -117,7 +117,7 @@ fi
|
||||
|
||||
BUNDLE_FILE="$CONFIGURATION_BUILD_DIR/main.jsbundle"
|
||||
|
||||
EXTRA_ARGS=()
|
||||
EXTRA_ARGS=
|
||||
|
||||
case "$PLATFORM_NAME" in
|
||||
"macosx")
|
||||
@@ -144,12 +144,12 @@ if [[ $EMIT_SOURCEMAP == true ]]; then
|
||||
else
|
||||
PACKAGER_SOURCEMAP_FILE="$SOURCEMAP_FILE"
|
||||
fi
|
||||
EXTRA_ARGS+=("--sourcemap-output" "$PACKAGER_SOURCEMAP_FILE")
|
||||
EXTRA_ARGS="$EXTRA_ARGS --sourcemap-output $PACKAGER_SOURCEMAP_FILE"
|
||||
fi
|
||||
|
||||
# Hermes doesn't require JS minification.
|
||||
if [[ $USE_HERMES == true && $DEV == false ]]; then
|
||||
EXTRA_ARGS+=("--minify" "false")
|
||||
EXTRA_ARGS="$EXTRA_ARGS --minify false"
|
||||
fi
|
||||
|
||||
"$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \
|
||||
@@ -160,8 +160,8 @@ fi
|
||||
--reset-cache \
|
||||
--bundle-output "$BUNDLE_FILE" \
|
||||
--assets-dest "$DEST" \
|
||||
"${EXTRA_ARGS[@]}" \
|
||||
"${EXTRA_PACKAGER_ARGS[@]}"
|
||||
$EXTRA_ARGS \
|
||||
$EXTRA_PACKAGER_ARGS
|
||||
|
||||
if [[ $USE_HERMES != true ]]; then
|
||||
cp "$BUNDLE_FILE" "$DEST/"
|
||||
|
||||
@@ -374,8 +374,24 @@ end
|
||||
# See https://github.com/facebook/react-native/issues/31480#issuecomment-902912841 for more context.
|
||||
# Actual fix was authored by https://github.com/mikehardy.
|
||||
# New app template will call this for now until the underlying issue is resolved.
|
||||
#
|
||||
# It's not needed anymore and will be removed later
|
||||
def __apply_Xcode_12_5_M1_post_install_workaround(installer)
|
||||
puts "__apply_Xcode_12_5_M1_post_install_workaround() is not needed anymore"
|
||||
# Flipper podspecs are still targeting an older iOS deployment target, and may cause an error like:
|
||||
# "error: thread-local storage is not supported for the current target"
|
||||
# The most reliable known workaround is to bump iOS deployment target to match react-native (iOS 11 now).
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
# ensure IPHONEOS_DEPLOYMENT_TARGET is at least 11.0
|
||||
deployment_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f
|
||||
should_upgrade = deployment_target < 11.0 && deployment_target != 0.0
|
||||
if should_upgrade
|
||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# But... doing so caused another issue in Flipper:
|
||||
# "Time.h:52:17: error: typedef redefinition with different types"
|
||||
# We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
|
||||
# See https://github.com/facebook/flipper/issues/834 for more details.
|
||||
`sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' Pods/RCT-Folly/folly/portability/Time.h`
|
||||
end
|
||||
|
||||
Executable
+163
@@ -0,0 +1,163 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* This script updates relevant React Native files with supplied version:
|
||||
* * Prepares a package.json suitable for package consumption
|
||||
* * Updates package.json for template project
|
||||
* * Updates the version in gradle files and makes sure they are consistent between each other
|
||||
* * Creates a gemfile
|
||||
*/
|
||||
const fs = require('fs');
|
||||
const {cat, echo, exec, exit, sed} = require('shelljs');
|
||||
const yargs = require('yargs');
|
||||
const {parseVersion} = require('./version-utils');
|
||||
|
||||
let argv = yargs.option('v', {
|
||||
alias: 'to-version',
|
||||
type: 'string',
|
||||
}).argv;
|
||||
|
||||
const version = argv.toVersion;
|
||||
|
||||
if (!version) {
|
||||
echo('You must specify a version using -v');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
let major,
|
||||
minor,
|
||||
patch,
|
||||
prerelease = -1;
|
||||
try {
|
||||
({major, minor, patch, prerelease} = parseVersion(version));
|
||||
} catch (e) {
|
||||
echo(e.message);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
'ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java',
|
||||
cat('scripts/versiontemplates/ReactNativeVersion.java.template')
|
||||
.replace('${major}', major)
|
||||
.replace('${minor}', minor)
|
||||
.replace('${patch}', patch)
|
||||
.replace(
|
||||
'${prerelease}',
|
||||
prerelease !== undefined ? `"${prerelease}"` : 'null',
|
||||
),
|
||||
'utf-8',
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
'React/Base/RCTVersion.m',
|
||||
cat('scripts/versiontemplates/RCTVersion.m.template')
|
||||
.replace('${major}', `@(${major})`)
|
||||
.replace('${minor}', `@(${minor})`)
|
||||
.replace('${patch}', `@(${patch})`)
|
||||
.replace(
|
||||
'${prerelease}',
|
||||
prerelease !== undefined ? `@"${prerelease}"` : '[NSNull null]',
|
||||
),
|
||||
'utf-8',
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
'ReactCommon/cxxreact/ReactNativeVersion.h',
|
||||
cat('scripts/versiontemplates/ReactNativeVersion.h.template')
|
||||
.replace('${major}', major)
|
||||
.replace('${minor}', minor)
|
||||
.replace('${patch}', patch)
|
||||
.replace(
|
||||
'${prerelease}',
|
||||
prerelease !== undefined ? `"${prerelease}"` : '""',
|
||||
),
|
||||
'utf-8',
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
'Libraries/Core/ReactNativeVersion.js',
|
||||
cat('scripts/versiontemplates/ReactNativeVersion.js.template')
|
||||
.replace('${major}', major)
|
||||
.replace('${minor}', minor)
|
||||
.replace('${patch}', patch)
|
||||
.replace(
|
||||
'${prerelease}',
|
||||
prerelease !== undefined ? `'${prerelease}'` : 'null',
|
||||
),
|
||||
'utf-8',
|
||||
);
|
||||
|
||||
let packageJson = JSON.parse(cat('package.json'));
|
||||
packageJson.version = version;
|
||||
delete packageJson.workspaces;
|
||||
delete packageJson.private;
|
||||
|
||||
// Copy dependencies over from repo-config/package.json
|
||||
const repoConfigJson = JSON.parse(cat('repo-config/package.json'));
|
||||
packageJson.devDependencies = {
|
||||
...packageJson.devDependencies,
|
||||
...repoConfigJson.dependencies,
|
||||
};
|
||||
// Make react-native-codegen a direct dependency of react-native
|
||||
delete packageJson.devDependencies['react-native-codegen'];
|
||||
packageJson.dependencies = {
|
||||
...packageJson.dependencies,
|
||||
'react-native-codegen': repoConfigJson.dependencies['react-native-codegen'],
|
||||
};
|
||||
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2), 'utf-8');
|
||||
|
||||
// Change ReactAndroid/gradle.properties
|
||||
if (
|
||||
sed(
|
||||
'-i',
|
||||
/^VERSION_NAME=.*/,
|
||||
`VERSION_NAME=${version}`,
|
||||
'ReactAndroid/gradle.properties',
|
||||
).code
|
||||
) {
|
||||
echo("Couldn't update version for Gradle");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Change react-native version in the template's package.json
|
||||
exec(`node scripts/set-rn-template-version.js ${version}`);
|
||||
|
||||
// Make sure to update ruby version
|
||||
if (exec('scripts/update-ruby.sh').code) {
|
||||
echo('Failed to update Ruby version');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Verify that files changed, we just do a git diff and check how many times version is added across files
|
||||
const filesToValidate = [
|
||||
'package.json',
|
||||
'ReactAndroid/gradle.properties',
|
||||
'template/package.json',
|
||||
];
|
||||
const numberOfChangedLinesWithNewVersion = exec(
|
||||
`git diff -U0 ${filesToValidate.join(
|
||||
' ',
|
||||
)}| grep '^[+]' | grep -c ${version} `,
|
||||
{silent: true},
|
||||
).stdout.trim();
|
||||
|
||||
if (+numberOfChangedLinesWithNewVersion !== filesToValidate.length) {
|
||||
echo(
|
||||
`Failed to update all the files: [${filesToValidate.join(
|
||||
', ',
|
||||
)}] must have versions in them`,
|
||||
);
|
||||
echo('Fix the issue and try again');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
@@ -55,6 +55,9 @@ sed_i -e "s/^\(ruby '\)[^']*\('.*\)$/\1$VERSION\2/" template/Gemfile
|
||||
|
||||
rm -f Gemfile.lock template/Gemfile.lock
|
||||
|
||||
export BUNDLE_APP_CONFIG="$ROOT/.bundle"
|
||||
cp "$BUNDLE_APP_CONFIG/"* template/_bundle # sync!
|
||||
|
||||
bundle lock
|
||||
(cd template && bundle lock)
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {exec} = require('shelljs');
|
||||
|
||||
const VERSION_REGEX = /^v?((\d+)\.(\d+)\.(\d+)(?:-(.+))?)$/;
|
||||
|
||||
function parseVersion(versionStr) {
|
||||
const match = versionStr.match(VERSION_REGEX);
|
||||
if (!match) {
|
||||
throw new Error(
|
||||
`You must pass a correctly formatted version; couldn't parse ${versionStr}`,
|
||||
);
|
||||
}
|
||||
const [, version, major, minor, patch, prerelease] = match;
|
||||
return {
|
||||
version,
|
||||
major,
|
||||
minor,
|
||||
patch,
|
||||
prerelease,
|
||||
};
|
||||
}
|
||||
|
||||
function getLatestVersionTag(branchVersion) {
|
||||
// Returns list of tags like ["v0.67.2", "v0.67.1", "v0.67.0-rc.3", "v0.67.0-rc.2", ...] in reverse lexical order
|
||||
const tags = exec(`git tag --list "v${branchVersion}*" --sort=-refname`, {
|
||||
silent: true,
|
||||
})
|
||||
.stdout.trim()
|
||||
.split('\n')
|
||||
.filter(tag => tag.length > 0);
|
||||
|
||||
// If there are no tags, return null
|
||||
if (tags.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return most recent tag (with the "v" prefix)
|
||||
return tags[0];
|
||||
}
|
||||
|
||||
function getNextVersionFromTags(branch) {
|
||||
// Assumption that branch names will follow pattern `{major}.{minor}-stable`
|
||||
// Ex. "0.67-stable" -> "0.67"
|
||||
const branchVersion = branch.replace('-stable', '');
|
||||
|
||||
// Get the latest version tag of the release branch
|
||||
const versionTag = getLatestVersionTag(branchVersion);
|
||||
|
||||
// If there are no tags , we assume this is the first pre-release
|
||||
if (versionTag == null) {
|
||||
return `${branchVersion}.0-rc.0`;
|
||||
}
|
||||
|
||||
const {major, minor, patch, prerelease} = parseVersion(versionTag);
|
||||
if (prerelease != null) {
|
||||
// prelease is of the form "rc.X"
|
||||
const prereleasePatch = parseInt(prerelease.slice(3), 10);
|
||||
return `${major}.${minor}.${patch}-rc.${prereleasePatch + 1}`;
|
||||
}
|
||||
|
||||
// If not prerelease, increment the patch version
|
||||
return `${major}.${minor}.${parseInt(patch, 10) + 1}`;
|
||||
}
|
||||
|
||||
function isReleaseBranch(branch) {
|
||||
return branch.endsWith('-stable');
|
||||
}
|
||||
|
||||
function isTaggedVersion(commitSha) {
|
||||
const tags = exec(`git tag --points-at ${commitSha}`, {
|
||||
silent: true,
|
||||
})
|
||||
.stdout.trim()
|
||||
.split('\n');
|
||||
return tags.some(tag => !!tag.match(VERSION_REGEX));
|
||||
}
|
||||
|
||||
function isTaggedLatest(commitSha) {
|
||||
return (
|
||||
exec(`git rev-list -1 latest | grep ${commitSha}`, {
|
||||
silent: true,
|
||||
}).stdout.trim() === commitSha
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isTaggedLatest,
|
||||
isTaggedVersion,
|
||||
parseVersion,
|
||||
getNextVersionFromTags,
|
||||
isReleaseBranch,
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.4)
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
activesupport (6.1.4.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
@@ -56,16 +56,16 @@ GEM
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.9)
|
||||
escape (0.0.4)
|
||||
ethon (0.14.0)
|
||||
ethon (0.15.0)
|
||||
ffi (>= 1.15.0)
|
||||
ffi (1.15.4)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.8.10)
|
||||
i18n (1.8.11)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.5.1)
|
||||
json (2.6.1)
|
||||
minitest (5.14.4)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
@@ -85,10 +85,10 @@ GEM
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.4.2)
|
||||
zeitwerk (2.5.1)
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin-20
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cocoapods (~> 1.11, >= 1.11.2)
|
||||
@@ -97,4 +97,4 @@ RUBY VERSION
|
||||
ruby 2.7.4p191
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.28
|
||||
2.2.27
|
||||
|
||||
@@ -25,5 +25,6 @@ target 'HelloWorld' do
|
||||
|
||||
post_install do |installer|
|
||||
react_native_post_install(installer)
|
||||
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "17.0.2",
|
||||
"react-native": "1000.0.0"
|
||||
"react-native": "0.67.0-rc.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.9",
|
||||
|
||||
@@ -1103,6 +1103,26 @@
|
||||
sudo-prompt "^9.0.0"
|
||||
wcwidth "^1.0.1"
|
||||
|
||||
"@react-native-community/eslint-plugin@*":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-community/eslint-plugin/-/eslint-plugin-1.1.0.tgz#e42b1bef12d2415411519fd528e64b593b1363dc"
|
||||
integrity sha512-W/J0fNYVO01tioHjvYWQ9m6RgndVtbElzYozBq1ZPrHO/iCzlqoySHl4gO/fpCl9QEFjvJfjPgtPMTMlsoq5DQ==
|
||||
|
||||
"@react-native/assets@1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e"
|
||||
integrity sha512-KrwSpS1tKI70wuKl68DwJZYEvXktDHdZMG0k2AXD/rJVSlB23/X2CB2cutVR0HwNMJIal9HOUOBB2rVfa6UGtQ==
|
||||
|
||||
"@react-native/normalize-color@2.0.0":
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native/normalize-color/-/normalize-color-2.0.0.tgz#da955909432474a9a0fe1cbffc66576a0447f567"
|
||||
integrity sha512-Wip/xsc5lw8vsBlmY2MO/gFLp3MvuZ2baBZjDeTjjndMgM0h5sxz7AZR62RDPGgstp8Np7JzjvVqVT7tpFZqsw==
|
||||
|
||||
"@react-native/polyfills@2.0.0":
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native/polyfills/-/polyfills-2.0.0.tgz#4c40b74655c83982c8cf47530ee7dc13d957b6aa"
|
||||
integrity sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==
|
||||
|
||||
"@reactions/component@^2.0.2":
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@reactions/component/-/component-2.0.2.tgz#40f8c1c2c37baabe57a0c944edb9310dc1ec6642"
|
||||
@@ -5572,6 +5592,15 @@ react-is@^16.8.1, react-is@^16.8.4:
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
|
||||
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
|
||||
|
||||
react-native-codegen@^0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.0.8.tgz#b7796a54074139d956fff2862cf1285db43c891b"
|
||||
integrity sha512-k/944+0XD+8l7zDaiKfYabyEKmAmyZgS1mj+4LcSRPyHnrjgCHKrh/Y6jM6kucQ6xU1+1uyMmF/dSkikxK8i+Q==
|
||||
dependencies:
|
||||
flow-parser "^0.121.0"
|
||||
jscodeshift "^0.11.0"
|
||||
nullthrows "^1.1.1"
|
||||
|
||||
react-refresh@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.0.tgz#d421f9bd65e0e4b9822a399f14ac56bda9c92292"
|
||||
@@ -6171,13 +6200,6 @@ source-map-resolve@^0.5.0:
|
||||
source-map-url "^0.4.0"
|
||||
urix "^0.1.0"
|
||||
|
||||
source-map-support@0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.0.tgz#2018a7ad2bdf8faf2691e5fddab26bed5a2bacab"
|
||||
integrity sha512-vUoN3I7fHQe0R/SJLKRdKYuEdRGogsviXFkHHo17AWaTGv17VLnxw+CFXvqy+y4ORZ3doWLQcxRYfwKrsd/H7Q==
|
||||
dependencies:
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map-support@^0.5.16, source-map-support@^0.5.6:
|
||||
version "0.5.16"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042"
|
||||
|
||||
Reference in New Issue
Block a user