Clarify when to use `rushx` over `rush-pnpm run`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- documentation
Research direction
Start with the linked rushx and rush-pnpm command pages, then compare the referenced RushCommandSelector.ts, RushPnpmCommandLineParser.ts, and RushXCommandLine.ts entry points. Trace the documented differences between workspace scripts, local commands, and remote commands. Done means the documentation clearly explains when to choose each command and covers the listed pnpm use cases.
Written by the indexing model from the issue text.
Description
I've been looking through the website to find some information on the binaries and am wondering if I am missing something obvious.
When do I use rushx <script-name> over rush-pnpm run <script-name>? What do they do differently?
(toggle) Motivation/Why?
This came about as I am trying to figure out whether I need to open a discussion in Rush's chat room or if I need to open an issue with the npm-run-all2 package to figure out how to correctly use npm-run-all2 in a Rush monorepo, including special consideration for pnpm if needed.
- use npm-run-all2 from a script in a workspace's
package.jsonfile - use npm-run-all2 from a command line when the CWD is in a workspace
- globally installed
- locally installed
- use npm-run-all2 at the root level
- custom command + auto installer?
While the need to use a specific package may be mine, I think the confusion about when to use which command with pnpm is not unique to me and could use clarity in the documentation.
Is there a part of the documentation that I am missing?
(toggle) I tried to follow the Rush source code, but got lost or burned out (probably both)
- All of the the binaries import start.js as a side effect
- Start calls
RushCommandSelector.execute(launcherVersion, selectedRushLib, options) - if
rush-pnpm- launch the internal API using
rush-lib, which then runs like any other API would - Process and load the Rush configuration
- Determine the pnpm command arguments (this includes the which pnpm command is being called)
- Among other things, it produces warnings and errors for commands known to be incompatible or otherwise contradictory to Rush.
runandexecare known to be safe
- launch the internal API using
- if
rushx- launch the internal API using
rush-lib, which then runs like any other API would
- launch the internal API using
(toggle) What Rush Command or Practice Replaces What?
Workspace script
- use
rushx <script-name>as a replacement for:npm run-script <script-name>(aliased:npm run)yarn <script-name>(Yarn Classic) CWD is in the workspaceyarn <script-name>
- pnpm: ???
- use
rush-pnpm run <script-name>orrushx <script-name>? as a replacement forpnpm run <script-name>
- use
Arbitrary Command From A Package At The Root Level
- don't do this in a Rush monorepo?
- use custom commands / autoinstallers instead?
In A Workspace While At The Root Level
- don't do this in a Rush monorepo?
- replaces:
npm run --workspace=<workspace-name> <command-name>(see also:--workspacesand--include-workspace-root)yarn workspace <workspace-name> <command-name>(Yarn Classic)yarn workspace <workspace-name> <command-name>- pnpm filtering
Arbitrary REMOTE Command From A Package At The Workspace Level
- don't do this in a Rush monorepo?
rush-pnpm dlx <command-name> "works" (I think?), but I can't figure out why. dlx is not known to be a safe command according to Rush. It is always REMOTE and doesn't seem to use the command in the workspace's LOCAL node_modules directory.
Arbitrary LOCAL Command From A Package At The Workspace Level
What is the rush replacement for the following?
npx <command-name>npm exec <command-name>yarn <command-name>(Yarn classic: Locally installed CLIs)yarn dlx <command-name>(Yarn Berry)yarn exec <command-name>(Yarn Berry)pnpm dlx <command-name>pnpxis an alias forpnpm dlx
pnpm exec <command-name>pnpm <command-name>The exec part is actually optional when the command is not in conflict with a builtin pnpm command
- Dominant language
- TypeScript
- Stars
- 39
- Forks
- 86
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/rushstack-websites
-
Difficulty 1/5 Under an hour Newbie friendliness 20/100
microsoft/rushstack-websites#318 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
microsoft/rushstack-websites#296 · 8 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
microsoft/rushstack-websites#279 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/rushstack-websites#231 · 5 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
microsoft/rushstack-websites#226 ·
All issues in microsoft/rushstack-websites
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·