Skip to content

0.20 does not find custom declaration files #1445

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

Closed
Gerrit0 opened this issue Jan 2, 2021 · 9 comments
Closed

0.20 does not find custom declaration files #1445

Gerrit0 opened this issue Jan 2, 2021 · 9 comments
Labels
needs reproduction Needs a minimal reproducible case - https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d

Comments

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 2, 2021

I just upgraded to 0.20.9 - PR here AndyOGo/stylelint-declaration-strict-value#131

However I still can't build the docs.
It doesn't find my custom declaration files for 2 modules.

But my normal lint and build with typescript works.

I also tried to a the typeRoots options, but without luck 😞
https://www.typescriptlang.org/tsconfig#typeRoots

> [email protected] docs /stylelint-declaration-strict-value
> typedoc --plugin typedoc-plugin-markdown src/index.ts

Loaded plugin typedoc-plugin-markdown

Error: /stylelint-declaration-strict-value/src/index.ts(2)
 Could not find a declaration file for module 'shortcss'. '/stylelint-declaration-strict-value/node_modules/shortcss/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/shortcss` if it exists or add a new declaration (.d.ts) file containing `declare module 'shortcss';`
Error: /stylelint-declaration-strict-value/src/index.ts(3)
 Could not find a declaration file for module 'shortcss/lib/list'. '/stylelint-declaration-strict-value/node_modules/shortcss/lib/list.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/shortcss` if it exists or add a new declaration (.d.ts) file containing `declare module 'shortcss/lib/list';`
Error: /stylelint-declaration-strict-value/src/index.ts(4)
 Could not find a declaration file for module 'css-values'. '/stylelint-declaration-strict-value/node_modules/css-values/dist/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/css-values` if it exists or add a new declaration (.d.ts) file containing `declare module 'css-values';

Originally posted by @AndyOGo in #1089 (comment)

@Gerrit0 Gerrit0 added the bug label Jan 2, 2021
@Gerrit0 Gerrit0 added the needs reproduction Needs a minimal reproducible case - https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d label Jan 2, 2021
@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Jan 2, 2021

@AndyOGo

I can't seem to reproduce this, what I did:

git clone [email protected]:AndyOGo/stylelint-declaration-strict-value.git
cd stylelint-declaration-strict-value
npm install
npx typedoc --plugin typedoc-plugin-markdown src/index.ts

This resulted in the following output:

> npx typedoc --plugin typedoc-plugin-markdown .\src\index.ts
Info: Loaded plugin typedoc-plugin-markdown
Rendering [========================================] 100%
Info: Documentation generated at C:\Users\gtbir\Documents\GitHub\stylelint-declaration-strict-value\docs

The output looks to be as expected, there are three exported values, so three items in the documentation

@AndyOGo
Copy link

AndyOGo commented Jan 2, 2021

@Gerrit0 thx for your quick reply.

I opened up a branch which has the issue.
AndyOGo/stylelint-declaration-strict-value#132

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Jan 2, 2021

I still can't seem to reproduce this, checking out that branch, then running npm i, npm run docs errors with:

~\Documents\GitHub\stylelint-declaration-strict-value [bugfix/docs-entry-point ≡]
> npm run docs

> [email protected] docs C:\Users\gtbir\Documents\GitHub\stylelint-declaration-strict-value
> typedoc --plugin typedoc-plugin-markdown src/index.ts

Info: Loaded plugin typedoc-plugin-markdown
Error: Tried to set an option (inputFiles) that was not declared.
Error: Tried to set an option (mode) that was not declared.

Removing those options from the options file:

diff --git a/typedoc.json b/typedoc.json
index 8066213..2bd7f78 100644
--- a/typedoc.json
+++ b/typedoc.json
@@ -1,6 +1,4 @@
 {
-  "inputFiles": ["./src/"],
-  "mode": "modules",
   "readme": "none",
   "out": "docs"
 }

Results in a working build:

~\Documents\GitHub\stylelint-declaration-strict-value [bugfix/docs-entry-point ≡ +0 ~1 -0 !]
> npm run docs

> [email protected] docs C:\Users\gtbir\Documents\GitHub\stylelint-declaration-strict-value
> typedoc --plugin typedoc-plugin-markdown src/index.ts

Info: Loaded plugin typedoc-plugin-markdown
Rendering [========================================] 100%
Info: Documentation generated at C:\Users\gtbir\Documents\GitHub\stylelint-declaration-strict-value\docs

@AndyOGo
Copy link

AndyOGo commented Jan 2, 2021

Thank you, that is very interesting 🤔

I will try it.

Btw. which platform are you using?

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Jan 2, 2021

I'm on Windows 10 Professional, not sure of the exact build.

@AndyOGo
Copy link

AndyOGo commented Jan 2, 2021

I'm on macOS Catalina 10.15.7 (19H2)
node -v: v10.19.0
npm -v: 6.13.4

Alright, I removed the mode and inputFiles options.
https://github.com/AndyOGo/stylelint-declaration-strict-value/pull/132/files#diff-6169a21f84f4d19da38a12219c19778338487973f106b9dad94370e66e1c8c1a

Now I get these errors 😞

npm run docs

> [email protected] docs /stylelint-declaration-strict-value
> typedoc --plugin typedoc-plugin-markdown src/index.ts

Info: Loaded plugin typedoc-plugin-markdown
TypeDoc exiting with unexpected error:
TypeError: Right-hand side of 'instanceof' is not an object
    at ReflectionType.type (/stylelint-declaration-strict-value/node_modules/typedoc-plugin-markdown/dist/resources/helpers/type.js:27:14)
    at getType (/stylelint-declaration-strict-value/node_modules/typedoc-plugin-markdown/dist/resources/helpers/declaration-title.js:30:24)
    at DeclarationReflection.declarationTitle (/stylelint-declaration-strict-value/node_modules/typedoc-plugin-markdown/dist/resources/helpers/declaration-title.js:22:124)
    at DeclarationReflection.wrapper (/stylelint-declaration-strict-value/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
    at Object.eval [as main] (eval at createFunctionContext (/stylelint-declaration-strict-value/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:10:225)
    at main (/stylelint-declaration-strict-value/node_modules/handlebars/dist/cjs/handlebars/runtime.js:208:32)
    at ret (/stylelint-declaration-strict-value/node_modules/handlebars/dist/cjs/handlebars/runtime.js:212:12)
    at ret (/stylelint-declaration-strict-value/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:519:21)
    at Object.invokePartial (/stylelint-declaration-strict-value/node_modules/handlebars/dist/cjs/handlebars/runtime.js:334:12)
    at Object.invokePartialWrapper [as invokePartial] (/stylelint-declaration-strict-value/node_modules/handlebars/dist/cjs/handlebars/runtime.js:84:39)

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Jan 2, 2021

Looks like you're running on an older version of typedoc-plugin-markdown that doesn't support 0.20.

@AndyOGo
Copy link

AndyOGo commented Jan 2, 2021

@Gerrit0
Thank you very much.
I was on [email protected].
Upgrading to 3.2.1 made it work, even though there seems to be a breaking change somewhere, no major upgrade 🤔

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Jan 2, 2021

Good to hear! Closing this as resolved then.

@Gerrit0 Gerrit0 closed this as completed Jan 2, 2021
@Gerrit0 Gerrit0 removed the bug label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction Needs a minimal reproducible case - https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d
Projects
None yet
Development

No branches or pull requests

2 participants