2

我正在创建一个非常大的组件、服务等库,因此我们的组织可以只关注域代码。

在这个库中,我有一些组件、服务等必须保密,因为它们存在于我在库中控制的特定上下文中。

当我构建 lib 时,我看到许多来自 ng-packagr 的导出已添加到我的 lib.d.ts 中:

export * from './public_api';
export { TrBoutonBase as ɵa } from './lib/bouton/tr-bouton-base';
export { TrNotificationComponent as ɵc } from './lib/communication-ui/tr-notification/components/tr-notification/tr-notification.component';
export { NotificationMaxContentFilterPipe as ɵb } from './lib/communication-ui/tr-notification/pipes/notification-max-content-filter.pipe';
export { TrChampDateTexteValeur as ɵd } from './lib/formulaire/components/tr-champ-date/tr-champ-date-texte-valeur';

来自的一切export * from './public_api都是我的公共 API。

所有其他导出都来自 ng-packagr,我想对我的最终用户隐藏它,因为他们仍然可以使用它们(尽管有丑陋的字符,但他们可以使用它们)。

编辑

我的 public_api.ts 的内容

// Module Bouton
export * from './lib/bouton/tr-bouton/tr-bouton.component';
export * from './lib/bouton/tr-bouton-lien/tr-bouton-lien.component';
export * from './lib/bouton/tr-bouton-rond/tr-bouton-rond.component';
export * from './lib/bouton/tr-bouton.module';

// Module CommunicationUi
export * from './lib/communication-ui/tr-message/tr-message.enums';
export * from './lib/communication-ui/tr-message/tr-message.interfaces';
export * from './lib/communication-ui/tr-message/tr-message.service';
export * from './lib/communication-ui/tr-message/tr-message.component';
export * from './lib/communication-ui/tr-notification/enums/tr-notification-type.enum';
export * from './lib/communication-ui/tr-notification/enums/tr-notification-type-animation.enum';
export * from './lib/communication-ui/tr-notification/interfaces/tr-notification-icones';
export * from './lib/communication-ui/tr-notification/interfaces/tr-notification-event';
export * from './lib/communication-ui/tr-notification/interfaces/tr-notification-options';
export * from './lib/communication-ui/tr-notification/interfaces/tr-notification';
export * from './lib/communication-ui/tr-notification/consts/tr-notification-options-token.const';
export * from './lib/communication-ui/tr-notification/consts/tr-notifiaction-icon-par-defaut.const';
export * from './lib/communication-ui/tr-notification/consts/tr-notification-options-par-defaut.const';
export * from './lib/communication-ui/tr-notification/tr-notifications.service';
export * from './lib/communication-ui/tr-notification/components/tr-notifications/tr-notifications.component';
export * from './lib/communication-ui/tr-traitement-en-cours/tr-traitement-en-cours.interfaces';
export * from './lib/communication-ui/tr-traitement-en-cours/tr-traitement-en-cours.service';
export * from './lib/communication-ui/tr-traitement-en-cours/tr-traitement-en-cours.component';
export * from './lib/communication-ui/tr-communication-ui.module';

// Enums
export * from './lib/enums/tr-bootstrap.enums';

// Module Formulaire
export * from './lib/formulaire/components/tr-bloc-controles/tr-bloc-controles.modeles';
export * from './lib/formulaire/components/tr-bloc-controles/tr-bloc-controles.component';
export * from './lib/formulaire/components/tr-champ-date/tr-champ-date.component';
export * from './lib/formulaire/components/tr-champ-lecture-seule/tr-champ-lecture-seule.component';
export * from './lib/formulaire/components/tr-champ-requis/tr-champ-requis.component';
export * from './lib/formulaire/components/tr-controle-form/tr-controle-form.component';
export * from './lib/formulaire/directives/tr-hauteur-automatique/tr-hauteur-auto-textarea.directive';
export * from './lib/formulaire/guards/tr-page-avec-formulaire.guard';
export * from './lib/formulaire/validators/tr-dates.validator';
export * from './lib/formulaire/validators/tr-form-array.validator';
export * from './lib/formulaire/validators/tr-regex.validator';
export * from './lib/formulaire/tr-form.service';
export * from './lib/formulaire/tr-form.module';

// Helpers
export * from './lib/helpers/date/tr-date.helper';

// Module Mise en Page
export * from './lib/mise-en-page/tr-menu-contextuel/tr-menu-contextuel.service';
export * from './lib/mise-en-page/tr-menu-pied-page/tr-menu-pied-page.enums';
export * from './lib/mise-en-page/tr-menu-pied-page/tr-menu-pied-page.interfaces';
export * from './lib/mise-en-page/tr-menu-pied-page/tr-menu-pied-page.service';
export * from './lib/mise-en-page/tr-menu-pied-page/tr-menu-pied-page.component';
export * from './lib/mise-en-page/tr-message-banniere/tr-message-banniere.component';
export * from './lib/mise-en-page/tr-modal/tr-modal.component';
export * from './lib/mise-en-page/tr-modal-pied/tr-modal-pied.component';
export * from './lib/mise-en-page/tr-sections-extensibles/tr-section-extenstensible.service';
export * from './lib/mise-en-page/tr-sections-extensibles/tr-section-extensible/tr-section-extensible.component';
export * from './lib/mise-en-page/tr-sections-extensibles/tr-section-extensible-groupe/tr-section-extensible-groupe.component';
export * from './lib/mise-en-page/tr-titre-page/tr-titre-page.component';
export * from './lib/mise-en-page/tr-mise-en-page.module';

// Module Navigation
export * from './lib/navigation/tr-navigation.interfaces';
export * from './lib/navigation/tr-menu-horizontal/tr-menu-horizontal.component';
export * from './lib/navigation/tr-piv-bas-page/tr-piv-bas-page.component';
export * from './lib/navigation/tr-piv-entete/tr-piv-entete.component';
export * from './lib/navigation/tr-retour-haut-page/tr-retour-haut-page.component';
export * from './lib/navigation/tr-navigation.module';

// Module Pipes
export * from './lib/pipes/tr-afficher-sauts-lignes/tr-afficher-sauts-lignes';
export * from './lib/pipes/tr-pipes.module';

// Module Services
export * from './lib/services/tr-historique/tr-historique.service';
export * from './lib/services/tr-valeurs-service/tr-valeurs.consts';
export * from './lib/services/tr-valeurs-service/tr-valeurs.interfaces';
export * from './lib/services/tr-valeurs-service/tr-valeurs.service';
export * from './lib/services/tr-services.module';

// Module MCO
export * from './lib/tr-mco.module';
4

0 回答 0