Skip to content

Commit a6814d0

Browse files
committed
Merge commit 'c40d94b92aa706cf8bce048a249a34a428e6c35b' into feature/uikit-refactor-p7
# Conflicts: # packages/uikit-workshop/package.json
2 parents 97ecdad + c40d94b commit a6814d0

File tree

6 files changed

+25
-20
lines changed

6 files changed

+25
-20
lines changed

packages/core/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ See [Usage](#usage) for more information.
2828

2929
For users wanting a more pre-packaged experience several editions are available.
3030

31-
* [Pattern Lab/Node: Vanilla Edition](https://github.com/pattern-lab/patternlab-node/packages/edition-node) contains info how to get started within a pure node environment.
31+
* [Pattern Lab/Node: Vanilla Edition](https://github.com/pattern-lab/patternlab-node/tree/dev/packages/edition-node) contains info how to get started within a pure node environment.
3232

33-
* [Pattern Lab/Node: Gulp Edition](https://github.com/pattern-lab/patternlab-node/packages/edition-node-gulp) contains info how to get started within a Gulp task running environment.
33+
* [Pattern Lab/Node: Gulp Edition](https://github.com/pattern-lab/patternlab-node/tree/dev/packages/edition-node-gulp) contains info how to get started within a Gulp task running environment.
3434

3535

3636
## Ecosystem
@@ -63,7 +63,7 @@ patternlab.serve({
6363

6464
* Read more about the rest of [Public API](./docs), and already implemented for you within [Editions](#editions).
6565

66-
* A full-featured [command line interface](https://github.com/pattern-lab/patternlab-node/packages/cli) is also available.
66+
* A full-featured [command line interface](https://github.com/pattern-lab/patternlab-node/tree/dev/packages/cli) is also available.
6767

6868
### Events
6969

packages/core/src/lib/addPattern.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,7 @@ module.exports = function(pattern, patternlab) {
4141
patternlab.partials[pattern.patternPartial] = pattern.patternDesc;
4242
}
4343

44-
//patterns sorted by name so the patterntype and patternsubtype is adhered to for menu building
45-
patternlab.patterns.splice(
46-
_.sortedIndexBy(patternlab.patterns, pattern, 'name'),
47-
0,
48-
pattern
49-
);
44+
patternlab.patterns.push(pattern);
5045
patternlab.graph.add(pattern);
5146
}
5247
};

packages/core/src/lib/patternlab.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,12 @@ module.exports = class PatternLab {
334334
this.patterns.map(pattern => {
335335
return processIterative(pattern, self);
336336
})
337-
);
337+
).then(() => {
338+
// patterns sorted by name so the patterntype and patternsubtype is adhered to for menu building
339+
this.patterns.sort((pattern1, pattern2) =>
340+
pattern1.name.localeCompare(pattern2.name)
341+
);
342+
});
338343
});
339344
}
340345

packages/core/src/lib/pseudopattern_hunter.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const logger = require('./log');
1212
const readDocumentation = require('./readDocumentation');
1313
const lineage_hunter = new lh();
1414
const changes_hunter = new ch();
15+
const yaml = require('js-yaml');
1516

1617
const pseudopattern_hunter = function() {};
1718

@@ -22,9 +23,12 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function(
2223
const paths = patternlab.config.paths;
2324

2425
//look for a pseudo pattern by checking if there is a file containing same
25-
//name, with ~ in it, ending in .json
26+
//name, with ~ in it, ending in .json, .yml or .yaml
2627
const needle =
27-
currentPattern.subdir + '/' + currentPattern.fileName + '~*.json';
28+
currentPattern.subdir +
29+
'/' +
30+
currentPattern.fileName +
31+
'~*.{json,yml,yaml}';
2832
const pseudoPatterns = glob.sync(needle, {
2933
cwd: paths.source.patterns,
3034
debug: false,
@@ -45,7 +49,9 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function(
4549
paths.source.patterns,
4650
pseudoPatterns[i]
4751
);
48-
variantFileData = fs.readJSONSync(variantFileFullPath);
52+
variantFileData = yaml.safeLoad(
53+
fs.readFileSync(variantFileFullPath, 'utf8')
54+
);
4955
} catch (err) {
5056
logger.warning(
5157
`There was an error parsing pseudopattern JSON for ${
@@ -65,9 +71,13 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function(
6571
const variantName = pseudoPatterns[i]
6672
.substring(pseudoPatterns[i].indexOf('~') + 1)
6773
.split('.')[0];
74+
const variantExtension = pseudoPatterns[i]
75+
.split('.')
76+
.slice(-1)
77+
.pop();
6878
const variantFilePath = path.join(
6979
currentPattern.subdir,
70-
currentPattern.fileName + '~' + variantName + '.json'
80+
currentPattern.fileName + '~' + variantName + '.' + variantExtension
7181
);
7282
const lm = fs.statSync(variantFileFullPath);
7383
const patternVariant = Pattern.create(

packages/engine-mustache/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## The Mustache PatternEngine for Pattern Lab / Node
22

3-
This one should be included by default with [Pattern Lab Node Core](https://github.com/pattern-lab/patternlab-node/packages/core) and consumed by [Node Editions](https://github.com/pattern-lab?utf8=%E2%9C%93&query=edition-node).
3+
This one should be included by default with [Pattern Lab Node Core](https://github.com/pattern-lab/patternlab-node/tree/dev/packages/core) and consumed by [Node Editions](https://github.com/pattern-lab?utf8=%E2%9C%93&query=edition-node).
44

55
If it's missing from your project for any reason, `npm install @pattern-lab/engine-mustache` should do the trick.

packages/uikit-workshop/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
"license": "MIT",
2929
"repository": "https://github.com/pattern-lab/patternlab-node/tree/master/packages/uikit-workshop",
3030
"bugs": "https://github.com/pattern-lab/patternlab-node/issues",
31-
"peerDependencies": {
32-
"jshint": "^2.9.5"
33-
},
3431
"devDependencies": {
3532
"@babel/core": "^7.0.0",
3633
"@babel/plugin-proposal-class-properties": "^7.0.0",
@@ -50,7 +47,6 @@
5047
"css-loader": "^1.0.0",
5148
"html-loader": "^0.5.5",
5249
"html-webpack-plugin": "github:jantimon/html-webpack-plugin#webpack-4",
53-
"jshint": "^2.9.6",
5450
"mini-css-extract-plugin": "^0.4.1",
5551
"no-emit-webpack-plugin": "^1.0.0",
5652
"node-sass": "^4.9.3",
@@ -90,7 +86,6 @@
9086
"iframe-resizer": "^3.6.2",
9187
"jquery": "^3.3.1",
9288
"js-cookie": "^2.2.0",
93-
"jshint": "^2.9.5",
9489
"mousetrap": "^1.6.2",
9590
"preact": "^8.3.1",
9691
"preact-compat": "^3.18.4",

0 commit comments

Comments
 (0)