Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove more table output #7407

Merged
merged 2 commits into from
Apr 23, 2024
Merged

Remove more table output #7407

merged 2 commits into from
Apr 23, 2024

Conversation

wraithgar
Copy link
Member

Removes table output from npm search npm publish and npm pack

Also removes the columnify dependency as it is no longer used.

  • fix: Remove table output from search and tar summary
  • deps: remove columnify

This removes table output from `npm search` and from all commands that
log a summary of tarball content (`npm publish` and `npm pack`).

Table output is discouraged in a cli for accessibility reasons.
@wraithgar wraithgar requested a review from a team as a code owner April 23, 2024 17:14
@wraithgar wraithgar merged commit c77f035 into latest Apr 23, 2024
20 checks passed
@wraithgar wraithgar deleted the gar/no-tables-part-two branch April 23, 2024 17:32
@github-actions github-actions bot mentioned this pull request Apr 23, 2024
fengmk2 pushed a commit to cnpm/cnpmcore that referenced this pull request Dec 18, 2024
### 改动原因

在今年 4 月份,npm cli 对 search 做了[一些改动],在 4 月份以前(npm cli < `v10.6.0`),采用的是
`maintainers` 字段,而在 npm/cli#7407 后,改为使用:
`publisher` 字段。

导致当 npm 版本大于等于 `v10.6.0` 后,search 结果中的 `author` 将变成 `???`,如图:

![CleanShot 2024-12-18 at 16 46
58@2x](https://github.com/user-attachments/assets/4b97bf63-78cb-4720-8c00-469eeff3e92f)

预期的结果应该为:

![CleanShot 2024-12-18 at 16 47
33@2x](https://github.com/user-attachments/assets/2d7fca89-4383-42bd-8b83-66257efe65e8)

### 技术细节说明

当前改动没有为 `es` 增加新的索引,原因是处于以下考虑:

1. es 的 `mapping` 一旦创建,就无法修改(虽然使用了 `dynamic: true` 但无法细粒度的进行控制)
2. 源数据中的 `_npmUser` 已经有相关信息了,没有必要为此浪费额外的磁盘空间
3. 如果想对以前的数据进行更新会比较麻烦,性价比较低

npm cli 老版本:
https://github.com/npm/cli/pull/7407/files#diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6L58
npm cli 新版本:
https://github.com/npm/cli/pull/7407/files#diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6R162

### 其他

相关 PR: #513

PTAL @Beace @fengmk2 @elrrrrrrr

[一些改动]: npm/cli#7407

Signed-off-by: Kevin Cui <bh@bugs.cc>
fengmk2 pushed a commit to cnpm/cnpmcore that referenced this pull request Dec 18, 2024
[skip ci]

## [3.71.2](v3.71.1...v3.71.2) (2024-12-18)

### Bug Fixes

* **search:** author is `???` in result ([#741](#741)) ([acffb14](acffb14)), closes [/github.com/npm/cli/pull/7407/files#diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6L58](https://github.com/cnpm//github.com/npm/cli/pull/7407/files/issues/diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6L58) [/github.com/npm/cli/pull/7407/files#diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6R162](https://github.com/cnpm//github.com/npm/cli/pull/7407/files/issues/diff-4bc15933c685fc9a9ce8be0c13a2f067f5e2b3334bacd6664bdfa7ddc46aedb6R162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants