Skip to content

Commit c8e752c

Browse files
committed
1 parent 2ee1090 commit c8e752c

File tree

7 files changed

+165
-141
lines changed

7 files changed

+165
-141
lines changed

core/lib/pattern_assembler.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ var pattern_assembler = function () {
4545
return patternlab.patterns[i];
4646
}
4747
}
48-
plutils.logOrange('Could not find pattern referenced with partial syntax ' + partialName + '. This can occur when a pattern was renamed, moved, or no longer exists but it still called within a different template somewhere.');
48+
plutils.warning('Could not find pattern referenced with partial syntax ' + partialName + '. This can occur when a pattern was renamed, moved, or no longer exists but it still called within a different template somewhere.');
4949
return undefined;
5050
}
5151

@@ -81,7 +81,7 @@ var pattern_assembler = function () {
8181
if (patternlab.config.patternStates && patternlab.config.patternStates[pattern.patternPartial]) {
8282

8383
if (displayDeprecatedWarning) {
84-
plutils.logRed("Deprecation Warning: Using patternlab-config.json patternStates object will be deprecated in favor of the state frontmatter key associated with individual pattern markdown files.");
84+
plutils.error("Deprecation Warning: Using patternlab-config.json patternStates object will be deprecated in favor of the state frontmatter key associated with individual pattern markdown files.");
8585
console.log("This feature will still work in it's current form this release (but still be overridden by the new parsing method), and will be removed in the future.");
8686
}
8787

@@ -245,13 +245,13 @@ var pattern_assembler = function () {
245245
var relativeDepth = (relPath.match(/\w(?=\\)|\w(?=\/)/g) || []).length;
246246
if (relativeDepth > 2) {
247247
console.log('');
248-
plutils.logOrange('Warning:');
249-
plutils.logOrange('A pattern file: ' + relPath + ' was found greater than 2 levels deep from ' + patternlab.config.paths.source.patterns + '.');
250-
plutils.logOrange('It\'s strongly suggested to not deviate from the following structure under _patterns/');
251-
plutils.logOrange('[patternType]/[patternSubtype]/[patternName].[patternExtension]');
248+
plutils.warning('Warning:');
249+
plutils.warning('A pattern file: ' + relPath + ' was found greater than 2 levels deep from ' + patternlab.config.paths.source.patterns + '.');
250+
plutils.warning('It\'s strongly suggested to not deviate from the following structure under _patterns/');
251+
plutils.warning('[patternType]/[patternSubtype]/[patternName].[patternExtension]');
252252
console.log('');
253-
plutils.logOrange('While Pattern Lab may still function, assets may 404 and frontend links may break. Consider yourself warned. ');
254-
plutils.logOrange('Read More: http://patternlab.io/docs/pattern-organization.html');
253+
plutils.warning('While Pattern Lab may still function, assets may 404 and frontend links may break. Consider yourself warned. ');
254+
plutils.warning('Read More: http://patternlab.io/docs/pattern-organization.html');
255255
console.log('');
256256
}
257257

core/lib/patternlab.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ function checkConfiguration(patternlab) {
8080
};
8181

8282
if (!patternlab.config.outputFileSuffixes) {
83-
plutils.logOrange('Configuration Object "outputFileSuffixes" not found, and defaulted to the following:');
83+
plutils.warning('Configuration Object "outputFileSuffixes" not found, and defaulted to the following:');
8484
console.log(outputFileSuffixes);
85-
plutils.logOrange('Since Pattern Lab Core 2.3.0 this configuration option is required. Suggest you add it to your patternlab-config.json file.');
85+
plutils.warning('Since Pattern Lab Core 2.3.0 this configuration option is required. Suggest you add it to your patternlab-config.json file.');
8686
console.log();
8787
}
8888
patternlab.config.outputFileSuffixes = _.extend(outputFileSuffixes, patternlab.config.outputFileSuffixes);
@@ -171,34 +171,34 @@ var patternlab_engine = function (config) {
171171
console.log('');
172172

173173
console.log('|=======================================|');
174-
plutils.logGreen(' Pattern Lab Node Help v' + patternlab.package.version);
174+
plutils.debug(' Pattern Lab Node Help v' + patternlab.package.version);
175175
console.log('|=======================================|');
176176

177177
console.log('');
178178
console.log('Command Line Interface - usually consumed by an edition');
179179
console.log('');
180180

181-
plutils.logGreen(' patternlab:build');
181+
plutils.debug(' patternlab:build');
182182
console.log(' > Compiles the patterns and frontend, outputting to config.paths.public');
183183
console.log('');
184184

185-
plutils.logGreen(' patternlab:patternsonly');
185+
plutils.debug(' patternlab:patternsonly');
186186
console.log(' > Compiles the patterns only, outputting to config.paths.public');
187187
console.log('');
188188

189-
plutils.logGreen(' patternlab:version');
189+
plutils.debug(' patternlab:version');
190190
console.log(' > Return the version of patternlab-node you have installed');
191191
console.log('');
192192

193-
plutils.logGreen(' patternlab:help');
193+
plutils.debug(' patternlab:help');
194194
console.log(' > Get more information about patternlab-node, pattern lab in general, and where to report issues.');
195195
console.log('');
196196

197-
plutils.logGreen(' patternlab:liststarterkits');
197+
plutils.debug(' patternlab:liststarterkits');
198198
console.log(' > Returns a url with the list of available starterkits hosted on the Pattern Lab organization Github account');
199199
console.log('');
200200

201-
plutils.logGreen(' patternlab:loadstarterkit');
201+
plutils.debug(' patternlab:loadstarterkit');
202202
console.log(' > Load a starterkit into config.paths.source/*');
203203
console.log(' > NOTE: Overwrites existing content, and only cleans out existing directory if --clean=true argument is passed.');
204204
console.log(' > NOTE: In most cases, `npm install starterkit-name` will precede this call.');
@@ -274,7 +274,7 @@ var patternlab_engine = function (config) {
274274
patternlab.userHead = headPattern.extendedTemplate;
275275
}
276276
catch (ex) {
277-
plutils.logRed('\nWARNING: Could not find the user-editable header template, currently configured to be at ' + path.join(config.paths.source.meta, '_00-head.mustache') + '. Your configured path may be incorrect (check paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.\n');
277+
plutils.error('\nWARNING: Could not find the user-editable header template, currently configured to be at ' + path.join(config.paths.source.meta, '_00-head.mustache') + '. Your configured path may be incorrect (check paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.\n');
278278
if (patternlab.config.debug) { console.log(ex); }
279279
process.exit(1);
280280
}
@@ -294,7 +294,7 @@ var patternlab_engine = function (config) {
294294
patternlab.userFoot = footPattern.extendedTemplate;
295295
}
296296
catch (ex) {
297-
plutils.logRed('\nWARNING: Could not find the user-editable footer template, currently configured to be at ' + path.join(config.paths.source.meta, '_01-foot.mustache') + '. Your configured path may be incorrect (check paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.\n');
297+
plutils.error('\nWARNING: Could not find the user-editable footer template, currently configured to be at ' + path.join(config.paths.source.meta, '_01-foot.mustache') + '. Your configured path may be incorrect (check paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.\n');
298298
if (patternlab.config.debug) { console.log(ex); }
299299
process.exit(1);
300300
}
@@ -338,13 +338,13 @@ var patternlab_engine = function (config) {
338338
try {
339339
patternlab.data = buildPatternData(paths.source.data, fs);
340340
} catch (ex) {
341-
plutils.logRed('missing or malformed' + paths.source.data + 'data.json Pattern Lab may not work without this file.');
341+
plutils.error('missing or malformed' + paths.source.data + 'data.json Pattern Lab may not work without this file.');
342342
patternlab.data = {};
343343
}
344344
try {
345345
patternlab.listitems = fs.readJSONSync(path.resolve(paths.source.data, 'listitems.json'));
346346
} catch (ex) {
347-
plutils.logOrange('WARNING: missing or malformed ' + paths.source.data + 'listitems.json file. Pattern Lab may not work without this file.');
347+
plutils.warning('WARNING: missing or malformed ' + paths.source.data + 'listitems.json file. Pattern Lab may not work without this file.');
348348
patternlab.listitems = {};
349349
}
350350
try {
@@ -355,7 +355,7 @@ var patternlab_engine = function (config) {
355355
patternlab.viewAll = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'viewall.mustache'), 'utf8');
356356
} catch (ex) {
357357
console.log(ex);
358-
plutils.logRed('\nERROR: missing an essential file from ' + paths.source.patternlabFiles + '. Pattern Lab won\'t work without this file.\n');
358+
plutils.error('\nERROR: missing an essential file from ' + paths.source.patternlabFiles + '. Pattern Lab won\'t work without this file.\n');
359359
process.exit(1);
360360
}
361361
patternlab.patterns = [];

core/lib/plugin_manager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ var plugin_manager = function (config, configPath) {
2929
try {
3030
var pluginDirStats = fs.statSync(pluginPath);
3131
} catch (ex) {
32-
util.logRed(pluginName + ' not found, please use npm to install it first.');
33-
util.logRed(pluginName + ' not loaded.');
32+
util.error(pluginName + ' not found, please use npm to install it first.');
33+
util.error(pluginName + ' not loaded.');
3434
return;
3535
}
3636
var pluginPathDirExists = pluginDirStats.isDirectory();
@@ -50,7 +50,7 @@ var plugin_manager = function (config, configPath) {
5050
//write config entry back
5151
fs.outputFileSync(path.resolve(configPath), JSON.stringify(diskConfig, null, 2));
5252

53-
util.logGreen('Plugin ' + pluginName + ' installed.');
53+
util.debug('Plugin ' + pluginName + ' installed.');
5454

5555
//todo, tell them how to uninstall or disable
5656

core/lib/starterkit_manager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var starterkit_manager = function (config) {
88
paths = config.paths;
99

1010
/**
11-
* Loads npm module identified by the starterkitName parameter.
11+
* Loads npm module identified by the starterkitName parameter.
1212
*
1313
* @param starterkitName {string} Kit name
1414
* @param clean {boolean} Indicates if the directory should be cleaned before loading
@@ -22,8 +22,8 @@ var starterkit_manager = function (config) {
2222
try {
2323
var kitDirStats = fs.statSync(kitPath);
2424
} catch (ex) {
25-
util.logRed(starterkitName + ' not found, please use npm to install it first.');
26-
util.logRed(starterkitName + ' not loaded.');
25+
util.error(starterkitName + ' not found, please use npm to install it first.');
26+
util.error(starterkitName + ' not loaded.');
2727
return;
2828
}
2929
var kitPathDirExists = kitDirStats.isDirectory();
@@ -40,7 +40,7 @@ var starterkit_manager = function (config) {
4040
if (ex) {
4141
console.error(ex);
4242
}
43-
util.logGreen('starterkit ' + starterkitName + ' loaded successfully.');
43+
util.debug('starterkit ' + starterkitName + ' loaded successfully.');
4444
});
4545
}
4646
} catch (ex) {

core/lib/ui_builder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ var ui_builder = function () {
167167
var patternType = _.find(patternlab.patternTypes, ['patternType', pattern.patternType]);
168168

169169
if (!patternType) {
170-
plutils.logRed('Could not find patternType' + pattern.patternType + '. This is a critical error.');
170+
plutils.error('Could not find patternType' + pattern.patternType + '. This is a critical error.');
171171
console.trace();
172172
process.exit(1);
173173
}
@@ -186,7 +186,7 @@ var ui_builder = function () {
186186
var patternSubType = _.find(patternType.patternTypeItems, ['patternSubtype', pattern.patternSubType]);
187187

188188
if (!patternSubType) {
189-
plutils.logRed('Could not find patternType ' + pattern.patternType + '-' + pattern.patternType + '. This is a critical error.');
189+
plutils.error('Could not find patternType ' + pattern.patternType + '-' + pattern.patternType + '. This is a critical error.');
190190
console.trace();
191191
process.exit(1);
192192
}
@@ -274,7 +274,7 @@ var ui_builder = function () {
274274
function addPatternItem(patternlab, pattern, isViewAllVariant) {
275275
var patternType = getPatternType(patternlab, pattern);
276276
if (!patternType) {
277-
plutils.logRed('Could not find patternType' + pattern.patternType + '. This is a critical error.');
277+
plutils.error('Could not find patternType' + pattern.patternType + '. This is a critical error.');
278278
console.trace();
279279
process.exit(1);
280280
}

0 commit comments

Comments
 (0)