-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
…specify the file path. Also fix tab indent in parser.
…e component is not preceded with a top-level variable declaration.
add option to treat methods as private by default
Great work! Thank for your PR. Could you remove this feature please? |
There was a problem hiding this 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
// ...
}
@@ -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)) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
👍
sure thing
sounds good |
updates for upstream project
@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. |
There was a problem hiding this comment.
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'
updated readme |
Thank you for your PR |
This PR also fixes #1 |
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:
module.exports
syntaxmethodsDefaultPrivate
, since (for us) the vast majority of vue methods are not part of the exposed component interfaceLet me know if there's anything you'd like me to change