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

Commit efb0c2f

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/dev' into pattern-engines
Conflicts: builder/patternlab.js package.json
2 parents 25fbef6 + 2a449d2 commit efb0c2f

File tree

6 files changed

+36
-25
lines changed

6 files changed

+36
-25
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ PL-node-v1.1.0
1111
- THX: Thanks @robinsonaaron for the issue and pull request!
1212
- FIX: Prefer exact pattern key match over fuzzy matches inside getpatternbykey()
1313
- THX: Thanks @EvanLovely for the suggestion
14+
- FIX: Fix issue where absolute paths in the config path object would not resolve
15+
- THX: Thanks to @geoffp and @EvanLovely for reporting, fixing and testing the issue in the dev branch.
16+
- FIX: Typo in gulp instructions in README.
17+
- THX: Thanks @simonknittel for the watchful eyes
1418

1519
PL-node-v1.0.0
1620
- FIX: Resolve issue with not hiding underscored patterns.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To run patternlab-node using gulp, you need to swap out the default grunt config
4444
3. Run `npm install` from the command line
4545
4. Run `gulp` or `gulp serve` from the command line
4646

47-
This creates all patterns, the styleguide, and the pattern lab site. It's strongly recommended to run `grunt serve` to see have BrowserSync spin up and serve the files to you.
47+
This creates all patterns, the styleguide, and the pattern lab site. It's strongly recommended to run `gulp serve` to have BrowserSync spin up and serve the files to you.
4848

4949
### There and Back Again, or Switching Between Grunt and Gulp
5050

builder/patternlab.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*/
1010

11-
var patternlab_engine = function () {
11+
var patternlab_engine = function (config) {
1212
'use strict';
1313

1414
var path = require('path'),
@@ -24,7 +24,7 @@ var patternlab_engine = function () {
2424
patternlab = {};
2525

2626
patternlab.package = fs.readJSONSync('./package.json');
27-
patternlab.config = fs.readJSONSync('./config.json');
27+
patternlab.config = config || fs.readJSONSync(path.resolve(__dirname, '../config.json'));
2828

2929
var paths = patternlab.config.paths;
3030

@@ -100,7 +100,7 @@ var patternlab_engine = function () {
100100
console.log(err);
101101
return;
102102
}
103-
pattern_assembler.process_pattern_iterative(file.substring(2), patternlab);
103+
pattern_assembler.process_pattern_iterative(path.resolve(file), patternlab);
104104
});
105105

106106
//now that all the main patterns are known, look for any links that might be within data and expand them
@@ -125,7 +125,7 @@ var patternlab_engine = function () {
125125
console.log(err);
126126
return;
127127
}
128-
pattern_assembler.process_pattern_recursive(file.substring(2), patternlab);
128+
pattern_assembler.process_pattern_recursive(path.resolve(file), patternlab);
129129
});
130130

131131

package.gulp.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@
22
"name": "patternlab-node",
33
"description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).",
44
"version": "1.0.1",
5-
"devDependencies": {
6-
"browser-sync": "^2.10.0",
5+
"main": "./builder/patternlab.js",
6+
"dependencies": {
77
"del": "^2.0.2",
88
"diveSync": "^0.3.0",
99
"fs-extra": "^0.26.2",
1010
"glob": "^6.0.1",
11+
"html-entities": "^1.2.0",
12+
"mustache": "^2.2.0"
13+
},
14+
"devDependencies": {
15+
"browser-sync": "^2.10.0",
1116
"gulp": "^3.9.0",
1217
"gulp-connect": "^2.2.0",
1318
"gulp-copy": "0.0.2",
1419
"gulp-header": "^1.7.1",
1520
"gulp-load": "^0.1.1",
1621
"gulp-nodeunit": "0.0.5",
17-
"gulp-strip-banner": "0.0.2",
18-
"html-entities": "^1.2.0",
19-
"mustache": "^2.2.0"
22+
"gulp-strip-banner": "0.0.2"
2023
},
2124
"keywords": [
2225
"Pattern Lab",

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@
22
"name": "patternlab-node",
33
"description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).",
44
"version": "1.0.1",
5-
"devDependencies": {
6-
"bs-html-injector": "^3.0.0",
5+
"main": "./builder/patternlab.js",
6+
"dependencies": {
77
"diveSync": "^0.3.0",
88
"fs-extra": "^0.26.2",
99
"glob": "^6.0.1",
10+
"html-entities": "^1.2.0",
11+
"matchdep": "^1.0.0",
12+
"mustache": "^2.2.0",
13+
"handlebars": "^4.0.5"
14+
},
15+
"devDependencies": {
16+
"bs-html-injector": "^3.0.0",
1017
"grunt": "~0.4.5",
1118
"grunt-browser-sync": "^2.2.0",
1219
"grunt-contrib-concat": "^0.5.1",
1320
"grunt-contrib-copy": "^0.8.2",
1421
"grunt-contrib-nodeunit": "^0.4.1",
15-
"grunt-contrib-watch": "^0.6.1",
16-
"handlebars": "^4.0.5",
17-
"html-entities": "^1.2.0",
18-
"matchdep": "^1.0.0",
19-
"mustache": "^2.2.0"
22+
"grunt-contrib-watch": "^0.6.1"
2023
},
2124
"keywords": [
2225
"Pattern Lab",

test/pattern_assembler_tests.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@
317317
return;
318318
}
319319

320-
pattern_assembler.process_pattern_iterative(file.substring(2), patternlab);
320+
pattern_assembler.process_pattern_iterative(path.resolve(file), patternlab);
321321
}
322322
);
323323

@@ -341,7 +341,7 @@
341341
return;
342342
}
343343

344-
pattern_assembler.process_pattern_recursive(file.substring(2), patternlab);
344+
pattern_assembler.process_pattern_recursive(path.resolve(file), patternlab);
345345
}
346346
);
347347

@@ -613,11 +613,12 @@
613613
var patternlab = {};
614614
//THIS IS BAD.
615615
patternlab.config = fs.readJSONSync('./config.json');
616-
patternlab.config.patterns = {source: patterns_dir};
617-
patternlab.data = fs.readJSONSync('./source/_data/data.json');
618-
patternlab.listitems = fs.readJSONSync('./source/_data/listitems.json');
619-
patternlab.header = fs.readFileSync('./source/_patternlab-files/pattern-header-footer/header.html', 'utf8');
620-
patternlab.footer = fs.readFileSync('./source/_patternlab-files/pattern-header-footer/footer.html', 'utf8');
616+
patternlab.config.paths.source.patterns = patterns_dir;
617+
618+
patternlab.data = fs.readJSONSync(path.resolve(patternlab.config.paths.source.data, 'data.json'));
619+
patternlab.listitems = fs.readJSONSync(path.resolve(patternlab.config.paths.source.data, 'listitems.json'));
620+
patternlab.header = fs.readFileSync(path.resolve(patternlab.config.paths.source.patternlabFiles, 'pattern-header-footer/header.html'), 'utf8');
621+
patternlab.footer = fs.readFileSync(path.resolve(patternlab.config.paths.source.patternlabFiles, 'pattern-header-footer/footer.html'), 'utf8');
621622
patternlab.patterns = [];
622623
patternlab.data.link = {};
623624
patternlab.partials = {};
@@ -641,7 +642,7 @@
641642
return;
642643
}
643644

644-
pattern_assembler.process_pattern_iterative(file.substring(2), patternlab);
645+
pattern_assembler.process_pattern_iterative(path.resolve(file), patternlab);
645646
}
646647
);
647648

0 commit comments

Comments
 (0)