Skip to content

Commit cf1a947

Browse files
reggiCopilot
andauthored
fix: prevent inline code from wrapping in table cells (#1968)
## Problem Inline code elements (e.g. `--provenance`, `--dry-run`) inside table cells can break across lines, making flag names hard to read. ## Fix Adds `white-space: nowrap` to `code` elements inside `td` and `th` in the `Table` styled component. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 17d5bac commit cf1a947

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

cli/lib/transform.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ const transform = (data, {release, path, frontmatter, format = s => s}) => {
128128
// then do any transformer specific replacements
129129
body = format(body)
130130

131-
// prettier again now that we've altered the contents
132-
body = prettierFormat(body)
131+
// then do any transformer specific replacements
132+
body = format(body)
133133

134-
return `---\n${yaml.stringify(attributes).trim()}\n---\n\n${body}`
134+
// prettier on the final assembled output so the committed file passes prettier --check
135+
return prettierFormat(`---\n${yaml.stringify(attributes).trim()}\n---\n\n${body}`)
135136
}
136137

137138
// copied from minipass-collect. collects all chunks into a single

content/cli/v11/commands/npm-stage.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ Before using `npm stage` commands, ensure the following requirements are met:
7777

7878
### 2FA Requirements by Subcommand
7979

80-
| Command | Requires 2FA | Notes |
81-
| --- | --- | --- |
82-
| `npm stage publish` | No | Designed for automated workflows; defers 2FA to approval |
83-
| `npm stage list` | No | View staged packages |
84-
| `npm stage view` | No | View staged package details |
85-
| `npm stage approve` | Yes | Prompts for 2FA to publish the staged package |
86-
| `npm stage reject` | Yes | Prompts for 2FA to permanently remove the staged package |
87-
| `npm stage download` | No | Downloads the tarball for local inspection |
80+
| Command | Requires 2FA | Notes |
81+
| -------------------- | ------------ | -------------------------------------------------------- |
82+
| `npm stage publish` | No | Designed for automated workflows; defers 2FA to approval |
83+
| `npm stage list` | No | View staged packages |
84+
| `npm stage view` | No | View staged package details |
85+
| `npm stage approve` | Yes | Prompts for 2FA to publish the staged package |
86+
| `npm stage reject` | Yes | Prompts for 2FA to permanently remove the staged package |
87+
| `npm stage download` | No | Downloads the tarball for local inspection |
8888

8989
### Tag Behavior
9090

@@ -96,12 +96,12 @@ The tag is an immutable property of the staged package. Once a package is staged
9696

9797
The key difference with staged publishing is that `npm stage publish` never requires a 2FA prompt, regardless of token type. This is what makes it suitable for automated workflows. The goal of `npm stage publish` is deferring proof-of-presence to a later point in time.
9898

99-
| Token Type | `npm stage publish` | `npm publish` |
100-
| --- | --- | --- |
101-
| GAT with bypass | Can stage | Can publish (if allowed by package publishing access) |
102-
| GAT without bypass | Can stage | 2FA prompt (if allowed by package publishing access) |
103-
| Session token | Can stage | 2FA prompt |
104-
| Trust token (OIDC) | Can stage (if allowed) | Can publish (if allowed) |
99+
| Token Type | `npm stage publish` | `npm publish` |
100+
| ------------------ | ---------------------- | ----------------------------------------------------- |
101+
| GAT with bypass | Can stage | Can publish (if allowed by package publishing access) |
102+
| GAT without bypass | Can stage | 2FA prompt (if allowed by package publishing access) |
103+
| Session token | Can stage | 2FA prompt |
104+
| Trust token (OIDC) | Can stage (if allowed) | Can publish (if allowed) |
105105

106106
### Trust Relationship Permissions
107107

src/mdx/components.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ export const Table = styled.table`
215215
border-top-width: 1px;
216216
}
217217
218+
td code,
219+
th code {
220+
white-space: nowrap;
221+
}
222+
218223
td a {
219224
color: var(--fgColor-default, #1f2328);
220225
text-decoration: underline;

0 commit comments

Comments
 (0)