Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ A boolean value to determine if you want to automatically install CocoaPods when

If set to `true`, you can skip running `pod install` manually whenever it's needed.

> Note: Starting from React Native 0.73, CLI's `init` command scaffolds the project with `react-native.config.js` file with this value set to `true` by default. Older projects can opt-in after migrating to 0.73. Please note that if your setup does not follow the standard React Native template, e.g. you are not using Gems to install CocoaPods, this might not work properly for you. Starting from React Native 0.79, users shouldn't install CocoaPods manually, but can still opt-out of automatic installation by setting this value to `false`.
> Note: Starting from React Native 0.79, the CLI installs CocoaPods automatically when required, even if the project does not have a `react-native.config.js` file. You can opt out by setting this value to `false`. If your setup does not follow the standard React Native template, e.g. you are not using Gems to install CocoaPods, automatic installation might not work properly for you.

### project.ios.assets

Expand Down
25 changes: 25 additions & 0 deletions packages/cli-config/src/__tests__/schema-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {projectConfig} from '../schema';

test.each([
['the entire config is omitted', undefined],
['the config is empty', {}],
['the project key is omitted', {dependencies: {}}],
['the project config is empty', {project: {}}],
])('applies nested platform defaults when %s', (_description, config) => {
const {error, value} = projectConfig.validate(config);

expect(error).toBeUndefined();
expect(value.project).toEqual({
android: {assets: []},
ios: {assets: [], automaticPodsInstallation: true},
});
});

test('preserves an explicit automatic CocoaPods installation opt-out', () => {
const {error, value} = projectConfig.validate({
project: {ios: {automaticPodsInstallation: false}},
});

expect(error).toBeUndefined();
expect(value.project.ios.automaticPodsInstallation).toBe(false);
});
4 changes: 2 additions & 2 deletions packages/cli-config/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const projectConfig = t
automaticPodsInstallation: t.bool().default(true),
assets: t.array().items(t.string()).default([]),
})
.default({}),
.default(),
android: t
// AndroidProjectParams
.object({
Expand All @@ -170,7 +170,7 @@ export const projectConfig = t
watchModeCommandParams: t.array().items(t.string()),
assets: t.array().items(t.string()).default([]),
})
.default({}),
.default(),
})
.default(),
assets: t.array().items(t.string()).default([]),
Expand Down
Loading