-
-
Notifications
You must be signed in to change notification settings - Fork 144
Add prompt for ESDoc/YUIDoc #248
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ module.exports = { | |
}); | ||
}, | ||
|
||
afterInstall() { | ||
afterInstall(options) { | ||
let configPath = require.resolve(this.project.configPath()); | ||
let configContents = fs.readFileSync(configPath, 'utf-8'); | ||
|
||
|
@@ -63,9 +63,36 @@ module.exports = { | |
} | ||
|
||
if (!hasPlugins) { | ||
return this.addAddonsToProject({ | ||
packages: ['ember-cli-addon-docs-yuidoc'] | ||
}); | ||
return this._chooseAddonsToInstall() | ||
.then((addon) => { | ||
return this.addAddonsToProject({ | ||
packages: [addon], | ||
blueprintOptions: { | ||
save: options.save | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this option doing? Was something behaving wrong when we didn't have it before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just allows a passthrough of if you do |
||
} | ||
}); | ||
}); | ||
} | ||
}, | ||
|
||
_chooseAddonsToInstall() { | ||
// Ask which ember addon to install | ||
return this.ui.prompt({ | ||
type: 'list', | ||
name: 'addonToInstall', | ||
message: 'Which documentation style would you like to use?', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we include a choice not to install anything at all? I could imagine wanting to use another addon-docs plugin that isn't necessarily part of the ember-learn org, or just not needing or wanting generated API docs for an addon at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could certainly add options, as they become necessary. I think for now, this is an improvement on always using yuidoc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. I'll probably turn around and add a "no plugin" option anyway because I think it's valuable, but I don't need to push that work on you here 🙂 |
||
choices: [ | ||
{ | ||
name: 'ESDoc', | ||
value: { name: 'ember-cli-addon-docs-esdoc' } | ||
}, | ||
{ | ||
name: 'YUIDoc', | ||
value: { name: 'ember-cli-addon-docs-yuidoc' } | ||
} | ||
] | ||
}).then((selected) => { | ||
return selected.addonToInstall; | ||
}); | ||
} | ||
}; |
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.
Looks like there's a lint failure because the
return
below this one is dead code nowThere 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.
Good call, I meant to remove that.