Repository navigation
Conversation
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5682
When PNPM skips a dependency's build scripts, it prints an "Ignored build scripts" warning box. During
rush installandrush update, Rush rewritespnpm approve-buildsin that box torush-pnpm --subspace <name> approve-builds, which is 24 characters longer. PNPM had already padded therow to fit the box, so that row's right border ended up 24 characters past the others.
This PR keeps the box aligned when Rush rewrites the command.
Details
I moved the replacement into a new function,
replaceTextInPnpmOutput()inlibraries/rush-lib/src/utilities/pnpmOutputUtilities.ts, and called it fromWorkspaceInstallManager.ts.For each line of output that contains the search text:
│ … │), it does a plain replacement, as before.it that continue the same paragraph (stopping at a blank row or the end of the box), and pads each new
row to the original width.
Color codes around the borders are kept, and the original line endings are kept. Rush receives PNPM's
output in arbitrary chunks, so a row that is cut off at the end of a chunk can't be fixed safely. Such
rows fall back to the plain replacement, so the worst case is the current behavior.
Known limitation: with a subspace name longer than about 30 characters, the command itself can be split
across two rows. I considered keeping it on one row, but then a long command would push past the right
border again, so I let it wrap to keep the box aligned.
An alternative solution could be, leaving PNPM's box unchanged and printing the
rush-pnpmcommand as a separate tip, would also work. I'm happy to switch if you'd prefer that.How it was tested
pnpmOutputUtilities.test.tscovering: output without the search text, textoutside a box, a box row where the new text fits, the real PNPM warning box, the same box with colored
borders, Windows line endings, and a row cut off at the end of a chunk.
rush initrepo using PNPM 10.32.1 with one project depending onrs-module-lexer@2.8.0(withglobalNeverBuiltDependenciesremoved so that PNPM skips the build script):ran
rush purgeandrush updateusing the locally built Rush (apps/rush/lib-commonjs/start-dev.js)and confirmed the box is aligned.
Before:

After:
