Skip to content

Commit 6d90e3b

Browse files
Merge branch 'dev' into feature-server-asset-change
2 parents 93ba4d0 + c4061c2 commit 6d90e3b

File tree

33 files changed

+375
-48
lines changed

33 files changed

+375
-48
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,45 @@
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+
## [5.9.2](https://github.com/pattern-lab/patternlab-node/compare/v5.9.1...v5.9.2) (2020-04-24)
7+
8+
**Note:** Version bump only for package pl-node
9+
10+
11+
12+
13+
14+
## [5.9.1](https://github.com/pattern-lab/patternlab-node/compare/v5.9.0...v5.9.1) (2020-04-24)
15+
16+
17+
### Bug Fixes
18+
19+
* **cli:** ensure specified directory exists prior to scaffold ([cc3b696](https://github.com/pattern-lab/patternlab-node/commit/cc3b69624d486c94ee3b1f4b1bbb0334a514fa59))
20+
21+
22+
23+
24+
25+
# [5.9.0](https://github.com/pattern-lab/patternlab-node/compare/v5.8.0...v5.9.0) (2020-04-24)
26+
27+
28+
### Bug Fixes
29+
30+
* **cli:** set current working directory before scaffolded npm init ([6d2186d](https://github.com/pattern-lab/patternlab-node/commit/6d2186d8e8a74634198a4474ca8ae83221dd70a9))
31+
* **core:** do not warn about uikit-polyfills ([6bb68e7](https://github.com/pattern-lab/patternlab-node/commit/6bb68e763769969546542bf7aaf6d1f4235c6622))
32+
* actually exit build when Twig render fails ([5d28a24](https://github.com/pattern-lab/patternlab-node/commit/5d28a24a53011396289c1e29e0a715cd82470185))
33+
* Update packages/engine-twig-php/lib/engine_twig_php.js ([c67d50e](https://github.com/pattern-lab/patternlab-node/commit/c67d50ebb5d69816b7514e85f129f8ecde984ad3))
34+
35+
36+
### Features
37+
38+
* **docs:** yarnify ([5a47dc7](https://github.com/pattern-lab/patternlab-node/commit/5a47dc7b90dc5c43c12a51143b41943dcbd8564c))
39+
* **README:** add netlify badges ([941df8a](https://github.com/pattern-lab/patternlab-node/commit/941df8a59b6b75bc1255646005f329e40be68106))
40+
41+
42+
43+
44+
645
# [5.8.0](https://github.com/pattern-lab/patternlab-node/compare/v5.7.2...v5.8.0) (2020-04-03)
746

847

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "3.11.0",
3-
"version": "5.8.0",
3+
"version": "5.9.2",
44
"packages": [
55
"packages/*"
66
],

packages/cli/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
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+
## [5.9.1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.9.0...v5.9.1) (2020-04-24)
7+
8+
9+
### Bug Fixes
10+
11+
* **cli:** ensure specified directory exists prior to scaffold ([cc3b696](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/cc3b69624d486c94ee3b1f4b1bbb0334a514fa59))
12+
13+
14+
15+
16+
17+
# [5.9.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.8.0...v5.9.0) (2020-04-24)
18+
19+
20+
### Bug Fixes
21+
22+
* **cli:** set current working directory before scaffolded npm init ([6d2186d](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/commit/6d2186d8e8a74634198a4474ca8ae83221dd70a9))
23+
24+
25+
26+
27+
628
# [5.7.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.6.0...v5.7.0) (2020-02-17)
729

830

packages/cli/bin/scaffold.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const path = require('path');
33
const execa = require('execa');
4-
const fs = require('fs');
4+
const fs = require('fs-extra');
55
const wrapAsync = require('./utils').wrapAsync;
66
const mkdirsAsync = require('./utils').mkdirsAsync;
77

@@ -16,8 +16,12 @@ const mkdirsAsync = require('./utils').mkdirsAsync;
1616
*/
1717
const scaffold = (projectDir, sourceDir, publicDir, exportDir) =>
1818
wrapAsync(function*() {
19-
if (!fs.existsSync(path.resolve(projectDir, 'package.json'))) {
20-
execa.sync('npm', ['init', '-y']);
19+
const projectPath = path.join(process.cwd(), projectDir);
20+
if (!fs.existsSync(path.join(projectPath, 'package.json'))) {
21+
fs.ensureDirSync(projectPath);
22+
execa.sync('npm', ['init', '-y'], {
23+
cwd: projectPath,
24+
});
2125
}
2226
/**
2327
* Create mandatory files structure

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": "5.7.0",
4+
"version": "5.9.1",
55
"bin": {
66
"patternlab": "bin/patternlab.js"
77
},
88
"author": {
99
"name": "Raphael Okon"
1010
},
1111
"dependencies": {
12-
"@pattern-lab/core": "^5.7.0",
12+
"@pattern-lab/core": "^5.9.0",
1313
"@pattern-lab/live-server": "^5.0.0",
1414
"archiver": "2.1.1",
1515
"chalk": "2.4.1",

packages/core/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
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+
# [5.9.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/v5.8.0...v5.9.0) (2020-04-24)
7+
8+
9+
### Bug Fixes
10+
11+
* **core:** do not warn about uikit-polyfills ([6bb68e7](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/6bb68e763769969546542bf7aaf6d1f4235c6622))
12+
13+
14+
15+
16+
617
# [5.7.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/v5.6.0...v5.7.0) (2020-02-17)
718

819
**Note:** Version bump only for package @pattern-lab/core

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": "5.7.0",
4+
"version": "5.9.0",
55
"main": "./src/index.js",
66
"dependencies": {
77
"@pattern-lab/engine-mustache": "^5.0.0",

packages/core/src/lib/loaduikits.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@ const readModuleFile = (kit, subPath) => {
3737
/**
3838
* Loads uikits, connecting configuration and installed modules
3939
* [1] Looks in node_modules for uikits.
40-
* [2] Only continue if uikit is enabled in patternlab-config.json
41-
* [3] Reads files from uikit that apply to every template
40+
* [2] Filter out our uikit-polyfills package.
41+
* [3] Only continue if uikit is enabled in patternlab-config.json
42+
* [4] Reads files from uikit that apply to every template
4243
* @param {object} patternlab
4344
*/
4445
module.exports = patternlab => {
4546
const paths = patternlab.config.paths;
4647

47-
const uikits = findModules(nodeModulesPath, isUIKitModule); // [1]
48-
48+
const uikits = findModules(nodeModulesPath, isUIKitModule) // [1]
49+
.filter(kit => kit.name !== 'polyfills'); // [2]
4950
uikits.forEach(kit => {
5051
const configEntry = _.find(_.filter(patternlab.config.uikits, 'enabled'), {
5152
name: `uikit-${kit.name}`,
52-
}); // [2]
53+
}); // [3]
5354

5455
if (!configEntry) {
5556
logger.warning(
@@ -83,7 +84,7 @@ module.exports = patternlab => {
8384
paths.source.patternlabFiles.patternSectionSubtype
8485
),
8586
viewAll: readModuleFile(kit, paths.source.patternlabFiles.viewall),
86-
}; // [3]
87+
}; // [4]
8788
} catch (ex) {
8889
logger.error(ex);
8990
logger.error(

packages/core/test/loaduitkits_tests.js

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const tap = require('tap');
44
const rewire = require('rewire');
55

6+
const logger = require('../src/lib/log');
67
const loaduikits = rewire('../src/lib/loaduikits');
78

89
const testConfig = require('./util/patternlab-config.json');
@@ -21,6 +22,10 @@ const findModulesMock = function() {
2122
name: 'baz',
2223
modulePath: 'node_modules/@pattern-lab/uikit-baz',
2324
},
25+
{
26+
name: 'polyfills',
27+
modulePath: 'node_modules/@pattern-lab/uikit-polyfills',
28+
},
2429
];
2530
};
2631

@@ -35,11 +40,40 @@ loaduikits.__set__({
3540
fs: fsMock,
3641
});
3742

43+
logger;
44+
45+
tap.test('loaduitkits - does not warn on uikit-polyfills', test => {
46+
//arrange
47+
const patternlab = {
48+
config: testConfig,
49+
uikits: {},
50+
};
51+
52+
patternlab.config.logLevel = 'warning';
53+
logger.log.on('warning', msg => test.notOk(msg.includes('uikit-polyfills')));
54+
55+
const uikitFoo = {
56+
name: 'uikit-foo',
57+
enabled: true,
58+
outputDir: 'foo',
59+
excludedPatternStates: ['legacy'],
60+
excludedTags: ['baz'],
61+
};
62+
63+
patternlab.config.uikits = [uikitFoo];
64+
65+
//act
66+
loaduikits(patternlab).then(() => {
67+
logger.warning = () => {};
68+
test.done();
69+
});
70+
});
71+
3872
tap.test('loaduikits - maps fields correctly', function(test) {
3973
//arrange
4074
const patternlab = {
4175
config: testConfig,
42-
uikits: [],
76+
uikits: {},
4377
};
4478

4579
const uikitFoo = {
@@ -78,7 +112,7 @@ tap.test('loaduikits - only adds files for enabled uikits', function(test) {
78112
//arrange
79113
const patternlab = {
80114
config: testConfig,
81-
uikits: [],
115+
uikits: {},
82116
};
83117

84118
patternlab.config.uikits = [

packages/create/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
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+
## [5.9.1](https://github.com/pattern-lab/patternlab-node/compare/v5.9.0...v5.9.1) (2020-04-24)
7+
8+
**Note:** Version bump only for package create-pattern-lab
9+
10+
11+
12+
13+
14+
# [5.9.0](https://github.com/pattern-lab/patternlab-node/compare/v5.8.0...v5.9.0) (2020-04-24)
15+
16+
**Note:** Version bump only for package create-pattern-lab
17+
18+
19+
20+
21+
622
# [5.7.0](https://github.com/pattern-lab/patternlab-node/compare/v5.6.0...v5.7.0) (2020-02-17)
723

824
**Note:** Version bump only for package create-pattern-lab

0 commit comments

Comments
 (0)