Closed selankon closed 1 year ago
Looks like a dependency collision with Docusarus. Try putting dummy-project and configs outside of the Docusaurus folder and run script there
root <- run script here
ㄴ docs (Docusaurus root)
ㄴ dummy_project
ㄴ jsdoc.json
ㄴ config.json
Thats ok, I got dummy-project documentation generated. Thanks
I Is there a way to avoid dependency collisions? The project I have to generate seems to have a dependency collision also. Is not a docusaurus project, and after do yarn
, with all dependencies downloaded, If i run the build docs it throws lots of errors like that.
I guess this is not a dependency collision. From a standalone, if I use yarn
and not npm
, it breaks with same error
I'm also facing with this issue RN, there's no way to run jsdoc-to-mdx
with yarn in this project: https://github.com/vocdoni/vocdoni-sdk/tree/main/docs
It works without any issue when using npm. I ensured both lockfiles are exactly the same (by using yarn import
), and it just crashes with yarn, while doing it with npm works as expected. Note that it crashes running the process, but the failure comes from installing wrong dependencies; meaning if I run npm i
and then run the script with yarn run script
it'll work, the problem lies with the installation of dependencies using yarn, then running jsdoc-to-mdx
with whatever you run it (either npx, or yarn, both fail).
Is a typescript project, as the one from the OP, and I'm also storing my docs project inside a docs
folder in the main repo.
Haven't tried what you say about moving scripts outside, I'd prefer not to do so, since it would mean adding dependencies outside that I don't want at all for the main project.
Personally I never faced with an issue like this before... I've been working with yarn since the very first day (+6 years now if I'm not wrong), and never faced an issue with dependencies being installed in different ways depending on the package manager used (running from the same json file, ofc).
Any ideas?
Maybe the command npx
used internally broke in this case I guess?
I was quite busy so I couldn't, but I'll take a look at it & fix it right now.
Also, quick notice for those who are interested in this project:
As jsdoc
itself lacks compatibility with Typescript-only features like generics, etc.
We're making a new document generator, which uses TypeDoc instead.
It's WIP, but you can take a sneak peek at it:
Ideas/PRs welcome!
Don't worry, both projects(this repo and the new one) will be maintained :)
Released a new beta version that might fix this issue, at least for my env.
Try installing jsdoc-to-mdx@1.1.3-beta.0
, it will be released if it's okay after PR.
Awesome @WoodNeck. TBH I won't be able to try it until next year already, since I'm out on vacation. Hopefully the OP could test it before 😅
Yey have you any ideas when an stable release of typedoc-to-mdx
will be stable?
I tried jsdoc-to-mdx@1.1.3-beta.0
and now yarn works good! Thanks!
@selankon
typedoc-to-mdx
will be released soon, maybe in January next year :)
But here are things you should consider, as it's in development stage:
Fixed in jsdoc-to-mdx@1.1.3
Hi @WoodNeck any updates with your awesome typedoc-to-mdx
??
Thanks in advance
@selankon That can be released within the next week. But the problem is, I have so many works to do right now so two things will be missing.
jsdoc-to-mdx
sass
/ css
files will be provided so you should include that in your projecttypedoc-to-mdx
don't create sidebar-api
file, but you can use Docusaurus's sidebar type autogenerated
instead.I'll leave a comment here after releasing it :)
Thats really nice. Just ping us when released and we will test it :)
@selankon
typedoc-to-mdx
is released!
Feedback is welcomed! It's a project I made in a hurry so that weird things might happen in your env. Please leave the issue on the project GitHub if anything happens.
Yey! Great news! Will test it asap!
I got the following error trying to parse the
dummy-project
copied from the installed node-module.How to reproduce:
Node.js v18.12.1
yarn add -D jsdoc-to-mdx
(install"jsdoc-to-mdx": "^1.1.2",
version)cp -r node_modules/jsdoc-to-mdx/dummy-project .
jsdoc-to-mdx.config.json
:jsdoc.json
tsconfig.json
npx jsdoc-to-mdx -c jsdoc-to-mdx.config.json
and got the error aboveFull stacktrace
``` ERROR: Unable to parse /home/user/project//dummy-project/class/DummyClass.ts: Unexpected token, expected "{" (19:37) ERROR: Unable to parse /home/user/project//dummy-project/class/ParentClass.ts: Unexpected token (16:9) ERROR: Unable to parse /home/user/project//dummy-project/const/consts.ts: Missing semicolon. (11:1) ERROR: Unable to parse /home/user/project//dummy-project/global/SomeGlobalFunction.ts: Unexpected token, expected "," (10:29) ERROR: Unable to parse /home/user/project//dummy-project/interface/DummyInterface.ts: Unexpected reserved word 'interface'. (11:0) ERROR: Unable to parse /home/user/project//dummy-project/interface/OtherInterface.ts: Unexpected reserved word 'interface'. (11:0) ERROR: Unable to parse /home/user/project//dummy-project/interface/ParentInterface.ts: Unexpected reserved word 'interface'. (7:0) ERROR: Unable to parse /home/user/project//dummy-project/typedef/DummyTypedef.ts: Missing semicolon. (6:4) /home/user/project//node_modules/child-process-promise/lib/index.js:132 var err = new ChildProcessError(message, code, cp); ^ ChildProcessError: `npx @daybrush/jsdoc -X -r -c ./jsdoc.json -d /tmp/tmp-80634-B6rkSgdVc3Ye` failed with code 1 at ChildProcess.