[feature request] Indent output of nested `npm` commands
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 28/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
- Ambito
- cli
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 60
- Fork
- 29
- Merge medio
- 2g 23h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di npm/run-script
-
[BUG] On Windows a plain `node server.js` script outlives npmForse già presa @azchohfi l’ha presa 9 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
npm/run-script#287 ·
-
Needs Triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
npm/run-script#237 ·
Tutte le issue di npm/run-script
Issue simili
-
docs: add SECURITY.md vulnerability reporting policyForse già presa @AK-Lmn l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
flisk-sh/linux2wasm#12 ·
I maintainer di solito rispondono entro 1 giorno
-
possible bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Mintplex-Labs/anything-llm#7388 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 60/100
I maintainer di solito rispondono entro 1 giorno
-
v6: Minified bootstrap.min.css is missing header infoForse già presa @lazerg l’ha presa oggi. Apertabug build confirmed has-pr v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
githubnext/gh-aw-workshop#6332 ·
I maintainer di solito rispondono entro 1 giorno