Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
const ios = require('@react-native-community/cli-platform-ios');
const android = require('@react-native-community/cli-platform-android');

// Remove commands so that react-native-macos can coexist with react-native in repos that depend on both.
const path = require('path');
const isReactNativeMacOS = path.basename(__dirname) === 'react-native-macos';
const iosCommands = isReactNativeMacOS ? [] : ios.commands;
const androidCommands = isReactNativeMacOS ? [] : android.commands;

module.exports = {
commands: [...ios.commands, ...android.commands],
commands: [...iosCommands, ...androidCommands],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we need a ...macCommands here too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will, but mac commands don't exist yet. We have to create a @react-native-community/cli-platform-macos package first.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, the commands can be in this repo. No need to make that a separate repo. Windows implements its commands within react-native-windows.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason the android and ios ones are separate is so that the community can handle the PRs etc without waiting on facebook, since facebook doesn't use the cli.

platforms: {
ios: {
linkConfig: ios.linkConfig,
Expand Down