Skip to content

feat: add platform-cli-apple with reusable utilities for OOT platforms - #2208

Merged
thymikee merged 15 commits into
react-native-community:mainfrom
okwasniewski:feat/split-runIOS
Dec 20, 2023
Merged

feat: add platform-cli-apple with reusable utilities for OOT platforms#2208
thymikee merged 15 commits into
react-native-community:mainfrom
okwasniewski:feat/split-runIOS

Conversation

@okwasniewski

@okwasniewskiokwasniewski commented Dec 14, 2023

Copy link
Copy Markdown
Contributor

Summary:

The goal of this PR is to refactor most of cli-platform-ios to cli-platform-apple which provides reusable utilities allowing OOT platforms to build their commands. Example:

const{
buildOptions,
getProjectConfig,
createBuild,}=require('@react-native-community/cli-platform-apple');constbuildVisionOS={name: 'build-visionos',description: 'builds your app for visionOS platform',func: createBuild({platformName: 'visionos'}),examples: [{desc: 'Build the app for visionOS in Release mode',cmd: 'npx react-native build-visionos --mode "Release"',},],options: buildOptions,};module.exports={commands: [buildVisionOS],// <- Add command hereplatforms: {visionos: {npmPackageName: '@callstack/react-native-visionos',projectConfig: getProjectConfig({platformName: 'visionos'}),dependencyConfig: ios.dependencyConfig,},}};

Test Plan:

CI Green

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

Comment threadpackages/cli-platform-ios/src/index.ts Outdated
Comment threadpackages/cli-platform-ios/src/commands/buildIOS/index.ts Outdated
Comment threadpackages/cli-platform-ios/src/index.ts Outdated
@github-actionsgithub-actionsBot added the docs Documentation change label Dec 18, 2023
@okwasniewskiokwasniewski changed the title feat: refactor run-ios to separate files, export more utilitiesfeat: add platform-cli-apple with reusable utilitiesDec 18, 2023

@TMisiukiewiczTMisiukiewicz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

left some comments

Comment threadpackages/cli-platform-apple/src/commands/runCommand/createRun.ts Outdated
Comment threadpackages/cli-platform-apple/src/commands/runCommand/createRun.ts Outdated
Comment threadpackages/cli-platform-ios/src/commands/runIOS/index.ts
@okwasniewski
okwasniewski marked this pull request as ready for review December 19, 2023 11:12
@okwasniewskiokwasniewski changed the title feat: add platform-cli-apple with reusable utilitiesfeat: add platform-cli-apple with reusable utilities for OOT platformsDec 19, 2023
Comment threadpackages/cli-platform-apple/src/commands/buildCommand/buildProject.ts Outdated
Comment threadpackages/cli-platform-apple/README.md
Comment threadpackages/cli-platform-ios/src/commands/logIOS/index.ts Outdated
Comment on lines +6 to +13
export function getFallbackSimulator(args: FlagsT): Device {
/**
* If provided simulator does not exist, try simulators in following order
* - iPhone 14
* - iPhone 13
* - iPhone 12
* - iPhone 11
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not really applicable for all apple platforms

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah, it's used only on iOS - I don't want to remove it to introduce breaking changes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Let's create a new issue to remove this

Comment threadpackages/cli-platform-apple/tsconfig.json Outdated
Comment threadpackages/cli-platform-apple/src/tools/pods.ts Outdated
Comment threadpackages/cli-platform-apple/README.md Outdated
import execa from 'execa';
import listIOSDevices from '../listIOSDevices';
import listDevices from '../listDevices';
import {getPlatformInfo} from '../../commands/runCommand/getPlatformInfo';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like this method is here by accident. Can we create a dedicated commands/runCommand/__tests__/getPlatformInfo.test.ts?

Comment threadpackages/cli-platform-apple/src/config/findPodfilePath.ts Outdated

@thymikeethymikee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a few small things to address, overall LGTM and nice refactor

@szymonrybczakszymonrybczak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

good work! 🎉

@TMisiukiewiczTMisiukiewicz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please check failing unit tests 👀

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation changefeature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@okwasniewski@thymikee@TMisiukiewicz@szymonrybczak