[feature request] Indent output of nested `npm` commands
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 28/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
- 領域
- cli
調査の方向性
Start by reading Node.js tty and readline documentation, then trace how run-script launches nested npm commands and handles inherited output. The feature is done when direct and indirect nested commands visibly indent their stdout and stderr, preserve parent-child boundaries, and account for resize and non-TTY behavior.
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When running nested npm commands like implicit pre and post scripts (pretest, prepack, preinstall...), they are run on new spawned processes, with the only reference to where they start by the process banner, but there's no indication of where they end or their relationship, since output is flat.
Expected Behavior
I would like that when a npm command is exec as direct or indirect result of a previous npm command, that its output gets indented, so it's easier to see where they start and end and who's its parent npm process. To do it, we would need to do:
- detect we are running as a nested
npmcommand, if not proceed as usual. - use https://nodejs.org/api/tty.html or https://nodejs.org/api/readline.html to create a virtual TTY where to run the command, instead of using
inherit. Also handle theresizeevent, and maybe mimic someway the commands they are not running on a TTY if the parent process doesn't does it. - process the output to the
stdoutandstderrof the virtual TTY, and indent it for each newnewlinethat arrives
Steps To Reproduce
No response
Environment
- npm: 9.6.7
- Node: v20.3.1
- OS: Ubuntu Linux 23.04
- platform: x86_64
- 主要言語
- JavaScript
- スター
- 60
- フォーク
- 29
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
npm/run-script のほかの issue
-
[BUG] On Windows a plain `node server.js` script outlives npm対応中かも @azchohfi が 9 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
npm/run-script#287 ·
-
Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
npm/run-script#237 ·
似ている issue
-
docs: add SECURITY.md vulnerability reporting policy対応中かも @AK-Lmn が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
flisk-sh/linux2wasm#12 ·
メンテナーはふだん 1 日以内に返信
-
possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Mintplex-Labs/anything-llm#7388 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
メンテナーはふだん 1 日以内に返信
-
v6: Minified bootstrap.min.css is missing header info対応中かも @lazerg が今日担当しました。 オープンbug build confirmed has-pr v6
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
githubnext/gh-aw-workshop#6332 ·
メンテナーはふだん 1 日以内に返信