Skip to content

Commit 8c8abb3

Browse files
committed
chore: merge dev into feature/monorep-updates
2 parents 8404c9c + 74dd314 commit 8c8abb3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+358
-121
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
patreon: patternlab

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Pattern Lab / Node wouldn't be what it is today without the support of the commu
6161
6262
* **[Brad Frost](http://bradfrost.com/)**
6363
* [Marcos Peebles](https://twitter.com/marcospeebles)
64+
* [Maximilian Franzke](https://twitter.com/maedmaex)
6465
* [Susan Simkins](https://twitter.com/susanmsimkins)
6566
6667
## Contributing

netlify.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[context.deploy-preview]
2+
command = "npm run setup && npm run preview:hbs"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"test": "lerna run test",
3939
"clean": "git clean -dfx",
4040
"publish": "npx lerna publish -m \"[skip travis] chore(release): publish %s\"",
41-
"postpublish": "auto release"
41+
"postpublish": "auto release",
42+
"preview:hbs": "cd packages/development-edition-engine-handlebars && npx patternlab add --starterkits '@pattern-lab/starterkit-handlebars-vanilla' && npm run pl:build"
4243
},
4344
"nyc": {
4445
"exclude": [

packages/cli/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.0.3](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/[email protected]...@pattern-lab/[email protected]) (2019-10-14)
7+
8+
**Note:** Version bump only for package @pattern-lab/cli
9+
10+
11+
12+
13+
14+
615
# [1.0.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/@pattern-lab/[email protected]...@pattern-lab/[email protected]) (2019-08-23)
716

817

packages/cli/bin/inquiries/starterkit.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ const starterkitSetup = [
2020
{
2121
name: 'starterkit-twig-demo (Recommended)',
2222
value: '@pattern-lab/starterkit-twig-demo',
23-
},
23+
},
2424
{
2525
name: 'starterkit-mustache-bootstrap',
2626
value: 'starterkit-mustache-bootstrap',
27-
},
27+
},
2828
{
2929
name: 'starterkit-mustache-demo',
3030
value: '@pattern-lab/starterkit-mustache-demo',
31-
},
31+
},
3232
{
3333
name: 'starterkit-mustache-foundation',
3434
value: 'starterkit-mustache-foundation',
35-
},
35+
},
3636
{
3737
name: 'starterkit-mustache-materialdesign',
3838
value: 'starterkit-mustache-materialdesign',
39-
},
39+
},
4040
{
4141
name: 'starterkit-mustache-base',
4242
value: '@pattern-lab/starterkit-mustache-base',
4343
},
44-
44+
4545
new inquirer.Separator(),
4646
{
4747
name: 'Custom starterkit',

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "@pattern-lab/cli",
33
"description": "Command-line interface (CLI) for the @pattern-lab/core.",
4-
"version": "1.0.2",
4+
"version": "1.0.4",
55
"bin": {
66
"patternlab": "bin/patternlab.js"
77
},
88
"author": {
99
"name": "Raphael Okon"
1010
},
1111
"dependencies": {
12-
"@pattern-lab/core": "^3.0.4",
12+
"@pattern-lab/core": "^3.0.5",
1313
"@pattern-lab/live-server": "^1.3.4",
1414
"archiver": "2.1.1",
1515
"chalk": "2.4.1",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@pattern-lab/core",
33
"description": "Create atomic design systems with Pattern Lab. This is the core API and orchestrator of the ecosystem.",
4-
"version": "3.0.4",
4+
"version": "3.0.5",
55
"main": "./src/index.js",
66
"dependencies": {
77
"@pattern-lab/engine-mustache": "^2.0.1",

packages/core/src/lib/object_factory.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const Pattern = function(relPath, data, patternlab) {
3939

4040
// this is the unique name, subDir + fileName (sans extension)
4141
this.name = '';
42-
if (info.hasDir) {
42+
if (info.hasDir && info.dirLevel > 2) {
4343
let variant = '';
4444

4545
if (this.fileName.indexOf('~') !== -1) {
@@ -76,23 +76,24 @@ const Pattern = function(relPath, data, patternlab) {
7676
.trim(); //this is the display name for the ui. strip numeric + hyphen prefixes
7777

7878
//00-atoms if needed
79-
this.patternType = this.getDirLevel(0, info);
79+
this.patternType = this.getDirLevel(0);
8080

8181
// the top-level pattern group this pattern belongs to. 'atoms'
8282
this.patternGroup = this.patternType.replace(patternPrefixMatcher, '');
8383

8484
//00-colors if needed
85-
this.patternSubType = this.getDirLevel(1, info);
85+
this.patternSubType = this.getDirLevel(1);
8686

8787
// the sub-group this pattern belongs to.
8888
this.patternSubGroup = this.patternSubType.replace(patternPrefixMatcher, ''); // 'global'
8989

9090
// the joined pattern group and subgroup directory
91-
this.flatPatternPath = info.hasDir
92-
? this.subdir
93-
.replace(/[/\\]/g, '-')
94-
.replace(new RegExp('-' + info.dir + '$'), '')
95-
: this.subdir.replace(/[\/\\]/g, '-'); // '00-atoms-00-global'
91+
this.flatPatternPath =
92+
info.hasDir && info.dirLevel > 2
93+
? this.subdir
94+
.replace(/[/\\]/g, '-')
95+
.replace(new RegExp('-' + info.dir + '$'), '')
96+
: this.subdir.replace(/[\/\\]/g, '-'); // '00-atoms-00-global'
9697

9798
// calculated path from the root of the public directory to the generated
9899
// (rendered!) html file for this pattern, to be shown in the iframe
@@ -214,11 +215,8 @@ Pattern.prototype = {
214215
return this.engine.findPartial(partialString);
215216
},
216217

217-
getDirLevel: function(level, info) {
218+
getDirLevel: function(level) {
218219
const items = this.subdir.split(path.sep);
219-
if (info.hasDir) {
220-
items.pop();
221-
}
222220

223221
if (items[level]) {
224222
return items[level];

packages/core/src/lib/plugin_manager.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const plugin_manager = function() {
44
const path = require('path');
5-
const findModules = require('./findModules');
65
const logger = require('./log');
76

87
const pluginMatcher = /^plugin-(.*)$/;
@@ -38,25 +37,25 @@ const plugin_manager = function() {
3837
* @param {object} patternlab
3938
*/
4039
function initializePlugins(patternlab) {
41-
const nodeModulesPath = path.join(process.cwd(), 'node_modules');
42-
const foundPlugins = findModules(nodeModulesPath, isPlugin);
40+
const foundPlugins = Object.keys(patternlab.config.plugins || {});
4341
foundPlugins.forEach(plugin => {
44-
logger.info(`Found plugin: plugin-${plugin.name}`);
42+
logger.info(`Found plugin: ${plugin}`);
4543
logger.info(`Attempting to load and initialize plugin.`);
46-
const pluginModule = loadPlugin(plugin.modulePath);
44+
const pluginModule = loadPlugin(
45+
path.join(process.cwd(), 'node_modules', plugin)
46+
);
4747
pluginModule(patternlab);
4848
});
4949
}
5050

51-
async function raiseEvent(patternlab, eventName, ...args) {
51+
async function raiseEvent(patternlab, eventName, args) {
5252
patternlab.events.emit(eventName, args);
53-
5453
await (async function() {
5554
const hookHandlers = (patternlab.hooks[eventName] || []).map(h =>
5655
h(args)
5756
);
5857

59-
const results = await Promise.all(hookHandlers);
58+
await Promise.all(hookHandlers);
6059
})();
6160
}
6261

0 commit comments

Comments
 (0)