New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on string repository property in package.json #39

Merged
merged 1 commit into from Aug 2, 2015

Conversation

Projects
None yet
2 participants
@r7kamura
Contributor

r7kamura commented Aug 1, 2015

String is used as shortcut syntax as we use like npm install user/repo.
See https://docs.npmjs.com/files/package.json#repository for more details.

How to reproduce error

diff --git a/test/fixture/package.json b/test/fixture/package.json
index c02f8fa..1b42a19 100644
--- a/test/fixture/package.json
+++ b/test/fixture/package.json
@@ -1,9 +1,6 @@
 {
   "name": "esdoc-test-fixture",
   "version": "1.2.3",
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/h13i32maru/esdoc"
-  },
+  "repository": "h13i32maru/esdoc",
   "main": "./out/src/MyClass.js"
 }
$ npm run test

> esdoc@0.1.4 test /Users/r7kamura/src/github.com/h13i32maru/esdoc
> node ./script/test.js

error: could not parse /Users/r7kamura/src/github.com/h13i32maru/esdoc/test/fixture/src/UnknownSyntax.js
badge.svg
/Users/r7kamura/src/github.com/h13i32maru/esdoc/src/Publisher/Builder/DocBuilder.js:230
      if (indexInfo.url.indexOf('git@github.com:') === 0) {
                       ^
TypeError: Cannot read property 'indexOf' of undefined
    at IdentifiersDocBuilder._getInfo (/Users/r7kamura/src/github.com/h13i32maru/esdoc/src/Publisher/Builder/DocBuilder.js:147:22)
Fix problem on string repository property in package.json
String is used as shortcut syntax as we use for `npm install user/repo`.
See https://docs.npmjs.com/files/package.json#repository for more details.

h13i32maru added a commit that referenced this pull request Aug 2, 2015

Merge pull request #39 from r7kamura/support-string-repository
Fix error on string repository property in package.json

@h13i32maru h13i32maru merged commit 5b94826 into esdoc:master Aug 2, 2015

@h13i32maru

This comment has been minimized.

Show comment
Hide comment
@h13i32maru

h13i32maru Aug 2, 2015

Member

Thanks for PR 😄

Member

h13i32maru commented Aug 2, 2015

Thanks for PR 😄

@r7kamura r7kamura deleted the r7kamura:support-string-repository branch Aug 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment