Skip to content

Node.js API with source instead of the input file broken #1057

@bodia-uz

Description

@bodia-uz

Commit f60d90c breaks ability to use Node.js API with source instead of the input file.

Or more precisely next lines:

documentation/src/index.js

Lines 108 to 110 in f60d90c

if (path.extname(sourceFile.file) === '.vue') {
return parseVueScript(sourceFile, config).map(buildPipeline);
}

  • What version of documentation.js are you using?:
    6.3.0
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?):
    Node.js API
documentation.build([{ source: documentationSource }], { shallow: true })

Error:

[08:26:34][npm test]     TypeError: Path must be a string. Received undefined
[08:26:34][npm test]       
[08:26:34][npm test]       at node_modules/documentation/lib/index.js:97:14
[08:26:34][npm test]       at arrayMap (node_modules/lodash/lodash.js:631:23)
[08:26:34][npm test]       at map (node_modules/lodash/lodash.js:9546:14)
[08:26:34][npm test]       at Function.flatMap (node_modules/lodash/lodash.js:9249:26)
[08:26:34][npm test]       at buildInternal (node_modules/documentation/lib/index.js:92:31)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions