Better support `ng new` use cases
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
調査の方向性
既存の ng new と ng generate の動作、およびリンクされている Angular workspace のファイル構成ドキュメントを確認することから始めます。現在の --create-application=false フローを、要求されているアプリケーション、ライブラリ、マルチアプリのユースケースと比較します。実装前に、workspace の用語とコマンドの境界について合意された方向性が定まっていることが完了の条件です。
索引モデルが issue の本文から書いたものです。
説明
🚀 Feature request
/cc @mgechev
Command (mark with an x)
- new
- generate
Description
We should rethink some of the DX around ng new, as it was originally intended to make new Angular applications, but has expanded somewhat, particularly with monorepos. There are three things in particular which are a bit awkward:
- There is no way to create an Angular library (using the CLI) without using a monorepo structure. This may not be desired and makes library authorship a little more awkward.
- To use a monorepo structure, users are supposed to use
ng new --create-application=false, which is a pretty awkward syntax and doesn't make clear that this is intended for a monorepo/multi-app workspace. - Reevaluate the definition of "workspace". I can't speak for others, but I always interpreted a "workspace" as effectively a monorepository for Angular apps. Looking through docs, it seems that anything with an
angular.jsonfile is technically a "workspace", song newtechnically creates a workspace, even though it isn't a monorepo. I think this definition of "workspace" only really applies internally so we should think more critically about the language here.
Additional context: https://twitter.com/justinfagnani/status/1373336274384293889
Describe the solution you'd like
I'm thinking we could add an extra flag to ng new to decide whether to make a standalone application (ng new --type app), a multi-app workspace (ng new --type workspace, equivalent to today's ng new --create-application=false), or a standalone library (ng new --type library). Note that ng new --type app and ng new --type library both technically create a "workspace" per the above definition. We might want to either tweak the definition of "workspace" to mean "a multi-app Angular repo" or use something like ng new --type empty-workspace.
This would be distinguished from ng generate because ng new makes a new repository while ng generate works within an existing repository. Arguably we should merge ng new and ng generate (maybe inferring from file path context whether a new repository is required).
Some of the broader questions we should discuss:
- How should we position Angular "workspaces"? Are they for monorepositories or not?
- How should
ng newandng generatework together or be merged?
Describe alternatives you've considered
Apparently you can use ng-packagr to generate a library without a workspace, but you're losing a lot of the benefits of the CLI by doing so: https://twitter.com/Splaktar/status/1373373386802479105
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 17時間 25分
- マージ済み PR(30日)
- 183
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/angular-cli のほかの issue
-
area: @angular/build gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/angular-cli#33055 · コメント 1 件 · リアクション 3 件 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 担当者 1 名 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 担当者 1 名 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 担当者 1 名 ·
angular/angular-cli の issue をすべて見る
似ている issue
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
supermomonga/zcode-acp#24 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
growthbook/growthbook#7100 ·
-
triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100