Skip to content

#490 Add proper javadoc comments to core/lib/starterkit_manager.js #494

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

Merged
merged 2 commits into from
Oct 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions core/lib/starterkit_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ var starterkit_manager = function (config) {
util = require('./utilities'),
paths = config.paths;

/**
* Loads npm module identified by the starterkitName parameter.
*
* @param starterkitName {string} Kit name
* @param clean {boolean} Indicates if the directory should be cleaned before loading
*/
function loadStarterKit(starterkitName, clean) {
try {
var kitPath = path.resolve(
Expand Down Expand Up @@ -43,9 +49,9 @@ var starterkit_manager = function (config) {
}

/**
* @func listStarterkits
* @desc Fetches starterkit repos from GH API that contain 'starterkit' in their name for the user 'pattern-lab'
* @returns {Promise} Returns an Array<{name,url}> for the starterkit repos
* Fetches starterkit repos from GH API that contain 'starterkit' in their name for the user 'pattern-lab'
*
* @return {Promise} Returns an Array<{name,url}> for the starterkit repos
*/
function listStarterkits() {
return fetch('https://api.github.com/search/repositories?q=starterkit+in:name+user:pattern-lab&sort=stars&order=desc', {
Expand Down Expand Up @@ -77,6 +83,11 @@ var starterkit_manager = function (config) {

}

/**
* Detects installed starter kits
*
* @return {array} List of starter kits installed
*/
function detectStarterKits() {
var node_modules_path = path.join(process.cwd(), 'node_modules');
var npm_modules = fs.readdirSync(node_modules_path).filter(function (dir) {
Expand Down