Skip to content

Commit 3e2f7ed

Browse files
authored
Fix link to set-up-your-environment emitted by the CLI (#2650)
1 parent 4ea2b35 commit 3e2f7ed

File tree

8 files changed

+26
-16
lines changed

8 files changed

+26
-16
lines changed

packages/cli-config-apple/src/tools/installPods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function runPodInstall(loader: Ora, options: RunPodInstallOptions) {
6161

6262
throw new CLIError(
6363
`Looks like your iOS environment is not properly set. Please go to ${link.docs(
64-
'environment-setup',
64+
'set-up-your-environment',
6565
'ios',
6666
{guide: 'native'},
6767
)} and follow the React Native CLI QuickStart guide for macOS and iOS.`,

packages/cli-config-apple/src/tools/runBundleInstall.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async function runBundleInstall(loader: Ora) {
1212
logger.error((error as any).stderr || (error as any).stdout);
1313
throw new CLIError(
1414
`Looks like your iOS environment is not properly set. Please go to ${link.docs(
15-
'environment-setup',
15+
'set-up-your-environment',
1616
'ios',
1717
{guide: 'native'},
1818
)} and follow the React Native CLI QuickStart guide for macOS and iOS.`,

packages/cli-doctor/src/tools/healthchecks/androidSDK.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export default {
182182

183183
return logManualInstallation({
184184
healthcheck: 'Android SDK',
185-
url: link.docs('environment-setup', 'android', {
185+
url: link.docs('set-up-your-environment', 'android', {
186186
hash: 'android-sdk',
187187
guide: 'native',
188188
}),

packages/cli-doctor/src/tools/healthchecks/androidStudio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default {
7878

7979
return logManualInstallation({
8080
healthcheck: 'Android Studio',
81-
url: link.docs('environment-setup', 'android', {
81+
url: link.docs('set-up-your-environment', 'android', {
8282
hash: 'android-studio',
8383
guide: 'native',
8484
}),

packages/cli-doctor/src/tools/healthchecks/jdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default {
6161
loader.fail();
6262
logManualInstallation({
6363
healthcheck: 'JDK',
64-
url: link.docs('environment-setup', 'android', {
64+
url: link.docs('set-up-your-environment', 'android', {
6565
hash: 'jdk-studio',
6666
guide: 'native',
6767
}),

packages/cli-doctor/src/tools/healthchecks/ruby.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default {
174174

175175
logManualInstallation({
176176
healthcheck: 'Ruby',
177-
url: link.docs('environment-setup', 'ios', {
177+
url: link.docs('set-up-your-environment', 'ios', {
178178
hash: 'ruby',
179179
guide: 'native',
180180
}),

packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function createInstallError(error: Error & {stderr: string}) {
129129
)}."`;
130130
} else if (stderr.includes('requires Java')) {
131131
message = `Looks like your Android environment is not properly set. Please go to ${chalk.dim.underline(
132-
link.docs('environment-setup', 'android', {
132+
link.docs('set-up-your-environment', 'android', {
133133
hash: 'jdk-studio',
134134
guide: 'native',
135135
}),

packages/cli-tools/src/__tests__/doclink.test.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,28 @@ describe('link', () => {
1010
mockPlatform.mockReturnValueOnce('darwin');
1111
link.setPlatform('android');
1212

13-
const url = new URL(link.docs('environment-setup', 'inherit')).toString();
13+
const url = new URL(
14+
link.docs('set-up-your-environment', 'inherit'),
15+
).toString();
1416
expect(url).toMatch(/os=macos/);
1517
expect(url).toMatch(/platform=android/);
1618
expect(url).toEqual(
17-
expect.stringContaining('https://reactnative.dev/docs/environment-setup'),
19+
expect.stringContaining(
20+
'https://reactnative.dev/docs/set-up-your-environment',
21+
),
1822
);
1923

2024
// Handles a change of os
2125
mockPlatform.mockReturnValueOnce('win32');
22-
expect(link.docs('environment-setup', 'inherit')).toMatch(/os=windows/);
26+
expect(link.docs('set-up-your-environment', 'inherit')).toMatch(
27+
/os=windows/,
28+
);
2329

2430
// Handles a change of platform
2531
link.setPlatform('ios');
26-
expect(link.docs('environment-setup', 'inherit')).toMatch(/platform=ios/);
32+
expect(link.docs('set-up-your-environment', 'inherit')).toMatch(
33+
/platform=ios/,
34+
);
2735

2836
// Handles cases where we don't need a platform
2937
expect(link.blog('2019/11/18/react-native-doctor', 'none')).not.toMatch(
@@ -32,7 +40,9 @@ describe('link', () => {
3240
});
3341

3442
it('preserves anchor-links', () => {
35-
expect(link.docs('environment-setup', 'inherit', 'ruby')).toMatch(/#ruby/);
43+
expect(link.docs('set-up-your-environment', 'inherit', 'ruby')).toMatch(
44+
/#ruby/,
45+
);
3646
});
3747

3848
describe('overrides', () => {
@@ -41,8 +51,8 @@ describe('link', () => {
4151
[{hash: 'ruby'}, /#ruby/],
4252
[{hash: 'ruby', os: 'linux'}, /os=linux/],
4353
[{'extra stuff': 'here?ok'}, /extra\+stuff=here%3Fok/],
44-
])("link.doc('environment-setup, %o) -> %o", (param, re) => {
45-
expect(link.docs('environment-setup', 'none', param)).toMatch(re);
54+
])("link.doc('set-up-your-environment, %o) -> %o", (param, re) => {
55+
expect(link.docs('set-up-your-environment', 'none', param)).toMatch(re);
4656
});
4757
});
4858

@@ -59,9 +69,9 @@ describe('link', () => {
5969
afterAll(() => link.setVersion(null));
6070
it('supports linking to a specific version of React Native', () => {
6171
link.setVersion('0.71');
62-
expect(link.docs('environment-setup', 'ios', 'ruby')).toEqual(
72+
expect(link.docs('set-up-your-environment', 'ios', 'ruby')).toEqual(
6373
expect.stringContaining(
64-
'https://reactnative.dev/docs/0.71/environment-setup',
74+
'https://reactnative.dev/docs/0.71/set-up-your-environment',
6575
),
6676
);
6777
});

0 commit comments

Comments
 (0)