mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42774 Reorganise release scripts so that command entry points are grouped based on execution context, which also reflects dependencies between scripts. Also: - Document the current behaviours of these scripts. - Relocate utils out of the root contents. - Replace `exec` call to `set-rn-version` script with function import. NOTE: `yarn trigger-react-native-release` (documented command in release process) is unchanged, since this is aliased from `package.json`. ``` ├── releases │ ├── templates/ │ ├── utils/ │ ├── remove-new-arch-flags.js │ ├── set-rn-version.js │ └── update-template-package.js ├── releases-ci │ ├── prepare-package-for-release.js │ └── publish-npm.js └── releases-local └── trigger-react-native-release.js ``` Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D53274341 fbshipit-source-id: eec2befc43e7a47fd821b2e2bcc818ddffbb6cf7
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
* @format
|
|
* @oncall react_native
|
|
*/
|
|
|
|
/*::
|
|
import type {Version} from '../utils/version-utils';
|
|
*/
|
|
|
|
module.exports = ({version} /*: {version: Version} */) /*: string */ => `/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* 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/releases/set-rn-version.js
|
|
*/
|
|
|
|
#import "RCTVersion.h"
|
|
|
|
NSString* const RCTVersionMajor = @"major";
|
|
NSString* const RCTVersionMinor = @"minor";
|
|
NSString* const RCTVersionPatch = @"patch";
|
|
NSString* const RCTVersionPrerelease = @"prerelease";
|
|
|
|
|
|
NSDictionary* RCTGetReactNativeVersion(void)
|
|
{
|
|
static NSDictionary* __rnVersion;
|
|
static dispatch_once_t onceToken;
|
|
dispatch_once(&onceToken, ^(void){
|
|
__rnVersion = @{
|
|
RCTVersionMajor: @(${version.major}),
|
|
RCTVersionMinor: @(${version.minor}),
|
|
RCTVersionPatch: @(${version.patch}),
|
|
RCTVersionPrerelease: ${
|
|
version.prerelease != null
|
|
? `@"${version.prerelease}"`
|
|
: '[NSNull null]'
|
|
},
|
|
};
|
|
});
|
|
return __rnVersion;
|
|
}
|
|
`;
|