Skip to content

Commit 30e63ca

Browse files
committed
feat: make hermes build for visionOS (#26)
* [WIP] feat: make hermes build for visionOS * feat: point to callstack/hermes-visionos fork, update README * fix: remove USE_HERMES from project.pbxproj
1 parent 6a49aa5 commit 30e63ca

File tree

5 files changed

+59
-7
lines changed

5 files changed

+59
-7
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const {
2+
buildOptions,
3+
createBuild,
4+
createLog,
5+
createRun,
6+
logOptions,
7+
runOptions,
8+
} = require('@react-native-community/cli-platform-apple');
9+
10+
const run = {
11+
name: 'run-visionos',
12+
description: 'builds your app and starts it on visionOS simulator',
13+
func: createRun({platformName: 'visionos'}),
14+
examples: [
15+
{
16+
desc: 'Run on a specific simulator',
17+
cmd: 'npx @callstack/react-native-visionos run-visionos --simulator "Apple Vision Pro"',
18+
},
19+
],
20+
options: runOptions,
21+
};
22+
23+
const log = {
24+
name: 'log-visionos',
25+
description: 'starts visionOS device syslog tail',
26+
func: createLog({platformName: 'visionos'}),
27+
options: logOptions,
28+
};
29+
30+
const build = {
31+
name: 'build-visionos',
32+
description: 'builds your app for visionOS platform',
33+
func: createBuild({platformName: 'visionos'}),
34+
examples: [
35+
{
36+
desc: 'Build the app for all visionOS devices in Release mode',
37+
cmd: 'npx @callstack/react-native-visionos build-visionos --mode "Release"',
38+
},
39+
],
40+
options: buildOptions,
41+
};
42+
43+
module.exports = [run, log, build];

packages/react-native/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@
9393
},
9494
"dependencies": {
9595
"@jest/create-cache-key-function": "^29.6.3",
96-
"@react-native-community/cli": "12.3.2",
97-
"@react-native-community/cli-platform-android": "12.3.2",
98-
"@react-native-community/cli-platform-ios": "12.3.2",
96+
"@react-native-community/cli": "13.5.1",
97+
"@react-native-community/cli-platform-android": "13.5.1",
98+
"@react-native-community/cli-platform-ios": "13.5.1",
99+
"@react-native-community/cli-platform-apple": "13.5.1",
99100
"@react-native/assets-registry": "0.73.1",
100101
"@react-native/community-cli-plugin": "0.73.16",
101102
"@react-native/codegen": "0.73.3",

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99

1010
'use strict';
1111

12-
const ios = require('@react-native-community/cli-platform-ios');
12+
const localCommands = require('./local-cli/localCommands');
1313
const android = require('@react-native-community/cli-platform-android');
14+
const {
15+
getDependencyConfig,
16+
getProjectConfig,
17+
} = require('@react-native-community/cli-platform-apple');
18+
const ios = require('@react-native-community/cli-platform-ios');
1419
const {
1520
bundleCommand,
1621
ramBundleCommand,
@@ -24,12 +29,14 @@ module.exports = {
2429
bundleCommand,
2530
ramBundleCommand,
2631
startCommand,
32+
codegenCommand,
33+
...localCommands,
2734
],
2835
platforms: {
2936
visionos: {
3037
npmPackageName: '@callstack/react-native-visionos',
31-
projectConfig: ios.projectConfig,
32-
dependencyConfig: ios.dependencyConfig,
38+
projectConfig: getProjectConfig({platformName: 'visionos'}),
39+
dependencyConfig: getDependencyConfig({platformName: 'visionos'}),
3340
},
3441
ios: {
3542
projectConfig: ios.projectConfig,

packages/react-native/template/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"android": "react-native run-android",
77
"ios": "react-native run-ios",
8+
"visionos": "react-native run-visionos",
89
"lint": "eslint .",
910
"start": "react-native start",
1011
"test": "jest"

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7025,7 +7025,7 @@ [email protected]:
70257025
dependencies:
70267026
terser "^5.15.0"
70277027

7028-
[email protected], metro-resolver@^0.80.3:
7028+
[email protected], metro-resolver@^0.80.0, metro-resolver@^0.80.3:
70297029
version "0.80.3"
70307030
resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.80.3.tgz#f9676508583d81182c7afaabc908254dc928a345"
70317031
integrity sha512-zwa0i32rj/TI3NivcvMXHJwTG2gUgo2dXdcnAJlhEKKQvyN+7AfhNdQSlDdDqMQmU7FaLRdeWORnQJbYCrprQQ==

0 commit comments

Comments
 (0)