Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secondary Entrypoints in Libs #2009

Closed
phihochzwei opened this issue Jul 20, 2022 · 4 comments
Closed

Secondary Entrypoints in Libs #2009

phihochzwei opened this issue Jul 20, 2022 · 4 comments
Labels
question Question about functionality

Comments

@phihochzwei
Copy link

Search terms

NX, Monorepo, Angular, Library, Libs

Question

Hi there,

is there currently a way to include secondary entrypoints inside a library into the documentation.

E.g.:
My project consists of 2 "TypeDoc"-Entrypoints, "Store" and "Model". The "Store"-library consists of eine primary and 4 secondary entry points, which right now in my setup are completly ignored.

Or am I doing something wrong ?

@phihochzwei phihochzwei added the question Question about functionality label Jul 20, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 23, 2022

It sounds like you want #1937 to me, is that accurate?

@phihochzwei
Copy link
Author

Honestly, I am not sure. In Angular, the secondary entrypoints are created by adding subfolders with additional ng-package.json-Files. And from here the ng-packagr takes over. A good sum-up of this is https://sandroroth.com/blog/angular-library

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 30, 2022

TyepDoc doesn't have any special casing (and I don't want to add any, most people don't use Angular) for ng-* files.

However, it looks like that setup could be used to produce reasonable documentation with TypeDoc, here's a forked example from that article with TypeDoc added: https://github.com/Gerrit0/angular-library-example

The relevant bits are:

typedoc.json - adding entry points, making it compile

{
  "$schema": "https://typedoc.org/schema.json",
  "name": "Angular API",
  "entryPoints": [
    "projects/mycomp/ui-sdk/public-api.ts",
    "projects/mycomp/ui-sdk/button/public-api.ts",
    "projects/mycomp/ui-sdk/i18n/public-api.ts",
    "projects/mycomp/ui-sdk copy/public-api.ts",
    "projects/mycomp/ui-sdk copy/button/public-api.ts",
    "projects/mycomp/ui-sdk copy/i18n/public-api.ts"
  ],
  "compilerOptions": {
    "skipLibCheck": true
  }
}

public-api.ts - using @module to override the display name

diff --git a/projects/mycomp/ui-sdk/public-api.ts b/projects/mycomp/ui-sdk/public-api.ts
index e619023..aa05058 100644
--- a/projects/mycomp/ui-sdk/public-api.ts
+++ b/projects/mycomp/ui-sdk/public-api.ts
@@ -1,3 +1,6 @@
+/**
+ * @module ui-sdk
+ */
 export * from './src/ui-sdk.service';
 export * from './src/ui-sdk.component';
 export * from './src/ui-sdk.module';

@phihochzwei
Copy link
Author

Okay, since this a very special combination I got here, I guess I just have bad luck :)

@phihochzwei phihochzwei closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about functionality
Projects
None yet
Development

No branches or pull requests

2 participants