Unsupported private class error doesn't throw on building library for production

未關閉
#17,518 6 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
angular, typescript, webpack
領域
build-system, cli

研究方向

首先,使用 issue 中描述的命令和測試函式庫 repository,透過 ng bng b --prod 重現函式庫建置。比較一般建置和 production 建置圍繞函式庫公開 API 以及 private class 驗證的進入點;當兩個命令都回報 Unsupported private class 錯誤時即表示完成。

由索引模型根據 Issue 內容生成。

描述

area: @schematics/angular freq1: low severity3: broken type: bug/fix

🐞 Bug report

Command (mark with an x)
  • new
  • 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

主要語言
TypeScript
星號
27k
分支
11.8k
平均合併
16 小時 35 分鐘
30 天內合併 PR
176

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

angular/angular-cli 的其他 Issue

查看 angular/angular-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。