react-native-macos 0.74.12 → 0.74.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/local-cli/runMacOS/runMacOS.js +38 -27
- package/package.json +2 -1
- package/react-native.config.js +6 -2
- package/local-cli/runMacOS/findXcodeProject.js +0 -37
package/React/Base/RCTVersion.m
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
// @ts-check
|
|
1
2
|
/**
|
|
2
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
4
|
* Licensed under the MIT License.
|
|
4
5
|
* @format
|
|
5
|
-
* @ts-check
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
@@ -20,14 +20,22 @@
|
|
|
20
20
|
*
|
|
21
21
|
* @typedef {{
|
|
22
22
|
* name: string;
|
|
23
|
+
* path: string;
|
|
23
24
|
* isWorkspace: boolean;
|
|
24
25
|
* }} XcodeProject
|
|
26
|
+
*
|
|
27
|
+
* @typedef {{
|
|
28
|
+
* project?: {
|
|
29
|
+
* macos?: {
|
|
30
|
+
* sourceDir: string;
|
|
31
|
+
* xcodeProject: XcodeProject;
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* }} ProjectConfig
|
|
25
35
|
*/
|
|
26
36
|
|
|
27
|
-
const findXcodeProject = require('./findXcodeProject');
|
|
28
37
|
const chalk = require('chalk');
|
|
29
38
|
const child_process = require('child_process');
|
|
30
|
-
const fs = require('fs');
|
|
31
39
|
const path = require('path');
|
|
32
40
|
const {logger, CLIError, getDefaultUserTerminal} = (() => {
|
|
33
41
|
const cli = require.resolve('@react-native-community/cli/package.json');
|
|
@@ -37,16 +45,11 @@ const {logger, CLIError, getDefaultUserTerminal} = (() => {
|
|
|
37
45
|
})();
|
|
38
46
|
|
|
39
47
|
/**
|
|
48
|
+
* @param {ProjectConfig} ctx
|
|
40
49
|
* @param {Options} args
|
|
41
|
-
* @returns {{ xcodeProject: XcodeProject, scheme: string }}
|
|
50
|
+
* @returns {{ sourceDir: string, xcodeProject: XcodeProject, scheme: string }}
|
|
42
51
|
*/
|
|
43
|
-
function parseArgs(args) {
|
|
44
|
-
if (!fs.existsSync(args.projectPath)) {
|
|
45
|
-
throw new CLIError(
|
|
46
|
-
'macOS project folder not found. Are you sure this is a React Native project?',
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
52
|
+
function parseArgs(ctx, args) {
|
|
50
53
|
if (args.configuration) {
|
|
51
54
|
logger.warn(
|
|
52
55
|
'Argument --configuration has been deprecated and will be removed in a future release, please use --mode instead.',
|
|
@@ -57,15 +60,20 @@ function parseArgs(args) {
|
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
const {sourceDir, xcodeProject} = ctx.project?.macos ?? {};
|
|
64
|
+
if (!sourceDir) {
|
|
65
|
+
throw new CLIError(
|
|
66
|
+
'macOS project folder not found. Are you sure this is a React Native project?',
|
|
67
|
+
);
|
|
68
|
+
}
|
|
61
69
|
|
|
62
|
-
const xcodeProject = findXcodeProject(fs.readdirSync('.'));
|
|
63
70
|
if (!xcodeProject) {
|
|
64
71
|
throw new CLIError(
|
|
65
|
-
|
|
72
|
+
'Xcode project for macOS not found. Did you forget to run `pod install`?',
|
|
66
73
|
);
|
|
67
74
|
}
|
|
68
75
|
|
|
76
|
+
// TODO: Find schemes using https://github.com/microsoft/rnx-kit/blob/2b4c569cda9e3755ba7afce42d846601bcc7c4e3/packages/tools-apple/src/scheme.ts#L5
|
|
69
77
|
const inferredSchemeName =
|
|
70
78
|
path.basename(xcodeProject.name, path.extname(xcodeProject.name)) +
|
|
71
79
|
'-macOS';
|
|
@@ -77,36 +85,37 @@ function parseArgs(args) {
|
|
|
77
85
|
} "${chalk.bold(xcodeProject.name)}"`,
|
|
78
86
|
);
|
|
79
87
|
|
|
80
|
-
return {xcodeProject, scheme};
|
|
88
|
+
return {sourceDir, xcodeProject, scheme};
|
|
81
89
|
}
|
|
82
90
|
|
|
83
91
|
/**
|
|
84
92
|
* @param {string[]} _
|
|
85
|
-
* @param {
|
|
93
|
+
* @param {ProjectConfig} ctx
|
|
86
94
|
* @param {Options} args
|
|
87
95
|
*/
|
|
88
|
-
function buildMacOS(_,
|
|
89
|
-
const {xcodeProject, scheme} = parseArgs(args);
|
|
90
|
-
return buildProject(xcodeProject, scheme, {...args, packager: false});
|
|
96
|
+
function buildMacOS(_, ctx, args) {
|
|
97
|
+
const {sourceDir, xcodeProject, scheme} = parseArgs(ctx, args);
|
|
98
|
+
return buildProject(sourceDir, xcodeProject, scheme, {...args, packager: false});
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
/**
|
|
94
102
|
* @param {string[]} _
|
|
95
|
-
* @param {
|
|
103
|
+
* @param {ProjectConfig} ctx
|
|
96
104
|
* @param {Options} args
|
|
97
105
|
*/
|
|
98
|
-
function runMacOS(_,
|
|
99
|
-
const {xcodeProject, scheme} = parseArgs(args);
|
|
100
|
-
return run(xcodeProject, scheme, args);
|
|
106
|
+
function runMacOS(_, ctx, args) {
|
|
107
|
+
const {sourceDir, xcodeProject, scheme} = parseArgs(ctx, args);
|
|
108
|
+
return run(sourceDir, xcodeProject, scheme, args);
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
/**
|
|
112
|
+
* @param {string} sourceDir
|
|
104
113
|
* @param {XcodeProject} xcodeProject
|
|
105
114
|
* @param {string} scheme
|
|
106
115
|
* @param {Options} args
|
|
107
116
|
*/
|
|
108
|
-
async function run(xcodeProject, scheme, args) {
|
|
109
|
-
await buildProject(xcodeProject, scheme, args);
|
|
117
|
+
async function run(sourceDir, xcodeProject, scheme, args) {
|
|
118
|
+
await buildProject(sourceDir, xcodeProject, scheme, args);
|
|
110
119
|
|
|
111
120
|
const buildSettings = getBuildSettings(xcodeProject, args.mode, scheme);
|
|
112
121
|
const appPath = path.join(
|
|
@@ -143,15 +152,17 @@ async function run(xcodeProject, scheme, args) {
|
|
|
143
152
|
}
|
|
144
153
|
|
|
145
154
|
/**
|
|
155
|
+
* @param {string} sourceDir
|
|
146
156
|
* @param {XcodeProject} xcodeProject
|
|
147
157
|
* @param {string} scheme
|
|
148
158
|
* @param {Options} args
|
|
159
|
+
* @returns {Promise<void>}
|
|
149
160
|
*/
|
|
150
|
-
function buildProject(xcodeProject, scheme, args) {
|
|
161
|
+
function buildProject(sourceDir, xcodeProject, scheme, args) {
|
|
151
162
|
return new Promise((resolve, reject) => {
|
|
152
163
|
const xcodebuildArgs = [
|
|
153
164
|
xcodeProject.isWorkspace ? '-workspace' : '-project',
|
|
154
|
-
xcodeProject.name,
|
|
165
|
+
path.join(sourceDir, xcodeProject.path, xcodeProject.name),
|
|
155
166
|
'-configuration',
|
|
156
167
|
args.mode,
|
|
157
168
|
'-scheme',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.13",
|
|
4
4
|
"description": "React Native for macOS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
111
111
|
"@react-native-community/cli": "13.6.9",
|
|
112
112
|
"@react-native-community/cli-platform-android": "13.6.9",
|
|
113
|
+
"@react-native-community/cli-platform-apple": "13.6.9",
|
|
113
114
|
"@react-native-community/cli-platform-ios": "13.6.9",
|
|
114
115
|
"@react-native-mac/virtualized-lists": "0.74.87",
|
|
115
116
|
"@react-native/assets-registry": "0.74.87",
|
package/react-native.config.js
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
const android = require('@react-native-community/cli-platform-android');
|
|
13
13
|
const ios = require('@react-native-community/cli-platform-ios');
|
|
14
|
+
const {
|
|
15
|
+
getDependencyConfig,
|
|
16
|
+
getProjectConfig,
|
|
17
|
+
} = require('@react-native-community/cli-platform-apple'); // [macOS]
|
|
14
18
|
const {
|
|
15
19
|
bundleCommand,
|
|
16
20
|
ramBundleCommand,
|
|
@@ -95,8 +99,8 @@ module.exports = {
|
|
|
95
99
|
) => {},
|
|
96
100
|
};
|
|
97
101
|
},
|
|
98
|
-
projectConfig: ()
|
|
99
|
-
dependencyConfig: ()
|
|
102
|
+
projectConfig: getProjectConfig({platformName: 'macos'}),
|
|
103
|
+
dependencyConfig: getDependencyConfig({platformName: 'macos'}),
|
|
100
104
|
npmPackageName: 'react-native-macos', // [macOS]
|
|
101
105
|
},
|
|
102
106
|
},
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
* @ts-check
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @param {string[]} files
|
|
13
|
-
*/
|
|
14
|
-
function findXcodeProject(files) {
|
|
15
|
-
const sortedFiles = files.sort();
|
|
16
|
-
for (let i = sortedFiles.length - 1; i >= 0; i--) {
|
|
17
|
-
const fileName = files[i];
|
|
18
|
-
const ext = path.extname(fileName);
|
|
19
|
-
|
|
20
|
-
if (ext === '.xcworkspace') {
|
|
21
|
-
return {
|
|
22
|
-
name: fileName,
|
|
23
|
-
isWorkspace: true,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (ext === '.xcodeproj') {
|
|
27
|
-
return {
|
|
28
|
-
name: fileName,
|
|
29
|
-
isWorkspace: false,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
module.exports = findXcodeProject;
|