nodejs / nodejs/node

Should node support subcommands?

オープン
#53,483 コメント 15 件 リアクション 13 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

cli feature request never-stale
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

What is the problem this feature will solve?

currently, node's cli interface is pretty simple and lean,
it mainly accepts flags that start with two dashes, or sometimes a single dash for some aliases.
additionally, many flags depend on each other or imply using another flag.

now that more and more flags are added to node, (and each new flag is heavily considered before adding to avoid options bloat), I propose we support a more complex cli interface with sub-commands.
this issue has come up before when adding node --run, and to avoid blocking that - the discussion was postponed, so I went ahead and opened this issue.

If I recall, the main concern was node run or node test is a breaking change since it today runs node run.js or node test.js accordingly - that can be addressed with releasing this gradually as semver-major with a deprecation warning for a few versions prior to the actual change

some groups/clusters of commands that might fit using sub commands:

  • node --run
  • node --watch, --watch-path
  • node --test
  • node --build-snapshot
What is the feature you are proposing to solve the problem?

N/A

What alternatives have you considered?

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず Node の CLI 処理と node --run に関するこれまでの議論を確認し、次に提案されているグループ --run--watch--test--build-snapshot を比較します。既存の node run.js および node test.js の呼び出しへの互換性の影響を考慮してください。完了とするには、合意されたサブコマンド設計と semver-major の非推奨化計画が必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
node.js
領域
cli
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。