new library public-api.ts file not using component type declared on angular.json's schematics
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- angular, typescript
- 領域
- build-system, cli
研究方向
首先,在 angular.json 中使用 @schematics/angular:component 的 type 設定重現 ng generate library foo-library,然後檢查產生的 projects/foo-library/src/lib/foo-library.cmp.ts 和 projects/foo-library/src/public-api.ts。當 public-api.ts 使用已設定的檔名後綴而不是 .component 匯出產生的元件時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
When I create a new library the default component inside of the lib folder takes its type from the component schematic declared on angular.json. If for example my angular.json looks like this:
{
//...
"newProjectRoot": "projects",
//...
"schematics": {
"@schematics/angular:application": {
"style": "scss",
"inlineTemplate": true,
"inlineStyle": true,
"ssr": false
},
"@schematics/angular:component": {
"changeDetection": "OnPush",
"type": "Cmp",
"inlineStyle": true,
"inlineTemplate": true,
"style": "scss"
}
}
}
After creating a library using ng generate library foo-library, the new library includes an empty dummy FooLibraryCmp inside the projects/foo-library/src/lib/foo-library.cmp.ts. However, the contents of projects/foo-library/src/public-api.ts look like this:
/*
* Public API Surface of foo-library
*/
export * from './lib/foo-library.service';
export * from './lib/foo-library.component'; // uses .component instead of .cmp
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 17.1.1
Node: 18.18.0
Package Manager: npm 9.6.6
OS: win32 x64
Angular: 17.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1701.1
@angular-devkit/build-angular 17.1.1
@angular-devkit/core 17.1.1
@angular-devkit/schematics 17.1.1
@schematics/angular 17.1.1
ng-packagr 17.1.2
rxjs 7.8.1
typescript 5.2.2
zone.js 0.14.3
Anything else?
No response
- 主要語言
- TypeScript
- 星號
- 27k
- 分支
- 11.8k
- 平均合併
- 17 小時 25 分鐘
- 30 天內合併 PR
- 183
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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 個 reaction ·
-
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
-
難度 2/5 1-3 小時 新手友好度 65/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
bug v2
難度 2/5 1-3 小時 新手友好度 75/100
modelcontextprotocol/inspector#2458 · 1 則留言 ·
-
難度 1/5 1 小時以內 新手友好度 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難度 2/5 1-3 小時 新手友好度 70/100
carbon-design-system/ibm-products#9907 ·