Skip to content

Commit f4afcd5

Browse files
authored
docs: fix npm commands (#3597)
1 parent 57ee523 commit f4afcd5

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

docsite/docs/guides/_package-run-command.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import CodeBlock from "@theme/CodeBlock";
44

55
<Tabs groupId="package-manager">
66
<TabItem value="yarn" label="Yarn" default>
7-
<CodeBlock language="sh">yarn {props.yarnArgs || props.args}</CodeBlock>
7+
<CodeBlock language="sh">yarn {props.args}</CodeBlock>
88
</TabItem>
99
<TabItem value="pnpm" label="pnpm">
10-
<CodeBlock language="sh">pnpm {props.pnpmArgs || props.args}</CodeBlock>
10+
<CodeBlock language="sh">pnpm {props.args}</CodeBlock>
1111
</TabItem>
1212
<TabItem value="npm" label="npm">
13-
<CodeBlock language="sh">npx {props.npxArgs || props.args}</CodeBlock>
13+
<CodeBlock language="sh">{props.installedScript ? "npx" : "npm run"} {props.args}</CodeBlock>
1414
</TabItem>
1515
</Tabs>

docsite/docs/guides/bundling.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ to add automation which guards your app against bundling errors in future PRs.
536536
If you use Lerna, you can run one command from the root of your repo to bundle
537537
all packages:
538538

539-
<PackageRunCommand args="lerna run bundle" />
539+
<PackageRunCommand args="lerna run bundle" installedScript />
540540

541541
If you're using a task runner like Nx, Lage or Gulp, you can go for a more
542542
sophisticated integration. The advantage being that `bundle` runs as its own

docsite/docs/guides/dependency-management.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ root of the repo, scanning all packages. This include packages which haven't
109109
onboarded yet. For those, `--requirements react-native@[version]` controls the
110110
target React Native release to use when checking compatibility.
111111

112-
<PackageRunCommand args="rnx-align-deps --requirements [email protected]" />
112+
<PackageRunCommand args="rnx-align-deps --requirements [email protected]" installedScript />
113113

114114
When a compatibility problem is found, the command fails with a non-zero exit
115115
code, which causes the PR loop to fail. This protects the repo from risky
@@ -186,7 +186,7 @@ info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
186186
Fixing problems is automated, too! From your development terminal, run the same
187187
command with a `--write` parameter.
188188

189-
<PackageRunCommand args="rnx-align-deps --requirements [email protected] --write" />
189+
<PackageRunCommand args="rnx-align-deps --requirements [email protected] --write" installedScript />
190190

191191
**Review** and **test** the fixes before pushing them to your PR.
192192

@@ -209,7 +209,7 @@ response.
209209
Run this command from the root of your repo. It uses the dependency manager to
210210
make the fixes automatically.
211211

212-
<PackageRunCommand args="rnx-align-deps --write" />
212+
<PackageRunCommand args="rnx-align-deps --write" installedScript />
213213

214214
**Review** and **test** the fixes before pushing them to the PR with the
215215
dependency manager update.
@@ -228,9 +228,9 @@ version and adjust all React Native dependencies to be compatible. Replace
228228
`[version]` with your target React Native version in `major.minor` format, such
229229
as "0.66" or "0.68".
230230

231-
<PackageRunCommand args="rnx-align-deps --set-version [version]" />
231+
<PackageRunCommand args="rnx-align-deps --set-version [version]" installedScript />
232232

233-
<PackageRunCommand args="rnx-align-deps --requirements react-native@[version] --write" />
233+
<PackageRunCommand args="rnx-align-deps --requirements react-native@[version] --write" installedScript />
234234

235235
**Review** and **test** your packages thoroughly before merging these changes.
236236

@@ -304,7 +304,7 @@ Next, configure each of your onboarded React Native packages to use the list.
304304
Now it's time to use the list. Run the dependency manager to update all of your
305305
packages.
306306

307-
<PackageRunCommand args="rnx-align-deps --requirements [email protected] --presets microsoft/react-native,path/to/dependency-profile.json --write" />
307+
<PackageRunCommand args="rnx-align-deps --requirements [email protected] --presets microsoft/react-native,path/to/dependency-profile.json --write" installedScript />
308308

309309
**Review** and **test** the changes before continuing.
310310

docsite/docs/guides/getting-started.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ package produces a bundle, it's an `app`. Otherwise, it's a `library`.
3333

3434
Fix any React Native package versions that might have compatibility issues.
3535

36-
<PackageRunCommand args="rnx-align-deps --write" />
36+
<PackageRunCommand args="rnx-align-deps --write" installedScript />
3737

3838
Review the changes. They should be limited to package.json and your Yarn / npm /
3939
pnpm lock file.

0 commit comments

Comments
 (0)