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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using type declarations - Unable to locate entry point #1446

Closed
benmccann opened this issue Jan 2, 2021 · 2 comments
Closed

Using type declarations - Unable to locate entry point #1446

benmccann opened this issue Jan 2, 2021 · 2 comments
Labels
question Question about functionality

Comments

@benmccann
Copy link

Description

I just sent a PR to upgrade Chart.js to 0.20.9! 馃帀

Chart.js has been using JS Doc since the beginning, but more recently has added hand coded type declarations. You mentioned the other day that TypeDoc can use type declarations. I wanted to try this since I think it'd result in better typed docs (most of the types from the JS Doc end up as any and the type declarations are fairly fleshed out so should be better)

I set "entryPoints": ["types/index.esm.d.ts"], and got:

Warning: Unable to locate entry point: types/index.esm.d.ts

I was wondering if you had any ideas if I might be doing something wrong

Steps to reproduce

git clone https://github.com/benmccann/Chart.js
cd Chart.js
git checkout typedoc-upgrade
npm install

Change typedocOptions in tsconfig.json to:

  "typedocOptions": {
    "name": "Chart.js",
    "entryPoints": ["types/index.esm.d.ts"],
    "excludeExternals": true,
    "excludeNotExported": true,
    "includeVersion": true,
    "includes": "./types",
    "out": "./dist/docs/typedoc"
  },

Run npx typedoc

@Gerrit0 Gerrit0 added the question Question about functionality label Jan 3, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 3, 2021

It looks like these declaration files aren't included in the tsconfig's include option, making this change lets the docs generate:

diff --git a/tsconfig.json b/tsconfig.json
index c3f6ee1b..3da36225 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -12,7 +12,7 @@
   },
   "typedocOptions": {
     "name": "Chart.js",
-    "entryPoints": ["src/index.esm.js"],
+    "entryPoints": ["types/index.esm.d.ts"],
     "excludeExternals": true,
     "excludeNotExported": true,
     "includeVersion": true,
@@ -20,6 +20,7 @@
     "out": "./dist/docs/typedoc"
   },
   "include": [
-    "./src/**/*.js"
+    "./src/**/*.js",
+    "types"
   ]
 }

@benmccann
Copy link
Author

Ah, thanks!!

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