dgeni文档生成集未定义

时间:2022-11-05 14:34:57

My problem is that the dgeni doc generation crashes and I read the error set is not defined, so I think the error has something to do with that.

我的问题是dgeni doc生成崩溃,我读错误集没有定义,所以我认为错误与此有关。

I have installed dgeni via npm install (currently under Windows 7 but also tried Ubuntu 14.04 before). With that I mean:

我已经通过npm install安装了dgeni(目前在Windows 7下,但之前也尝试过Ubuntu 14.04)。我的意思是:

  • dgeni ~0.4.2
  • dgeni-packages ~0.14.0
  • canonical-path 0.0.2

In the public folder of the project there are a lot of .js files in. They are not directly in /public but some subfolders.

在项目的公共文件夹中有很多.js文件。它们不是直接在/ public,而是一些子文件夹。

I set up a dgeni package like this in the docs folder and downloaded templates located in /docs/templates:

我在docs文件夹中设置了这样的dgeni包,并在/ docs / templates中下载了模板:

dgeni-docs.js

var path = require('canonical-path');
var Package = require('dgeni').Package;

module.exports = new Package('dgeniDocsPackage', [
  require('dgeni-packages/dgeni'),
  require('dgeni-packages/jsdoc'),
  require('dgeni-packages/nunjucks')
])

.config(function(log, readFilesProcessor, writeFilesProcessor, templateFinder, debugDumpProcessor) {

  log.level = 'info';

  readFilesProcessor.basePath = path.resolve(__dirname, '..');
  readFilesProcessor.sourceFiles = [{ include: 'public/**/*.js', basePath: 'public' }];
  writeFilesProcessor.outputFolder = 'docs/build';

  templateFinder.templateFolders.unshift('docs/templates');
  templateFinder.templatePatterns.unshift('common.template.html');
});

common.template.html

<h1>{{ doc.codeName }} ({{ doc.outputPath }})</h1>
<p>{{ doc.description }}</p>

{%- if doc.params %}
<h2>Params</h2>
<ul>
{%- for param in doc.params %}
  <li>
    <strong>{{ param.name }}</strong> { {{ param.typeList }} } - {{ param.description }}
  </li>
{%- endfor %}
</ul>
{%- endif %}

{%- if doc.returns %}
<h2>Returns</h2>
<p>
  { {{ doc.returns.typeList }} } - {{ doc.returns.description }}
</p>
{%- endif %}

and the command I started it with is "dgeni .\docs\dgeni-docs.js"

我开始使用的命令是“dgeni。\ docs \ dgeni-docs.js”

The output is:

输出是:

W:\home\webserver\aconcept (master) (aconcept@0.3.3)
λ dgeni .\docs\dgeni-docs.js

W:\home\webserver\aconcept\node_modules\dgeni-packages\jsdoc\services\transforms\extract-access.js:8
  extractAccessTransformImpl.allowedDocTypes = new Set(['property', 'method'])
                                                   ^
ReferenceError: Set is not defined
    at extractAccessTransform (W:\home\webserver\aconcept\node_modules\dgeni-packages\jsdoc\services\transforms\extract-access.js:8:52)
    at Array.invoke [as 0] (C:\Users\HSO4ABT\AppData\Roaming\npm\node_modules\dgeni\node_modules\di\lib\injector.js:75:15)
    at get (C:\Users\HSO4ABT\AppData\Roaming\npm\node_modules\dgeni\node_modules\di\lib\injector.js:48:43)
    at C:\Users\HSO4ABT\AppData\Roaming\npm\node_modules\dgeni\node_modules\di\lib\injector.js:71:14
    at Array.map (native)
    at invoke (C:\Users\HSO4ABT\AppData\Roaming\npm\node_modules\dgeni\node_modules\di\lib\injector.js:70:31)
    at C:\Users\HSO4ABT\AppData\Roaming\npm\node_modules\dgeni\lib\util\getInjectables.js:10:31
    at Array.map (native)
    at C:\Users\HSO4ABT\AppData\Roaming\npm\node_modules\dgeni\lib\util\getInjectables.js:9:22
    at module.exports.Package.processor.processor.processor.processor.processor.processor.processor.processor.processor.factory.factory.factory.factory.factory.factory.factory.factory.factory.factory.config.config.config.extractTagsProcessor.defaultTagTransforms (W:\home\webserver\aconcept\node_modules\dgeni-packages\jsdoc\index.js:42:39)

Thanks for reading

谢谢阅读

1 个解决方案

#1


0  

I managed to do it, the solution was to use gulp for the generation. Up to the documentation it should also be possible to call it in the console directly though.

我设法做到了,解决方案是使用gulp进行生成。直到文档,它也应该可以直接在控制台中调用它。

Here a finished example for those of you who are interested in a complete one: https://github.com/petebacondarwin/dgeni-example

这里有一个完整的例子,对于那些对完整的一个感兴趣的人:https://github.com/petebacondarwin/dgeni-example

#1


0  

I managed to do it, the solution was to use gulp for the generation. Up to the documentation it should also be possible to call it in the console directly though.

我设法做到了,解决方案是使用gulp进行生成。直到文档,它也应该可以直接在控制台中调用它。

Here a finished example for those of you who are interested in a complete one: https://github.com/petebacondarwin/dgeni-example

这里有一个完整的例子,对于那些对完整的一个感兴趣的人:https://github.com/petebacondarwin/dgeni-example