Skip to content

Commit e43ee17

Browse files
Saadnajmitido64
andauthored
chore(0.81): backport a couple of fixes (#2821)
## Summary: Backport #2820 Backport #2819 ## Test Plan: CI should pass --------- Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
1 parent 7d4126c commit e43ee17

7 files changed

Lines changed: 43 additions & 17 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
__default__: patch
3+
---
4+
5+
Release 0.81.1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-native-macos/monorepo",
3-
"version": "0.81.0-rc0",
3+
"version": "0.81.0",
44
"license": "MIT",
55
"packageManager": "yarn@4.12.0",
66
"scripts": {

packages/nx-release-version/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-native-macos/nx-release-version",
3-
"version": "0.81.0-rc0",
3+
"version": "0.81.0",
44
"description": "Nx Release Version Actions for React Native macOS",
55
"homepage": "https://github.com/microsoft/react-native-macos/tree/HEAD/packages/nx-release-version#readme",
66
"license": "MIT",

packages/react-native/local-cli/runMacOS/runMacOS.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,27 @@
3535
* }} ProjectConfig
3636
*/
3737

38-
const chalk = require('chalk');
39-
const child_process = require('child_process');
40-
const path = require('path');
38+
const child_process = require('node:child_process');
39+
const path = require('node:path');
4140

42-
const {logger, CLIError, getDefaultUserTerminal} = (() => {
43-
const cli = require.resolve('@react-native-community/cli/package.json');
41+
const colors = (() => {
42+
const {WriteStream} = require('node:tty');
43+
if (WriteStream.prototype.hasColors() &&
44+
!process.env.NODE_TEST_CONTEXT &&
45+
process.env.NODE_ENV !== 'test'
46+
) {
47+
return {
48+
bold: (s) => '\u001B[1m' + s + '\u001B[22m',
49+
dim: (s) => '\u001B[2m' + s + '\u001B[22m',
50+
}
51+
}
52+
53+
const passthrough = (s) => s;
54+
return { bold: passthrough, dim: passthrough };
55+
})();
56+
57+
const {logger, CLIError, getDefaultUserTerminal} = ((projectRoot = process.cwd()) => {
58+
const cli = require.resolve('@react-native-community/cli/package.json', {paths: [projectRoot]});
4459
const options = {paths: [path.dirname(cli)]};
4560
const tools = require.resolve('@react-native-community/cli-tools', options);
4661
return require(tools);
@@ -92,7 +107,7 @@ function parseArgs(ctx, args) {
92107
logger.info(
93108
`Found Xcode ${
94109
xcodeProject.isWorkspace ? 'workspace' : 'project'
95-
} "${chalk.bold(xcodeProject.name)}"`,
110+
} "${colors.bold(xcodeProject.name)}"`,
96111
);
97112

98113
return {sourceDir, xcodeProject, scheme};
@@ -146,7 +161,7 @@ async function run(sourceDir, xcodeProject, scheme, args) {
146161
.trim();
147162

148163
logger.info(
149-
`Launching app "${chalk.bold(bundleID)}" from "${chalk.bold(appPath)}"`,
164+
`Launching app "${colors.bold(bundleID)}" from "${colors.bold(appPath)}"`,
150165
);
151166

152167
child_process.exec(
@@ -179,7 +194,7 @@ function buildProject(sourceDir, xcodeProject, scheme, args) {
179194
scheme,
180195
];
181196
logger.info(
182-
`Building ${chalk.dim(
197+
`Building ${colors.dim(
183198
`(using "xcodebuild ${xcodebuildArgs.join(' ')}")`,
184199
)}`,
185200
);

packages/react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
{
206206
"name": "FBReactNativeSpec",
207207
"type": "all",
208-
"ios": {
208+
"macos": {
209209
"modules": {
210210
"AccessibilityManager": {
211211
"unstableRequiresMainQueueSetup": true

packages/react-native/react-native.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,14 @@ try {
7171
// [macOS
7272
let apple;
7373
try {
74+
const iosPath = require.resolve('@react-native-community/cli-platform-ios', {
75+
paths: [process.cwd()],
76+
});
7477
// $FlowFixMe[untyped-import]
75-
apple = require('@react-native-community/cli-platform-apple');
78+
apple = findCommunityPlatformPackage(
79+
'@react-native-community/cli-platform-apple',
80+
iosPath,
81+
);
7682
} catch {
7783
if (verbose) {
7884
console.warn(
@@ -156,7 +162,7 @@ if (android != null) {
156162

157163
// [macOS
158164
config.commands.push(...macosCommands);
159-
if (apple != null) {
165+
if (apple) {
160166
config.platforms.macos = {
161167
linkConfig: () => {
162168
return {

packages/react-native/scripts/codegen/__tests__/__snapshots__/generate-artifacts-executor-test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ exports[`execute test-app "ReactAppDependencyProvider.podspec" should match snap
361361
# This source code is licensed under the MIT license found in the
362362
# LICENSE file in the root directory of this source tree.
363363
364-
version = \\"0.81.0-rc0\\"
364+
version = \\"0.81.0\\"
365365
source = { :git => 'https://github.com/facebook/react-native.git' }
366366
if version == '1000.0.0'
367367
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
@@ -399,7 +399,7 @@ exports[`execute test-app "ReactCodegen.podspec" should match snapshot 1`] = `
399399
# This source code is licensed under the MIT license found in the
400400
# LICENSE file in the root directory of this source tree.
401401
402-
version = \\"0.81.0-rc0\\"
402+
version = \\"0.81.0\\"
403403
source = { :git => 'https://github.com/facebook/react-native.git' }
404404
if version == '1000.0.0'
405405
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
@@ -840,7 +840,7 @@ exports[`execute test-app-legacy "ReactAppDependencyProvider.podspec" should mat
840840
# This source code is licensed under the MIT license found in the
841841
# LICENSE file in the root directory of this source tree.
842842
843-
version = \\"0.81.0-rc0\\"
843+
version = \\"0.81.0\\"
844844
source = { :git => 'https://github.com/facebook/react-native.git' }
845845
if version == '1000.0.0'
846846
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
@@ -878,7 +878,7 @@ exports[`execute test-app-legacy "ReactCodegen.podspec" should match snapshot 1`
878878
# This source code is licensed under the MIT license found in the
879879
# LICENSE file in the root directory of this source tree.
880880
881-
version = \\"0.81.0-rc0\\"
881+
version = \\"0.81.0\\"
882882
source = { :git => 'https://github.com/facebook/react-native.git' }
883883
if version == '1000.0.0'
884884
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.

0 commit comments

Comments
 (0)