',
@@ -634,7 +634,7 @@ tap.test('find_lineage - does not apply lineage twice', function (test) {
Pattern.createEmpty({
name: 'atoms-alerts-error',
subdir: 'atoms\\alerts',
- filename: 'error.mustache',
+ filename: 'error.hbs',
data: null,
template: '
{{message}}
',
extendedTemplate: '
{{message}}
',
diff --git a/packages/core/test/loadPattern_tests.js b/packages/core/test/loadPattern_tests.js
index e2e4bc3ca..e48f9b723 100644
--- a/packages/core/test/loadPattern_tests.js
+++ b/packages/core/test/loadPattern_tests.js
@@ -46,7 +46,7 @@ tap.test(
function (test) {
//arrange
const patternlab = util.fakePatternLab(patterns_dir);
- var fooPatternPath = path.join('test', 'bar.mustache');
+ var fooPatternPath = path.join('test', 'bar.hbs');
//act
var result = loadPattern(fooPatternPath, patternlab);
@@ -62,7 +62,7 @@ tap.test(
function (test) {
//arrange
const patternlab = util.fakePatternLab(patterns_dir);
- var fooPatternPath = path.join('test', 'bar.mustache');
+ var fooPatternPath = path.join('test', 'bar.hbs');
//act
var result = loadPattern(fooPatternPath, patternlab);
diff --git a/packages/core/test/object_factory_tests.js b/packages/core/test/object_factory_tests.js
index 6684628df..79551af7c 100644
--- a/packages/core/test/object_factory_tests.js
+++ b/packages/core/test/object_factory_tests.js
@@ -31,15 +31,15 @@ var engineLoader = require('../src/lib/pattern_engines');
engineLoader.loadAllEngines(config);
tap.test('test Pattern initializes correctly', function (test) {
- var p = new Pattern('atoms/global/colors.mustache', { d: 123 });
+ var p = new Pattern('atoms/global/colors.hbs', { d: 123 });
test.equal(
p.relPath,
- 'atoms' + path.sep + 'global' + path.sep + 'colors.mustache'
+ 'atoms' + path.sep + 'global' + path.sep + 'colors.hbs'
);
test.equal(p.name, 'atoms-global-colors');
test.equal(p.subdir, 'atoms' + path.sep + 'global');
test.equal(p.fileName, 'colors');
- test.equal(p.fileExtension, '.mustache');
+ test.equal(p.fileExtension, '.hbs');
test.equal(p.jsonFileData.d, 123);
test.equal(p.patternBaseName, 'colors');
test.equal(p.patternName, 'Colors');
@@ -64,7 +64,7 @@ tap.test('test Pattern initializes correctly', function (test) {
tap.test(
'test Pattern initializes correctly with pattern in sepatated directory',
function (test) {
- var p = new Pattern('atoms/global/colors/colors.mustache', {
+ var p = new Pattern('atoms/global/colors/colors.hbs', {
d: 123,
});
test.equal(
@@ -75,12 +75,12 @@ tap.test(
path.sep +
'colors' +
path.sep +
- 'colors.mustache'
+ 'colors.hbs'
);
test.equal(p.name, 'atoms-global-colors');
test.equal(p.subdir, path.join('atoms', 'global', 'colors'));
test.equal(p.fileName, 'colors');
- test.equal(p.fileExtension, '.mustache');
+ test.equal(p.fileExtension, '.hbs');
test.equal(p.jsonFileData.d, 123);
test.equal(p.patternBaseName, 'colors');
test.equal(p.patternName, 'Colors');
@@ -106,7 +106,7 @@ tap.test(
tap.test(
'test Pattern name for variants correctly initialzed',
function (test) {
- var p1 = new Pattern('atoms/global/colors/colors~variant.mustache', {
+ var p1 = new Pattern('atoms/global/colors/colors~variant.hbs', {
d: 123,
});
var p2 = new Pattern('atoms/global/colors/colors~variant-minus.json', {
@@ -121,12 +121,12 @@ tap.test(
tap.test(
'test Pattern with one-directory subdir works as expected',
function (test) {
- var p = new Pattern('atoms/colors.mustache', { d: 123 });
- test.equal(p.relPath, 'atoms' + path.sep + 'colors.mustache');
+ var p = new Pattern('atoms/colors.hbs', { d: 123 });
+ test.equal(p.relPath, 'atoms' + path.sep + 'colors.hbs');
test.equal(p.name, 'atoms-colors');
test.equal(p.subdir, 'atoms');
test.equal(p.fileName, 'colors');
- test.equal(p.fileExtension, '.mustache');
+ test.equal(p.fileExtension, '.hbs');
test.equal(p.jsonFileData.d, 123);
test.equal(p.patternBaseName, 'colors');
test.equal(p.patternName, 'Colors');
@@ -149,14 +149,14 @@ tap.test(
tap.test(
'test Pattern with own-directory gets resetted as expected',
function (test) {
- var p = new Pattern('atoms/button/button.mustache', { d: 123 }, pl);
+ var p = new Pattern('atoms/button/button.hbs', { d: 123 }, pl);
p.promoteFromDirectoryToFlatPattern(pl);
- test.equal(p.relPath, path.join('atoms', 'button', 'button.mustache'));
+ test.equal(p.relPath, path.join('atoms', 'button', 'button.hbs'));
test.equal(p.name, 'atoms-button');
test.equal(p.subdir, path.join('atoms', 'button'));
test.equal(p.fileName, 'button');
- test.equal(p.fileExtension, '.mustache');
+ test.equal(p.fileExtension, '.hbs');
test.equal(p.jsonFileData.d, 123);
test.equal(p.patternBaseName, 'button');
test.equal(p.patternName, 'Button');
@@ -179,8 +179,8 @@ tap.test(
tap.test(
'test Pattern with no numbers in pattern group works as expected',
function (test) {
- var p = new Pattern('atoms/colors.mustache', { d: 123 });
- test.equal(p.relPath, 'atoms' + path.sep + 'colors.mustache');
+ var p = new Pattern('atoms/colors.hbs', { d: 123 });
+ test.equal(p.relPath, 'atoms' + path.sep + 'colors.hbs');
test.equal(p.name, 'atoms-colors');
test.equal(p.subdir, 'atoms');
test.equal(p.fileName, 'colors');
@@ -198,7 +198,7 @@ tap.test(
tap.test(
'test Pattern capitalizes patternDisplayName correctly',
function (test) {
- var p = new Pattern('atoms/global/colors-alt.mustache', { d: 123 });
+ var p = new Pattern('atoms/global/colors-alt.hbs', { d: 123 });
test.equal(p.patternBaseName, 'colors-alt');
test.equal(p.patternName, 'Colors Alt');
test.end();
@@ -208,16 +208,16 @@ tap.test(
tap.test(
'test Pattern get dir level no separated pattern directory',
function (test) {
- var p = new Pattern('atoms/global/colors-alt.mustache', { d: 123 });
+ var p = new Pattern('atoms/global/colors-alt.hbs', { d: 123 });
console.log(p);
test.equal(p.getDirLevel(0, { patternHasOwnDir: false }), 'atoms');
test.equal(p.getDirLevel(1, { patternHasOwnDir: false }), 'global');
test.equal(p.getDirLevel(2, { patternHasOwnDir: false }), ''); // There is no third level
- var p = new Pattern('atoms/colors-alt.mustache', { d: 123 });
+ var p = new Pattern('atoms/colors-alt.hbs', { d: 123 });
test.equal(p.getDirLevel(0, { patternHasOwnDir: false }), 'atoms');
test.equal(p.getDirLevel(1, { patternHasOwnDir: false }), ''); // There is no second level
test.equal(p.getDirLevel(2, { patternHasOwnDir: false }), ''); // There is no third level
- var p = new Pattern('colors-alt.mustache', { d: 123 });
+ var p = new Pattern('colors-alt.hbs', { d: 123 });
test.equal(p.getDirLevel(0, { patternHasOwnDir: false }), 'root'); // No first level means root
test.equal(p.getDirLevel(1, { patternHasOwnDir: false }), ''); // There is no second level
test.equal(p.getDirLevel(2, { patternHasOwnDir: false }), ''); // There is no third leveL
@@ -228,26 +228,26 @@ tap.test(
tap.test(
'test Pattern get dir level with separated pattern directory',
function (test) {
- var p = new Pattern('atoms/global/colors-alt/colors-alt.mustache', {
+ var p = new Pattern('atoms/global/colors-alt/colors-alt.hbs', {
d: 123,
});
test.equal(p.getDirLevel(0, { patternHasOwnDir: true }), 'atoms');
test.equal(p.getDirLevel(1, { patternHasOwnDir: true }), 'global');
test.equal(p.getDirLevel(2, { patternHasOwnDir: true }), ''); // There is no third level
- var p = new Pattern('atoms/colors-alt/colors-alt.mustache', {
+ var p = new Pattern('atoms/colors-alt/colors-alt.hbs', {
d: 123,
});
test.equal(p.getDirLevel(0, { patternHasOwnDir: true }), 'atoms');
test.equal(p.getDirLevel(1, { patternHasOwnDir: true }), ''); // There is no second level
test.equal(p.getDirLevel(2, { patternHasOwnDir: true }), ''); // There is no third level
- var p = new Pattern('colors-alt/colors-alt.mustache', { d: 123 });
+ var p = new Pattern('colors-alt/colors-alt.hbs', { d: 123 });
test.equal(p.getDirLevel(0, { patternHasOwnDir: true }), 'root'); // No first level means root
test.equal(p.getDirLevel(1, { patternHasOwnDir: true }), ''); // There is no second level
test.equal(p.getDirLevel(2, { patternHasOwnDir: true }), ''); // There is no third leveL
- var p = new Pattern('atoms/global/colors-alt/colors-alt~variant.mustache', {
+ var p = new Pattern('atoms/global/colors-alt/colors-alt~variant.hbs', {
d: 123,
});
test.equal(p.name, 'atoms-global-colors-alt-variant');
@@ -261,14 +261,14 @@ tap.test(
tap.test(
'test Patterns that are nested deeper without own directory',
function (test) {
- var p = new Pattern('atoms/global/random-folder/colors-alt.mustache', {
+ var p = new Pattern('atoms/global/random-folder/colors-alt.hbs', {
d: 123,
});
test.equal(p.name, 'atoms-global-colors-alt');
test.equal(p.flatPatternPath, 'atoms-global');
var p = new Pattern(
- 'atoms/global/random-folder/another-folder/colors-alt.mustache',
+ 'atoms/global/random-folder/another-folder/colors-alt.hbs',
{
d: 123,
}
@@ -277,21 +277,21 @@ tap.test(
test.equal(p.flatPatternPath, 'atoms-global');
var p = new Pattern(
- 'atoms/global/random-folder/another-folder/some-folder/colors-alt.mustache',
+ 'atoms/global/random-folder/another-folder/some-folder/colors-alt.hbs',
{ d: 123 }
);
test.equal(p.name, 'atoms-global-colors-alt');
test.equal(p.flatPatternPath, 'atoms-global');
var p = new Pattern(
- 'atoms/global/random-folder/another-folder/colors-alt/colors-alt.mustache',
+ 'atoms/global/random-folder/another-folder/colors-alt/colors-alt.hbs',
{ d: 123 }
);
test.equal(p.name, 'atoms-global-colors-alt');
test.equal(p.flatPatternPath, 'atoms-global');
var p = new Pattern(
- 'atoms/global/random-folder/another-folder/some-folder/colors-alt~variant.mustache',
+ 'atoms/global/random-folder/another-folder/some-folder/colors-alt~variant.hbs',
{ d: 123 }
);
test.equal(p.name, 'atoms-global-colors-alt-variant');
diff --git a/packages/core/test/pattern_engines_tests.js b/packages/core/test/pattern_engines_tests.js
index 3a1e78f1f..38cf43677 100644
--- a/packages/core/test/pattern_engines_tests.js
+++ b/packages/core/test/pattern_engines_tests.js
@@ -10,11 +10,11 @@ patternEngines.loadAllEngines(config);
// the mustache test pattern, stolen from object_factory unit tests
var mustacheTestPattern = new Pattern(
- 'source/_patterns/atoms/global/colors-alt.mustache',
+ 'source/_patterns/atoms/global/colors-alt.hbs',
{ d: 123 }
);
var mustacheTestPseudoPatternBasePattern = new Pattern(
- 'source/_patterns/pages/homepage.mustache',
+ 'source/_patterns/pages/homepage.hbs',
{ d: 123 }
);
var mustacheTestPseudoPattern = new Pattern(
@@ -64,7 +64,7 @@ tap.test(
'getEngineForPattern returns a reference to the mustache engine from test pattern',
function (test) {
var engine = patternEngines.getEngineForPattern(mustacheTestPattern);
- test.equal(engine, patternEngines.mustache);
+ test.equal(engine, patternEngines.hbs);
test.end();
}
);
@@ -73,7 +73,7 @@ tap.test(
'getEngineForPattern returns a reference to the mustache engine from test pseudo-pattern',
function (test) {
var engine = patternEngines.getEngineForPattern(mustacheTestPseudoPattern);
- test.equal(engine, patternEngines.mustache);
+ test.equal(engine, patternEngines.hbs);
test.end();
}
);
@@ -116,11 +116,11 @@ tap.test(
function (test) {
// each test case
var filenames = {
- 'comment-thread.mustache': true,
+ 'comment-thread.hbs': true,
'comment-thread.fakeextthatdoesntexist': false,
'comment-thread': false,
- '_comment-thread.mustache': true,
- '.comment-thread.mustache': false,
+ '_comment-thread.hbs': true,
+ '.comment-thread.hbs': false,
'comment-thread.json': false,
'homepage~emergency.json': true,
};
@@ -198,10 +198,10 @@ tap.test(
);
tap.test(
- 'patternEngines object reports that it supports the .mustache extension',
+ 'patternEngines object reports that it supports the .hbs extension',
function (test) {
test.plan(1);
- test.ok(patternEngines.isFileExtensionSupported('.mustache'));
+ test.ok(patternEngines.isFileExtensionSupported('.hbs'));
test.end();
}
);
diff --git a/packages/core/test/processRecursive_tests.js b/packages/core/test/processRecursive_tests.js
index 1825c561e..ef21b8045 100644
--- a/packages/core/test/processRecursive_tests.js
+++ b/packages/core/test/processRecursive_tests.js
@@ -20,10 +20,10 @@ tap.test('processRecursive recursively includes partials', function (test) {
//assert
const patternlab = util.fakePatternLab(patterns_dir);
- var fooPatternPath = path.join('test', 'foo.mustache');
+ var fooPatternPath = path.join('test', 'foo.hbs');
var fooPattern = loadPattern(fooPatternPath, patternlab);
- var barPatternPath = path.join('test', 'bar.mustache');
+ var barPatternPath = path.join('test', 'bar.hbs');
var barPattern = loadPattern(barPatternPath, patternlab);
var p1 = processIterative(fooPattern, patternlab);
@@ -315,10 +315,10 @@ tap
//arrange
const patternlab = util.fakePatternLab(patterns_dir);
- var atomPath = path.join('test', 'bar.mustache');
+ var atomPath = path.join('test', 'bar.hbs');
var atomPattern = loadPattern(atomPath, patternlab);
- var templatePath = path.join('test', 'foo.mustache');
+ var templatePath = path.join('test', 'foo.hbs');
var templatePattern = loadPattern(templatePath, patternlab);
var pagesPath = path.join('test', 'inception.hbs');
@@ -412,7 +412,7 @@ tap.test(
//arrange
var pl = util.fakePatternLab(patterns_dir);
- var testPatternPath = path.join('test', 'bar.mustache');
+ var testPatternPath = path.join('test', 'bar.hbs');
var testPattern = loadPattern(testPatternPath, pl);
//act
@@ -439,7 +439,7 @@ tap.test(
//arrange
var pl = util.fakePatternLab(patterns_dir);
- var testPatternPath = path.join('test', 'bar.mustache');
+ var testPatternPath = path.join('test', 'bar.hbs');
var testPattern = loadPattern(testPatternPath, pl);
//act
diff --git a/packages/core/test/ui_builder_tests.js b/packages/core/test/ui_builder_tests.js
index 8a6c5c2f7..0de5549c9 100644
--- a/packages/core/test/ui_builder_tests.js
+++ b/packages/core/test/ui_builder_tests.js
@@ -113,9 +113,9 @@ tap.test(
path.sep +
'patternSubgroup' +
path.sep +
- 'foo.mustache',
+ 'foo.hbs',
isPattern: true,
- fileName: 'foo.mustache',
+ fileName: 'foo.hbs',
patternPartial: 'hidden-foo',
});
@@ -138,10 +138,9 @@ tap.test(
//arrange
var patternlab = createFakePatternLab({});
var pattern = Pattern.createEmpty({
- relPath:
- 'shown' + path.sep + 'patternsubtype' + path.sep + 'foo.mustache',
+ relPath: 'shown' + path.sep + 'patternsubtype' + path.sep + 'foo.hbs',
isPattern: true,
- fileName: 'foo.mustache',
+ fileName: 'foo.hbs',
patternPartial: 'shown-foo',
});
@@ -164,10 +163,9 @@ tap.test(
//arrange
var patternlab = createFakePatternLab({});
var pattern = Pattern.createEmpty({
- relPath:
- 'shown' + path.sep + '_patternSubgroup' + path.sep + 'foo.mustache',
+ relPath: 'shown' + path.sep + '_patternSubgroup' + path.sep + 'foo.hbs',
isPattern: true,
- fileName: 'foo.mustache',
+ fileName: 'foo.hbs',
patternPartial: 'shown-foo',
patternState: 'complete',
});
@@ -195,12 +193,12 @@ tap.test('groupPatterns - creates pattern groups correctly', function (test) {
new Pattern('foobar.hbs'),
new Pattern('test/bar.hbs'),
new Pattern('test/foo.hbs'),
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/black.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/grey.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/white.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/black.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/grey.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/white.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -274,9 +272,9 @@ tap.test(
// Should be sorted by order and secondly by name
patternlab.patterns.push(
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -316,9 +314,9 @@ tap.test(
});
patternlab.patterns.push(
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -357,9 +355,9 @@ tap.test(
});
patternlab.patterns.push(
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -406,12 +404,12 @@ tap.test(
patternlab.patterns.push(
new Pattern('test/foo.hbs'),
new Pattern('test/bar.hbs'),
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/black.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/grey.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/white.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/black.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/grey.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/white.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -449,12 +447,12 @@ tap.test(
patternlab.patterns.push(
new Pattern('test/foo.hbs'),
new Pattern('test/bar.hbs'),
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/black.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/grey.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/white.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/black.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/grey.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/white.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -506,12 +504,12 @@ tap.test(
patternlab.patterns.push(
new Pattern('test/foo.hbs'),
new Pattern('test/bar.hbs'),
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/black.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/grey.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/white.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/black.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/grey.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/white.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -561,12 +559,12 @@ tap.test(
patternlab.patterns.push(
//this flat pattern is found and causes trouble for the rest of the crew
new Pattern('test/foo.hbs'),
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/black.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/grey.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/white.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/black.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/grey.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/white.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -584,8 +582,8 @@ tap.test(
// within _.forOwn(...) loops, causing premature termination of the entire loop
// when what was intended was a continue
// we expect 10 here because:
- // - foo.mustache is flat and therefore does not have a viewall page
- // - the colors.mustache files make 6
+ // - foo.hbs is flat and therefore does not have a viewall page
+ // - the colors.hbs files make 6
// - patternSubgroup1 and patternSubgroup2 make 8
// - the general view all page make 9
// while most of that heavy lifting occurs inside groupPatterns and not buildViewAllPages,
@@ -631,12 +629,12 @@ tap.test(
patternlab.patterns.push(
//this flat pattern is found and causes trouble for the rest of the crew
new Pattern('test/foo.hbs'),
- new Pattern('patternGroup1/patternSubgroup1/blue.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/red.mustache'),
- new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/black.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/grey.mustache'),
- new Pattern('patternGroup1/patternSubgroup2/white.mustache')
+ new Pattern('patternGroup1/patternSubgroup1/blue.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/red.hbs'),
+ new Pattern('patternGroup1/patternSubgroup1/yellow.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/black.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/grey.hbs'),
+ new Pattern('patternGroup1/patternSubgroup2/white.hbs')
);
ui.resetUIBuilderState(patternlab);
@@ -654,8 +652,8 @@ tap.test(
// within _.forOwn(...) loops, causing premature termination of the entire loop
// when what was intended was a continue
// we expect 8 here because:
- // - foo.mustache is flat and therefore does not have a viewall page
- // - the colors.mustache files make 6
+ // - foo.hbs is flat and therefore does not have a viewall page
+ // - the colors.hbs files make 6
// - patternSubgroup1 and patternSubgroup2 make 8
// - the general view all page make 9
// - the view-all page of test and test-foo make 11
diff --git a/packages/core/test/watchPatternLabFiles_tests.js b/packages/core/test/watchPatternLabFiles_tests.js
index 0dcc7fbc1..f1fa8e823 100644
--- a/packages/core/test/watchPatternLabFiles_tests.js
+++ b/packages/core/test/watchPatternLabFiles_tests.js
@@ -19,7 +19,7 @@ tap.test(
});
pl.engines.getSupportedFileExtensions = () => {
- return ['.mustache'];
+ return ['.hbs', '.handlebars'];
};
watchPatternLabFiles(
@@ -36,8 +36,8 @@ tap.test(
);
// should have two for _data and _meta
- // should have five for '.json', '.yml', '.yaml', '.md' and '.mustache'
- test.equal(Object.keys(pl.watchers).length, 7);
+ // should have five for '.json', '.yml', '.yaml', '.md', '.hbs' and '.handlebars'
+ test.equal(Object.keys(pl.watchers).length, 8);
test.end();
}
diff --git a/packages/docs/src/docs/data-pattern-specific.md b/packages/docs/src/docs/data-pattern-specific.md
index d2863fa49..e43c0b4e1 100644
--- a/packages/docs/src/docs/data-pattern-specific.md
+++ b/packages/docs/src/docs/data-pattern-specific.md
@@ -19,7 +19,7 @@ Storing data for your atoms, molecules, and organisms in `./source/_data` may wo
In order to tell the Node version of Pattern Lab to use pattern-specific data to override the default global data create a JSON file with the same name as the pattern and put it in the same directory as the pattern. For example, if you wanted to provide pattern-specific data for the `article` pattern under the pattern type `pages` your `pages` directory would look like this:
```
-pages/article.mustache
+pages/article.hbs
pages/article.json
```
diff --git a/packages/docs/src/docs/pattern-add-new.md b/packages/docs/src/docs/pattern-add-new.md
index bad9986f2..b2ed7db41 100644
--- a/packages/docs/src/docs/pattern-add-new.md
+++ b/packages/docs/src/docs/pattern-add-new.md
@@ -13,15 +13,15 @@ sitemapChangefreq: 'monthly'
To add new patterns to the Node version of Pattern Lab just add new Mustache templates under the appropriate pattern type or pattern subgroup directories in `./source/_patterns`. For example, let's add a new pattern under the pattern type "molecules" and the pattern sub-type "blocks". The `./source/_patterns/molecules/blocks/` directory looks like:
- block-hero.mustache
- headline-byline.mustache
- media-block.mustache
+ block-hero.hbs
+ headline-byline.hbs
+ media-block.hbs
If we want to add a new pattern we simply tack it onto the end:
- block-hero.mustache
- headline-byline.mustache
- media-block.mustache
- new-pattern.mustache
+ block-hero.hbs
+ headline-byline.hbs
+ media-block.hbs
+ new-pattern.hbs
If you want more control over their ordering please refer to "[Reorganizing Patterns](/docs/reorganizing-patterns/)."
diff --git a/packages/docs/src/docs/pattern-documenting.md b/packages/docs/src/docs/pattern-documenting.md
index e0bddca33..c30e9c667 100644
--- a/packages/docs/src/docs/pattern-documenting.md
+++ b/packages/docs/src/docs/pattern-documenting.md
@@ -33,7 +33,7 @@ The `description` is used in the styleguide views.
Pattern documentation needs to have a `.md` file extension and match the name of the pattern it's documenting. For example, to document the following pattern:
- atoms/images/landscape-16x9.mustache
+ atoms/images/landscape-16x9.hbs
We'd name our documentation file:
@@ -46,7 +46,7 @@ To add documentation to [pseudo-patterns](/docs/using-pseudo-patterns/), create
For example, to document the following pseudo-pattern:
```
-atoms/button/button~red.mustache
+atoms/button/button~red.hbs
```
We'd name our documentation file:
diff --git a/packages/docs/src/docs/pattern-hiding.md b/packages/docs/src/docs/pattern-hiding.md
index e511bed4f..d8eec5bd2 100644
--- a/packages/docs/src/docs/pattern-hiding.md
+++ b/packages/docs/src/docs/pattern-hiding.md
@@ -13,7 +13,7 @@ sitemapChangefreq: 'monthly'
Removing a pattern from Pattern Lab's drop-down navigation and style guide is accomplished by setting the `hidden` frontmatter key on any pattern's companion `.md` file. For example, we may have a Google Map-based pattern that we don't need for a particular project. The path might look like:
- molecules/media/map.mustache
+ molecules/media/map.hbs
We would create or edit a file in the same location, calling it `map.md`:
diff --git a/packages/docs/src/docs/pattern-including.md b/packages/docs/src/docs/pattern-including.md
index 7e60fa338..781e0f277 100644
--- a/packages/docs/src/docs/pattern-including.md
+++ b/packages/docs/src/docs/pattern-including.md
@@ -24,7 +24,7 @@ The shorthand include syntax is less verbose than the default include syntax for
For example, to include the following pattern in a molecule:
- atoms/images/landscape-16x9.mustache
+ atoms/images/landscape-16x9.hbs
The shorthand include syntax would be:
@@ -39,7 +39,7 @@ The following are examples of using the shorthand include syntax with our suppor
{% raw %}{% include "atoms-landscape-16x9" %} // Twig{% endraw %}
```
-The shorthand syntax also allows for fuzzy matching on pattern names. This means that if you feel your pattern name is going to be unique within a given pattern type you can supply just the unique part of the pattern name and the partial will be included correctly. For example, using the shorthand syntax the pattern `atoms-landscape-16x9.mustache` could be written as:
+The shorthand syntax also allows for fuzzy matching on pattern names. This means that if you feel your pattern name is going to be unique within a given pattern type you can supply just the unique part of the pattern name and the partial will be included correctly. For example, using the shorthand syntax the pattern `atoms-landscape-16x9.hbs` could be written as:
atoms-16x9
@@ -50,9 +50,9 @@ _Warning:_ Because subgroups are not included in the shorthand include syntax a
## The Default Include Syntax
-If you need more specificity when including patterns the Node version of Pattern Lab also support the include syntax for the template language that you're using. For example, the syntax for Mustache is the path to the pattern minus the `.mustache` extension. Let's say we wanted to include the following pattern in a molecule:
+If you need more specificity when including patterns the Node version of Pattern Lab also support the include syntax for the template language that you're using. For example, the syntax for Mustache is the path to the pattern minus the `.hbs` extension. Let's say we wanted to include the following pattern in a molecule:
- atoms/images/landscape-16x9.mustache
+ atoms/images/landscape-16x9.hbs
The default Mustache include syntax would be:
@@ -68,13 +68,13 @@ Here are some examples of how to include patterns as well as some gotchas.
```handlebars
{% raw %}// partials to match
-atoms/global/test.mustache
-atoms/global/test-with-picture.mustache
+atoms/global/test.hbs
+atoms/global/test-with-picture.hbs
// using the shorthand partials syntax
-{{> atoms-test }} // will match atoms/global/test.mustache
-{{> atoms-test-with-picture }} // will match atoms/global/test-with-picture.mustache
+{{> atoms-test }} // will match atoms/global/test.hbs
+{{> atoms-test-with-picture }} // will match atoms/global/test-with-picture.hbs
// using the default mustache partials syntax
-{{> atoms/global/test }} // will match atoms/global/test.mustache{% endraw %}
+{{> atoms/global/test }} // will match atoms/global/test.hbs{% endraw %}
```
diff --git a/packages/docs/src/docs/pattern-organization.md b/packages/docs/src/docs/pattern-organization.md
index 9119fac98..de0deb982 100644
--- a/packages/docs/src/docs/pattern-organization.md
+++ b/packages/docs/src/docs/pattern-organization.md
@@ -24,9 +24,9 @@ Here are the parts:
- `patternGroup` denotes the overall pattern type. If using Atomic Design this will be something like "atoms" or "molecules" but it can be anything you want. For example, "components" or "elements."
- `patternSubgroup` denotes the sub-type of pattern and is _optional_. This helps to organize patterns under an overall pattern type in the drop downs in Pattern Lab. For example, a "blocks" pattern subgroup under the "molecules" pattern type.
- `patternName` is the name of the pattern. This is used when the pattern is displayed in the drop downs in Pattern Lab.
-- `patternExtension` is the file extension that tells the PatternEngine to render the pattern. For example, `.mustache`.
+- `patternExtension` is the file extension that tells the PatternEngine to render the pattern. For example, `.hbs`.
-Dashes (`-`) in your pattern types, pattern subgroups or pattern names will be replaced with spaces. For example, if you want a pattern to be displayed in the drop-down as "Hamburger Navigation" and you're using the Mustache PatternEngine you should name it `hamburger-navigation.mustache`.
+Dashes (`-`) in your pattern types, pattern subgroups or pattern names will be replaced with spaces. For example, if you want a pattern to be displayed in the drop-down as "Hamburger Navigation" and you're using the Mustache PatternEngine you should name it `hamburger-navigation.hbs`.
## Pattern Type Naming Conventions
@@ -43,8 +43,8 @@ Node versions support nesting of folders under `patternSubgroup`. For example, y
- molecules/
- blocks/
- media-block/
+ - media-block.hbs
- media-block.md
- - media-block.mustache
- media-block.scss
- media-block~variant1.json
- media-block~variant2.json
diff --git a/packages/docs/src/docs/pattern-pseudo-patterns.md b/packages/docs/src/docs/pattern-pseudo-patterns.md
index 397cc39bc..460130b38 100644
--- a/packages/docs/src/docs/pattern-pseudo-patterns.md
+++ b/packages/docs/src/docs/pattern-pseudo-patterns.md
@@ -35,11 +35,11 @@ From a navigation and naming perspective `patternName` and `pseudoPatternName` w
Adding a pseudo-pattern is as simple as naming it correctly and following the [pattern-specific JSON file](/docs/creating-pattern-specific-values/) instructions for organizing its content. Let's look at a simple example where we want to show an emergency notification on our homepage Mustache template. Our `templates/` directory might look like this:
- article.mustache
- blog.mustache
- homepage.mustache
+ article.hbs
+ blog.hbs
+ homepage.hbs
-Our `homepage.mustache` template might look like this:
+Our `homepage.hbs` template might look like this:
```html
{% raw %}
@@ -51,12 +51,12 @@ Our `homepage.mustache` template might look like this:
{% endraw %}
```
-If our `_data.json` file doesn't give a value for `emergency` that section will never show up when `homepage.mustache` is rendered. Obviously we'd need to show _both_ the regular and emergency states of the homepage but we don't want to duplicate the entire `homepage.mustache` template. That would be a maintenance nightmare. So let's add our pseudo-pattern:
+If our `_data.json` file doesn't give a value for `emergency` that section will never show up when `homepage.hbs` is rendered. Obviously we'd need to show _both_ the regular and emergency states of the homepage but we don't want to duplicate the entire `homepage.hbs` template. That would be a maintenance nightmare. So let's add our pseudo-pattern:
```
-article.mustache
-blog.mustache
-homepage.mustache
+article.hbs
+blog.hbs
+homepage.hbs
homepage~emergency.json
```
diff --git a/packages/docs/src/docs/pattern-reorganizing.md b/packages/docs/src/docs/pattern-reorganizing.md
index 1d2b80242..89469bf65 100644
--- a/packages/docs/src/docs/pattern-reorganizing.md
+++ b/packages/docs/src/docs/pattern-reorganizing.md
@@ -16,14 +16,14 @@ By default, the Node version of Pattern Lab organizes pattern groups, pattern su
For example, we'll look at how we can re-organize patterns. Using alphabetical ordering the `lists` pattern subgroup in `atoms` looks like:
```
-definition.mustache
-ordered.mustache
-unordered.mustache
+definition.hbs
+ordered.hbs
+unordered.hbs
```
This is also the order they'll show up in the drop-down navigation. Because you rarely need to see the definition list pattern, maybe you want to have it show up last in the navigation. To re-order the patterns add the parameter `order` to the documentation `.md` file of the pattern. If no documentation `.md` file exists, you can create one:
-The default value for `order` is `0`. That's why there is no file for `ordered.mustache` required.
+The default value for `order` is `0`. That's why there is no file for `ordered.hbs` required.
```
---
@@ -42,9 +42,9 @@ order: 1
Result
```
-ordered.mustache
-unordered.mustache
-definition.mustache
+ordered.hbs
+unordered.hbs
+definition.hbs
```
## Re-ordering Pseudo-Patterns
@@ -56,8 +56,8 @@ The rules for re-ordering [pseudo-patterns](/docs/using-pseudo-patterns/) are sl
- Third: order by `pattern-name` / `variant-name`
```
-- some-other-pattern.mustache
-- some-pattern.mustache
+- some-other-pattern.hbs
+- some-pattern.hbs
- some-pattern.yml
- some-pattern~variation1.yml
- some-pattern~variation2.yml
diff --git a/packages/docs/src/docs/pattern-states.md b/packages/docs/src/docs/pattern-states.md
index 3198faf91..9dfba49e1 100644
--- a/packages/docs/src/docs/pattern-states.md
+++ b/packages/docs/src/docs/pattern-states.md
@@ -28,7 +28,7 @@ Any pattern that includes a pattern partial that has a lower pattern state will
Giving patterns a state is accomplished by setting the `state` frontmatter key on any pattern's companion `.md` file. Consider this media block pattern:
```
-./source/_patterns/molecules/blocks/media-block.mustache
+./source/_patterns/molecules/blocks/media-block.hbs
```
We would create or edit a file in the same location, calling it `media-block.md`:
diff --git a/packages/edition-node-gulp/source/_meta/_foot.mustache b/packages/edition-node-gulp/source/_meta/_foot.hbs
similarity index 100%
rename from packages/edition-node-gulp/source/_meta/_foot.mustache
rename to packages/edition-node-gulp/source/_meta/_foot.hbs
diff --git a/packages/edition-node-gulp/source/_meta/_head.mustache b/packages/edition-node-gulp/source/_meta/_head.hbs
similarity index 100%
rename from packages/edition-node-gulp/source/_meta/_head.mustache
rename to packages/edition-node-gulp/source/_meta/_head.hbs
diff --git a/packages/edition-node/source/_meta/_foot.mustache b/packages/edition-node/source/_meta/_foot.hbs
similarity index 100%
rename from packages/edition-node/source/_meta/_foot.mustache
rename to packages/edition-node/source/_meta/_foot.hbs
diff --git a/packages/edition-node/source/_meta/_head.mustache b/packages/edition-node/source/_meta/_head.hbs
similarity index 100%
rename from packages/edition-node/source/_meta/_head.mustache
rename to packages/edition-node/source/_meta/_head.hbs
diff --git a/packages/plugin-tab/README.md b/packages/plugin-tab/README.md
index 359f77fbe..203cf7a18 100644
--- a/packages/plugin-tab/README.md
+++ b/packages/plugin-tab/README.md
@@ -48,7 +48,7 @@ For example, if we added an `scss` tab:
```
./_patterns/foo/bar
-├── pattern.mustache (the pattern template)
+├── pattern.hbs (the pattern template)
├── pattern.md (optional pattern-specific documentation and metadata)
├── pattern.json (optional pattern-specific data)
└── pattern.scss (a file matching the tab you added.)
From 91323771afe4e66a6df8647576e5d0ca70a28219 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 00:34:25 +0100
Subject: [PATCH 03/30] refactor: changed mustache to handlebars extensions
---
packages/core/test/engine_mustache_tests.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/core/test/engine_mustache_tests.js b/packages/core/test/engine_mustache_tests.js
index 1bfcf8cee..018459000 100644
--- a/packages/core/test/engine_mustache_tests.js
+++ b/packages/core/test/engine_mustache_tests.js
@@ -52,7 +52,7 @@ function testFindPartials(test, partialTests) {
// docs on partial syntax are here:
// https://patternlab.io/docs/including-patterns/
var currentPattern = Pattern.create(
- 'molecules/testing/test-mol.mustache', // relative path now
+ 'molecules/testing/test-mol.hbs', // relative path now
null, // data
{
template: partialTests.join(eol),
@@ -78,7 +78,7 @@ function testFindPartialsWithStyleModifiers(test, partialTests) {
// docs on partial syntax are here:
// https://patternlab.io/docs/including-patterns/
var currentPattern = Pattern.create(
- 'molecules/testing/test-mol.mustache', // relative path now
+ 'molecules/testing/test-mol.hbs', // relative path now
null, // data
{
template: partialTests.join(eol),
@@ -104,7 +104,7 @@ function testFindPartialsWithPatternParameters(test, partialTests) {
// docs on partial syntax are here:
// https://patternlab.io/docs/including-patterns/
var currentPattern = Pattern.create(
- 'molecules/testing/test-mol.mustache', // relative path now
+ 'molecules/testing/test-mol.hbs', // relative path now
null, // data
{
template: partialTests.join(eol),
From f5f23d2fb418c0369cf3a6cb3bc556b360e4eff3 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 00:34:54 +0100
Subject: [PATCH 04/30] chore: removed mustache related test
---
packages/core/test/engine_mustache_tests.js | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/packages/core/test/engine_mustache_tests.js b/packages/core/test/engine_mustache_tests.js
index 018459000..4d5112b39 100644
--- a/packages/core/test/engine_mustache_tests.js
+++ b/packages/core/test/engine_mustache_tests.js
@@ -9,16 +9,6 @@ var testPatternsPath = path.resolve(__dirname, 'files', '_patterns');
var eol = require('os').EOL;
var config = require('./util/patternlab-config.json');
-// don't run these tests unless mustache is installed
-var engineLoader = require('../src/lib/pattern_engines');
-engineLoader.loadAllEngines(config);
-if (!engineLoader.mustache) {
- tap.test('Mustache engine not installed, skipping tests.', function (test) {
- test.end();
- });
- return;
-}
-
// fake pattern lab constructor:
// sets up a fake patternlab object, which is needed by the pattern processing
// apparatus.
From b37bd08eeec114d78bbb484b233b19db5d9a2a1f Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 00:51:17 +0100
Subject: [PATCH 05/30] fix: corrected those path
---
packages/cli/test/fixtures/patternlab-config.json | 2 +-
packages/core/patternlab-config.json | 2 +-
packages/core/test/util/patternlab-config.json | 2 +-
.../patternlab-config.json | 2 +-
.../development-edition-engine-react/patternlab-config.json | 2 +-
packages/development-edition-engine-twig/patternlab-config.json | 2 +-
packages/edition-node-gulp/patternlab-config.json | 2 +-
packages/edition-node/patternlab-config.json | 2 +-
packages/edition-twig/patternlab-config.json | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/packages/cli/test/fixtures/patternlab-config.json b/packages/cli/test/fixtures/patternlab-config.json
index b7359cf78..77417d8cc 100644
--- a/packages/cli/test/fixtures/patternlab-config.json
+++ b/packages/cli/test/fixtures/patternlab-config.json
@@ -49,7 +49,7 @@
"patternSectionSubgroup":
"node_modules/@pattern-lab/uikit-workshop/views/partials/patternSectionSubgroup.hbs",
"viewall":
- "node_modules/@pattern-lab/uikit-workshop/viewall.hbs"
+ "node_modules/@pattern-lab/uikit-workshop/views/viewall.hbs"
},
"js": "./test/fixtures/source/js",
"images": "./test/fixtures/source/images",
diff --git a/packages/core/patternlab-config.json b/packages/core/patternlab-config.json
index b09e76529..0232690ec 100644
--- a/packages/core/patternlab-config.json
+++ b/packages/core/patternlab-config.json
@@ -49,7 +49,7 @@
"patternSectionSubgroup":
"views/partials/patternSectionSubgroup.hbs",
"viewall":
- "viewall.hbs"
+ "views/viewall.hbs"
},
"js": "./source/js",
"images": "./source/images",
diff --git a/packages/core/test/util/patternlab-config.json b/packages/core/test/util/patternlab-config.json
index 31b1dce94..a530b1f74 100644
--- a/packages/core/test/util/patternlab-config.json
+++ b/packages/core/test/util/patternlab-config.json
@@ -12,7 +12,7 @@
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup":
"views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "./test/files/js",
"images": "./test/files/images",
diff --git a/packages/development-edition-engine-handlebars/patternlab-config.json b/packages/development-edition-engine-handlebars/patternlab-config.json
index d547ea28d..bc866c8ac 100644
--- a/packages/development-edition-engine-handlebars/patternlab-config.json
+++ b/packages/development-edition-engine-handlebars/patternlab-config.json
@@ -53,7 +53,7 @@
"general-footer": "views/partials/general-footer.hbs",
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "source/js",
"images": "source/images",
diff --git a/packages/development-edition-engine-react/patternlab-config.json b/packages/development-edition-engine-react/patternlab-config.json
index 06f9bd2e8..4a46205c7 100644
--- a/packages/development-edition-engine-react/patternlab-config.json
+++ b/packages/development-edition-engine-react/patternlab-config.json
@@ -49,7 +49,7 @@
"patternSectionSubgroup":
"./node_modules/@pattern-lab/uikit-workshop/views/partials/patternSectionSubgroup.hbs",
"viewall":
- "./node_modules/@pattern-lab/uikit-workshop/viewall.hbs"
+ "./node_modules/@pattern-lab/uikit-workshop/views/viewall.hbs"
},
"js" : "./source/js",
"images" : "./source/images",
diff --git a/packages/development-edition-engine-twig/patternlab-config.json b/packages/development-edition-engine-twig/patternlab-config.json
index 7a472d6b7..dcea6cb55 100644
--- a/packages/development-edition-engine-twig/patternlab-config.json
+++ b/packages/development-edition-engine-twig/patternlab-config.json
@@ -53,7 +53,7 @@
"general-footer": "views/partials/general-footer.hbs",
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "source/js",
"images": "source/images",
diff --git a/packages/edition-node-gulp/patternlab-config.json b/packages/edition-node-gulp/patternlab-config.json
index 237ed1cd5..fb880183e 100644
--- a/packages/edition-node-gulp/patternlab-config.json
+++ b/packages/edition-node-gulp/patternlab-config.json
@@ -49,7 +49,7 @@
"patternSectionSubgroup":
"views/partials/patternSectionSubgroup.hbs",
"viewall":
- "viewall.hbs"
+ "views/viewall.hbs"
},
"js": "./source/js",
"images": "./source/images",
diff --git a/packages/edition-node/patternlab-config.json b/packages/edition-node/patternlab-config.json
index 37026998c..feb6e3051 100644
--- a/packages/edition-node/patternlab-config.json
+++ b/packages/edition-node/patternlab-config.json
@@ -49,7 +49,7 @@
"patternSectionSubgroup":
"views/partials/patternSectionSubgroup.hbs",
"viewall":
- "viewall.hbs"
+ "views/viewall.hbs"
},
"js": "./source/js",
"images": "./source/images",
diff --git a/packages/edition-twig/patternlab-config.json b/packages/edition-twig/patternlab-config.json
index a422597d3..888418f98 100644
--- a/packages/edition-twig/patternlab-config.json
+++ b/packages/edition-twig/patternlab-config.json
@@ -109,7 +109,7 @@
"general-footer": "views/partials/general-footer.hbs",
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "./source/js",
"images": "./source/images",
From 8c001e44a8c58361541acf880a6125054a285555 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 01:06:47 +0100
Subject: [PATCH 06/30] refactor: removed the mustache package dependency
---
.github/workflows/continuous-integration.yml | 1 -
.travis.yml | 1 -
packages/core/package.json | 1 -
.../package.json | 1 -
.../package.json | 1 -
packages/edition-node-gulp/package.json | 1 -
packages/uikit-workshop/package.json | 1 -
yarn.lock | 25 -------------------
8 files changed, 32 deletions(-)
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 2b125cacf..90fc0e215 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -17,7 +17,6 @@ jobs:
- name: Setup the project
run: |
yarn run setup
- npx lerna add @pattern-lab/engine-mustache --scope=@pattern-lab/core
npx lerna add @pattern-lab/engine-handlebars --scope=@pattern-lab/core
npx lerna add @pattern-lab/engine-underscore --scope=@pattern-lab/core
npx lerna add @pattern-lab/engine-liquid --scope=@pattern-lab/core
diff --git a/.travis.yml b/.travis.yml
index 3fb4c3593..d44c3ae26 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,6 @@ before_install:
before_script:
- yarn run setup
- - npx lerna add @pattern-lab/engine-mustache --scope=@pattern-lab/core
- npx lerna add @pattern-lab/engine-handlebars --scope=@pattern-lab/core
- npx lerna add @pattern-lab/engine-underscore --scope=@pattern-lab/core
- npx lerna add @pattern-lab/engine-liquid --scope=@pattern-lab/core
diff --git a/packages/core/package.json b/packages/core/package.json
index dacf65b84..38d940268 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -4,7 +4,6 @@
"version": "5.17.0",
"main": "./src/index.js",
"dependencies": {
- "@pattern-lab/engine-mustache": "^5.16.4",
"@pattern-lab/live-server": "^5.16.1",
"chalk": "4.1.0",
"chokidar": "3.5.1",
diff --git a/packages/development-edition-engine-handlebars/package.json b/packages/development-edition-engine-handlebars/package.json
index ee105eebd..fd2c53e2a 100644
--- a/packages/development-edition-engine-handlebars/package.json
+++ b/packages/development-edition-engine-handlebars/package.json
@@ -32,7 +32,6 @@
"@pattern-lab/cli": "^5.17.0",
"@pattern-lab/core": "^5.17.0",
"@pattern-lab/engine-handlebars": "^5.16.4",
- "@pattern-lab/engine-mustache": "^5.16.4",
"@pattern-lab/plugin-tab": "^5.16.1",
"@pattern-lab/starterkit-handlebars-demo": "^5.16.4",
"@pattern-lab/uikit-workshop": "^5.17.0"
diff --git a/packages/development-edition-engine-react/package.json b/packages/development-edition-engine-react/package.json
index 3e281c60e..d2c9dc20f 100644
--- a/packages/development-edition-engine-react/package.json
+++ b/packages/development-edition-engine-react/package.json
@@ -6,7 +6,6 @@
"main": "gulpfile.js",
"dependencies": {
"@pattern-lab/core": "^5.17.0",
- "@pattern-lab/engine-mustache": "^5.16.4",
"@pattern-lab/engine-react": "^5.16.1",
"@pattern-lab/uikit-workshop": "^5.17.0",
"gulp": "4.0.2",
diff --git a/packages/edition-node-gulp/package.json b/packages/edition-node-gulp/package.json
index 0f476c625..b1beecd5a 100644
--- a/packages/edition-node-gulp/package.json
+++ b/packages/edition-node-gulp/package.json
@@ -6,7 +6,6 @@
"dependencies": {
"@pattern-lab/cli": "^5.17.0",
"@pattern-lab/core": "^5.17.0",
- "@pattern-lab/engine-mustache": "^5.16.4",
"@pattern-lab/uikit-workshop": "^5.17.0",
"gulp": "4.0.2",
"minimist": "1.2.5"
diff --git a/packages/uikit-workshop/package.json b/packages/uikit-workshop/package.json
index e1330de8b..72519e771 100644
--- a/packages/uikit-workshop/package.json
+++ b/packages/uikit-workshop/package.json
@@ -44,7 +44,6 @@
"@babel/runtime": "^7.13.10",
"@pattern-lab/core": "^5.17.0",
"@pattern-lab/engine-handlebars": "^5.16.4",
- "@pattern-lab/engine-mustache": "^5.16.4",
"@pattern-lab/uikit-polyfills": "^5.16.1",
"@reach/visually-hidden": "^0.1.2",
"@webcomponents/custom-elements": "^1.4.3",
diff --git a/yarn.lock b/yarn.lock
index 2ffddd8a3..e8504f439 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2031,11 +2031,6 @@
dependencies:
"@octokit/openapi-types" "^11.2.0"
-"@pattern-lab/starterkit-mustache-base@3.0.3":
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/@pattern-lab/starterkit-mustache-base/-/starterkit-mustache-base-3.0.3.tgz#8ce9bc8e0d2254ee970a09c4bdc76d4f6131c91d"
- integrity sha512-AALdLim5L4ODDjUevRGBY/omhzTU38tSJMRRLaCnwoZ9dxn2QOZNampxj5T7Fhn4oTQnyjhawslVbqVekoViig==
-
"@reach/visually-hidden@^0.1.2":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@reach/visually-hidden/-/visually-hidden-0.1.4.tgz#0dc4ecedf523004337214187db70a46183bd945b"
@@ -14959,26 +14954,6 @@ standard-version@9.1.1:
stringify-package "^1.0.1"
yargs "^16.0.0"
-starterkit-mustache-acidtest@0.0.3:
- version "0.0.3"
- resolved "https://registry.yarnpkg.com/starterkit-mustache-acidtest/-/starterkit-mustache-acidtest-0.0.3.tgz#8ad2b69f955b487ce60415b4d2b0e2177aa0af29"
- integrity sha1-itK2n5VbSHzmBBW00rDiF3qgryk=
-
-starterkit-mustache-bootstrap@0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/starterkit-mustache-bootstrap/-/starterkit-mustache-bootstrap-0.1.1.tgz#1cc0b988a8e6fc084dbb9604bf166af17b4216e6"
- integrity sha1-HMC5iKjm/AhNu5YEvxZq8XtCFuY=
-
-starterkit-mustache-foundation@0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/starterkit-mustache-foundation/-/starterkit-mustache-foundation-0.1.1.tgz#083bf6c1cf6a605ce8729555d502726fa419fd01"
- integrity sha1-CDv2wc9qYFzocpVV1QJyb6QZ/QE=
-
-starterkit-mustache-materialdesign@0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/starterkit-mustache-materialdesign/-/starterkit-mustache-materialdesign-0.1.2.tgz#1806fa26c87a79ed343cffc139d215a634b7994a"
- integrity sha1-GAb6Jsh6ee00PP/BOdIVpjS3mUo=
-
static-extend@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
From be893acd93fa64a3db0a6b56ff035a3ef0631c99 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 01:07:00 +0100
Subject: [PATCH 07/30] chore: updated engine
---
packages/starterkit-twig-demo/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/starterkit-twig-demo/README.md b/packages/starterkit-twig-demo/README.md
index d2b215dd8..22507fabc 100755
--- a/packages/starterkit-twig-demo/README.md
+++ b/packages/starterkit-twig-demo/README.md
@@ -3,7 +3,7 @@
# Demo StarterKit for Twig
-The Demo StarterKit for Twig is meant to be used as a demo that highlights how to combine Twig and Pattern Lab. It is currently very thin. We're looking for maintainers who may be interested in making this demo the equal to if not better than the Mustache demo.
+The Demo StarterKit for Twig is meant to be used as a demo that highlights how to combine Twig and Pattern Lab. It is currently very thin. We're looking for maintainers who may be interested in making this demo the equal to if not better than the Handlebars demo.
## Requirements
From b991e027b2ee1765c41c38bfde60d0093d21e815 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 01:07:21 +0100
Subject: [PATCH 08/30] chore: corrected the fileending
---
packages/docs/src/docs/advanced-config-options.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/packages/docs/src/docs/advanced-config-options.md b/packages/docs/src/docs/advanced-config-options.md
index 7be2f0813..fd1ed081d 100644
--- a/packages/docs/src/docs/advanced-config-options.md
+++ b/packages/docs/src/docs/advanced-config-options.md
@@ -149,11 +149,11 @@ Sets the configurable source and public directories for files Pattern Lab Node o
"annotations": "./source/_annotations/",
"styleguide": "dist/",
"patternlabFiles": {
- "general-header": "views/partials/general-header.handlebars",
- "general-footer": "views/partials/general-footer.handlebars",
- "patternSection": "views/partials/patternSection.handlebars",
- "patternSectionSubgroup": "views/partials/patternSectionSubgroup.handlebars",
- "viewall": "views/viewall.handlebars"
+ "general-header": "views/partials/general-header.hbs",
+ "general-footer": "views/partials/general-footer.hbs",
+ "patternSection": "views/partials/patternSection.hbs",
+ "patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
+ "viewall": "views/viewall.hbs"
},
"js": "./source/js",
"images": "./source/images",
From cc913fad9fac32dda6514fc447d6ee6b317b65a1 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 01:44:20 +0100
Subject: [PATCH 09/30] refactor: adapted handlebars config and docs
---
packages/core/patternlab-config.json | 2 +-
packages/core/src/lib/pattern_engines.js | 6 +--
packages/core/test/pattern_engines_tests.js | 44 ++++++++++---------
.../core/test/util/patternlab-config.json | 2 +-
.../patternlab-config.json | 2 +-
.../docs/src/docs/advanced-config-options.md | 2 +-
.../src/docs/advanced-ecosystem-overview.md | 2 +-
.../src/docs/advanced-keyboard-shortcuts.md | 2 +-
.../docs/src/docs/advanced-starterkits.md | 4 +-
...d-template-language-and-pattern-engines.md | 4 +-
packages/docs/src/docs/data-json-mustache.md | 16 +++----
packages/docs/src/docs/data-overview.md | 2 +-
packages/docs/src/docs/pattern-add-new.md | 2 +-
packages/docs/src/docs/pattern-including.md | 10 ++---
.../docs/src/docs/pattern-organization.md | 2 +-
packages/docs/src/docs/pattern-parameters.md | 8 ++--
.../docs/src/docs/pattern-pseudo-patterns.md | 2 +-
packages/edition-node-gulp/README.md | 2 +-
.../edition-node-gulp/patternlab-config.json | 2 +-
yarn.lock | 5 +++
20 files changed, 66 insertions(+), 55 deletions(-)
diff --git a/packages/core/patternlab-config.json b/packages/core/patternlab-config.json
index 0232690ec..eb09c097d 100644
--- a/packages/core/patternlab-config.json
+++ b/packages/core/patternlab-config.json
@@ -68,7 +68,7 @@
"css": "public/css"
}
},
- "patternExtension": "mustache",
+ "patternExtension": "hbs",
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportAll": false,
"patternExportDirectory": "pattern_exports",
diff --git a/packages/core/src/lib/pattern_engines.js b/packages/core/src/lib/pattern_engines.js
index a744f4d7d..ee36e75bf 100644
--- a/packages/core/src/lib/pattern_engines.js
+++ b/packages/core/src/lib/pattern_engines.js
@@ -70,7 +70,7 @@ function findEngineModulesInDirectory(dir) {
// any loaded PatternEngine by addressing them like this:
//
// var PatternEngines = require('./pattern_engines/pattern_engines');
-// var Mustache = PatternEngines['mustache'];
+// var Handlebars = PatternEngines['handlebars'];
//
// Object.create lets us create an object with a specified prototype. We want
// this here because we would like the object's "own properties" to include
@@ -172,9 +172,9 @@ const PatternEngines = Object.create({
}
}
- // otherwise, assume it's a plain mustache template string and act
+ // otherwise, assume it's a plain handlebars template string and act
// accordingly
- return 'mustache';
+ return 'handlebars';
},
/**
diff --git a/packages/core/test/pattern_engines_tests.js b/packages/core/test/pattern_engines_tests.js
index 38cf43677..d9f70169f 100644
--- a/packages/core/test/pattern_engines_tests.js
+++ b/packages/core/test/pattern_engines_tests.js
@@ -8,71 +8,75 @@ var config = require('./util/patternlab-config.json');
patternEngines.loadAllEngines(config);
-// the mustache test pattern, stolen from object_factory unit tests
-var mustacheTestPattern = new Pattern(
+// the handlebars test pattern, stolen from object_factory unit tests
+var handlebarsTestPattern = new Pattern(
'source/_patterns/atoms/global/colors-alt.hbs',
{ d: 123 }
);
-var mustacheTestPseudoPatternBasePattern = new Pattern(
+var handlebarsTestPseudoPatternBasePattern = new Pattern(
'source/_patterns/pages/homepage.hbs',
{ d: 123 }
);
-var mustacheTestPseudoPattern = new Pattern(
+var handlebarsTestPseudoPattern = new Pattern(
'source/_patterns/pages/homepage~emergency.json',
{ d: 123 }
);
-mustacheTestPseudoPattern.isPseudoPattern = true;
-mustacheTestPseudoPattern.basePattern = mustacheTestPseudoPatternBasePattern;
+handlebarsTestPseudoPattern.isPseudoPattern = true;
+handlebarsTestPseudoPattern.basePattern =
+ handlebarsTestPseudoPatternBasePattern;
var engineNames = Object.keys(patternEngines);
tap.test(
- 'getEngineNameForPattern returns "mustache" from test pattern',
+ 'getEngineNameForPattern returns "handlebars" from test pattern',
function (test) {
- var engineName =
- patternEngines.getEngineNameForPattern(mustacheTestPattern);
- test.equal(engineName, 'mustache');
+ var engineName = patternEngines.getEngineNameForPattern(
+ handlebarsTestPattern
+ );
+ test.equal(engineName, 'handlebars');
test.end();
}
);
tap.test(
- 'getEngineNameForPattern returns "mustache" for a plain string template as a backwards compatibility measure',
+ 'getEngineNameForPattern returns "handlebars" for a plain string template as a backwards compatibility measure',
function (test) {
test.plan(1);
test.equal(
patternEngines.getEngineNameForPattern('plain text string'),
- 'mustache'
+ 'handlebars'
);
test.end();
}
);
tap.test(
- 'getEngineNameForPattern returns "mustache" for an artificial empty template',
+ 'getEngineNameForPattern returns "handlebars" for an artificial empty template',
function (test) {
test.plan(1);
var emptyPattern = Pattern.createEmpty();
test.equal(
patternEngines.getEngineNameForPattern(emptyPattern),
- 'mustache'
+ 'handlebars'
);
test.end();
}
);
tap.test(
- 'getEngineForPattern returns a reference to the mustache engine from test pattern',
+ 'getEngineForPattern returns a reference to the handlebars engine from test pattern',
function (test) {
- var engine = patternEngines.getEngineForPattern(mustacheTestPattern);
+ var engine = patternEngines.getEngineForPattern(handlebarsTestPattern);
test.equal(engine, patternEngines.hbs);
test.end();
}
);
tap.test(
- 'getEngineForPattern returns a reference to the mustache engine from test pseudo-pattern',
+ 'getEngineForPattern returns a reference to the handlebars engine from test pseudo-pattern',
function (test) {
- var engine = patternEngines.getEngineForPattern(mustacheTestPseudoPattern);
+ var engine = patternEngines.getEngineForPattern(
+ handlebarsTestPseudoPattern
+ );
test.equal(engine, patternEngines.hbs);
test.end();
}
@@ -189,10 +193,10 @@ function testProps(object, propTests, test) {
}
tap.test(
- 'patternEngines object contains at least the default mustache engine',
+ 'patternEngines object contains at least the default handlebars engine',
function (test) {
test.plan(1);
- test.ok(patternEngines.hasOwnProperty('mustache'));
+ test.ok(patternEngines.hasOwnProperty('handlebars'));
test.end();
}
);
diff --git a/packages/core/test/util/patternlab-config.json b/packages/core/test/util/patternlab-config.json
index a530b1f74..335688e69 100644
--- a/packages/core/test/util/patternlab-config.json
+++ b/packages/core/test/util/patternlab-config.json
@@ -56,7 +56,7 @@
"patternStates": {},
"patternExportPatternPartials": [],
"patternExportDirectory": "./pattern_exports/",
- "patternExtension": "mustache",
+ "patternExtension": "hbs",
"patternMergeVariantArrays": true,
"renderFlatPatternsOnViewAllPages": false,
"cacheBust": true,
diff --git a/packages/development-edition-engine-react/patternlab-config.json b/packages/development-edition-engine-react/patternlab-config.json
index 4a46205c7..cdd574627 100644
--- a/packages/development-edition-engine-react/patternlab-config.json
+++ b/packages/development-edition-engine-react/patternlab-config.json
@@ -68,7 +68,7 @@
"css" : "./public/css"
}
},
- "patternExtension": "mustache",
+ "patternExtension": "hbs",
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportAll": false,
"patternExportPreserveDirectoryStructure": false,
diff --git a/packages/docs/src/docs/advanced-config-options.md b/packages/docs/src/docs/advanced-config-options.md
index fd1ed081d..4c9d00e6c 100644
--- a/packages/docs/src/docs/advanced-config-options.md
+++ b/packages/docs/src/docs/advanced-config-options.md
@@ -178,7 +178,7 @@ Sets the configurable source and public directories for files Pattern Lab Node o
Sets the panel name and language for the code tab on the styleguide. Since this only accepts one value, this is a place where mixed pattern trees (different PatternEngines in the same instance of Pattern Lab) does not quite work.
-**default**: `mustache`
+**default**: `hbs`
## patternStateCascade
diff --git a/packages/docs/src/docs/advanced-ecosystem-overview.md b/packages/docs/src/docs/advanced-ecosystem-overview.md
index 7e47e454d..32e2963d5 100644
--- a/packages/docs/src/docs/advanced-ecosystem-overview.md
+++ b/packages/docs/src/docs/advanced-ecosystem-overview.md
@@ -44,7 +44,7 @@ UIKits are the front-end of Pattern Lab. We call this “The Viewer.” UIKits a
### PatternEngines
-PatternEngines are the templating engines that are responsible for parsing patterns and turning them into HTML. PatternEngines give Pattern Lab Core the flexibility to render many different types of template languages. Current PatternEngines include Mustache and Twig, with others like Handlebars and Underscore in development. And there’s no stopping you from adding another templating engine to Pattern Lab.
+PatternEngines are the templating engines that are responsible for parsing patterns and turning them into HTML. PatternEngines give Pattern Lab Core the flexibility to render many different types of template languages. Current PatternEngines include Handlebars and Twig, with others like React and Underscore in development. And there’s nothing stopping you from adding another templating engine to Pattern Lab.
### Plugins
diff --git a/packages/docs/src/docs/advanced-keyboard-shortcuts.md b/packages/docs/src/docs/advanced-keyboard-shortcuts.md
index e2fddd3c1..b05e5d46e 100644
--- a/packages/docs/src/docs/advanced-keyboard-shortcuts.md
+++ b/packages/docs/src/docs/advanced-keyboard-shortcuts.md
@@ -28,7 +28,7 @@ Modifying the views:
- **ctrl+shift+a**: open/close info panels
- **ctrl+shift+c**: open/close info panels
- **cmd+a/ctrl+a**: select the content of the current open tab in code view
-- **ctrl+shift+u**: make the Mustache tab active
+- **ctrl+shift+u**: make the Handlebars tab active
- **ctrl+shift+y**: make the HTML tab active
- **esc**: close the open view
diff --git a/packages/docs/src/docs/advanced-starterkits.md b/packages/docs/src/docs/advanced-starterkits.md
index 87777da66..6059f24bc 100644
--- a/packages/docs/src/docs/advanced-starterkits.md
+++ b/packages/docs/src/docs/advanced-starterkits.md
@@ -44,8 +44,8 @@ where [starterkit-name] is the name of the Starterkit.
so... a complete example:
```
-npm install @pattern-lab/starterkit-mustache-demo
-gulp patternlab:loadstarterkit --kit=@pattern-lab/starterkit-mustache-demo
+npm install @pattern-lab/starterkit-handlebars-demo
+gulp patternlab:loadstarterkit --kit=@pattern-lab/starterkit-handlebars-demo
```
The [Pattern Lab Node CLI](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli) will also support installation of Starterkits should you not be using gulp.
diff --git a/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md b/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md
index 0ad36ebe3..3845a6221 100644
--- a/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md
+++ b/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md
@@ -10,9 +10,9 @@ eleventyNavigation:
sitemapPriority: '0.8'
---
-By default Pattern Lab uses the Mustache template language, extended with [pattern parameters](/docs/using-pattern-parameters/). PatternEngines let you add support for a template language of your personal choice. Each PatternEngine has it's own set of features and caveats.
+By default Pattern Lab uses the Handlebars template language, that uses template specific functionality like [partial parameters](https://handlebarsjs.com/guide/partials.html#partial-parameters) (whereas e.g. Mustache previously got an extension with [pattern parameters](/docs/using-pattern-parameters/#heading-the-pattern-parameter-syntax)). PatternEngines let you add support for a template language of your personal choice. Each PatternEngine has it's own set of features and caveats.
-Right now the most mature PatternEngines are Handlebars, Mustache and Twig.
+Right now the most mature PatternEngines are Handlebars and Twig.
## Official PatternEngines for Node
diff --git a/packages/docs/src/docs/data-json-mustache.md b/packages/docs/src/docs/data-json-mustache.md
index 1e6b5689f..223e15faa 100644
--- a/packages/docs/src/docs/data-json-mustache.md
+++ b/packages/docs/src/docs/data-json-mustache.md
@@ -1,16 +1,16 @@
---
-title: Introduction to JSON & Mustache Variables
+title: Introduction to JSON & Handlebars Variables
tags:
- docs
category: data
eleventyNavigation:
- title: Introduction to JSON & Mustache Variables
+ title: Introduction to JSON & Handlebars Variables
key: data
order: 300
sitemapPriority: '0.8'
---
-> This documentation is provided as a simple introduction to using one of the supported data types and one of the supported PatternEngines. The best reference for this topic is the [Mustache documentation](https://mustache.github.io/mustache.5.html) but this should provide a good beginner's primer.
+> This documentation is provided as a simple introduction to using one of the supported data types and one of the supported PatternEngines. The best reference for this topic is the [Handlebars documentation](https://handlebarsjs.com/contributing/interactive-examples.html#embedding-parts-of-an-example) but this should provide a good beginner's primer.
## Simple Variables
@@ -20,13 +20,13 @@ At its core JSON is a simple key-value store. This means that any piece of data
"src": "../../images/fpo_avatar.png"
```
-In this case the key is `src` and the value is `../../images/fpo_avatar.png`. Let's look at how we might reference this data in a pattern template. Mustache variables are denoted by the double-curly braces (or mustaches).
+In this case the key is `src` and the value is `../../images/fpo_avatar.png`. Let's look at how we might reference this data in a pattern template. Handlebars variables are denoted by the double-curly braces (or mustaches).
```html
```
-The Mustache variable is `{% raw %}{{ src }}{% endraw %}`. Note that `src` matches the name of the key in our JSON example. When the Node version of Pattern Lab compile this template the end result will be:
+The Handlebars variable is `{% raw %}{{ src }}{% endraw %}`. Note that `src` matches the name of the key in our JSON example. When the Node version of Pattern Lab compile this template the end result will be:
```html
@@ -36,7 +36,7 @@ Note that `{% raw %}{{ src }}{% endraw %}` was replaced by the value for `src` f
## Nested Variables
-We may want our JSON file to be a little more organized and our Mustache variable names to be a little more descriptive. For example, maybe we have multiple image sizes that we want to provide image sources for. We might organize our JSON key-values this way:
+We may want our JSON file to be a little more organized and our Handlebars variable names to be a little more descriptive. For example, maybe we have multiple image sizes that we want to provide image sources for. We might organize our JSON key-values this way:
```javascript
"square": {
@@ -74,13 +74,13 @@ This nesting makes it easier to read how the attributes are organized in our pat
## Rendering HTML in Variables
-You may want to include HTML in your variables. By default, Mustache will convert HTML mark-up to their HTML entity equivalents. For example, our JSON may look like:
+You may want to include HTML in your variables. By default, Handlebars will convert HTML mark-up to their HTML entity equivalents. For example, our JSON may look like:
```javascript
"lyrics": "Just good ol' boys, wouldn't change if they could, fightin' the system like a true modern day Robin Hood."
```
-Based on our previous Mustache examples you would probably write out your template like so:
+Based on our previous Handlebars examples you would probably write out your template like so:
```html
TV Show Lyrics
diff --git a/packages/docs/src/docs/data-overview.md b/packages/docs/src/docs/data-overview.md
index c4d0a0a38..6e44f9f2e 100644
--- a/packages/docs/src/docs/data-overview.md
+++ b/packages/docs/src/docs/data-overview.md
@@ -24,7 +24,7 @@ There are three places to store data in Pattern Lab:
- in [pattern-specific](/docs/creating-pattern-specific-values/) files in `./source/_patterns`.
- in [pseudo-pattern](/docs/using-pseudo-patterns/) files in `./source/_patterns`.
-### A Special Note About Pattern Parameters
+### A Special Note About Pattern Parameters (Mustache engine)
[Pattern parameters](/docs/using-pattern-parameters/) are a simple find and replace of variables in the included pattern. As such they do not affect the context stack of Mustache and we don't consider them true data. They have no impact on overall data inheritance and they cannot be used any deeper than the included pattern. They are a hack.
diff --git a/packages/docs/src/docs/pattern-add-new.md b/packages/docs/src/docs/pattern-add-new.md
index b2ed7db41..6cc2a2545 100644
--- a/packages/docs/src/docs/pattern-add-new.md
+++ b/packages/docs/src/docs/pattern-add-new.md
@@ -11,7 +11,7 @@ sitemapPriority: '0.8'
sitemapChangefreq: 'monthly'
---
-To add new patterns to the Node version of Pattern Lab just add new Mustache templates under the appropriate pattern type or pattern subgroup directories in `./source/_patterns`. For example, let's add a new pattern under the pattern type "molecules" and the pattern sub-type "blocks". The `./source/_patterns/molecules/blocks/` directory looks like:
+To add new patterns to the Node version of Pattern Lab just add new Handlebars templates under the appropriate pattern type or pattern subgroup directories in `./source/_patterns`. For example, let's add a new pattern under the pattern type "molecules" and the pattern sub-type "blocks". The `./source/_patterns/molecules/blocks/` directory looks like:
block-hero.hbs
headline-byline.hbs
diff --git a/packages/docs/src/docs/pattern-including.md b/packages/docs/src/docs/pattern-including.md
index 781e0f277..20c2d5722 100644
--- a/packages/docs/src/docs/pattern-including.md
+++ b/packages/docs/src/docs/pattern-including.md
@@ -14,7 +14,7 @@ sitemapChangefreq: 'monthly'
To include one pattern within another, for example to create a molecule from several atoms, you can either use:
- a shorthand include syntax or
-- the default include syntax for the template language you're using (e.g. Mustache, Twig, Handlebars).
+- the default include syntax for the template language you're using (e.g. Handlebars, Twig).
## The Shorthand Include Syntax
@@ -35,7 +35,7 @@ The pattern type matches the top-level folder and is `atoms`. The pattern name m
The following are examples of using the shorthand include syntax with our supported PatternEngines:
```
-{% raw %}{{> atoms-landscape-16x9 }} // Mustache{% endraw %}
+{% raw %}{{> atoms-landscape-16x9 }} // Handlebars{% endraw %}
{% raw %}{% include "atoms-landscape-16x9" %} // Twig{% endraw %}
```
@@ -50,11 +50,11 @@ _Warning:_ Because subgroups are not included in the shorthand include syntax a
## The Default Include Syntax
-If you need more specificity when including patterns the Node version of Pattern Lab also support the include syntax for the template language that you're using. For example, the syntax for Mustache is the path to the pattern minus the `.hbs` extension. Let's say we wanted to include the following pattern in a molecule:
+If you need more specificity when including patterns the Node version of Pattern Lab also support the include syntax for the template language that you're using. For example, the syntax for Handlebars is the path to the pattern minus the `.hbs` extension. Let's say we wanted to include the following pattern in a molecule:
atoms/images/landscape-16x9.hbs
-The default Mustache include syntax would be:
+The default Handlebars include syntax would be:
```handlebars
{% raw %}{{> atoms/images/landscape-16x9 }}{% endraw %}
@@ -75,6 +75,6 @@ atoms/global/test-with-picture.hbs
{{> atoms-test }} // will match atoms/global/test.hbs
{{> atoms-test-with-picture }} // will match atoms/global/test-with-picture.hbs
-// using the default mustache partials syntax
+// using the default handlebars partials syntax
{{> atoms/global/test }} // will match atoms/global/test.hbs{% endraw %}
```
diff --git a/packages/docs/src/docs/pattern-organization.md b/packages/docs/src/docs/pattern-organization.md
index de0deb982..b6e8df5ca 100644
--- a/packages/docs/src/docs/pattern-organization.md
+++ b/packages/docs/src/docs/pattern-organization.md
@@ -26,7 +26,7 @@ Here are the parts:
- `patternName` is the name of the pattern. This is used when the pattern is displayed in the drop downs in Pattern Lab.
- `patternExtension` is the file extension that tells the PatternEngine to render the pattern. For example, `.hbs`.
-Dashes (`-`) in your pattern types, pattern subgroups or pattern names will be replaced with spaces. For example, if you want a pattern to be displayed in the drop-down as "Hamburger Navigation" and you're using the Mustache PatternEngine you should name it `hamburger-navigation.hbs`.
+Dashes (`-`) in your pattern types, pattern subgroups or pattern names will be replaced with spaces. For example, if you want a pattern to be displayed in the drop-down as "Hamburger Navigation" and you're using the Handlebars PatternEngine you should name it `hamburger-navigation.hbs`.
## Pattern Type Naming Conventions
diff --git a/packages/docs/src/docs/pattern-parameters.md b/packages/docs/src/docs/pattern-parameters.md
index 5b040e926..65b4ca684 100644
--- a/packages/docs/src/docs/pattern-parameters.md
+++ b/packages/docs/src/docs/pattern-parameters.md
@@ -11,6 +11,8 @@ sitemapPriority: '0.8'
sitemapChangefreq: 'monthly'
---
+## Mustache
+
**Important:** Pattern parameters are supported by the Node Mustache PatternEngines. Other template languages provide better solutions to this problem.
Pattern parameters are a **simple** mechanism for replacing Mustache variables in an included pattern. They are limited to replacing variables in the included pattern and **only** the included pattern. They are especially useful when including a single pattern multiple times in a molecule, template, or page and you want to supply unique data to that pattern each time it's included. Pattern parameters **do not** currently support the following:
@@ -25,7 +27,7 @@ Pattern parameters are Pattern Lab-specific, have no relationship to Mustache, a
- [Adding Pattern Parameters to Your Pattern Partial](#adding-pattern-parameters)
- [Toggling Sections with Pattern Parameters](#toggling-sections)
-## The Pattern Parameter Syntax
+### The Pattern Parameter Syntax
The attributes listed in the pattern parameters need to match Mustache variable names in your pattern. The values listed for each attribute will replace the Mustache variables. For example:
@@ -33,7 +35,7 @@ The attributes listed in the pattern parameters need to match Mustache variable
Again, pattern parameters are a simple find and replace of Mustache variables with the supplied values.
-## Adding Pattern Parameters to Your Pattern Partial
+### Adding Pattern Parameters to Your Pattern Partial
Let's look at a simple example for how we might use pattern parameters. First we'll set-up a pattern that might be included multiple times. We'll make it a simple "message" pattern with a single Mustache variable of `message`.
@@ -73,7 +75,7 @@ Instead we can use pattern parameters to supply unique messages for each instanc
Now each pattern would have its very own message.
-## Toggling Sections with Pattern Parameters
+### Toggling Sections with Pattern Parameters
While pattern parameters are not a one-to-one match for Mustache they do offer the ability to toggle sections of content. For example we might have the following in a generic header pattern called `organisms-header`:
diff --git a/packages/docs/src/docs/pattern-pseudo-patterns.md b/packages/docs/src/docs/pattern-pseudo-patterns.md
index 460130b38..9cf7a4dc6 100644
--- a/packages/docs/src/docs/pattern-pseudo-patterns.md
+++ b/packages/docs/src/docs/pattern-pseudo-patterns.md
@@ -33,7 +33,7 @@ From a navigation and naming perspective `patternName` and `pseudoPatternName` w
## Adding Pseudo-Patterns to Your Project
-Adding a pseudo-pattern is as simple as naming it correctly and following the [pattern-specific JSON file](/docs/creating-pattern-specific-values/) instructions for organizing its content. Let's look at a simple example where we want to show an emergency notification on our homepage Mustache template. Our `templates/` directory might look like this:
+Adding a pseudo-pattern is as simple as naming it correctly and following the [pattern-specific JSON file](/docs/creating-pattern-specific-values/) instructions for organizing its content. Let's look at a simple example where we want to show an emergency notification on our homepage Handlebars template. Our `templates/` directory might look like this:
article.hbs
blog.hbs
diff --git a/packages/edition-node-gulp/README.md b/packages/edition-node-gulp/README.md
index 4769ff0ea..044b6e604 100644
--- a/packages/edition-node-gulp/README.md
+++ b/packages/edition-node-gulp/README.md
@@ -14,7 +14,7 @@ The Gulp wrapper around [Pattern Lab Node Core](https://github.com/pattern-lab/p
This Edition comes with the following components:
* `@pattern-lab/core`: [GitHub](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core) | [npm](https://www.npmjs.com/package/@pattern-lab/core)
-* `@pattern-lab/engine-mustache`: [GitHub](https://github.com/pattern-lab/patternlab-node/tree/master/packages/engine-mustache) | [npm](https://www.npmjs.com/package/@pattern-lab/engine-mustache)
+* `@pattern-lab/engine-handlebars`: [GitHub](https://github.com/pattern-lab/patternlab-node/tree/master/packages/engine-handlebars) | [npm](https://www.npmjs.com/package/@pattern-lab/engine-handlebars)
* `@pattern-lab/uikit-workshop`: [GitHub](https://github.com/pattern-lab/patternlab-node/tree/master/packages/uikit-workshop) | [npm](https://www.npmjs.com/package/@pattern-lab/uikit-workshop)
## Prerequisites
diff --git a/packages/edition-node-gulp/patternlab-config.json b/packages/edition-node-gulp/patternlab-config.json
index fb880183e..5f05f60ed 100644
--- a/packages/edition-node-gulp/patternlab-config.json
+++ b/packages/edition-node-gulp/patternlab-config.json
@@ -68,7 +68,7 @@
"css": "public/css"
}
},
- "patternExtension": "mustache",
+ "patternExtension": "hbs",
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportAll": false,
"patternExportDirectory": "pattern_exports",
diff --git a/yarn.lock b/yarn.lock
index e8504f439..5a8e14387 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2031,6 +2031,11 @@
dependencies:
"@octokit/openapi-types" "^11.2.0"
+"@pattern-lab/starterkit-handlebars-vanilla@1.4.3":
+ version "1.4.3"
+ resolved "https://registry.yarnpkg.com/@pattern-lab/starterkit-handlebars-vanilla/-/starterkit-handlebars-vanilla-1.4.3.tgz#28aef5bbf7d99faf83e244b619cb2a04e0411ef8"
+ integrity sha512-s+V1s1SXaOdfN+7eNPwZjFjrQb5eUuIb0TGU6Lp3dsfr+1neUn2qfWzhYhKqagxCmNZLnPMr78kliRx3dbG5Qg==
+
"@reach/visually-hidden@^0.1.2":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@reach/visually-hidden/-/visually-hidden-0.1.4.tgz#0dc4ecedf523004337214187db70a46183bd945b"
From e6fb9cd6a85a7adf7e3ffa6755a24d3dc1dab597 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Mon, 26 Dec 2022 01:49:41 +0100
Subject: [PATCH 10/30] chore: adapted structure out of newer uikit
---
.../src/docs/advanced-keyboard-shortcuts.md | 2 +-
.../docs/src/docs/editing-source-files.md | 46 +++++++++++--------
.../docs/src/docs/pattern-managing-assets.md | 46 +++++++++++--------
3 files changed, 53 insertions(+), 41 deletions(-)
diff --git a/packages/docs/src/docs/advanced-keyboard-shortcuts.md b/packages/docs/src/docs/advanced-keyboard-shortcuts.md
index b05e5d46e..454a638e0 100644
--- a/packages/docs/src/docs/advanced-keyboard-shortcuts.md
+++ b/packages/docs/src/docs/advanced-keyboard-shortcuts.md
@@ -10,7 +10,7 @@ eleventyNavigation:
sitemapPriority: '0.8'
---
-> **Note:** This feature is currently disabled. It will be back in a future release of `styleguidekit-assets-default`.
+> **Note:** This feature is currently disabled. It will be back in a future release of `uikit-workshop`.
Pattern Lab comes with support for a number of special keyboard shortcuts to make using Pattern Lab easier. These are broken up by where they work or are most useful.
diff --git a/packages/docs/src/docs/editing-source-files.md b/packages/docs/src/docs/editing-source-files.md
index a4755fc6f..1fb5012c6 100644
--- a/packages/docs/src/docs/editing-source-files.md
+++ b/packages/docs/src/docs/editing-source-files.md
@@ -51,28 +51,34 @@ In the Node version of Pattern Lab you can modify the following configuration op
```javascript
"paths" : {
"source" : {
- "root": "./source/",
- "patterns" : "./source/_patterns/",
- "data" : "./source/_data/",
- "meta": "./source/_meta/",
- "annotations" : "./source/_annotations/",
- "styleguide" : "./node_modules/styleguidekit-assets-default/dist/",
- "patternlabFiles" : "./node_modules/styleguidekit-mustache-default/views/",
- "js" : "./source/js",
- "images" : "./source/images",
- "fonts" : "./source/fonts",
- "css" : "./source/css/"
+ "root": "source/",
+ "patterns" : "source/_patterns/",
+ "data" : "source/_data/",
+ "meta": "source/_meta/",
+ "annotations" : "source/_annotations/",
+ "styleguide" : "dist/",
+ "patternlabFiles": {
+ "general-header": "views/partials/general-header.hbs",
+ "general-footer": "views/partials/general-footer.hbs",
+ "patternSection": "views/partials/patternSection.hbs",
+ "patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
+ "viewall": "views/viewall.hbs"
+ },
+ "js" : "source/js",
+ "images" : "source/images",
+ "fonts" : "source/fonts",
+ "css" : "source/css"
},
"public" : {
- "root" : "./public/",
- "patterns" : "./public/patterns/",
- "data" : "./public/styleguide/data/",
- "annotations" : "./public/annotations/",
- "styleguide" : "./public/styleguide/",
- "js" : "./public/js",
- "images" : "./public/images",
- "fonts" : "./public/fonts",
- "css" : "./public/css"
+ "root" : "public/",
+ "patterns" : "public/patterns/",
+ "data" : "public/styleguide/data/",
+ "annotations" : "public/annotations/",
+ "styleguide" : "public/styleguide/",
+ "js" : "public/js",
+ "images" : "public/images",
+ "fonts" : "public/fonts",
+ "css" : "public/css"
}
}
```
diff --git a/packages/docs/src/docs/pattern-managing-assets.md b/packages/docs/src/docs/pattern-managing-assets.md
index fd8c24161..fce6258d0 100644
--- a/packages/docs/src/docs/pattern-managing-assets.md
+++ b/packages/docs/src/docs/pattern-managing-assets.md
@@ -24,28 +24,34 @@ Pattern Lab has a configuration object which allows users to separate source pat
```javascript
"paths" : {
"source" : {
- "root": "./source/",
- "patterns" : "./source/_patterns/",
- "data" : "./source/_data/",
- "meta": "./source/_meta/",
- "annotations" : "./source/_annotations/",
- "styleguide" : "./node_modules/styleguidekit-assets-default/dist/",
- "patternlabFiles" : "./node_modules/styleguidekit-mustache-default/views/",
- "js" : "./source/js",
- "images" : "./source/images",
- "fonts" : "./source/fonts",
- "css" : "./source/css/"
+ "root": "source/",
+ "patterns" : "source/_patterns/",
+ "data" : "source/_data/",
+ "meta": "source/_meta/",
+ "annotations" : "source/_annotations/",
+ "styleguide" : "dist/",
+ "patternlabFiles": {
+ "general-header": "views/partials/general-header.hbs",
+ "general-footer": "views/partials/general-footer.hbs",
+ "patternSection": "views/partials/patternSection.hbs",
+ "patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
+ "viewall": "views/viewall.hbs"
+ },
+ "js" : "source/js",
+ "images" : "source/images",
+ "fonts" : "source/fonts",
+ "css" : "source/css/"
},
"public" : {
- "root" : "./public/",
- "patterns" : "./public/patterns/",
- "data" : "./public/styleguide/data/",
- "annotations" : "./public/annotations/",
- "styleguide" : "./public/styleguide/",
- "js" : "./public/js",
- "images" : "./public/images",
- "fonts" : "./public/fonts",
- "css" : "./public/css"
+ "root" : "public/",
+ "patterns" : "public/patterns/",
+ "data" : "public/styleguide/data/",
+ "annotations" : "public/annotations/",
+ "styleguide" : "public/styleguide/",
+ "js" : "public/js",
+ "images" : "public/images",
+ "fonts" : "public/fonts",
+ "css" : "public/css"
}
}
```
From 98ce349fed6859c37bfb9640b27330f67b2b05d0 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 01:07:11 +0100
Subject: [PATCH 11/30] fix: incorrect path
---
packages/cli/test/fixtures/patternlab-config.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/cli/test/fixtures/patternlab-config.json b/packages/cli/test/fixtures/patternlab-config.json
index 07c806145..562cd23b4 100644
--- a/packages/cli/test/fixtures/patternlab-config.json
+++ b/packages/cli/test/fixtures/patternlab-config.json
@@ -49,7 +49,7 @@
"patternSectionSubgroup":
"node_modules/@pattern-lab/uikit-workshop/views/partials/patternSectionSubgroup.hbs",
"viewall":
- "node_modules/@pattern-lab/uikit-workshop/viewall.hbs"
+ "node_modules/@pattern-lab/uikit-workshop/views/viewall.hbs"
},
"js": "./test/fixtures/source/js",
"images": "./test/fixtures/source/images",
From 04a7c957729d4c8fbda5bbbeb53d53c002920499 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 01:07:38 +0100
Subject: [PATCH 12/30] fix: incorrect path
---
packages/core/patternlab-config.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/core/patternlab-config.json b/packages/core/patternlab-config.json
index b09e76529..0232690ec 100644
--- a/packages/core/patternlab-config.json
+++ b/packages/core/patternlab-config.json
@@ -49,7 +49,7 @@
"patternSectionSubgroup":
"views/partials/patternSectionSubgroup.hbs",
"viewall":
- "viewall.hbs"
+ "views/viewall.hbs"
},
"js": "./source/js",
"images": "./source/images",
From 65b4690b7127db0f0f96f6291fe1ab01d30a24a6 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 01:08:23 +0100
Subject: [PATCH 13/30] fix: incorrect path
---
packages/core/test/util/patternlab-config.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/core/test/util/patternlab-config.json b/packages/core/test/util/patternlab-config.json
index 31b1dce94..a530b1f74 100644
--- a/packages/core/test/util/patternlab-config.json
+++ b/packages/core/test/util/patternlab-config.json
@@ -12,7 +12,7 @@
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup":
"views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "./test/files/js",
"images": "./test/files/images",
From 74a3cada0cad52ad3e74da9f91613b4f44283adb Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 01:10:36 +0100
Subject: [PATCH 14/30] fix: incorrect path
---
.../patternlab-config.json | 2 +-
packages/development-edition-engine-twig/patternlab-config.json | 2 +-
packages/edition-twig/patternlab-config.json | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/development-edition-engine-handlebars/patternlab-config.json b/packages/development-edition-engine-handlebars/patternlab-config.json
index d547ea28d..bc866c8ac 100644
--- a/packages/development-edition-engine-handlebars/patternlab-config.json
+++ b/packages/development-edition-engine-handlebars/patternlab-config.json
@@ -53,7 +53,7 @@
"general-footer": "views/partials/general-footer.hbs",
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "source/js",
"images": "source/images",
diff --git a/packages/development-edition-engine-twig/patternlab-config.json b/packages/development-edition-engine-twig/patternlab-config.json
index 7a472d6b7..dcea6cb55 100644
--- a/packages/development-edition-engine-twig/patternlab-config.json
+++ b/packages/development-edition-engine-twig/patternlab-config.json
@@ -53,7 +53,7 @@
"general-footer": "views/partials/general-footer.hbs",
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "source/js",
"images": "source/images",
diff --git a/packages/edition-twig/patternlab-config.json b/packages/edition-twig/patternlab-config.json
index a422597d3..888418f98 100644
--- a/packages/edition-twig/patternlab-config.json
+++ b/packages/edition-twig/patternlab-config.json
@@ -109,7 +109,7 @@
"general-footer": "views/partials/general-footer.hbs",
"patternSection": "views/partials/patternSection.hbs",
"patternSectionSubgroup": "views/partials/patternSectionSubgroup.hbs",
- "viewall": "viewall.hbs"
+ "viewall": "views/viewall.hbs"
},
"js": "./source/js",
"images": "./source/images",
From 7f9fd5a8e6c1dcc9d440228e0161058526541e95 Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 21:01:14 +0100
Subject: [PATCH 15/30] chore(CI/CD): let's not install mustache engine anymore
---
.github/workflows/continuous-integration.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 648d89c97..e67af19f9 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -17,7 +17,6 @@ jobs:
- name: Setup the project
run: |
yarn run setup
- npx lerna add @pattern-lab/engine-mustache --scope=@pattern-lab/core
npx lerna add @pattern-lab/engine-handlebars --scope=@pattern-lab/core
npx lerna add @pattern-lab/engine-underscore --scope=@pattern-lab/core
npx lerna add @pattern-lab/engine-liquid --scope=@pattern-lab/core
From fe8329cb53214a65d275c8839704ea9239686666 Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 21:01:49 +0100
Subject: [PATCH 16/30] refactor: need to switch to the handlebars engine
---
packages/core/package.json | 2 +-
packages/development-edition-engine-handlebars/package.json | 1 -
packages/uikit-workshop/package.json | 1 -
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/packages/core/package.json b/packages/core/package.json
index 77c464c65..e0aa18040 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -4,7 +4,7 @@
"version": "5.17.0",
"main": "./src/index.js",
"dependencies": {
- "@pattern-lab/engine-mustache": "^5.16.4",
+ "@pattern-lab/engine-handlebars": "^5.16.4",
"@pattern-lab/live-server": "^5.16.1",
"chalk": "4.1.0",
"chokidar": "3.5.1",
diff --git a/packages/development-edition-engine-handlebars/package.json b/packages/development-edition-engine-handlebars/package.json
index 2240f0285..1689789d2 100644
--- a/packages/development-edition-engine-handlebars/package.json
+++ b/packages/development-edition-engine-handlebars/package.json
@@ -32,7 +32,6 @@
"@pattern-lab/cli": "^5.17.0",
"@pattern-lab/core": "^5.17.0",
"@pattern-lab/engine-handlebars": "^5.16.4",
- "@pattern-lab/engine-mustache": "^5.16.4",
"@pattern-lab/plugin-tab": "^5.16.1",
"@pattern-lab/starterkit-handlebars-demo": "^5.16.4",
"@pattern-lab/uikit-workshop": "^5.17.0"
diff --git a/packages/uikit-workshop/package.json b/packages/uikit-workshop/package.json
index 677eac4a8..538ce2406 100644
--- a/packages/uikit-workshop/package.json
+++ b/packages/uikit-workshop/package.json
@@ -44,7 +44,6 @@
"@babel/runtime": "^7.13.10",
"@pattern-lab/core": "^5.17.0",
"@pattern-lab/engine-handlebars": "^5.16.4",
- "@pattern-lab/engine-mustache": "^5.16.4",
"@pattern-lab/uikit-polyfills": "^5.16.1",
"@reach/visually-hidden": "^0.1.2",
"@webcomponents/custom-elements": "^1.4.3",
From 4835d3b8cbb15993d93b1936139e64ec19e8f8e5 Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 21:03:19 +0100
Subject: [PATCH 17/30] refactor: switched to hbs fileextension in
configurations
---
packages/core/patternlab-config.json | 2 +-
packages/core/test/util/patternlab-config.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/core/patternlab-config.json b/packages/core/patternlab-config.json
index 759848f39..3904633ec 100644
--- a/packages/core/patternlab-config.json
+++ b/packages/core/patternlab-config.json
@@ -68,7 +68,7 @@
"css": "public/css"
}
},
- "patternExtension": "mustache",
+ "patternExtension": "hbs",
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportAll": false,
"patternExportDirectory": "pattern_exports",
diff --git a/packages/core/test/util/patternlab-config.json b/packages/core/test/util/patternlab-config.json
index 8bb158c86..6530433da 100644
--- a/packages/core/test/util/patternlab-config.json
+++ b/packages/core/test/util/patternlab-config.json
@@ -56,7 +56,7 @@
"patternStates": {},
"patternExportPatternPartials": [],
"patternExportDirectory": "./pattern_exports/",
- "patternExtension": "mustache",
+ "patternExtension": "hbs",
"patternMergeVariantArrays": true,
"renderFlatPatternsOnViewAllPages": false,
"cacheBust": true,
From c78ebc6bd527b81a5b23a081b293ea70d2bae92c Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 21:04:18 +0100
Subject: [PATCH 18/30] refactor: switching from mustache engine to handlebars
---
packages/core/src/lib/pattern_engines.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/core/src/lib/pattern_engines.js b/packages/core/src/lib/pattern_engines.js
index a719d5f22..8eb6aade5 100644
--- a/packages/core/src/lib/pattern_engines.js
+++ b/packages/core/src/lib/pattern_engines.js
@@ -83,7 +83,7 @@ function findEnginesInConfig(config) {
// any loaded PatternEngine by addressing them like this:
//
// var PatternEngines = require('./pattern_engines/pattern_engines');
-// var Mustache = PatternEngines['mustache'];
+// var Handlebars = PatternEngines['handlebars'];
//
// Object.create lets us create an object with a specified prototype. We want
// this here because we would like the object's "own properties" to include
@@ -239,9 +239,9 @@ const PatternEngines = Object.create({
}
}
- // otherwise, assume it's a plain mustache template string and act
+ // otherwise, assume it's a plain handlebars template string and act
// accordingly
- return 'mustache';
+ return 'handlebars';
},
/**
From 30be5bcdc07962876a532f9db5ce1affcde3063d Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 21:05:09 +0100
Subject: [PATCH 19/30] refactor(docs): switching from mustache to handlebars
---
packages/docs/src/docs/advanced-config-options.md | 2 +-
packages/docs/src/docs/advanced-ecosystem-overview.md | 2 +-
packages/docs/src/docs/advanced-keyboard-shortcuts.md | 2 +-
packages/docs/src/docs/advanced-starterkits.md | 4 ++--
.../docs/advanced-template-language-and-pattern-engines.md | 4 ++--
packages/docs/src/docs/pattern-pseudo-patterns.md | 2 +-
packages/starterkit-twig-demo/README.md | 2 +-
7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/packages/docs/src/docs/advanced-config-options.md b/packages/docs/src/docs/advanced-config-options.md
index 14be82c7c..c770ddb4e 100644
--- a/packages/docs/src/docs/advanced-config-options.md
+++ b/packages/docs/src/docs/advanced-config-options.md
@@ -178,7 +178,7 @@ Sets the configurable source and public directories for files Pattern Lab Node o
Sets the panel name and language for the code tab on the styleguide. Since this only accepts one value, this is a place where mixed pattern trees (different PatternEngines in the same instance of Pattern Lab) does not quite work.
-**default**: `mustache`
+**default**: `hbs`
## engines
diff --git a/packages/docs/src/docs/advanced-ecosystem-overview.md b/packages/docs/src/docs/advanced-ecosystem-overview.md
index 63ae2a860..1eceb3acc 100644
--- a/packages/docs/src/docs/advanced-ecosystem-overview.md
+++ b/packages/docs/src/docs/advanced-ecosystem-overview.md
@@ -44,7 +44,7 @@ UIKits are the front-end of Pattern Lab. We call this “The Viewer.” UIKits a
### PatternEngines
-PatternEngines are the templating engines that are responsible for parsing patterns and turning them into HTML. PatternEngines give Pattern Lab Core the flexibility to render many different types of template languages. Current PatternEngines include Mustache and Twig, with others like Handlebars and Underscore in development. And there’s no stopping you from adding another templating engine to Pattern Lab.
+PatternEngines are the templating engines that are responsible for parsing patterns and turning them into HTML. PatternEngines give Pattern Lab Core the flexibility to render many different types of template languages. Current PatternEngines include Handlebars and Twig, with others like React and Underscore in development. And there’s no stopping you from adding another templating engine to Pattern Lab.
### Plugins
diff --git a/packages/docs/src/docs/advanced-keyboard-shortcuts.md b/packages/docs/src/docs/advanced-keyboard-shortcuts.md
index e2fddd3c1..b05e5d46e 100644
--- a/packages/docs/src/docs/advanced-keyboard-shortcuts.md
+++ b/packages/docs/src/docs/advanced-keyboard-shortcuts.md
@@ -28,7 +28,7 @@ Modifying the views:
- **ctrl+shift+a**: open/close info panels
- **ctrl+shift+c**: open/close info panels
- **cmd+a/ctrl+a**: select the content of the current open tab in code view
-- **ctrl+shift+u**: make the Mustache tab active
+- **ctrl+shift+u**: make the Handlebars tab active
- **ctrl+shift+y**: make the HTML tab active
- **esc**: close the open view
diff --git a/packages/docs/src/docs/advanced-starterkits.md b/packages/docs/src/docs/advanced-starterkits.md
index 87777da66..6059f24bc 100644
--- a/packages/docs/src/docs/advanced-starterkits.md
+++ b/packages/docs/src/docs/advanced-starterkits.md
@@ -44,8 +44,8 @@ where [starterkit-name] is the name of the Starterkit.
so... a complete example:
```
-npm install @pattern-lab/starterkit-mustache-demo
-gulp patternlab:loadstarterkit --kit=@pattern-lab/starterkit-mustache-demo
+npm install @pattern-lab/starterkit-handlebars-demo
+gulp patternlab:loadstarterkit --kit=@pattern-lab/starterkit-handlebars-demo
```
The [Pattern Lab Node CLI](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli) will also support installation of Starterkits should you not be using gulp.
diff --git a/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md b/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md
index 0ad36ebe3..2589e7371 100644
--- a/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md
+++ b/packages/docs/src/docs/advanced-template-language-and-pattern-engines.md
@@ -10,9 +10,9 @@ eleventyNavigation:
sitemapPriority: '0.8'
---
-By default Pattern Lab uses the Mustache template language, extended with [pattern parameters](/docs/using-pattern-parameters/). PatternEngines let you add support for a template language of your personal choice. Each PatternEngine has it's own set of features and caveats.
+By default Pattern Lab uses the Handlebars template language, extended with [pattern parameters](/docs/using-pattern-parameters/). PatternEngines let you add support for a template language of your personal choice. Each PatternEngine has it's own set of features and caveats.
-Right now the most mature PatternEngines are Handlebars, Mustache and Twig.
+Right now the most mature PatternEngines are Handlebars and Twig.
## Official PatternEngines for Node
diff --git a/packages/docs/src/docs/pattern-pseudo-patterns.md b/packages/docs/src/docs/pattern-pseudo-patterns.md
index 460130b38..9cf7a4dc6 100644
--- a/packages/docs/src/docs/pattern-pseudo-patterns.md
+++ b/packages/docs/src/docs/pattern-pseudo-patterns.md
@@ -33,7 +33,7 @@ From a navigation and naming perspective `patternName` and `pseudoPatternName` w
## Adding Pseudo-Patterns to Your Project
-Adding a pseudo-pattern is as simple as naming it correctly and following the [pattern-specific JSON file](/docs/creating-pattern-specific-values/) instructions for organizing its content. Let's look at a simple example where we want to show an emergency notification on our homepage Mustache template. Our `templates/` directory might look like this:
+Adding a pseudo-pattern is as simple as naming it correctly and following the [pattern-specific JSON file](/docs/creating-pattern-specific-values/) instructions for organizing its content. Let's look at a simple example where we want to show an emergency notification on our homepage Handlebars template. Our `templates/` directory might look like this:
article.hbs
blog.hbs
diff --git a/packages/starterkit-twig-demo/README.md b/packages/starterkit-twig-demo/README.md
index d2b215dd8..22507fabc 100755
--- a/packages/starterkit-twig-demo/README.md
+++ b/packages/starterkit-twig-demo/README.md
@@ -3,7 +3,7 @@
# Demo StarterKit for Twig
-The Demo StarterKit for Twig is meant to be used as a demo that highlights how to combine Twig and Pattern Lab. It is currently very thin. We're looking for maintainers who may be interested in making this demo the equal to if not better than the Mustache demo.
+The Demo StarterKit for Twig is meant to be used as a demo that highlights how to combine Twig and Pattern Lab. It is currently very thin. We're looking for maintainers who may be interested in making this demo the equal to if not better than the Handlebars demo.
## Requirements
From 2c318bdf3428e67bd97a465b9d63999590ac0cd8 Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 21:05:25 +0100
Subject: [PATCH 20/30] test: switching from mustache to handlebars
---
packages/core/test/pattern_engines_tests.js | 44 +++++++++++----------
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/packages/core/test/pattern_engines_tests.js b/packages/core/test/pattern_engines_tests.js
index 38cf43677..d9f70169f 100644
--- a/packages/core/test/pattern_engines_tests.js
+++ b/packages/core/test/pattern_engines_tests.js
@@ -8,71 +8,75 @@ var config = require('./util/patternlab-config.json');
patternEngines.loadAllEngines(config);
-// the mustache test pattern, stolen from object_factory unit tests
-var mustacheTestPattern = new Pattern(
+// the handlebars test pattern, stolen from object_factory unit tests
+var handlebarsTestPattern = new Pattern(
'source/_patterns/atoms/global/colors-alt.hbs',
{ d: 123 }
);
-var mustacheTestPseudoPatternBasePattern = new Pattern(
+var handlebarsTestPseudoPatternBasePattern = new Pattern(
'source/_patterns/pages/homepage.hbs',
{ d: 123 }
);
-var mustacheTestPseudoPattern = new Pattern(
+var handlebarsTestPseudoPattern = new Pattern(
'source/_patterns/pages/homepage~emergency.json',
{ d: 123 }
);
-mustacheTestPseudoPattern.isPseudoPattern = true;
-mustacheTestPseudoPattern.basePattern = mustacheTestPseudoPatternBasePattern;
+handlebarsTestPseudoPattern.isPseudoPattern = true;
+handlebarsTestPseudoPattern.basePattern =
+ handlebarsTestPseudoPatternBasePattern;
var engineNames = Object.keys(patternEngines);
tap.test(
- 'getEngineNameForPattern returns "mustache" from test pattern',
+ 'getEngineNameForPattern returns "handlebars" from test pattern',
function (test) {
- var engineName =
- patternEngines.getEngineNameForPattern(mustacheTestPattern);
- test.equal(engineName, 'mustache');
+ var engineName = patternEngines.getEngineNameForPattern(
+ handlebarsTestPattern
+ );
+ test.equal(engineName, 'handlebars');
test.end();
}
);
tap.test(
- 'getEngineNameForPattern returns "mustache" for a plain string template as a backwards compatibility measure',
+ 'getEngineNameForPattern returns "handlebars" for a plain string template as a backwards compatibility measure',
function (test) {
test.plan(1);
test.equal(
patternEngines.getEngineNameForPattern('plain text string'),
- 'mustache'
+ 'handlebars'
);
test.end();
}
);
tap.test(
- 'getEngineNameForPattern returns "mustache" for an artificial empty template',
+ 'getEngineNameForPattern returns "handlebars" for an artificial empty template',
function (test) {
test.plan(1);
var emptyPattern = Pattern.createEmpty();
test.equal(
patternEngines.getEngineNameForPattern(emptyPattern),
- 'mustache'
+ 'handlebars'
);
test.end();
}
);
tap.test(
- 'getEngineForPattern returns a reference to the mustache engine from test pattern',
+ 'getEngineForPattern returns a reference to the handlebars engine from test pattern',
function (test) {
- var engine = patternEngines.getEngineForPattern(mustacheTestPattern);
+ var engine = patternEngines.getEngineForPattern(handlebarsTestPattern);
test.equal(engine, patternEngines.hbs);
test.end();
}
);
tap.test(
- 'getEngineForPattern returns a reference to the mustache engine from test pseudo-pattern',
+ 'getEngineForPattern returns a reference to the handlebars engine from test pseudo-pattern',
function (test) {
- var engine = patternEngines.getEngineForPattern(mustacheTestPseudoPattern);
+ var engine = patternEngines.getEngineForPattern(
+ handlebarsTestPseudoPattern
+ );
test.equal(engine, patternEngines.hbs);
test.end();
}
@@ -189,10 +193,10 @@ function testProps(object, propTests, test) {
}
tap.test(
- 'patternEngines object contains at least the default mustache engine',
+ 'patternEngines object contains at least the default handlebars engine',
function (test) {
test.plan(1);
- test.ok(patternEngines.hasOwnProperty('mustache'));
+ test.ok(patternEngines.hasOwnProperty('handlebars'));
test.end();
}
);
From 853a493e33bc3228e53f1f5343de0ee2fd5885d0 Mon Sep 17 00:00:00 2001
From: Maximilian <787658+mfranzke@users.noreply.github.com>
Date: Fri, 30 Dec 2022 21:06:38 +0100
Subject: [PATCH 21/30] refactor: revert the workaround out of !1256
https://github.com/pattern-lab/patternlab-node/pull/1256
---
packages/core/src/lib/pattern_engines.js | 8 --------
1 file changed, 8 deletions(-)
diff --git a/packages/core/src/lib/pattern_engines.js b/packages/core/src/lib/pattern_engines.js
index 8eb6aade5..b8347b005 100644
--- a/packages/core/src/lib/pattern_engines.js
+++ b/packages/core/src/lib/pattern_engines.js
@@ -103,14 +103,6 @@ const PatternEngines = Object.create({
const enginesInConfig = findEnginesInConfig(patternLabConfig);
if (enginesInConfig) {
- // Quick fix until we've removed @pattern-lab/engine-mustache, starting with https://github.com/pattern-lab/patternlab-node/issues/1239 & https://github.com/pattern-lab/patternlab-node/pull/1455
- // @TODO: Remove after removing @pattern-lab/engine-mustache dependency
- enginesInConfig.mustache = enginesInConfig.mustache || {};
- enginesInConfig.mustache.package =
- enginesInConfig.mustache.package || '@pattern-lab/engine-mustache';
- enginesInConfig.mustache.extensions =
- enginesInConfig.mustache.extensions || 'mustache';
-
// Try loading each of the configured pattern engines
// eslint-disable-next-line guard-for-in
for (const name in enginesInConfig) {
From 560c7ec3c0b977a241febb13acce21acf0a7d7c9 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Sat, 31 Dec 2022 08:19:15 +0100
Subject: [PATCH 22/30] Update pattern_engines.js
---
packages/core/src/lib/pattern_engines.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/core/src/lib/pattern_engines.js b/packages/core/src/lib/pattern_engines.js
index b8347b005..3e7c31d2a 100644
--- a/packages/core/src/lib/pattern_engines.js
+++ b/packages/core/src/lib/pattern_engines.js
@@ -67,7 +67,7 @@ function findEnginesInConfig(config) {
return config.engines;
}
logger.warning(
- "Scanning the 'node_modules' folder for pattern engines is deprecated and will be removed in v6."
+ "Scanning the 'node_modules' folder for pattern engines is deprecated and will be removed in v7."
);
logger.warning(
'To configure your engines in patternlab-config.json, see https://patternlab.io/docs/editing-the-configuration-options/#heading-engines'
From 62240b15cf8167a3ce1865fbbe31b30d9e1665f9 Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Sun, 1 Jan 2023 21:46:38 +0100
Subject: [PATCH 23/30] Restore packages/core/test/engine_mustache_tests.js
---
packages/core/test/engine_mustache_tests.js | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/packages/core/test/engine_mustache_tests.js b/packages/core/test/engine_mustache_tests.js
index dd7dc1eb3..dd5e3fb19 100644
--- a/packages/core/test/engine_mustache_tests.js
+++ b/packages/core/test/engine_mustache_tests.js
@@ -9,6 +9,16 @@ var testPatternsPath = path.resolve(__dirname, 'files', '_patterns');
var eol = require('os').EOL;
var config = require('./util/patternlab-config.json');
+// don't run these tests unless mustache is installed
+var engineLoader = require('../src/lib/pattern_engines');
+engineLoader.loadAllEngines(config);
+if (!engineLoader.mustache) {
+ tap.test('Mustache engine not installed, skipping tests.', function (test) {
+ test.end();
+ });
+ return;
+}
+
// fake pattern lab constructor:
// sets up a fake patternlab object, which is needed by the pattern processing
// apparatus.
@@ -42,7 +52,7 @@ function testFindPartials(test, partialTests) {
// docs on partial syntax are here:
// https://patternlab.io/docs/including-patterns/
var currentPattern = Pattern.create(
- 'molecules/testing/test-mol.hbs', // relative path now
+ 'molecules/testing/test-mol.mustache', // relative path now
null, // data
{
template: partialTests.join(eol),
@@ -68,7 +78,7 @@ function testFindPartialsWithPatternParameters(test, partialTests) {
// docs on partial syntax are here:
// https://patternlab.io/docs/including-patterns/
var currentPattern = Pattern.create(
- 'molecules/testing/test-mol.hbs', // relative path now
+ 'molecules/testing/test-mol.mustache', // relative path now
null, // data
{
template: partialTests.join(eol),
From bd7dfd987a6a638f511ec83cb88114d52320854a Mon Sep 17 00:00:00 2001
From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com>
Date: Sun, 1 Jan 2023 21:56:25 +0100
Subject: [PATCH 24/30] refactor(test): updated syntax to handlebars
---
packages/core/test/files/_patterns/test/a.hbs | 6 +++---
packages/core/test/files/_patterns/test/b.hbs | 6 +++---
.../core/test/files/_patterns/test/bookend-params.hbs | 4 ++--
packages/core/test/files/_patterns/test/c.hbs | 2 +-
packages/core/test/files/_patterns/test/group2.hbs | 8 ++++----
.../core/test/files/_patterns/test/linkInParameter.hbs | 2 +-
packages/core/test/files/_patterns/test/mixed-params.hbs | 6 +++---
.../files/_patterns/test/multiple-classes-numeric.hbs | 6 +++---
packages/core/test/files/_patterns/test/paramParent.hbs | 2 +-
packages/core/test/files/_patterns/test/parameterTags.hbs | 2 +-
.../test/files/_patterns/test/sticky-comment-verbose.hbs | 2 +-
.../core/test/files/_patterns/test/sticky-comment.hbs | 2 +-
12 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/packages/core/test/files/_patterns/test/a.hbs b/packages/core/test/files/_patterns/test/a.hbs
index ba154f442..9dd03c16f 100644
--- a/packages/core/test/files/_patterns/test/a.hbs
+++ b/packages/core/test/files/_patterns/test/a.hbs
@@ -1,4 +1,4 @@
a
-{{ #a }}
-a!
-{{ /a }}
+{{#if a}}
+ a!
+{{/if}}
\ No newline at end of file
diff --git a/packages/core/test/files/_patterns/test/b.hbs b/packages/core/test/files/_patterns/test/b.hbs
index 70997abb3..0dccb606d 100644
--- a/packages/core/test/files/_patterns/test/b.hbs
+++ b/packages/core/test/files/_patterns/test/b.hbs
@@ -1,5 +1,5 @@
b
-{{ #b }}
+{{#if b }}
b!
-{{ /b }}
-{{> test-a(a: true) }}
+{{/if }}
+{{> test-a a=true }}
diff --git a/packages/core/test/files/_patterns/test/bookend-params.hbs b/packages/core/test/files/_patterns/test/bookend-params.hbs
index d2d0b4081..b3c1a704a 100644
--- a/packages/core/test/files/_patterns/test/bookend-params.hbs
+++ b/packages/core/test/files/_patterns/test/bookend-params.hbs
@@ -1,6 +1,6 @@