diff --git a/Gruntfile.js b/Gruntfile.js index 2f5dc2ad3..83cdbb4c8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,7 +3,7 @@ module.exports = function (grunt) { var path = require('path'); function paths() { - return require('./config.json').paths; + return require('./patternlab-config.json').paths; } // Project configuration. diff --git a/README.md b/README.md index ba5bc510f..ce7d394b6 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Get more information about patternlab-node, pattern lab in general, and where to To have patternlab-node watch for changes to either a mustache template, data, or stylesheets, run `grunt|gulp watch` or `grunt|gulp serve`. The `Gruntfile|Gulpfile` governs what is watched. It should be easy to add scss or whatever preprocessor you fancy. ##### Configurable Paths -Pattern Lab Node ships with a particular source and public workflow intended to separate the code you work on with the code generated for consumption elsewhere. If you wish to change any paths, you may do so within `config.json`. The contents are here: +Pattern Lab Node ships with a particular source and public workflow intended to separate the code you work on with the code generated for consumption elsewhere. If you wish to change any paths, you may do so within `patternlab-config.json`. The contents are here: ``` "paths" : { @@ -117,7 +117,7 @@ Pattern Lab Node ships with a particular source and public workflow intended to Note the intentional repitition of the nested structure, made this way for maximum flexibility. Relative paths are default but absolute paths should work too. You may also use these paths within Grunt or Gulp files by referring to the paths() object. ##### Nav Bar Controls -If you don't have a need for some of the nav-bar tools in the Pattern Lab frontend, you can turn them off in `config.json`. +If you don't have a need for some of the nav-bar tools in the Pattern Lab frontend, you can turn them off in `patternlab-config.json`. The current selection is as follows. @@ -144,7 +144,7 @@ The current selection is as follows. } ``` ##### Pattern States -You can set the state of a pattern by including it in `config.json` too. The out of the box styles are in progress (orange), in review (yellow), and complete (green). +You can set the state of a pattern by including it in `patternlab-config.json` too. The out of the box styles are in progress (orange), in review (yellow), and complete (green). Pattern states should be lowercase and use hyphens where spaces are present. ``` "patternStates": { @@ -155,7 +155,7 @@ Pattern states should be lowercase and use hyphens where spaces are present. ``` ##### Pattern Export -`config.json` also has two properties that work together to export completed patterns for use in a production environment. Provide an array of keys and an output directory. Pattern Lab doesn't ship with any pattern export keys, but the default directory is `"./pattern_exports/"` created inside the install directory. +`patternlab-config.json` also has two properties that work together to export completed patterns for use in a production environment. Provide an array of keys and an output directory. Pattern Lab doesn't ship with any pattern export keys, but the default directory is `"./pattern_exports/"` created inside the install directory. ``` "patternExportKeys": ["molecules-primary-nav", "organisms-header", "organisms-header"], @@ -165,7 +165,7 @@ Pattern states should be lowercase and use hyphens where spaces are present. Coupled with exported css (much easier to extract with existing tools like [grunt-contrib-copy](https://github.com/gruntjs/grunt-contrib-copy)), pattern export can help to maintain the relevancy of the design system by directly placing partials in a directory of your choosing. ##### cacheBust -`config.json` has this flag to instruct Pattern Lab to append a unique query string to Javascript and CSS assets throughout the frontend. +`patternlab-config.json` has this flag to instruct Pattern Lab to append a unique query string to Javascript and CSS assets throughout the frontend. ``` "cacheBust": true @@ -174,7 +174,7 @@ Coupled with exported css (much easier to extract with existing tools like [grun Default: true ##### defaultPattter -`config.json` has an entry that allows you to specifiy a specific pattern upon launch of the main site. It works even without BrowserSync running. Set it like this: +`patternlab-config.json` has an entry that allows you to specifiy a specific pattern upon launch of the main site. It works even without BrowserSync running. Set it like this: ``` "defaultPattern": "pages-homepage", @@ -204,7 +204,7 @@ You can also exclude complete directories by prepending the directory name with ##### Style Guide Excludes -Exclude whole pattern types from the "All patterns" styleguide by adding entries to `config.json`. This is quite useful to make speedier. Pattern Lab Node ships with the following: +Exclude whole pattern types from the "All patterns" styleguide by adding entries to `patternlab-config.json`. This is quite useful to make speedier. Pattern Lab Node ships with the following: ``` "styleGuideExcludes": [ @@ -215,7 +215,7 @@ Exclude whole pattern types from the "All patterns" styleguide by adding entries ##### Debug Mode -`patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.config.json` to see all the secrets. +`patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.patternlab-config.json` to see all the secrets. ##### Server & BrowserSync Running `grunt serve` or `gulp serve` will compile the Pattern Lab frontend and host it by default on http://localhost:3000 via [BrowserSync](http://www.browsersync.io/docs/). After it starts, templates, `data.json`, and scss/css changes in your source code will be automatically injected into the page. diff --git a/core/lib/patternlab.js b/core/lib/patternlab.js index 7f79cf102..c09f0986d 100644 --- a/core/lib/patternlab.js +++ b/core/lib/patternlab.js @@ -22,7 +22,7 @@ var patternlab_engine = function (config) { patternlab = {}; patternlab.package = fs.readJSONSync('./package.json'); - patternlab.config = config || fs.readJSONSync(path.resolve(__dirname, '../../config.json')); + patternlab.config = config || fs.readJSONSync(path.resolve(__dirname, '../../patternlab-config.json')); var paths = patternlab.config.paths; @@ -47,7 +47,7 @@ var patternlab_engine = function (config) { } function printDebug() { - //debug file can be written by setting flag on config.json + //debug file can be written by setting flag on patternlab-config.json if (patternlab.config.debug) { console.log('writing patternlab debug file to ./patternlab.json'); fs.outputFileSync('./patternlab.json', JSON.stringify(patternlab, null, 3)); diff --git a/gulpfile.js b/gulpfile.js index 85e157f15..a97b3b805 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -23,7 +23,7 @@ var banner = [ '/** ', ' * ', ' **/'].join(eol); function paths() { - return require('./config.json').paths; + return require('./patternlab-config.json').paths; } //load patternlab-node tasks diff --git a/config.json b/patternlab-config.json similarity index 100% rename from config.json rename to patternlab-config.json diff --git a/test/pattern_assembler_tests.js b/test/pattern_assembler_tests.js index cca671f9d..14d6cc3f7 100644 --- a/test/pattern_assembler_tests.js +++ b/test/pattern_assembler_tests.js @@ -197,7 +197,7 @@ var pattern_assembler = new pa(); var patterns_dir = './test/files/_patterns'; var patternlab = {}; - patternlab.config = fs.readJSONSync('./config.json'); + patternlab.config = fs.readJSONSync('./patternlab-config.json'); patternlab.config.paths.source.patterns = patterns_dir; patternlab.data = fs.readJSONSync(path.resolve(patternlab.config.paths.source.data, 'data.json')); @@ -525,7 +525,7 @@ var patterns_dir = './test/files/_patterns'; var patternlab = {}; //THIS IS BAD. - patternlab.config = fs.readJSONSync('./config.json'); + patternlab.config = fs.readJSONSync('./patternlab-config.json'); patternlab.config.paths.source.patterns = patterns_dir; patternlab.data = fs.readJSONSync(path.resolve(patternlab.config.paths.source.data, 'data.json')); @@ -618,7 +618,7 @@ var patterns_dir = './test/files/_patterns/'; var patternlab = {}; //THIS IS BAD - patternlab.config = fs.readJSONSync('./config.json'); + patternlab.config = fs.readJSONSync('./patternlab-config.json'); patternlab.config.paths.source.patterns = patterns_dir; patternlab.data = fs.readJSONSync(path.resolve(patternlab.config.paths.source.data, 'data.json')); patternlab.listitems = fs.readJSONSync(path.resolve(patternlab.config.paths.source.data, 'listitems.json'));