Skip to content
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

various updates #2

Merged
merged 13 commits into from
Sep 5, 2017
Merged

various updates #2

merged 13 commits into from
Sep 5, 2017

Conversation

indirectlylit
Copy link
Contributor

Hi, thanks for a very useful tool! We're using it internally, and have made a few updates that perhaps you'd be interested in.

Sorry this isn't split into multiple PRs; might be possible to cherry-pick but not sure.

The main functional updates are:

  • can take a vue template string instead of a file path
  • adds support for the older module.exports syntax
  • adds a new option methodsDefaultPrivate, since (for us) the vast majority of vue methods are not part of the exposed component interface

Let me know if there's anything you'd like me to change

@demsking
Copy link
Member

demsking commented Sep 1, 2017

Great work! Thank for your PR.
Just a problem... Travis CI checks failed! It seems that your changes is not compatible with NodeJS 4.8.2.
You use a default function parameters feature which is available from NodeJS 6.4.0.

Could you remove this feature please?

Copy link
Member

@demsking demsking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're using the default function parameters feature in parseComment() and getComment().
This feature is not available on NodeJS 4.8.2, so the Travis CI checks cannot success.

Could you remove this feature please?
Something like that would be good:

const parseComment = (text, defaultVisibility) => {
  defaultVisibility = defaultVisibility || DEFAULT_VISIBILITY
  // ...
}

@demsking demsking self-assigned this Sep 1, 2017
@@ -9,8 +9,8 @@ const DEFAULT_ENCODING = 'utf8'
const DEFAULT_IGNORED_VISIBILITIES = ['protected', 'private']

const parseOptions = function (options) {
if (!options || !options.filename) {
throw new Error('options.filename is required')
if (!options || (!options.filename && !options.filecontent)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature! I did not think about that!

README.md Outdated
- `encoding` (*optional*) `default: utf8`
- `ignoreName` (*optional*) `default: false` Set `true` to ignore the component name in the result
- `ignoreDescription` (*optional*) `default: false` Set `true` to ignore the component description in the result
- `methodsDefaultPrivate` (*optional*) `default: false` Set `true` to treat methods as `@private` unless otherwise specified
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... What do you think to rename this option to defaultMethodVisibility with public as a default value?

lib/parser.js Outdated
if (body.type !== 'ExportDefaultDeclaration' && body.type !== 'ExpressionStatement') {
const entry = getComment(body)
const description = entry ? entry.description : null
const entry = getComment(body)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great @magali-br. This commit fixes the #1 issue
👍

@indirectlylit
Copy link
Contributor Author

You use a default function parameters feature which is available from NodeJS 6.4.0. Could you remove this feature please?

sure thing

What do you think to rename this option to defaultMethodVisibility with public as a default value?

sounds good

updates for upstream project
@christianmemije
Copy link

@demsking Requested changes were pushed.

README.md Outdated
- `encoding` (*optional*) `default: utf8`
- `ignoreName` (*optional*) `default: false` Set `true` to ignore the component name in the result
- `ignoreDescription` (*optional*) `default: false` Set `true` to ignore the component description in the result
- `defaultMethodVisibility` (*optional*) `default: DEFAULT_VISIBILITY`. Can be set to `private`, `public`, or `protected` to override global `DEFAULT_VISIBILITY` for component methods.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEFAULT VISIBILITY is an internal variable, the user does not know it and don't know its value.
I suggest to set default: 'public'

@indirectlylit
Copy link
Contributor Author

updated readme

@demsking demsking merged commit 01d6c49 into vuedoc:master Sep 5, 2017
@demsking
Copy link
Member

demsking commented Sep 5, 2017

Thank you for your PR

@demsking
Copy link
Member

demsking commented Sep 5, 2017

This PR also fixes #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants