Skip to content

Commit d52fbcf

Browse files
committed
feat: implement visionos cli commands
1 parent e6df7ca commit d52fbcf

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
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+
export default [run, log, build];

packages/react-native/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"@react-native-community/cli": "13.0.0",
9999
"@react-native-community/cli-platform-android": "13.0.0",
100100
"@react-native-community/cli-platform-ios": "13.0.0",
101+
"@react-native-community/cli-platform-apple": "13.0.0",
101102
"@react-native/assets-registry": "^0.74.0",
102103
"@react-native/community-cli-plugin": "^0.74.0",
103104
"@react-native/codegen": "^0.74.0",

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99

1010
'use strict';
1111

12+
const localCommands = require('./local-cli/localCommands');
1213
const android = require('@react-native-community/cli-platform-android');
14+
const {
15+
getProjectConfig,
16+
} = require('@react-native-community/cli-platform-apple');
1317
const ios = require('@react-native-community/cli-platform-ios');
1418
const {
1519
bundleCommand,
@@ -52,11 +56,12 @@ module.exports = {
5256
ramBundleCommand,
5357
startCommand,
5458
codegenCommand,
59+
...localCommands,
5560
],
5661
platforms: {
5762
visionos: {
5863
npmPackageName: '@callstack/react-native-visionos',
59-
projectConfig: ios.projectConfig,
64+
projectConfig: getProjectConfig({platformName: 'visionos'}),
6065
dependencyConfig: ios.dependencyConfig,
6166
},
6267
ios: {

0 commit comments

Comments
 (0)