docts icon indicating copy to clipboard operation
docts copied to clipboard

TypeError when repository is not hosted on github

Open SupernaviX opened this issue 7 years ago • 2 comments

Hi,

I seem to be getting a TypeError trying to generate docs for something without a repository url.

Unhandled rejection TypeError: Cannot read property 'isDirty' of undefined
    at DocBuilder.getSource (/Users/gelliss/stash/miniapp-version-resolver/node_modules/docts/dist/DocBuilder.js:52:30)
    at DocBuilder.formatPos (/Users/gelliss/stash/miniapp-version-resolver/node_modules/docts/dist/DocBuilder.js:76:22)
    at DocBuilder.printTitle (/Users/gelliss/stash/miniapp-version-resolver/node_modules/docts/dist/DocBuilder.js:93:22)
    at DocBuilder.printClass (/Users/gelliss/stash/miniapp-version-resolver/node_modules/docts/dist/DocBuilder.js:164:18)
    at /Users/gelliss/stash/miniapp-version-resolver/node_modules/docts/dist/DocBuilder.js:201:64
    at tryCatcher (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/map.js:61:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/promise_array.js:114:31)
    at MappingPromiseArray.init (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/promise_array.js:78:10)
    at MappingPromiseArray._asyncInit (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/map.js:30:10)
    at Async._drainQueue (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/async.js:138:12)
    at Async._drainQueues (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/gelliss/stash/miniapp-version-resolver/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

Taking a quick peek at the code, it looks like there's a regex explicitly checking for a repository.url that points to github. The project I'm trying to use this on is in an internal bitbucket instance, it would be helpful if docts either supported arbitrary repo urls or made the url optional.

SupernaviX avatar Mar 01 '18 17:03 SupernaviX

Can you post here your repo URL and some link to the code, with a range of lines highlighted (if BitBucket supports that)? I'll make it work without the URL, but it could also support adding readme links to code hosted on BitBucket.

jjrv avatar Mar 02 '18 07:03 jjrv

The repo is private so I can't show the contents, but if all you're interested in is the URL structure than no problem.

Clone url: http://stash.es.ad.adp.com/scm/mea/miniapp-version-resolver.git Link to a particular file, at a specific commit ("master" also works) with lines 4-8 highlighted: http://stash.es.ad.adp.com/projects/mea/repos/miniapp-version-resolver/browse/lib/errors/errors.ts?at=9fd84bd824c54946f453c9dd67c1d5f127c10a80#4-8

SupernaviX avatar Mar 02 '18 13:03 SupernaviX