Unsupported private class error doesn't throw on building library for production
- Ngôn ngữ chính
- TypeScript
- Star
- 27k
- Fork
- 11.8k
- Merge trung bình
- 14 giờ 23 phút
- Pull request đã merge (30 ngày)
- 162
Mô tả
# 🐞 Bug report
### Command (mark with an `x`)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
### Is this a regression?
i'm not sure
### Description
when i export a component in the library module but not in the public API
the build command throw errors only in normal mode, but in production mode it completes successfully
## 🔬 Minimal Reproduction
clone https://github.com/robertIsaac/test-library
and run ng b and ng b --prod
or generate from scratch
```
ng new test-library --create-application=false
cd test-library
ng generate library test-library
ng g c test-export --export
ng b
ng b --prod
```
## 🔥 Exception or Error
both commands should throw the following error
Unsupported private class TestExportComponent. This class is visible to consumers via TestLibraryModule -> TestExportComponent, but is not exported from the top-level library entrypoint.
## 🌍 Your Environment
$ ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 9.1.1
Node: 12.14.1
OS: win32 x64
Angular: 9.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.901.1
@angular-devkit/build-angular 0.901.1
@angular-devkit/build-ng-packagr 0.901.1
@angular-devkit/build-optimizer 0.901.1
@angular-devkit/build-webpack 0.901.1
@angular-devkit/core 9.1.1
@angular-devkit/schematics 9.1.1
@angular/cli 9.1.1
@ngtools/webpack 9.1.1
@schematics/angular 9.1.1
@schematics/update 0.901.1
ng-packagr 9.1.1
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
**Anything else relevant?**
it would be nice if --export command also update the public api file if it's running inside a library
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện quá trình build thư viện với `ng b` và `ng b --prod` bằng các lệnh và repository thư viện kiểm thử được mô tả trong issue. So sánh các entry point của bản build thông thường và bản build production liên quan đến public API của thư viện và việc kiểm tra private class; hoàn tất khi cả hai lệnh đều báo lỗi Unsupported private class.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, typescript, webpack
- Lĩnh vực
- build-system, cli
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100