mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
42
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25f3d310d9 | ||
|
|
96ad60e3a1 | ||
|
|
218b4c19bb | ||
|
|
857dbd9b20 | ||
|
|
900af2b3b6 | ||
|
|
842aac5a3c | ||
|
|
a59141fb28 | ||
|
|
e7296d6b34 | ||
|
|
6fc004e95f | ||
|
|
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,9 +856,24 @@ workflows:
|
||||
|
||||
releases:
|
||||
jobs:
|
||||
# This job will trigger on relevant release branch pushes.
|
||||
# It prepares the package and triggers `build_npm_package` for release
|
||||
- prepare_package_for_release:
|
||||
name: prepare_package_for_release
|
||||
# Since CircleCI does not support branch AND tag filters, we manually check in job
|
||||
# and no-op if there is no `publish-v{version}` tag set.
|
||||
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
|
||||
# CircleCI filters are OR-ed, with all branches triggering by default and tags excluded by default
|
||||
# CircleCI env-vars are only set with the branch OR tag that triggered the job, not both.
|
||||
# In this case, CIRCLE_BRANCH is unset, but CIRCLE_TAG is set
|
||||
filters:
|
||||
# Both of the following conditions must be included!
|
||||
# Ignore any commit on any branch by default.
|
||||
|
||||
@@ -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*
|
||||
|
||||
+10
-10
@@ -1,9 +1,9 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.4)
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
activesupport (6.1.4.1)
|
||||
activesupport (6.1.4.4)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
@@ -15,7 +15,7 @@ GEM
|
||||
httpclient (~> 2.8, >= 2.8.3)
|
||||
json (>= 1.5.1)
|
||||
atomos (0.1.3)
|
||||
claide (1.0.3)
|
||||
claide (1.1.0)
|
||||
cocoapods (1.11.2)
|
||||
addressable (~> 2.8)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
@@ -56,17 +56,17 @@ 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)
|
||||
ffi (1.15.5)
|
||||
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)
|
||||
minitest (5.14.4)
|
||||
json (2.6.1)
|
||||
minitest (5.15.0)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
nap (1.1.0)
|
||||
@@ -85,7 +85,7 @@ GEM
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.4.2)
|
||||
zeitwerk (2.5.3)
|
||||
|
||||
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/set-rn-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,
|
||||
patch: 0,
|
||||
minor: 67,
|
||||
patch: 1,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
@@ -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>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
@@ -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: @(1),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
|
||||
- (void)hide
|
||||
{
|
||||
[_alertWindow setHidden:YES];
|
||||
|
||||
if (@available(iOS 13, *)) {
|
||||
_alertWindow.windowScene = nil;
|
||||
}
|
||||
|
||||
_alertWindow = nil;
|
||||
}
|
||||
|
||||
|
||||
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.1
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
@@ -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,
|
||||
"patch", 0,
|
||||
"minor", 67,
|
||||
"patch", 1,
|
||||
"prerelease", null);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@@ -16,8 +16,8 @@ namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 0;
|
||||
int32_t Patch = 0;
|
||||
int32_t Minor = 67;
|
||||
int32_t Patch = 1;
|
||||
std::string_view Prerelease = "";
|
||||
} ReactNativeVersion;
|
||||
|
||||
|
||||
+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
|
||||
|
||||
+46
-9
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"private": true,
|
||||
"version": "1000.0.0",
|
||||
"version": "0.67.1",
|
||||
"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,53 @@
|
||||
"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",
|
||||
"inquirer": "^7.1.0"
|
||||
},
|
||||
"detox": {
|
||||
"test-runner": "jest",
|
||||
@@ -159,4 +196,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-4
@@ -244,10 +244,6 @@ private fun Project.cleanupVMFiles(
|
||||
} else {
|
||||
// For JSC, delete all the libhermes* files
|
||||
it.include("**/libhermes*.so")
|
||||
// Delete the libjscexecutor from release build
|
||||
if (cleanup) {
|
||||
it.include("**/libjscexecutor.so")
|
||||
}
|
||||
}
|
||||
}
|
||||
.visit { visit ->
|
||||
|
||||
@@ -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
@@ -363,10 +363,6 @@ afterEvaluate {
|
||||
} else {
|
||||
// For JSC, delete all the libhermes* files
|
||||
include "**/libhermes*.so"
|
||||
// Delete the libjscexecutor from release build
|
||||
if (cleanup) {
|
||||
include "**/libjscexecutor.so"
|
||||
}
|
||||
}
|
||||
}.visit { details ->
|
||||
def targetVariant1 = ".*/transforms/[^/]*/${targetPath}/.*"
|
||||
|
||||
@@ -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",
|
||||
@@ -37,11 +34,11 @@
|
||||
"eslint-plugin-react-native": "3.10.0",
|
||||
"eslint-plugin-relay": "1.8.1",
|
||||
"flow-bin": "^0.162.0",
|
||||
"inquirer": "^7.1.0",
|
||||
"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": "17.0.2",
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
/**
|
||||
* 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,
|
||||
isTaggedLatest,
|
||||
getPublishVersion,
|
||||
isReleaseBranch,
|
||||
getPublishTag,
|
||||
} = require('../version-utils');
|
||||
|
||||
let execResult = null;
|
||||
jest.mock('shelljs', () => ({
|
||||
exec: () => {
|
||||
return {
|
||||
stdout: execResult,
|
||||
};
|
||||
},
|
||||
}));
|
||||
|
||||
describe('version-utils', () => {
|
||||
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('getPublishTag', () => {
|
||||
it('Should return null no tags are returned', () => {
|
||||
execResult = '\n';
|
||||
expect(getPublishTag()).toBe(null);
|
||||
});
|
||||
it('Should return tag', () => {
|
||||
execResult = 'publish-v999.0.0-rc.0\n';
|
||||
expect(getPublishTag()).toBe('publish-v999.0.0-rc.0');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getPublishVersion', () => {
|
||||
it('Should return null if invalid tag provided', () => {
|
||||
expect(getPublishVersion('')).toBe(null);
|
||||
expect(getPublishVersion('something')).toBe(null);
|
||||
});
|
||||
it('should throw error if invalid tag version provided', () => {
|
||||
function testInvalidVersion() {
|
||||
getPublishVersion('publish-<invalid-version>');
|
||||
}
|
||||
expect(testInvalidVersion).toThrowErrorMatchingInlineSnapshot(
|
||||
`"You must pass a correctly formatted version; couldn't parse <invalid-version>"`,
|
||||
);
|
||||
});
|
||||
it('Should return version for tag', () => {
|
||||
const {version, major, minor, patch, prerelease} = getPublishVersion(
|
||||
'publish-v0.67.0-rc.6',
|
||||
);
|
||||
expect(version).toBe('0.67.0-rc.6');
|
||||
expect(major).toBe('0');
|
||||
expect(minor).toBe('67');
|
||||
expect(patch).toBe('0');
|
||||
expect(prerelease).toBe('rc.6');
|
||||
});
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
});
|
||||
});
|
||||
+98
-189
@@ -11,223 +11,132 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* This script bumps a new version for open source releases.
|
||||
* It updates the version in json/gradle files and makes sure they are consistent between each other
|
||||
* After changing the files it makes a commit and tags it.
|
||||
* All you have to do is push changes to remote and CI will make a new build.
|
||||
* This script walks a releaser through bumping the version for a release
|
||||
* It will commit the appropriate tags to trigger the CircleCI jobs.
|
||||
* TODO change this workflow to use POST a trigger vs. using tags
|
||||
*/
|
||||
const fs = require('fs');
|
||||
const {cat, echo, exec, exit, sed} = require('shelljs');
|
||||
const {exec, exit} = require('shelljs');
|
||||
const yargs = require('yargs');
|
||||
const inquirer = require('inquirer');
|
||||
const {
|
||||
parseVersion,
|
||||
isReleaseBranch,
|
||||
getBranchName,
|
||||
} = require('./version-utils');
|
||||
|
||||
let argv = yargs
|
||||
.option('r', {
|
||||
alias: 'remote',
|
||||
default: 'origin',
|
||||
})
|
||||
.option('n', {
|
||||
alias: 'nightly',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
})
|
||||
.option('v', {
|
||||
alias: 'to-version',
|
||||
type: 'string',
|
||||
.check(() => {
|
||||
const branch = getBranchName();
|
||||
exitIfNotOnReleaseBranch(branch);
|
||||
return true;
|
||||
}).argv;
|
||||
|
||||
const nightlyBuild = argv.nightly;
|
||||
const version = argv.toVersion;
|
||||
|
||||
if (!version) {
|
||||
echo(
|
||||
'You must specify a version using -v',
|
||||
);
|
||||
exit(1);
|
||||
function exitIfNotOnReleaseBranch(branch) {
|
||||
if (!isReleaseBranch(branch)) {
|
||||
console.log(
|
||||
'This script must be run in a react-native git repository checkout and on a release branch',
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
let branch;
|
||||
if (!nightlyBuild) {
|
||||
// Check we are in release branch, e.g. 0.33-stable
|
||||
branch = exec('git symbolic-ref --short HEAD', {
|
||||
function getLatestTag(versionPrefix) {
|
||||
const tags = exec(`git tag --list "v${versionPrefix}*" --sort=-refname`, {
|
||||
silent: true,
|
||||
}).stdout.trim();
|
||||
|
||||
if (branch.indexOf('-stable') === -1) {
|
||||
echo('You must be in 0.XX-stable branch to bump a version');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// e.g. 0.33
|
||||
let versionMajor = branch.slice(0, branch.indexOf('-stable'));
|
||||
|
||||
// - check that argument version matches branch
|
||||
// e.g. 0.33.1 or 0.33.0-rc4
|
||||
if (version.indexOf(versionMajor) !== 0) {
|
||||
echo(
|
||||
`You must specify a version tag like 0.${versionMajor}.[X]-rc[Y] to bump a version`,
|
||||
);
|
||||
exit(1);
|
||||
})
|
||||
.stdout.trim()
|
||||
.split('\n')
|
||||
.filter(tag => tag.length > 0);
|
||||
if (tags.length > 0) {
|
||||
return tags[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 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}`,
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
let [, major, minor, patch, prerelease] = match;
|
||||
async function main() {
|
||||
const branch = getBranchName();
|
||||
|
||||
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',
|
||||
);
|
||||
const {pulled} = await inquirer.prompt({
|
||||
type: 'confirm',
|
||||
name: 'pulled',
|
||||
message: `You are currently on branch: ${branch}. Have you run "git pull ${argv.remote} ${branch} --tags"?`,
|
||||
});
|
||||
|
||||
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}`);
|
||||
|
||||
// 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',
|
||||
];
|
||||
let numberOfChangedLinesWithNewVersion = exec(
|
||||
`git diff -U0 ${filesToValidate.join(' ')}| grep '^[+]' | grep -c ${version} `,
|
||||
{silent: true},
|
||||
).stdout.trim();
|
||||
|
||||
// Make sure to update ruby version
|
||||
if (exec('scripts/update-ruby.sh').code) {
|
||||
echo('Failed to update Ruby version');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Release builds should commit the version bumps, and create tags.
|
||||
// Nightly builds do not need to do that.
|
||||
if (!nightlyBuild) {
|
||||
if (+numberOfChangedLinesWithNewVersion !== filesToValidate.length) {
|
||||
echo(
|
||||
`Failed to update all the files: [${filesToValidate.join(', ')}] must have versions in them`,
|
||||
);
|
||||
echo('Fix the issue, revert and try again');
|
||||
exec('git diff');
|
||||
if (!pulled) {
|
||||
console.log(`Please run 'git pull ${argv.remote} ${branch} --tags'`);
|
||||
exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
// Update Podfile.lock only on release builds, not nightlies.
|
||||
// Nightly builds don't need it as the main branch will already be up-to-date.
|
||||
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);
|
||||
const lastVersionTag = getLatestTag(branch.replace('-stable', ''));
|
||||
const lastVersion = lastVersionTag
|
||||
? parseVersion(lastVersionTag).version
|
||||
: null;
|
||||
const lastVersionMessage = lastVersion
|
||||
? `Last version tagged is ${lastVersion}.\n`
|
||||
: '';
|
||||
|
||||
const {releaseVersion} = await inquirer.prompt({
|
||||
type: 'input',
|
||||
name: 'releaseVersion',
|
||||
message: `What version are you releasing? (Ex. 0.66.0-rc.4)\n${lastVersionMessage}`,
|
||||
});
|
||||
|
||||
let setLatest = false;
|
||||
|
||||
const {version, prerelease} = parseVersion(releaseVersion);
|
||||
if (!prerelease) {
|
||||
const {latest} = await inquirer.prompt({
|
||||
type: 'confirm',
|
||||
name: 'latest',
|
||||
message: 'Set this version as "latest" on npm?',
|
||||
});
|
||||
setLatest = latest;
|
||||
}
|
||||
const npmTag = setLatest ? 'latest' : !prerelease ? branch : 'next';
|
||||
const {confirmRelease} = await inquirer.prompt({
|
||||
type: 'confirm',
|
||||
name: 'confirmRelease',
|
||||
message: `Releasing version "${version}" with npm tag "${npmTag}". Is this correct?`,
|
||||
});
|
||||
|
||||
if (!confirmRelease) {
|
||||
console.log('Aborting.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Make commit [0.21.0-rc] Bump version numbers
|
||||
if (exec(`git commit -a -m "[${version}] Bump version numbers"`).code) {
|
||||
echo('failed to commit');
|
||||
if (
|
||||
exec(`git tag -a publish-v${version} -m "publish version ${version}"`).code
|
||||
) {
|
||||
console.error(`Failed to tag publish-v${version}`);
|
||||
exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add tag v0.21.0-rc
|
||||
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}`);
|
||||
|
||||
// Tag latest if doing stable release
|
||||
if (version.indexOf('rc') === -1) {
|
||||
if (setLatest) {
|
||||
exec('git tag -d latest');
|
||||
exec(`git push ${remote} :latest`);
|
||||
exec('git tag latest');
|
||||
exec(`git push ${remote} latest`);
|
||||
exec(`git push ${argv.remote} :latest`);
|
||||
exec('git tag -a latest -m "latest"');
|
||||
}
|
||||
|
||||
exec(`git push ${remote} ${branch} --follow-tags`);
|
||||
if (exec(`git push ${argv.remote} ${branch} --follow-tags`).code) {
|
||||
console.error(`Failed to push tag publish-v${version}`);
|
||||
exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO
|
||||
// 1. Link to CircleCI job to watch
|
||||
// 2. Output the release changelog to paste into Github releases
|
||||
// 3. Link to release discussions to update
|
||||
// 4. Verify RN-diff publish is through
|
||||
// 5. General changelog update on PR?
|
||||
}
|
||||
|
||||
exit(0);
|
||||
main().then(() => {
|
||||
exit(0);
|
||||
});
|
||||
|
||||
Executable
+111
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* 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,
|
||||
getPublishVersion,
|
||||
getPublishTag,
|
||||
} = require('./version-utils');
|
||||
|
||||
const argv = yargs.option('r', {
|
||||
alias: 'remote',
|
||||
default: 'origin',
|
||||
}).argv;
|
||||
|
||||
const currentCommit = process.env.CIRCLE_SHA1;
|
||||
const branch = process.env.CIRCLE_BRANCH;
|
||||
const remote = argv.remote;
|
||||
|
||||
const tag = getPublishTag();
|
||||
if (tag == null) {
|
||||
console.log(
|
||||
'No publish tag set. Not publishing this release.\nCircleCI cannot filter workflows on both branch and tag so we do this check in prepare-package-for-release',
|
||||
);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!isReleaseBranch(branch)) {
|
||||
console.error(`This needs to be on a release branch. On branch: ${branch}`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Get the version we're publishing from the publish tag
|
||||
// Tag of the form `publish-v{versionStr}`
|
||||
const versionInfo = getPublishVersion(tag);
|
||||
if (versionInfo == null) {
|
||||
console.error(
|
||||
`Invalid tag provided: ${tag}, needs to be of form 'publish-v{major}.{minor}.{patch}'`,
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Clean up tag now that we're publishing the release.
|
||||
exec(`git tag -d ${tag}`);
|
||||
exec(`git push ${remote} :${tag}`);
|
||||
|
||||
const {version} = versionInfo;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// Add tag v0.21.0-rc.1
|
||||
if (exec(`git tag -a v${version} -m "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);
|
||||
}
|
||||
|
||||
// See if `latest` was set on the commit that triggered this script
|
||||
// If yes, move the tag to commit we just made
|
||||
// This tag will also update npm release as `latest`
|
||||
const isLatest = isTaggedLatest(currentCommit);
|
||||
if (isLatest) {
|
||||
exec('git tag -d latest');
|
||||
exec(`git push ${remote} :latest`);
|
||||
|
||||
// This will be pushed with the `--follow-tags`
|
||||
exec('git tag -a latest -m "latest"');
|
||||
}
|
||||
|
||||
exec(`git push ${remote} ${branch} --follow-tags`);
|
||||
|
||||
exit(0);
|
||||
+73
-110
@@ -10,50 +10,35 @@
|
||||
'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
|
||||
* version to publish the package.
|
||||
* For a dry run (commitly), this script will:
|
||||
* * Version the commitly of the form `1000.0.0-<commitSha>`
|
||||
* * Create Android artifacts
|
||||
* * It will not publish to npm
|
||||
*
|
||||
* To cut a branch (and release RC):
|
||||
* - Developer: `git checkout -b 0.XY-stable`
|
||||
* - Developer: `./scripts/bump-oss-version.js -v v0.XY.0-rc.0`
|
||||
* - CI: test and deploy to npm (run this script) with version `0.XY.0-rc.0`
|
||||
* with tag "next"
|
||||
* For a nightly run, this script will:
|
||||
* * Version the nightly release of the form `0.0.0-<dateIdentifier>-<commitSha>`
|
||||
* * Create Android artifacts
|
||||
* * Publish to npm using `nightly` tag
|
||||
*
|
||||
* To update RC release:
|
||||
* - Developer: `git checkout 0.XY-stable`
|
||||
* - Developer: cherry-pick whatever changes needed
|
||||
* - Developer: `./scripts/bump-oss-version.js -v v0.XY.0-rc.1`
|
||||
* - CI: test and deploy to npm (run this script) with version `0.XY.0-rc.1`
|
||||
* with tag "next"
|
||||
*
|
||||
* To publish a release:
|
||||
* - Developer: `git checkout 0.XY-stable`
|
||||
* - Developer: cherry-pick whatever changes needed
|
||||
* - Developer: `./scripts/bump-oss-version.js -v v0.XY.0`
|
||||
* - CI: test and deploy to npm (run this script) with version `0.XY.0`
|
||||
* and no tag ("latest" is implied by npm)
|
||||
*
|
||||
* To patch old release:
|
||||
* - Developer: `git checkout 0.XY-stable`
|
||||
* - Developer: cherry-pick whatever changes needed
|
||||
* - Developer: `git tag v0.XY.Z`
|
||||
* - Developer: `git push` to git@github.com:facebook/react-native.git (or merge as pull request)
|
||||
* - CI: test and deploy to npm (run this script) with version 0.XY.Z with no tag, npm will not mark it as latest if
|
||||
* there is a version higher than XY
|
||||
*
|
||||
* Important tags:
|
||||
* If tag v0.XY.0-rc.Z is present on the commit then publish to npm with version 0.XY.0-rc.Z and tag next
|
||||
* 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)
|
||||
* For a release run, this script will:
|
||||
* * Version the release by the tag version that triggered CI
|
||||
* * Create Android artifacts
|
||||
* * Publish to npm
|
||||
* * using `latest` tag if commit is currently tagged `latest`
|
||||
* * or otherwise `{major}.{minor}-stable`
|
||||
*/
|
||||
|
||||
/*eslint-disable no-undef */
|
||||
require('shelljs/global');
|
||||
const {exec, echo, exit, test} = require('shelljs');
|
||||
const yargs = require('yargs');
|
||||
const {parseVersion, isTaggedLatest} = 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 +49,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 rely on CircleCI job `prepare_package_for_release` to handle this
|
||||
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');
|
||||
echo(`Failed to set version number to ${releaseVersion}`);
|
||||
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 +137,21 @@ if (dryRunBuild) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// if version contains -rc, tag as prerelease
|
||||
// Running to see if this commit has been git tagged as `latest`
|
||||
const isLatest = isTaggedLatest(currentCommit);
|
||||
|
||||
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 +163,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,73 @@
|
||||
/**
|
||||
* 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 isReleaseBranch(branch) {
|
||||
return branch.endsWith('-stable');
|
||||
}
|
||||
|
||||
function getBranchName() {
|
||||
return exec('git rev-parse --abbrev-ref HEAD', {
|
||||
silent: true,
|
||||
}).stdout.trim();
|
||||
}
|
||||
|
||||
function getPublishVersion(tag) {
|
||||
if (!tag.startsWith('publish-')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const versionStr = tag.replace('publish-', '');
|
||||
return parseVersion(versionStr);
|
||||
}
|
||||
|
||||
function isTaggedLatest(commitSha) {
|
||||
return (
|
||||
exec(`git rev-list -1 latest | grep ${commitSha}`, {
|
||||
silent: true,
|
||||
}).stdout.trim() === commitSha
|
||||
);
|
||||
}
|
||||
|
||||
function getPublishTag() {
|
||||
// Assumes we only ever have one tag with the prefix `publish-v`
|
||||
const tag = exec("git tag --points-at HEAD | grep 'publish-v'", {
|
||||
silent: true,
|
||||
}).stdout.trim();
|
||||
return tag ? tag : null;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getBranchName,
|
||||
isTaggedLatest,
|
||||
getPublishTag,
|
||||
getPublishVersion,
|
||||
parseVersion,
|
||||
isReleaseBranch,
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @generated by scripts/set-rn-version.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
|
||||
+11
-11
@@ -1,9 +1,9 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.4)
|
||||
CFPropertyList (3.0.5)
|
||||
rexml
|
||||
activesupport (6.1.4.1)
|
||||
activesupport (6.1.4.4)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
@@ -15,7 +15,7 @@ GEM
|
||||
httpclient (~> 2.8, >= 2.8.3)
|
||||
json (>= 1.5.1)
|
||||
atomos (0.1.3)
|
||||
claide (1.0.3)
|
||||
claide (1.1.0)
|
||||
cocoapods (1.11.2)
|
||||
addressable (~> 2.8)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
@@ -56,17 +56,17 @@ 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)
|
||||
ffi (1.15.5)
|
||||
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)
|
||||
minitest (5.14.4)
|
||||
json (2.6.1)
|
||||
minitest (5.15.0)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
nap (1.1.0)
|
||||
@@ -85,10 +85,10 @@ GEM
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.4.2)
|
||||
zeitwerk (2.5.3)
|
||||
|
||||
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.1"
|
||||
},
|
||||
"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"
|
||||
@@ -1926,11 +1946,24 @@ chalk@^4.0.0:
|
||||
ansi-styles "^4.1.0"
|
||||
supports-color "^7.1.0"
|
||||
|
||||
chalk@^4.1.0:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
||||
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
|
||||
dependencies:
|
||||
ansi-styles "^4.1.0"
|
||||
supports-color "^7.1.0"
|
||||
|
||||
char-regex@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf"
|
||||
integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==
|
||||
|
||||
chardet@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
|
||||
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
|
||||
|
||||
child-process-promise@^2.2.0:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/child-process-promise/-/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074"
|
||||
@@ -1976,11 +2009,23 @@ cli-cursor@^2.1.0:
|
||||
dependencies:
|
||||
restore-cursor "^2.0.0"
|
||||
|
||||
cli-cursor@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307"
|
||||
integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==
|
||||
dependencies:
|
||||
restore-cursor "^3.1.0"
|
||||
|
||||
cli-spinners@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.1.0.tgz#22c34b4d51f573240885b201efda4e4ec9fff3c7"
|
||||
integrity sha512-8B00fJOEh1HPrx4fo5eW16XmE1PcL1tGpGrxy63CXGP9nHdPBN63X75hA1zhvQuhVztJWLqV58Roj2qlNM7cAA==
|
||||
|
||||
cli-width@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6"
|
||||
integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==
|
||||
|
||||
cliui@^4.0.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
|
||||
@@ -2907,6 +2952,15 @@ extend@~3.0.2:
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
|
||||
|
||||
external-editor@^3.0.3:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495"
|
||||
integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==
|
||||
dependencies:
|
||||
chardet "^0.7.0"
|
||||
iconv-lite "^0.4.24"
|
||||
tmp "^0.0.33"
|
||||
|
||||
extglob@^2.0.4:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
|
||||
@@ -2953,6 +3007,13 @@ fb-watchman@^2.0.0:
|
||||
dependencies:
|
||||
bser "^2.0.0"
|
||||
|
||||
figures@^3.0.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af"
|
||||
integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==
|
||||
dependencies:
|
||||
escape-string-regexp "^1.0.5"
|
||||
|
||||
file-entry-cache@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c"
|
||||
@@ -3355,7 +3416,7 @@ human-signals@^1.1.1:
|
||||
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
|
||||
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
|
||||
|
||||
iconv-lite@0.4.24:
|
||||
iconv-lite@0.4.24, iconv-lite@^0.4.24:
|
||||
version "0.4.24"
|
||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
||||
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
|
||||
@@ -3424,6 +3485,25 @@ ini@^1.3.4:
|
||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
||||
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
|
||||
|
||||
inquirer@^7.1.0:
|
||||
version "7.3.3"
|
||||
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003"
|
||||
integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==
|
||||
dependencies:
|
||||
ansi-escapes "^4.2.1"
|
||||
chalk "^4.1.0"
|
||||
cli-cursor "^3.1.0"
|
||||
cli-width "^3.0.0"
|
||||
external-editor "^3.0.3"
|
||||
figures "^3.0.0"
|
||||
lodash "^4.17.19"
|
||||
mute-stream "0.0.8"
|
||||
run-async "^2.4.0"
|
||||
rxjs "^6.6.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
through "^2.3.6"
|
||||
|
||||
internal-slot@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3"
|
||||
@@ -4436,11 +4516,16 @@ lodash.throttle@^4.1.1:
|
||||
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
|
||||
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=
|
||||
|
||||
lodash@4.x.x, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.5:
|
||||
lodash@4.x.x, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5:
|
||||
version "4.17.20"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
||||
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
||||
|
||||
lodash@^4.17.19:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
log-driver@^1.2.7:
|
||||
version "1.2.7"
|
||||
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"
|
||||
@@ -4904,6 +4989,11 @@ ms@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||
|
||||
mute-stream@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
|
||||
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
|
||||
|
||||
mv@~2:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/mv/-/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2"
|
||||
@@ -5242,7 +5332,7 @@ os-locale@^3.1.0:
|
||||
lcid "^2.0.0"
|
||||
mem "^4.0.0"
|
||||
|
||||
os-tmpdir@^1.0.0:
|
||||
os-tmpdir@^1.0.0, os-tmpdir@~1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
|
||||
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
|
||||
@@ -5572,6 +5662,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"
|
||||
@@ -5833,6 +5932,14 @@ restore-cursor@^2.0.0:
|
||||
onetime "^2.0.0"
|
||||
signal-exit "^3.0.2"
|
||||
|
||||
restore-cursor@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
|
||||
integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==
|
||||
dependencies:
|
||||
onetime "^5.1.0"
|
||||
signal-exit "^3.0.2"
|
||||
|
||||
ret@~0.1.10:
|
||||
version "0.1.15"
|
||||
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
|
||||
@@ -5874,6 +5981,18 @@ rsvp@^3.3.3:
|
||||
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a"
|
||||
integrity sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==
|
||||
|
||||
run-async@^2.4.0:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455"
|
||||
integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==
|
||||
|
||||
rxjs@^6.6.0:
|
||||
version "6.6.7"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
|
||||
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
@@ -6171,13 +6290,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"
|
||||
@@ -6545,6 +6657,18 @@ through2@^2.0.1:
|
||||
readable-stream "~2.3.6"
|
||||
xtend "~4.0.1"
|
||||
|
||||
through@^2.3.6:
|
||||
version "2.3.8"
|
||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
|
||||
|
||||
tmp@^0.0.33:
|
||||
version "0.0.33"
|
||||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
|
||||
integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
|
||||
dependencies:
|
||||
os-tmpdir "~1.0.2"
|
||||
|
||||
tmpl@1.0.x:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
|
||||
@@ -6618,6 +6742,11 @@ truncate-utf8-bytes@^1.0.0:
|
||||
dependencies:
|
||||
utf8-byte-length "^1.0.1"
|
||||
|
||||
tslib@^1.9.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tslib@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e"
|
||||
|
||||
Reference in New Issue
Block a user