Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit 1d07ef8

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/dev' into pattern-engines-upstream
2 parents e2ee979 + 97498c7 commit 1d07ef8

20 files changed

+113
-36
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#Contributing to Patternlab - Node
2-
If you'd like to contribute to patternlab - node, please do so! There is always a lot of ground to cover, with patternlab - php being so feature-rich.
1+
# Contributing to Patternlab Node
2+
If you'd like to contribute to Pattern Lab Node, please do so! There is always a lot of ground to cover and something for your wheelhouse.
33

4-
No pull request is too small. Check out any [up for grabs issues](https://github.com/pattern-lab/patternlab-node/labels/up%20for%20grabs) as a good way to get your feet wet.
4+
No pull request is too small. Check out any [up for grabs issues](https://github.com/pattern-lab/patternlab-node/labels/up%20for%20grabs) as a good way to get your feet wet, or add some more unit tests.
55

6-
##Guidelines
7-
1. Please keep your pull requests concise and limited to **ONE** substantive change at a time.
8-
2. _ALWAYS_ submit pull requests against the [dev branch](https://github.com/pattern-lab/patternlab-node/tree/dev). If this does not occur, I will first, try to redirect you gently, second, port over your contribution manually if time allows, and/or third, close your pull request.
9-
3. If you can, add some unit tests using the existing patterns
6+
## Guidelines
7+
1. Please keep your pull requests concise and limited to **ONE** substantive change at a time. This makes reviewing and testing so much easier.
8+
2. _ALWAYS_ submit pull requests against the [dev branch](https://github.com/pattern-lab/patternlab-node/tree/dev). If this does not occur, I will first, try to redirect you gently, second, port over your contribution manually if time allows, and/or third, close your pull request. If you have a major feature to stabilize over time, talk to @bmuenzenmeyer about making a dedicated `feature-branch`
9+
3. If you can, add some unit tests using the existing patterns in the `./test` directory
1010

1111
##Coding style
1212
Regarding code style like indentation and whitespace, follow the conventions you see used in the source already. Add enough source code comments to help the next person.

.github/ISSUE_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
I am using Pattern Lab Node `vX.X.X` on `Windows|Mac|Linux`, using the `grunt|gulp` configuration.
2+
3+
##### Expected Behavior
4+
5+
6+
##### Actual Behavior
7+
8+
9+
##### Steps to Reproduce

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- **Please read the contribution guidelines first, and target the `dev` branch!** -->
2+
3+
Addresses #
4+
5+
Summary of changes:

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
22

3+
PL-node-v1.1.2
4+
- FIX: Greatly improved the browsersync configuration, so that it only fires on the iframe, preventing users from losing their scroll position. Also lightened up the styling and made it less obtrusive.
5+
- THX: Thanks to @geoffp for taking the lead on this issue.
6+
- THX: This release also marks the first with @geoff's more official involvement with the project as a core contributor. His work on the `pattern_engine` branch and configurable paths have and will continue to make Pattern Lab Node better.
7+
- FIX: Replace `eval()` with a smarter `JSON.parse()` call within the `parameter_hunter.js`
8+
- THX: Thanks to @e2tha-e for taking the high road!
9+
310
PL-node-v1.1.1
411
- FIX: Fixed issue where alternate patterns are added to end of styleguide instead of inline with their parent pattern.
512

Gruntfile.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,36 @@ module.exports = function(grunt) {
101101
ignoreInitial: true,
102102
ignored: '*.html'
103103
},
104+
snippetOptions: {
105+
// Ignore all HTML files within the templates folder
106+
blacklist: ['/index.html', '/']
107+
},
104108
plugins: [
105109
{
106110
module: 'bs-html-injector',
107111
options: {
108112
files: [path.resolve(paths().public.root + '/index.html'), path.resolve(paths().public.styleguide + '/styleguide.html')]
109113
}
110114
}
111-
]
115+
],
116+
notify: {
117+
styles: [
118+
'display: none',
119+
'padding: 15px',
120+
'font-family: sans-serif',
121+
'position: fixed',
122+
'font-size: 1em',
123+
'z-index: 9999',
124+
'bottom: 0px',
125+
'right: 0px',
126+
'border-top-left-radius: 5px',
127+
'background-color: #1B2032',
128+
'opacity: 0.4',
129+
'margin: 0',
130+
'color: white',
131+
'text-align: center'
132+
]
133+
}
112134
}
113135
}
114136
},

builder/lineage_hunter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v1.1.1 - 2016
2+
* patternlab-node - v1.1.2 - 2016
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.

builder/list_item_hunter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v1.1.1 - 2016
2+
* patternlab-node - v1.1.2 - 2016
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.

builder/media_hunter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v1.1.1 - 2016
2+
* patternlab-node - v1.1.2 - 2016
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.

builder/object_factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v1.1.1 - 2016
2+
* patternlab-node - v1.1.2 - 2016
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.

builder/parameter_hunter.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v1.1.1 - 2016
2+
* patternlab-node - v1.1.2 - 2016
33
*
44
* Brian Muenzenmeyer, and the web community.
55
* Licensed under the MIT license.
@@ -35,16 +35,28 @@
3535
console.log('found patternParameters for ' + partialName);
3636
}
3737

38-
//strip out the additional data and eval
38+
//strip out the additional data, convert string to JSON.
3939
var leftParen = pMatch.indexOf('(');
4040
var rightParen = pMatch.indexOf(')');
41-
var paramString = '({' + pMatch.substring(leftParen + 1, rightParen) + '})';
42-
43-
//do no evil. there is no good way to do this that I can think of without using a split, which then makes commas and colons special characters and unusable within the pattern params
44-
var paramData = eval(paramString);
45-
46-
var globalData = JSON.parse(JSON.stringify(patternlab.data));
47-
var localData = JSON.parse(JSON.stringify(pattern.jsonFileData || {}));
41+
var paramString = '{' + pMatch.substring(leftParen + 1, rightParen) + '}';
42+
//if param keys are wrapped in single quotes, replace with double quotes.
43+
var paramStringWellFormed = paramString.replace(/(')([^']+)(')(\s*\:)/gm, '"$2"$4');
44+
//if params keys are not wrapped in any quotes, wrap in double quotes.
45+
var paramStringWellFormed = paramStringWellFormed.replace(/([\{|,]\s*)([^\:\s]+)(\s*\:)/gm, '$1"$2"$3');
46+
//if param values are wrapped in single quotes, replace with double quotes.
47+
var paramStringWellFormed = paramStringWellFormed.replace(/(\:\s*)(')([^']+)(')/gm, '$1"$3"');
48+
49+
var paramData = {};
50+
var globalData = {};
51+
var localData = {};
52+
53+
try {
54+
paramData = JSON.parse(paramStringWellFormed);
55+
globalData = JSON.parse(JSON.stringify(patternlab.data));
56+
localData = JSON.parse(JSON.stringify(pattern.jsonFileData || {}));
57+
} catch(e){
58+
console.log(e);
59+
}
4860

4961
var allData = plutils.mergeData(globalData, localData);
5062
allData = plutils.mergeData(allData, paramData);

0 commit comments

Comments
 (0)