Skip to content

Commit

Permalink
renamed config.json to patternlab-config.json for better consumption
Browse files Browse the repository at this point in the history
closes #192
  • Loading branch information
bmuenzenmeyer committed Mar 7, 2016
1 parent 6f967dc commit 31a5b11
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
Expand Down Expand Up @@ -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.

Expand All @@ -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": {
Expand All @@ -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"],
Expand All @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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": [
Expand All @@ -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 <a href="http://localhost:3000">http://localhost:3000</a> 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.
Expand Down
4 changes: 2 additions & 2 deletions core/lib/patternlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions test/pattern_assembler_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -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'));
Expand Down Expand Up @@ -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'));
Expand Down

0 comments on commit 31a5b11

Please sign in to comment.