Closed mmattel closed 3 years ago
Hi @mmattel
That's correct, the Node.js entry point is now node_modules/asciidoctor-kroki/src/asciidoctor-kroki.js
.
How do you require/load the library?
The main
field in the package.json
describes the entry point:
See: https://docs.npmjs.com/cli/v6/configuring-npm/package-json#main
Node will use this value to load the library when using require('asciidoctor-kroki')
.
I am no yarn specialist and hope I am not getting flamed, but this seems strange to me.
No flame here, we are here to help each other :hugs:
Many thanks for your help. I changed the path and it worked.
Note: the problem happened in https://github.com/owncloud/docs/pull/2867 which is auto-generated code by GitHub dependabot https://github.com/owncloud/docs/pull/2867/commits/9a8968e11d64c1f4dfabdc0f24a6eb0ea0c28c30
The reference to asciidoctor-kroki is in https://github.com/owncloud/docs/blob/master/site.yml extension
section, and that has (had) a path ./node_modules/asciidoctor-kroki/dist/node/asciidoctor-kroki.js
going through dist/node
Many thanks for your help. I changed the path and it worked.
Awesome :+1:
The reference to asciidoctor-kroki is in https://github.com/owncloud/docs/blob/master/site.yml extension section, and that has (had) a path ./node_modules/asciidoctor-kroki/dist/node/asciidoctor-kroki.js going through dist/node
I think you can use the value asciidoctor-kroki
in asciidoc.extensions
. Behind the scene, Antora will use require
to resolve the library. It will be more robust than using a relative path from the node_modules
directory.
Thanks for the hint, I will try that and see if I can make it work according your suggestion
I am investigating a strange issue. Using antora in our ownCloud docs environment, we get errors when trying to upgrade to 0.10.0 because of missing
node/asciidoctor-kroki.js
. Running:yarn upgrade asciidoctor-kroki@0.8.2
respectivelyyarn upgrade asciidoctor-kroki@0.10.0
Comparing the directories
node_modules/asciidoctor-kroki/dist
you see an important difference: 0.8.2 --> has subdirectoriesbrowser
andnode
0.10.0 -- has only subdirectorybrowser
...I am no yarn specialist and hope I am not getting flamed, but this seems strange to me.
Any ideas?