Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e151563
chore: initial commit - remove files
grabbou Jan 27, 2022
0ae9eea
chore: further removal
grabbou Jan 27, 2022
30103d3
chore: wip
grabbou Jan 27, 2022
6c53e48
continue work
grabbou Jan 28, 2022
596d849
chore: fix warnings and errors
grabbou Jan 28, 2022
8a24cd2
chore: move findXcodeProj to config and upgrade run-ios
grabbou Feb 2, 2022
a1fe895
chore: add todo
grabbou Feb 2, 2022
2f8baf8
chore: remove example
grabbou Feb 2, 2022
510a903
chore: update source dir and update dependnecy config for ios
grabbou Feb 2, 2022
2a43345
chore: remove logger
grabbou Feb 2, 2022
410ec1a
chore: fix type issues
grabbou Feb 2, 2022
b3e0730
chore: remove tests for missing properties, prefer snapshots instead …
grabbou Feb 2, 2022
16996b3
chore: update snapshots for iOS config (removed properties)
grabbou Feb 2, 2022
a67a5a6
chore: fix upgrade tests
grabbou Feb 2, 2022
65f4335
chore: remove extra tests
grabbou Feb 2, 2022
edf3175
chore: update config tests
grabbou Feb 2, 2022
3854ee3
chore: two tests tbd to support new resolution mechanism
grabbou Feb 2, 2022
f8a9ade
chore: fix ios tests and bring back configurable sourceDir
grabbou Feb 2, 2022
1c9508e
feat: align findPodfilePath with old findProject heuristics
grabbou Feb 2, 2022
be963e1
chore: fix lint
grabbou Feb 2, 2022
194ee75
chore: update snapshot
grabbou Feb 2, 2022
387f9ee
fix: filter invalid deps
grabbou Feb 2, 2022
299285f
chore: update tests
grabbou Feb 2, 2022
d665720
chore: add missing properties to Joi schema
grabbou Feb 2, 2022
020aa16
chore: another update
grabbou Feb 2, 2022
0153690
chore: fix Joi schema
grabbou Feb 2, 2022
f8fd19d
chore: update schema
grabbou Feb 2, 2022
de1a5d2
chore: fix snapshot
grabbou Feb 2, 2022
2c732a8
chore: note on the future development for this file
grabbou Feb 2, 2022
6051201
chore: update snapshot one more time - nitpick
grabbou Feb 2, 2022
361f0c9
one last time
grabbou Feb 2, 2022
64b4ef7
feat: print when multiple podfiles are found
grabbou Feb 3, 2022
00ccd36
update docs
grabbou Feb 3, 2022
59cb6e0
chore: fix
grabbou Feb 3, 2022
9e70eb3
Update autolinking.md
grabbou Feb 4, 2022
48686a9
chore: remove xmldoc dep
thymikee Feb 4, 2022
7326892
chore: remove xcode dep
thymikee Feb 4, 2022
794d9b3
chore: return type for dependencyConfig
thymikee Feb 4, 2022
ae7c66e
Merge branch 'master' into feat/remove-link
grabbou Feb 7, 2022
3e5cb0b
Update index.ts
grabbou Feb 7, 2022
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
Prev Previous commit
Next Next commit
chore: move findXcodeProj to config and upgrade run-ios
  • Loading branch information
grabbou committed Feb 2, 2022
commit 8a24cd28bdcdc87718d2c638ba43d4e6ec6b5e6a
4 changes: 4 additions & 0 deletions packages/cli-types/src/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export interface IOSProjectParams {}

export interface IOSProjectConfig {
sourceDir: string;
xcodeProject: {
name: string;
isWorkspace: boolean;
} | null;
}

export interface IOSDependencyConfig {
Expand Down
9 changes: 3 additions & 6 deletions packages/cli/src/commands/upgrade/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {Config} from '@react-native-community/cli-types';
import {logger, CLIError, fetch} from '@react-native-community/cli-tools';
import * as PackageManager from '../../tools/packageManager';
import {installPods} from '@react-native-community/cli-doctor';
import {findXcodeProject} from '@react-native-community/cli-platform-ios';

type UpgradeError = {message: string; stderr: string};

Expand Down Expand Up @@ -112,13 +111,11 @@ const getPatch = async (
return;
}
if (platform === 'ios') {
const project = findXcodeProject(
fs.readdirSync(config.project[platform]!.sourceDir),
);
if (project) {
const xcodeProject = config.project.ios!.xcodeProject;
if (xcodeProject) {
patchWithRenamedProjects = patchWithRenamedProjects.replace(
new RegExp('RnDiffApp', 'g'),
project.name.replace('.xcodeproj', ''),
xcodeProject.name.replace('.xcodeproj', ''),
);
}
} else if (platform === 'android') {
Expand Down
13 changes: 11 additions & 2 deletions packages/platform-ios/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@
*
*/
import path from 'path';
import fs from 'fs';
import findPodfilePath from './findPodfilePath';
import findXcodeProject from './findXcodeProject';
import findPodspec from './findPodspec';
import {
IOSProjectParams,
IOSDependencyParams,
IOSProjectConfig,
} from '@react-native-community/cli-types';
import {logger} from '@react-native-community/cli-tools';

/**
* Returns project config by analyzing given folder and applying some user defaults
* when constructing final object
*/
export function projectConfig(folder: string, userConfig: IOSProjectParams) {
export function projectConfig(
folder: string,
userConfig: IOSProjectParams,
): IOSProjectConfig | null {
if (!userConfig) {
return;
return null;
}

const podfile = findPodfilePath(folder);
Expand All @@ -34,8 +40,11 @@ export function projectConfig(folder: string, userConfig: IOSProjectParams) {
return null;
}

const xcodeProject = findXcodeProject(fs.readdirSync(folder));

return {
sourceDir: path.dirname(podfile),
xcodeProject,
};
}

Expand Down
1 change: 0 additions & 1 deletion packages/platform-ios/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@

export {default as commands} from './commands';
export {projectConfig, dependencyConfig} from './config';
export {default as findXcodeProject} from './commands/runIOS/findXcodeProject';