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