From 973235053cfc9da6ac9262c556dd572f7ec4c121 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Mon, 26 Dec 2022 00:14:13 +0100 Subject: [PATCH 01/30] refactor: renamed and removed mustache files in favour of their handlebars equivalents --- .../cli/test/fixtures/patternlab-config.json | 10 ++-- packages/core/patternlab-config.json | 10 ++-- packages/core/test/addPattern_tests.js | 4 +- packages/core/test/files/_meta/_head.mustache | 17 ------ .../a/{a-test.mustache => a-test.hbs} | 0 .../b/{b-test.mustache => b-test.hbs} | 0 .../c/{c-test.mustache => c-test.hbs} | 0 .../{subfolder.mustache => subfolder.hbs} | 0 ...n-pattern.mustache => _hidden-pattern.hbs} | 0 .../files/_patterns/test/_ignored-pattern.hbs | 1 + .../_patterns/test/_ignored-pattern.mustache | 1 - .../_patterns/test/{a.mustache => a.hbs} | 0 ...-atom.mustache => another-styled-atom.hbs} | 0 .../_patterns/test/{b.mustache => b.hbs} | 0 .../_patterns/test/{bar.mustache => bar.hbs} | 0 .../_patterns/test/{baz.mustache => baz.hbs} | 0 ...listitem.mustache => bookend-listitem.hbs} | 0 ...end-params.mustache => bookend-params.hbs} | 0 .../test/{bookend.mustache => bookend.hbs} | 0 .../_patterns/test/{c.mustache => c.hbs} | 0 .../{comment-tag.mustache => comment-tag.hbs} | 0 .../test/{comment.mustache => comment.hbs} | 0 .../_patterns/test/{foo.mustache => foo.hbs} | 0 .../test/{group.mustache => group.hbs} | 0 .../test/{group2.mustache => group2.hbs} | 0 ...ter.mustache => hidden-pattern-tester.hbs} | 0 .../{inception.mustache => inception.hbs} | 0 .../test/{link.mustache => link.hbs} | 0 ...Parameter.mustache => linkInParameter.hbs} | 0 .../test/{list.mustache => list.hbs} | 0 ...stItems.mustache => listWithListItems.hbs} | 0 ...thPartial.mustache => listWithPartial.hbs} | 0 .../test/{listitem.mustache => listitem.hbs} | 0 .../test/{mirror.mustache => mirror.hbs} | 0 ...mixed-params.mustache => mixed-params.hbs} | 0 .../test/{mixed.mustache => mixed.hbs} | 0 ....mustache => multiple-classes-numeric.hbs} | 0 .../_patterns/test/{nav.mustache => nav.hbs} | 0 .../{paramMiddle.mustache => paramMiddle.hbs} | 0 .../{paramParent.mustache => paramParent.hbs} | 0 ...rameterTags.mustache => parameterTags.hbs} | 0 ...n.mustache => pattern-wrap-class-json.hbs} | 0 ...stache => pattern-wrap-class-markdown.hbs} | 0 ...domodifier.mustache => pseudomodifier.hbs} | 0 ...stItems.mustache => repeatedListItems.hbs} | 0 ...se.mustache => sticky-comment-verbose.hbs} | 0 ...ky-comment.mustache => sticky-comment.hbs} | 0 .../{styled-atom.mustache => styled-atom.hbs} | 0 ...variant-test.mustache => variant-test.hbs} | 0 ...ral-footer.mustache => general-footer.hbs} | 0 ...ral-header.mustache => general-header.hbs} | 0 ...ernSection.mustache => patternSection.hbs} | 0 ...up.mustache => patternSectionSubgroup.hbs} | 0 packages/core/test/lineage_hunter_tests.js | 28 +++++----- packages/core/test/list_item_hunter_tests.js | 4 +- packages/core/test/loadPattern_tests.js | 10 ++-- .../core/test/markModifiedPatterns_tests.js | 6 +-- packages/core/test/parameter_hunter_tests.js | 52 +++++++++---------- packages/core/test/parseAllLinks_tests.js | 2 +- .../core/test/patternWrapClasses_tests.js | 4 +- packages/core/test/processRecursive_tests.js | 34 ++++++------ .../core/test/pseudopattern_hunter_tests.js | 18 +++---- packages/core/test/ui_builder_tests.js | 26 +++++----- .../core/test/util/patternlab-config.json | 10 ++-- .../patternlab-config.json | 10 ++-- .../source/_meta/_foot.mustache | 9 ---- .../source/_meta/_head.mustache | 18 ------- .../patternlab-config.json | 10 ++-- .../patternlab-config.json | 10 ++-- .../docs/src/docs/advanced-config-options.md | 12 ++--- .../docs/src/docs/pattern-header-footer.md | 8 +-- .../edition-node-gulp/patternlab-config.json | 10 ++-- packages/edition-node/patternlab-config.json | 10 ++-- packages/edition-twig/patternlab-config.json | 10 ++-- .../source/_meta/_foot.hbs} | 0 .../edition-twig/source/_meta/_foot.mustache | 6 --- .../_meta/{_head.mustache => _head.hbs} | 0 .../engine-mustache/lib/engine_mustache.js | 4 +- packages/uikit-workshop/src/html/index.html | 2 +- .../src/scripts/components/plugin-loader.js | 2 +- ...ral-footer.mustache => general-footer.hbs} | 0 ...ral-header.mustache => general-header.hbs} | 0 ...ernSection.mustache => patternSection.hbs} | 0 ...up.mustache => patternSectionSubgroup.hbs} | 0 .../views/{viewall.mustache => viewall.hbs} | 0 85 files changed, 154 insertions(+), 204 deletions(-) delete mode 100644 packages/core/test/files/_meta/_head.mustache rename packages/core/test/files/_patterns/orderTest/a/{a-test.mustache => a-test.hbs} (100%) rename packages/core/test/files/_patterns/orderTest/b/{b-test.mustache => b-test.hbs} (100%) rename packages/core/test/files/_patterns/orderTest/c/{c-test.mustache => c-test.hbs} (100%) rename packages/core/test/files/_patterns/orderTest/c/subfolder/{subfolder.mustache => subfolder.hbs} (100%) rename packages/core/test/files/_patterns/test/{_hidden-pattern.mustache => _hidden-pattern.hbs} (100%) create mode 100644 packages/core/test/files/_patterns/test/_ignored-pattern.hbs delete mode 100644 packages/core/test/files/_patterns/test/_ignored-pattern.mustache rename packages/core/test/files/_patterns/test/{a.mustache => a.hbs} (100%) rename packages/core/test/files/_patterns/test/{another-styled-atom.mustache => another-styled-atom.hbs} (100%) rename packages/core/test/files/_patterns/test/{b.mustache => b.hbs} (100%) rename packages/core/test/files/_patterns/test/{bar.mustache => bar.hbs} (100%) rename packages/core/test/files/_patterns/test/{baz.mustache => baz.hbs} (100%) rename packages/core/test/files/_patterns/test/{bookend-listitem.mustache => bookend-listitem.hbs} (100%) rename packages/core/test/files/_patterns/test/{bookend-params.mustache => bookend-params.hbs} (100%) rename packages/core/test/files/_patterns/test/{bookend.mustache => bookend.hbs} (100%) rename packages/core/test/files/_patterns/test/{c.mustache => c.hbs} (100%) rename packages/core/test/files/_patterns/test/{comment-tag.mustache => comment-tag.hbs} (100%) rename packages/core/test/files/_patterns/test/{comment.mustache => comment.hbs} (100%) rename packages/core/test/files/_patterns/test/{foo.mustache => foo.hbs} (100%) rename packages/core/test/files/_patterns/test/{group.mustache => group.hbs} (100%) rename packages/core/test/files/_patterns/test/{group2.mustache => group2.hbs} (100%) rename packages/core/test/files/_patterns/test/{hidden-pattern-tester.mustache => hidden-pattern-tester.hbs} (100%) rename packages/core/test/files/_patterns/test/{inception.mustache => inception.hbs} (100%) rename packages/core/test/files/_patterns/test/{link.mustache => link.hbs} (100%) rename packages/core/test/files/_patterns/test/{linkInParameter.mustache => linkInParameter.hbs} (100%) rename packages/core/test/files/_patterns/test/{list.mustache => list.hbs} (100%) rename packages/core/test/files/_patterns/test/{listWithListItems.mustache => listWithListItems.hbs} (100%) rename packages/core/test/files/_patterns/test/{listWithPartial.mustache => listWithPartial.hbs} (100%) rename packages/core/test/files/_patterns/test/{listitem.mustache => listitem.hbs} (100%) rename packages/core/test/files/_patterns/test/{mirror.mustache => mirror.hbs} (100%) rename packages/core/test/files/_patterns/test/{mixed-params.mustache => mixed-params.hbs} (100%) rename packages/core/test/files/_patterns/test/{mixed.mustache => mixed.hbs} (100%) rename packages/core/test/files/_patterns/test/{multiple-classes-numeric.mustache => multiple-classes-numeric.hbs} (100%) rename packages/core/test/files/_patterns/test/{nav.mustache => nav.hbs} (100%) rename packages/core/test/files/_patterns/test/{paramMiddle.mustache => paramMiddle.hbs} (100%) rename packages/core/test/files/_patterns/test/{paramParent.mustache => paramParent.hbs} (100%) rename packages/core/test/files/_patterns/test/{parameterTags.mustache => parameterTags.hbs} (100%) rename packages/core/test/files/_patterns/test/{pattern-wrap-class-json.mustache => pattern-wrap-class-json.hbs} (100%) rename packages/core/test/files/_patterns/test/{pattern-wrap-class-markdown.mustache => pattern-wrap-class-markdown.hbs} (100%) rename packages/core/test/files/_patterns/test/{pseudomodifier.mustache => pseudomodifier.hbs} (100%) rename packages/core/test/files/_patterns/test/{repeatedListItems.mustache => repeatedListItems.hbs} (100%) rename packages/core/test/files/_patterns/test/{sticky-comment-verbose.mustache => sticky-comment-verbose.hbs} (100%) rename packages/core/test/files/_patterns/test/{sticky-comment.mustache => sticky-comment.hbs} (100%) rename packages/core/test/files/_patterns/test/{styled-atom.mustache => styled-atom.hbs} (100%) rename packages/core/test/files/_patterns/test/{variant-test.mustache => variant-test.hbs} (100%) rename packages/core/test/files/partials/{general-footer.mustache => general-footer.hbs} (100%) rename packages/core/test/files/partials/{general-header.mustache => general-header.hbs} (100%) rename packages/core/test/files/partials/{patternSection.mustache => patternSection.hbs} (100%) rename packages/core/test/files/partials/{patternSectionSubgroup.mustache => patternSectionSubgroup.hbs} (100%) delete mode 100644 packages/development-edition-engine-handlebars/source/_meta/_foot.mustache delete mode 100644 packages/development-edition-engine-handlebars/source/_meta/_head.mustache rename packages/{core/test/files/_meta/_foot.mustache => edition-twig/source/_meta/_foot.hbs} (100%) delete mode 100644 packages/edition-twig/source/_meta/_foot.mustache rename packages/edition-twig/source/_meta/{_head.mustache => _head.hbs} (100%) rename packages/uikit-workshop/views/partials/{general-footer.mustache => general-footer.hbs} (100%) rename packages/uikit-workshop/views/partials/{general-header.mustache => general-header.hbs} (100%) rename packages/uikit-workshop/views/partials/{patternSection.mustache => patternSection.hbs} (100%) rename packages/uikit-workshop/views/partials/{patternSectionSubgroup.mustache => patternSectionSubgroup.hbs} (100%) rename packages/uikit-workshop/views/{viewall.mustache => viewall.hbs} (100%) diff --git a/packages/cli/test/fixtures/patternlab-config.json b/packages/cli/test/fixtures/patternlab-config.json index 8fdff2714..b7359cf78 100644 --- a/packages/cli/test/fixtures/patternlab-config.json +++ b/packages/cli/test/fixtures/patternlab-config.json @@ -41,15 +41,15 @@ "styleguide": "node_modules/@pattern-lab/uikit-workshop/dist/", "patternlabFiles": { "general-header": - "node_modules/@pattern-lab/uikit-workshop/views/partials/general-header.mustache", + "node_modules/@pattern-lab/uikit-workshop/views/partials/general-header.hbs", "general-footer": - "node_modules/@pattern-lab/uikit-workshop/views/partials/general-footer.mustache", + "node_modules/@pattern-lab/uikit-workshop/views/partials/general-footer.hbs", "patternSection": - "node_modules/@pattern-lab/uikit-workshop/views/partials/patternSection.mustache", + "node_modules/@pattern-lab/uikit-workshop/views/partials/patternSection.hbs", "patternSectionSubgroup": - "node_modules/@pattern-lab/uikit-workshop/views/partials/patternSectionSubgroup.mustache", + "node_modules/@pattern-lab/uikit-workshop/views/partials/patternSectionSubgroup.hbs", "viewall": - "node_modules/@pattern-lab/uikit-workshop/views/viewall.mustache" + "node_modules/@pattern-lab/uikit-workshop/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 2571bb52f..b09e76529 100644 --- a/packages/core/patternlab-config.json +++ b/packages/core/patternlab-config.json @@ -41,15 +41,15 @@ "styleguide": "dist/", "patternlabFiles": { "general-header": - "views/partials/general-header.mustache", + "views/partials/general-header.hbs", "general-footer": - "views/partials/general-footer.mustache", + "views/partials/general-footer.hbs", "patternSection": - "views/partials/patternSection.mustache", + "views/partials/patternSection.hbs", "patternSectionSubgroup": - "views/partials/patternSectionSubgroup.mustache", + "views/partials/patternSectionSubgroup.hbs", "viewall": - "views/viewall.mustache" + "viewall.hbs" }, "js": "./source/js", "images": "./source/images", diff --git a/packages/core/test/addPattern_tests.js b/packages/core/test/addPattern_tests.js index cf495cccb..90f5aa6f6 100644 --- a/packages/core/test/addPattern_tests.js +++ b/packages/core/test/addPattern_tests.js @@ -14,7 +14,7 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var pattern = new Pattern('test/bar.mustache'); + var pattern = new Pattern('test/bar.hbs'); pattern.extendedTemplate = 'barExtended'; pattern.template = 'bar'; @@ -35,7 +35,7 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var pattern = new Pattern('test/bar.mustache'); + var pattern = new Pattern('test/bar.hbs'); pattern.extendedTemplate = undefined; pattern.template = 'bar'; diff --git a/packages/core/test/files/_meta/_head.mustache b/packages/core/test/files/_meta/_head.mustache deleted file mode 100644 index 14a98f369..000000000 --- a/packages/core/test/files/_meta/_head.mustache +++ /dev/null @@ -1,17 +0,0 @@ - - - - {{ title }} - - - - - - - - {{{ patternLabHead }}} - - - - - diff --git a/packages/core/test/files/_patterns/orderTest/a/a-test.mustache b/packages/core/test/files/_patterns/orderTest/a/a-test.hbs similarity index 100% rename from packages/core/test/files/_patterns/orderTest/a/a-test.mustache rename to packages/core/test/files/_patterns/orderTest/a/a-test.hbs diff --git a/packages/core/test/files/_patterns/orderTest/b/b-test.mustache b/packages/core/test/files/_patterns/orderTest/b/b-test.hbs similarity index 100% rename from packages/core/test/files/_patterns/orderTest/b/b-test.mustache rename to packages/core/test/files/_patterns/orderTest/b/b-test.hbs diff --git a/packages/core/test/files/_patterns/orderTest/c/c-test.mustache b/packages/core/test/files/_patterns/orderTest/c/c-test.hbs similarity index 100% rename from packages/core/test/files/_patterns/orderTest/c/c-test.mustache rename to packages/core/test/files/_patterns/orderTest/c/c-test.hbs diff --git a/packages/core/test/files/_patterns/orderTest/c/subfolder/subfolder.mustache b/packages/core/test/files/_patterns/orderTest/c/subfolder/subfolder.hbs similarity index 100% rename from packages/core/test/files/_patterns/orderTest/c/subfolder/subfolder.mustache rename to packages/core/test/files/_patterns/orderTest/c/subfolder/subfolder.hbs diff --git a/packages/core/test/files/_patterns/test/_hidden-pattern.mustache b/packages/core/test/files/_patterns/test/_hidden-pattern.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/_hidden-pattern.mustache rename to packages/core/test/files/_patterns/test/_hidden-pattern.hbs diff --git a/packages/core/test/files/_patterns/test/_ignored-pattern.hbs b/packages/core/test/files/_patterns/test/_ignored-pattern.hbs new file mode 100644 index 000000000..c2b833a59 --- /dev/null +++ b/packages/core/test/files/_patterns/test/_ignored-pattern.hbs @@ -0,0 +1 @@ +
These aren't the patterns you are looking for.
\ No newline at end of file diff --git a/packages/core/test/files/_patterns/test/_ignored-pattern.mustache b/packages/core/test/files/_patterns/test/_ignored-pattern.mustache deleted file mode 100644 index ae9ed0946..000000000 --- a/packages/core/test/files/_patterns/test/_ignored-pattern.mustache +++ /dev/null @@ -1 +0,0 @@ -
These aren't the patterns you are looking for.
diff --git a/packages/core/test/files/_patterns/test/a.mustache b/packages/core/test/files/_patterns/test/a.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/a.mustache rename to packages/core/test/files/_patterns/test/a.hbs diff --git a/packages/core/test/files/_patterns/test/another-styled-atom.mustache b/packages/core/test/files/_patterns/test/another-styled-atom.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/another-styled-atom.mustache rename to packages/core/test/files/_patterns/test/another-styled-atom.hbs diff --git a/packages/core/test/files/_patterns/test/b.mustache b/packages/core/test/files/_patterns/test/b.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/b.mustache rename to packages/core/test/files/_patterns/test/b.hbs diff --git a/packages/core/test/files/_patterns/test/bar.mustache b/packages/core/test/files/_patterns/test/bar.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/bar.mustache rename to packages/core/test/files/_patterns/test/bar.hbs diff --git a/packages/core/test/files/_patterns/test/baz.mustache b/packages/core/test/files/_patterns/test/baz.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/baz.mustache rename to packages/core/test/files/_patterns/test/baz.hbs diff --git a/packages/core/test/files/_patterns/test/bookend-listitem.mustache b/packages/core/test/files/_patterns/test/bookend-listitem.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/bookend-listitem.mustache rename to packages/core/test/files/_patterns/test/bookend-listitem.hbs diff --git a/packages/core/test/files/_patterns/test/bookend-params.mustache b/packages/core/test/files/_patterns/test/bookend-params.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/bookend-params.mustache rename to packages/core/test/files/_patterns/test/bookend-params.hbs diff --git a/packages/core/test/files/_patterns/test/bookend.mustache b/packages/core/test/files/_patterns/test/bookend.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/bookend.mustache rename to packages/core/test/files/_patterns/test/bookend.hbs diff --git a/packages/core/test/files/_patterns/test/c.mustache b/packages/core/test/files/_patterns/test/c.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/c.mustache rename to packages/core/test/files/_patterns/test/c.hbs diff --git a/packages/core/test/files/_patterns/test/comment-tag.mustache b/packages/core/test/files/_patterns/test/comment-tag.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/comment-tag.mustache rename to packages/core/test/files/_patterns/test/comment-tag.hbs diff --git a/packages/core/test/files/_patterns/test/comment.mustache b/packages/core/test/files/_patterns/test/comment.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/comment.mustache rename to packages/core/test/files/_patterns/test/comment.hbs diff --git a/packages/core/test/files/_patterns/test/foo.mustache b/packages/core/test/files/_patterns/test/foo.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/foo.mustache rename to packages/core/test/files/_patterns/test/foo.hbs diff --git a/packages/core/test/files/_patterns/test/group.mustache b/packages/core/test/files/_patterns/test/group.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/group.mustache rename to packages/core/test/files/_patterns/test/group.hbs diff --git a/packages/core/test/files/_patterns/test/group2.mustache b/packages/core/test/files/_patterns/test/group2.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/group2.mustache rename to packages/core/test/files/_patterns/test/group2.hbs diff --git a/packages/core/test/files/_patterns/test/hidden-pattern-tester.mustache b/packages/core/test/files/_patterns/test/hidden-pattern-tester.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/hidden-pattern-tester.mustache rename to packages/core/test/files/_patterns/test/hidden-pattern-tester.hbs diff --git a/packages/core/test/files/_patterns/test/inception.mustache b/packages/core/test/files/_patterns/test/inception.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/inception.mustache rename to packages/core/test/files/_patterns/test/inception.hbs diff --git a/packages/core/test/files/_patterns/test/link.mustache b/packages/core/test/files/_patterns/test/link.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/link.mustache rename to packages/core/test/files/_patterns/test/link.hbs diff --git a/packages/core/test/files/_patterns/test/linkInParameter.mustache b/packages/core/test/files/_patterns/test/linkInParameter.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/linkInParameter.mustache rename to packages/core/test/files/_patterns/test/linkInParameter.hbs diff --git a/packages/core/test/files/_patterns/test/list.mustache b/packages/core/test/files/_patterns/test/list.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/list.mustache rename to packages/core/test/files/_patterns/test/list.hbs diff --git a/packages/core/test/files/_patterns/test/listWithListItems.mustache b/packages/core/test/files/_patterns/test/listWithListItems.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/listWithListItems.mustache rename to packages/core/test/files/_patterns/test/listWithListItems.hbs diff --git a/packages/core/test/files/_patterns/test/listWithPartial.mustache b/packages/core/test/files/_patterns/test/listWithPartial.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/listWithPartial.mustache rename to packages/core/test/files/_patterns/test/listWithPartial.hbs diff --git a/packages/core/test/files/_patterns/test/listitem.mustache b/packages/core/test/files/_patterns/test/listitem.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/listitem.mustache rename to packages/core/test/files/_patterns/test/listitem.hbs diff --git a/packages/core/test/files/_patterns/test/mirror.mustache b/packages/core/test/files/_patterns/test/mirror.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/mirror.mustache rename to packages/core/test/files/_patterns/test/mirror.hbs diff --git a/packages/core/test/files/_patterns/test/mixed-params.mustache b/packages/core/test/files/_patterns/test/mixed-params.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/mixed-params.mustache rename to packages/core/test/files/_patterns/test/mixed-params.hbs diff --git a/packages/core/test/files/_patterns/test/mixed.mustache b/packages/core/test/files/_patterns/test/mixed.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/mixed.mustache rename to packages/core/test/files/_patterns/test/mixed.hbs diff --git a/packages/core/test/files/_patterns/test/multiple-classes-numeric.mustache b/packages/core/test/files/_patterns/test/multiple-classes-numeric.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/multiple-classes-numeric.mustache rename to packages/core/test/files/_patterns/test/multiple-classes-numeric.hbs diff --git a/packages/core/test/files/_patterns/test/nav.mustache b/packages/core/test/files/_patterns/test/nav.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/nav.mustache rename to packages/core/test/files/_patterns/test/nav.hbs diff --git a/packages/core/test/files/_patterns/test/paramMiddle.mustache b/packages/core/test/files/_patterns/test/paramMiddle.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/paramMiddle.mustache rename to packages/core/test/files/_patterns/test/paramMiddle.hbs diff --git a/packages/core/test/files/_patterns/test/paramParent.mustache b/packages/core/test/files/_patterns/test/paramParent.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/paramParent.mustache rename to packages/core/test/files/_patterns/test/paramParent.hbs diff --git a/packages/core/test/files/_patterns/test/parameterTags.mustache b/packages/core/test/files/_patterns/test/parameterTags.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/parameterTags.mustache rename to packages/core/test/files/_patterns/test/parameterTags.hbs diff --git a/packages/core/test/files/_patterns/test/pattern-wrap-class-json.mustache b/packages/core/test/files/_patterns/test/pattern-wrap-class-json.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/pattern-wrap-class-json.mustache rename to packages/core/test/files/_patterns/test/pattern-wrap-class-json.hbs diff --git a/packages/core/test/files/_patterns/test/pattern-wrap-class-markdown.mustache b/packages/core/test/files/_patterns/test/pattern-wrap-class-markdown.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/pattern-wrap-class-markdown.mustache rename to packages/core/test/files/_patterns/test/pattern-wrap-class-markdown.hbs diff --git a/packages/core/test/files/_patterns/test/pseudomodifier.mustache b/packages/core/test/files/_patterns/test/pseudomodifier.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/pseudomodifier.mustache rename to packages/core/test/files/_patterns/test/pseudomodifier.hbs diff --git a/packages/core/test/files/_patterns/test/repeatedListItems.mustache b/packages/core/test/files/_patterns/test/repeatedListItems.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/repeatedListItems.mustache rename to packages/core/test/files/_patterns/test/repeatedListItems.hbs diff --git a/packages/core/test/files/_patterns/test/sticky-comment-verbose.mustache b/packages/core/test/files/_patterns/test/sticky-comment-verbose.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/sticky-comment-verbose.mustache rename to packages/core/test/files/_patterns/test/sticky-comment-verbose.hbs diff --git a/packages/core/test/files/_patterns/test/sticky-comment.mustache b/packages/core/test/files/_patterns/test/sticky-comment.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/sticky-comment.mustache rename to packages/core/test/files/_patterns/test/sticky-comment.hbs diff --git a/packages/core/test/files/_patterns/test/styled-atom.mustache b/packages/core/test/files/_patterns/test/styled-atom.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/styled-atom.mustache rename to packages/core/test/files/_patterns/test/styled-atom.hbs diff --git a/packages/core/test/files/_patterns/test/variant-test.mustache b/packages/core/test/files/_patterns/test/variant-test.hbs similarity index 100% rename from packages/core/test/files/_patterns/test/variant-test.mustache rename to packages/core/test/files/_patterns/test/variant-test.hbs diff --git a/packages/core/test/files/partials/general-footer.mustache b/packages/core/test/files/partials/general-footer.hbs similarity index 100% rename from packages/core/test/files/partials/general-footer.mustache rename to packages/core/test/files/partials/general-footer.hbs diff --git a/packages/core/test/files/partials/general-header.mustache b/packages/core/test/files/partials/general-header.hbs similarity index 100% rename from packages/core/test/files/partials/general-header.mustache rename to packages/core/test/files/partials/general-header.hbs diff --git a/packages/core/test/files/partials/patternSection.mustache b/packages/core/test/files/partials/patternSection.hbs similarity index 100% rename from packages/core/test/files/partials/patternSection.mustache rename to packages/core/test/files/partials/patternSection.hbs diff --git a/packages/core/test/files/partials/patternSectionSubgroup.mustache b/packages/core/test/files/partials/patternSectionSubgroup.hbs similarity index 100% rename from packages/core/test/files/partials/patternSectionSubgroup.mustache rename to packages/core/test/files/partials/patternSectionSubgroup.hbs diff --git a/packages/core/test/lineage_hunter_tests.js b/packages/core/test/lineage_hunter_tests.js index 24a4a62f0..db1211b72 100644 --- a/packages/core/test/lineage_hunter_tests.js +++ b/packages/core/test/lineage_hunter_tests.js @@ -231,9 +231,9 @@ tap.test( //arrange var pl = createBasePatternLabObject(); - var atomPattern = new of.Pattern('test/bar.mustache'); + var atomPattern = new of.Pattern('test/bar.hbs'); atomPattern.template = fs.readFileSync( - pl.config.paths.source.patterns + 'test/bar.mustache', + pl.config.paths.source.patterns + 'test/bar.hbs', 'utf8' ); atomPattern.extendedTemplate = atomPattern.template; @@ -241,9 +241,9 @@ tap.test( addPattern(atomPattern, pl); - var consumerPattern = new of.Pattern('test/foo.mustache'); + var consumerPattern = new of.Pattern('test/foo.hbs'); consumerPattern.template = fs.readFileSync( - pl.config.paths.source.patterns + 'test/foo.mustache', + pl.config.paths.source.patterns + 'test/foo.hbs', 'utf8' ); consumerPattern.extendedTemplate = consumerPattern.template; @@ -268,9 +268,9 @@ tap.test( //arrange var pl = createBasePatternLabObject(); - var atomPattern = new of.Pattern('test/bar.mustache'); + var atomPattern = new of.Pattern('test/bar.hbs'); atomPattern.template = fs.readFileSync( - pl.config.paths.source.patterns + 'test/bar.mustache', + pl.config.paths.source.patterns + 'test/bar.hbs', 'utf8' ); atomPattern.extendedTemplate = atomPattern.template; @@ -278,9 +278,9 @@ tap.test( addPattern(atomPattern, pl); - var consumerPattern = new of.Pattern('test/foo.mustache'); + var consumerPattern = new of.Pattern('test/foo.hbs'); consumerPattern.template = fs.readFileSync( - pl.config.paths.source.patterns + 'test/foo.mustache', + pl.config.paths.source.patterns + 'test/foo.hbs', 'utf8' ); consumerPattern.extendedTemplate = consumerPattern.template; @@ -306,8 +306,8 @@ tap.test( //arrange var pl = createBasePatternLabObject(); - var atomPattern = loadPattern('test/bar.mustache', pl); - var consumerPattern = loadPattern('test/foo.mustache', pl); + var atomPattern = loadPattern('test/bar.hbs', pl); + var consumerPattern = loadPattern('test/foo.hbs', pl); lineage_hunter.find_lineage(consumerPattern, pl); @@ -329,9 +329,9 @@ tap.test( //arrange var pl = createBasePatternLabObject(); - var atomPattern = new of.Pattern('test/bar.mustache'); + var atomPattern = new of.Pattern('test/bar.hbs'); atomPattern.template = fs.readFileSync( - path.resolve(pl.config.paths.source.patterns, 'test/bar.mustache'), + path.resolve(pl.config.paths.source.patterns, 'test/bar.hbs'), 'utf8' ); atomPattern.extendedTemplate = atomPattern.template; @@ -339,9 +339,9 @@ tap.test( addPattern(atomPattern, pl); - var consumerPattern = new of.Pattern('test/foo.mustache'); + var consumerPattern = new of.Pattern('test/foo.hbs'); consumerPattern.template = fs.readFileSync( - path.resolve(pl.config.paths.source.patterns, 'test/foo.mustache'), + path.resolve(pl.config.paths.source.patterns, 'test/foo.hbs'), 'utf8' ); consumerPattern.extendedTemplate = consumerPattern.template; diff --git a/packages/core/test/list_item_hunter_tests.js b/packages/core/test/list_item_hunter_tests.js index 5447f194f..90c5944ad 100644 --- a/packages/core/test/list_item_hunter_tests.js +++ b/packages/core/test/list_item_hunter_tests.js @@ -19,7 +19,7 @@ tap.test( (test) => { //arrange const pl = util.fakePatternLab(testPatternsPath); - const listPath = path.join('test', 'list.mustache'); + const listPath = path.join('test', 'list.hbs'); const testPattern = loadPattern(listPath, pl); //usually decompose does this @@ -46,7 +46,7 @@ tap.test( (test) => { //arrange const pl = util.fakePatternLab(testPatternsPath); - const listPath = path.join('test', 'listWithPartial.mustache'); + const listPath = path.join('test', 'listWithPartial.hbs'); const testPattern = loadPattern(listPath, pl); //usually decompose does this diff --git a/packages/core/test/loadPattern_tests.js b/packages/core/test/loadPattern_tests.js index d2903a6c0..e2e4bc3ca 100644 --- a/packages/core/test/loadPattern_tests.js +++ b/packages/core/test/loadPattern_tests.js @@ -31,7 +31,7 @@ tap.test( tap.test('loadPattern - loads pattern sibling json if found', function (test) { //arrange const patternlab = util.fakePatternLab(patterns_dir); - var patternPath = path.join('test', 'styled-atom.mustache'); + var patternPath = path.join('test', 'styled-atom.hbs'); //act var result = loadPattern(patternPath, patternlab); @@ -104,7 +104,7 @@ tap.test( (test) => { //arrange const patternlab = util.fakePatternLab(patterns_dir); - const basePatternPath = path.join('test', 'pseudomodifier.mustache'); + const basePatternPath = path.join('test', 'pseudomodifier.hbs'); //act const result = loadPattern(basePatternPath, patternlab); @@ -122,13 +122,13 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - const basePatternAPath = path.join('orderTest', 'a', 'a-test.mustache'); - const basePatternBPath = path.join('orderTest', 'b', 'b-test.mustache'); + const basePatternAPath = path.join('orderTest', 'a', 'a-test.hbs'); + const basePatternBPath = path.join('orderTest', 'b', 'b-test.hbs'); const basePatternCPath = path.join( 'orderTest', 'c', 'subfolder', - 'subfolder.mustache' + 'subfolder.hbs' ); //act diff --git a/packages/core/test/markModifiedPatterns_tests.js b/packages/core/test/markModifiedPatterns_tests.js index 18f06d646..552a2a2fc 100644 --- a/packages/core/test/markModifiedPatterns_tests.js +++ b/packages/core/test/markModifiedPatterns_tests.js @@ -40,7 +40,7 @@ tap.only( markupOnly: '.markup-only', }; - var pattern = new Pattern('test/bar.mustache'); + var pattern = new Pattern('test/bar.hbs'); pattern.extendedTemplate = undefined; pattern.template = 'bar'; @@ -83,7 +83,7 @@ tap.test( patternlab.config = { logLevel: 'quiet' }; patternlab.config.outputFileSuffixes = { rendered: '' }; - var pattern = new Pattern('test/bar.mustache'); + var pattern = new Pattern('test/bar.hbs'); pattern.extendedTemplate = undefined; pattern.template = 'bar'; pattern.lastModified = undefined; @@ -106,7 +106,7 @@ tap.test( patternlab.config = { logLevel: 'quiet' }; patternlab.config.outputFileSuffixes = { rendered: '' }; - var pattern = new Pattern('test/bar.mustache'); + var pattern = new Pattern('test/bar.hbs'); pattern.extendedTemplate = undefined; pattern.template = 'bar'; pattern.lastModified = 100000; diff --git a/packages/core/test/parameter_hunter_tests.js b/packages/core/test/parameter_hunter_tests.js index b19314d10..41ee754e2 100644 --- a/packages/core/test/parameter_hunter_tests.js +++ b/packages/core/test/parameter_hunter_tests.js @@ -20,10 +20,10 @@ tap.test('parameter hunter finds and extends templates', function (test) { //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); var p1 = processIterative(commentPattern, pl); @@ -55,10 +55,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment-verbose.mustache'); + var testPatternPath = path.join('test', 'sticky-comment-verbose.hbs'); var testPattern = loadPattern(testPatternPath, pl); var p1 = processIterative(commentPattern, pl); @@ -93,10 +93,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -127,10 +127,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -161,10 +161,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -195,10 +195,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -230,10 +230,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -265,10 +265,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -299,10 +299,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -334,10 +334,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -369,10 +369,10 @@ tap.test( //arrange const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file @@ -403,10 +403,10 @@ tap.test( // //arrange // const pl = util.fakePatternLab(testPatternsPath); -// var commentPath = path.join('test', 'comment.mustache'); +// var commentPath = path.join('test', 'comment.hbs'); // var commentPattern = loadPattern(commentPath, pl); -// var testPatternPath = path.join('test', 'sticky-comment.mustache'); +// var testPatternPath = path.join('test', 'sticky-comment.hbs'); // var testPattern = loadPattern(testPatternPath, pl); // //override the file @@ -430,10 +430,10 @@ tap.test( tap.test('parameter hunter skips malformed parameters', function (test) { const pl = util.fakePatternLab(testPatternsPath); - var commentPath = path.join('test', 'comment.mustache'); + var commentPath = path.join('test', 'comment.hbs'); var commentPattern = loadPattern(commentPath, pl); - var testPatternPath = path.join('test', 'sticky-comment.mustache'); + var testPatternPath = path.join('test', 'sticky-comment.hbs'); var testPattern = loadPattern(testPatternPath, pl); //override the file diff --git a/packages/core/test/parseAllLinks_tests.js b/packages/core/test/parseAllLinks_tests.js index 7077bf454..fe5d85d08 100644 --- a/packages/core/test/parseAllLinks_tests.js +++ b/packages/core/test/parseAllLinks_tests.js @@ -36,7 +36,7 @@ tap.test( ); // copies essential logic from loadPattern - const navPattern = new Pattern('test/nav.mustache', {}, patternlab); + const navPattern = new Pattern('test/nav.hbs', {}, patternlab); const patternData = dataLoader.loadDataFromFile( path.resolve( __dirname, diff --git a/packages/core/test/patternWrapClasses_tests.js b/packages/core/test/patternWrapClasses_tests.js index a00d06dd1..35702e570 100644 --- a/packages/core/test/patternWrapClasses_tests.js +++ b/packages/core/test/patternWrapClasses_tests.js @@ -23,7 +23,7 @@ tap.test('reading pattern wrap class from markdown', function (test) { const patternPathMarkdown = path.join( 'test', - 'pattern-wrap-class-markdown.mustache' + 'pattern-wrap-class-markdown.hbs' ); const patternMarkdown = loadPattern(patternPathMarkdown, patternlab); patternWrapClassesChangePatternTemplate(patternlab, patternMarkdown); @@ -42,7 +42,7 @@ tap.test('reading pattern wrap class from json', function (test) { patternWrapClassesKey: ['theme-class'], }; - const patternPathJson = path.join('test', 'pattern-wrap-class-json.mustache'); + const patternPathJson = path.join('test', 'pattern-wrap-class-json.hbs'); const patternJson = loadPattern(patternPathJson, patternlab); patternWrapClassesChangePatternTemplate(patternlab, patternJson); const patternPartialJson = diff --git a/packages/core/test/processRecursive_tests.js b/packages/core/test/processRecursive_tests.js index 96de00066..1825c561e 100644 --- a/packages/core/test/processRecursive_tests.js +++ b/packages/core/test/processRecursive_tests.js @@ -53,10 +53,10 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var atomPath = path.join('test', 'styled-atom.mustache'); + var atomPath = path.join('test', 'styled-atom.hbs'); var atomPattern = loadPattern(atomPath, patternlab); - var groupPath = path.join('test', 'group.mustache'); + var groupPath = path.join('test', 'group.hbs'); var groupPattern = loadPattern(groupPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -88,10 +88,10 @@ tap.only( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var atomPath = path.join('test', 'styled-atom.mustache'); + var atomPath = path.join('test', 'styled-atom.hbs'); var atomPattern = loadPattern(atomPath, patternlab); - var groupPath = path.join('test', 'multiple-classes-numeric.mustache'); + var groupPath = path.join('test', 'multiple-classes-numeric.hbs'); var groupPattern = loadPattern(groupPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -123,10 +123,10 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var atomPath = path.join('test', 'styled-atom.mustache'); + var atomPath = path.join('test', 'styled-atom.hbs'); var atomPattern = loadPattern(atomPath, patternlab); - var mixedPath = path.join('test', 'mixed.mustache'); + var mixedPath = path.join('test', 'mixed.hbs'); var mixedPattern = loadPattern(mixedPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -158,10 +158,10 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var atomPath = path.join('test', 'styled-atom.mustache'); + var atomPath = path.join('test', 'styled-atom.hbs'); var atomPattern = loadPattern(atomPath, patternlab); - var bookendPath = path.join('test', 'bookend.mustache'); + var bookendPath = path.join('test', 'bookend.hbs'); var bookendPattern = loadPattern(bookendPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -193,10 +193,10 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var atomPath = path.join('test', 'styled-atom.mustache'); + var atomPath = path.join('test', 'styled-atom.hbs'); var atomPattern = loadPattern(atomPath, patternlab); - var mixedPath = path.join('test', 'mixed-params.mustache'); + var mixedPath = path.join('test', 'mixed-params.hbs'); var mixedPattern = loadPattern(mixedPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -228,10 +228,10 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var atomPath = path.join('test', 'styled-atom.mustache'); + var atomPath = path.join('test', 'styled-atom.hbs'); var atomPattern = loadPattern(atomPath, patternlab); - var bookendPath = path.join('test', 'bookend-params.mustache'); + var bookendPath = path.join('test', 'bookend-params.hbs'); var bookendPattern = loadPattern(bookendPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -263,10 +263,10 @@ tap.test( //arrange const patternlab = util.fakePatternLab(patterns_dir); - var atomPath = path.join('test', 'styled-atom.mustache'); + var atomPath = path.join('test', 'styled-atom.hbs'); var atomPattern = loadPattern(atomPath, patternlab); - var anotherPath = path.join('test', 'another-styled-atom.mustache'); + var anotherPath = path.join('test', 'another-styled-atom.hbs'); var anotherPattern = loadPattern(anotherPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -321,7 +321,7 @@ tap var templatePath = path.join('test', 'foo.mustache'); var templatePattern = loadPattern(templatePath, patternlab); - var pagesPath = path.join('test', 'inception.mustache'); + var pagesPath = path.join('test', 'inception.hbs'); var pagesPattern = loadPattern(pagesPath, patternlab); var p1 = processIterative(atomPattern, patternlab); @@ -377,10 +377,10 @@ tap.test('hidden patterns can be called by their nice names', function (test) { const patternlab = util.fakePatternLab(patterns_dir); //act - var hiddenPatternPath = path.join('test', '_hidden-pattern.mustache'); + var hiddenPatternPath = path.join('test', '_hidden-pattern.hbs'); var hiddenPattern = loadPattern(hiddenPatternPath, patternlab); - var testPatternPath = path.join('test', 'hidden-pattern-tester.mustache'); + var testPatternPath = path.join('test', 'hidden-pattern-tester.hbs'); var testPattern = loadPattern(testPatternPath, patternlab); var p1 = processIterative(hiddenPattern, patternlab); diff --git a/packages/core/test/pseudopattern_hunter_tests.js b/packages/core/test/pseudopattern_hunter_tests.js index 9c5bf40c1..cea8801f2 100644 --- a/packages/core/test/pseudopattern_hunter_tests.js +++ b/packages/core/test/pseudopattern_hunter_tests.js @@ -46,7 +46,7 @@ tap.test('pseudpattern found and added as a pattern', function (test) { //arrange var pl = stubPatternlab(); - var atomPattern = loadPattern('test/styled-atom.mustache', pl); + var atomPattern = loadPattern('test/styled-atom.hbs', pl); addPattern(atomPattern, pl); //act @@ -70,7 +70,7 @@ tap.test('pseudpattern does not pollute base pattern data', function (test) { //arrange var pl = stubPatternlab(); - var atomPattern = loadPattern('test/styled-atom.mustache', pl); + var atomPattern = loadPattern('test/styled-atom.hbs', pl); //act var patternCountBefore = pl.patterns.length; @@ -90,9 +90,9 @@ tap.test( //arrange var pl = stubPatternlab(); - var atomPattern = new Pattern('test/styled-atom.mustache'); + var atomPattern = new Pattern('test/styled-atom.hbs'); atomPattern.template = fs.readFileSync( - patterns_dir + 'test/styled-atom.mustache', + patterns_dir + 'test/styled-atom.hbs', 'utf8' ); atomPattern.extendedTemplate = atomPattern.template; @@ -101,9 +101,9 @@ tap.test( atomPattern.parameteredPartials = atomPattern.findPartialsWithPatternParameters(atomPattern); - var pseudoPattern = new Pattern('test/pseudomodifier.mustache'); + var pseudoPattern = new Pattern('test/pseudomodifier.hbs'); pseudoPattern.template = fs.readFileSync( - patterns_dir + 'test/pseudomodifier.mustache', + patterns_dir + 'test/pseudomodifier.hbs', 'utf8' ); pseudoPattern.extendedTemplate = atomPattern.template; @@ -132,7 +132,7 @@ tap.test('pseudo pattern variant data should merge arrays', function (test) { const pl = stubPatternlab(); pl.config.patternMergeVariantArrays = true; - const pattern = loadPattern('test/variant-test.mustache', pl); + const pattern = loadPattern('test/variant-test.hbs', pl); addPattern(pattern, pl); @@ -154,7 +154,7 @@ tap.test( function (test) { const pl = stubPatternlab(); - const pattern = loadPattern('test/variant-test.mustache', pl); + const pattern = loadPattern('test/variant-test.hbs', pl); addPattern(pattern, pl); @@ -176,7 +176,7 @@ tap.test('pseudo pattern variant data should override arrays', function (test) { const pl = stubPatternlab(); pl.config.patternMergeVariantArrays = false; - const pattern = loadPattern('test/variant-test.mustache', pl); + const pattern = loadPattern('test/variant-test.hbs', pl); addPattern(pattern, pl); diff --git a/packages/core/test/ui_builder_tests.js b/packages/core/test/ui_builder_tests.js index 1070151d6..8a6c5c2f7 100644 --- a/packages/core/test/ui_builder_tests.js +++ b/packages/core/test/ui_builder_tests.js @@ -72,7 +72,7 @@ tap.test( function (test) { //arrange var patternlab = createFakePatternLab({}); - var pattern = new Pattern('test/ignored-pattern.mustache'); + var pattern = new Pattern('test/ignored-pattern.hbs'); pattern.hidden = true; //act @@ -89,7 +89,7 @@ tap.test( function (test) { //arrange var patternlab = createFakePatternLab({}); - var pattern = new Pattern('test/foo.mustache'); + var pattern = new Pattern('test/foo.hbs'); patternlab.config.defaultPattern = 'test-foo'; //act @@ -192,9 +192,9 @@ tap.test('groupPatterns - creates pattern groups correctly', function (test) { }); patternlab.patterns.push( - new Pattern('foobar.mustache'), - new Pattern('test/bar.mustache'), - new Pattern('test/foo.mustache'), + 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'), @@ -404,8 +404,8 @@ tap.test( }); patternlab.patterns.push( - new Pattern('test/foo.mustache'), - new Pattern('test/bar.mustache'), + 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'), @@ -447,8 +447,8 @@ tap.test( }); patternlab.patterns.push( - new Pattern('test/foo.mustache'), - new Pattern('test/bar.mustache'), + 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'), @@ -504,8 +504,8 @@ tap.test( }); patternlab.patterns.push( - new Pattern('test/foo.mustache'), - new Pattern('test/bar.mustache'), + 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'), @@ -560,7 +560,7 @@ tap.test( patternlab.patterns.push( //this flat pattern is found and causes trouble for the rest of the crew - new Pattern('test/foo.mustache'), + new Pattern('test/foo.hbs'), new Pattern('patternGroup1/patternSubgroup1/blue.mustache'), new Pattern('patternGroup1/patternSubgroup1/red.mustache'), new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'), @@ -630,7 +630,7 @@ tap.test( patternlab.patterns.push( //this flat pattern is found and causes trouble for the rest of the crew - new Pattern('test/foo.mustache'), + new Pattern('test/foo.hbs'), new Pattern('patternGroup1/patternSubgroup1/blue.mustache'), new Pattern('patternGroup1/patternSubgroup1/red.mustache'), new Pattern('patternGroup1/patternSubgroup1/yellow.mustache'), diff --git a/packages/core/test/util/patternlab-config.json b/packages/core/test/util/patternlab-config.json index 6095b5288..31b1dce94 100644 --- a/packages/core/test/util/patternlab-config.json +++ b/packages/core/test/util/patternlab-config.json @@ -7,12 +7,12 @@ "meta": "./test/files/_meta/", "styleguide": "./test/files/styleguide/", "patternlabFiles": { - "general-header": "views/partials/general-header.mustache", - "general-footer": "views/partials/general-footer.mustache", - "patternSection": "views/partials/patternSection.mustache", + "general-header": "views/partials/general-header.hbs", + "general-footer": "views/partials/general-footer.hbs", + "patternSection": "views/partials/patternSection.hbs", "patternSectionSubgroup": - "views/partials/patternSectionSubgroup.mustache", - "viewall": "views/viewall.mustache" + "views/partials/patternSectionSubgroup.hbs", + "viewall": "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 1ec665048..d547ea28d 100644 --- a/packages/development-edition-engine-handlebars/patternlab-config.json +++ b/packages/development-edition-engine-handlebars/patternlab-config.json @@ -49,11 +49,11 @@ "annotations": "source/_annotations/", "styleguide": "dist/", "patternlabFiles": { - "general-header": "views/partials/general-header.mustache", - "general-footer": "views/partials/general-footer.mustache", - "patternSection": "views/partials/patternSection.mustache", - "patternSectionSubgroup": "views/partials/patternSectionSubgroup.mustache", - "viewall": "views/viewall.mustache" + "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": "viewall.hbs" }, "js": "source/js", "images": "source/images", diff --git a/packages/development-edition-engine-handlebars/source/_meta/_foot.mustache b/packages/development-edition-engine-handlebars/source/_meta/_foot.mustache deleted file mode 100644 index 98d360860..000000000 --- a/packages/development-edition-engine-handlebars/source/_meta/_foot.mustache +++ /dev/null @@ -1,9 +0,0 @@ - - - - - {{{ patternLabFoot }}} - - - - diff --git a/packages/development-edition-engine-handlebars/source/_meta/_head.mustache b/packages/development-edition-engine-handlebars/source/_meta/_head.mustache deleted file mode 100644 index 76899a54a..000000000 --- a/packages/development-edition-engine-handlebars/source/_meta/_head.mustache +++ /dev/null @@ -1,18 +0,0 @@ - - - - {{ title }} - - - - - - - - - {{{ patternLabHead }}} - - - - - diff --git a/packages/development-edition-engine-react/patternlab-config.json b/packages/development-edition-engine-react/patternlab-config.json index 8e42b1247..06f9bd2e8 100644 --- a/packages/development-edition-engine-react/patternlab-config.json +++ b/packages/development-edition-engine-react/patternlab-config.json @@ -41,15 +41,15 @@ "styleguide": "./node_modules/@pattern-lab/uikit-workshop/dist/", "patternlabFiles": { "general-header": - "./node_modules/@pattern-lab/uikit-workshop/views/partials/general-header.mustache", + "./node_modules/@pattern-lab/uikit-workshop/views/partials/general-header.hbs", "general-footer": - "./node_modules/@pattern-lab/uikit-workshop/views/partials/general-footer.mustache", + "./node_modules/@pattern-lab/uikit-workshop/views/partials/general-footer.hbs", "patternSection": - "./node_modules/@pattern-lab/uikit-workshop/views/partials/patternSection.mustache", + "./node_modules/@pattern-lab/uikit-workshop/views/partials/patternSection.hbs", "patternSectionSubgroup": - "./node_modules/@pattern-lab/uikit-workshop/views/partials/patternSectionSubgroup.mustache", + "./node_modules/@pattern-lab/uikit-workshop/views/partials/patternSectionSubgroup.hbs", "viewall": - "./node_modules/@pattern-lab/uikit-workshop/views/viewall.mustache" + "./node_modules/@pattern-lab/uikit-workshop/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 38527b3e6..7a472d6b7 100644 --- a/packages/development-edition-engine-twig/patternlab-config.json +++ b/packages/development-edition-engine-twig/patternlab-config.json @@ -49,11 +49,11 @@ "annotations": "source/_annotations/", "styleguide": "dist/", "patternlabFiles": { - "general-header": "views/partials/general-header.mustache", - "general-footer": "views/partials/general-footer.mustache", - "patternSection": "views/partials/patternSection.mustache", - "patternSectionSubgroup": "views/partials/patternSectionSubgroup.mustache", - "viewall": "views/viewall.mustache" + "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": "viewall.hbs" }, "js": "source/js", "images": "source/images", diff --git a/packages/docs/src/docs/advanced-config-options.md b/packages/docs/src/docs/advanced-config-options.md index 7f2b5384c..7be2f0813 100644 --- a/packages/docs/src/docs/advanced-config-options.md +++ b/packages/docs/src/docs/advanced-config-options.md @@ -57,7 +57,7 @@ Possibility to define whether the initial viewport width on opening pattern lab Sets default active pattern info code panel by file extension - if unset, uses the value out of _patternExtension_ config value, or instead use value `html` to display the html code initially, or the value defined for the _patternExtension_. -**default**: _patternExtension_ value (`"hbs"` | `"mustache"` | `"twig"` | `"html"`) +**default**: _patternExtension_ value (`"hbs"` | `"twig"` | `"html"`) ## ishControlsHide @@ -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.mustache", - "general-footer": "views/partials/general-footer.mustache", - "patternSection": "views/partials/patternSection.mustache", - "patternSectionSubgroup": "views/partials/patternSectionSubgroup.mustache", - "viewall": "views/viewall.mustache" + "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" }, "js": "./source/js", "images": "./source/images", diff --git a/packages/docs/src/docs/pattern-header-footer.md b/packages/docs/src/docs/pattern-header-footer.md index b7f561995..e9a2787f7 100644 --- a/packages/docs/src/docs/pattern-header-footer.md +++ b/packages/docs/src/docs/pattern-header-footer.md @@ -13,8 +13,8 @@ sitemapChangefreq: 'monthly' To add your own assets like JavaScript and CSS to your patterns' header and footer you need to modify two files: -- `./source/_meta/_head.mustache` -- `./source/_meta/_foot.mustache` +- `./source/_meta/_head.hbs` +- `./source/_meta/_foot.hbs` These files are added to every rendered pattern, "view all" page and style guide. To see your changes simply re-generate your site. @@ -22,7 +22,7 @@ These files are added to every rendered pattern, "view all" page and style guide **Do not remove the following two lines in these patterns:** -- a tag referencing `patternLabHead` in `_head.mustache` -- a tag referencing `patternLabFoot` in `_foot.mustache` +- a tag referencing `patternLabHead` in `_head.hbs` +- a tag referencing `patternLabFoot` in `_foot.hbs` Pattern Lab will not so mysteriously stop working if you do. diff --git a/packages/edition-node-gulp/patternlab-config.json b/packages/edition-node-gulp/patternlab-config.json index e63fec918..237ed1cd5 100644 --- a/packages/edition-node-gulp/patternlab-config.json +++ b/packages/edition-node-gulp/patternlab-config.json @@ -41,15 +41,15 @@ "styleguide": "dist/", "patternlabFiles": { "general-header": - "views/partials/general-header.mustache", + "views/partials/general-header.hbs", "general-footer": - "views/partials/general-footer.mustache", + "views/partials/general-footer.hbs", "patternSection": - "views/partials/patternSection.mustache", + "views/partials/patternSection.hbs", "patternSectionSubgroup": - "views/partials/patternSectionSubgroup.mustache", + "views/partials/patternSectionSubgroup.hbs", "viewall": - "views/viewall.mustache" + "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 4afb4d1d5..37026998c 100644 --- a/packages/edition-node/patternlab-config.json +++ b/packages/edition-node/patternlab-config.json @@ -41,15 +41,15 @@ "styleguide": "dist/", "patternlabFiles": { "general-header": - "views/partials/general-header.mustache", + "views/partials/general-header.hbs", "general-footer": - "views/partials/general-footer.mustache", + "views/partials/general-footer.hbs", "patternSection": - "views/partials/patternSection.mustache", + "views/partials/patternSection.hbs", "patternSectionSubgroup": - "views/partials/patternSectionSubgroup.mustache", + "views/partials/patternSectionSubgroup.hbs", "viewall": - "views/viewall.mustache" + "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 e9fd3c456..a422597d3 100644 --- a/packages/edition-twig/patternlab-config.json +++ b/packages/edition-twig/patternlab-config.json @@ -105,11 +105,11 @@ "annotations": "./source/_annotations/", "styleguide": "dist/", "patternlabFiles": { - "general-header": "views/partials/general-header.mustache", - "general-footer": "views/partials/general-footer.mustache", - "patternSection": "views/partials/patternSection.mustache", - "patternSectionSubgroup": "views/partials/patternSectionSubgroup.mustache", - "viewall": "views/viewall.mustache" + "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": "viewall.hbs" }, "js": "./source/js", "images": "./source/images", diff --git a/packages/core/test/files/_meta/_foot.mustache b/packages/edition-twig/source/_meta/_foot.hbs similarity index 100% rename from packages/core/test/files/_meta/_foot.mustache rename to packages/edition-twig/source/_meta/_foot.hbs diff --git a/packages/edition-twig/source/_meta/_foot.mustache b/packages/edition-twig/source/_meta/_foot.mustache deleted file mode 100644 index 797d9418d..000000000 --- a/packages/edition-twig/source/_meta/_foot.mustache +++ /dev/null @@ -1,6 +0,0 @@ - - -{{{ patternLabFoot }}} - - - diff --git a/packages/edition-twig/source/_meta/_head.mustache b/packages/edition-twig/source/_meta/_head.hbs similarity index 100% rename from packages/edition-twig/source/_meta/_head.mustache rename to packages/edition-twig/source/_meta/_head.hbs diff --git a/packages/engine-mustache/lib/engine_mustache.js b/packages/engine-mustache/lib/engine_mustache.js index e39359490..4698f491b 100644 --- a/packages/engine-mustache/lib/engine_mustache.js +++ b/packages/engine-mustache/lib/engine_mustache.js @@ -104,8 +104,8 @@ const engine_mustache = { * assume it's already present */ spawnMeta: function (config) { - this.spawnFile(config, '_head.mustache'); - this.spawnFile(config, '_foot.mustache'); + this.spawnFile(config, '_head.hbs'); + this.spawnFile(config, '_foot.hbs'); }, // find and return any {{> template-name }} within pattern diff --git a/packages/uikit-workshop/src/html/index.html b/packages/uikit-workshop/src/html/index.html index 00b7b7a21..b5f8174d1 100644 --- a/packages/uikit-workshop/src/html/index.html +++ b/packages/uikit-workshop/src/html/index.html @@ -26,7 +26,7 @@ - diff --git a/packages/uikit-workshop/src/scripts/components/plugin-loader.js b/packages/uikit-workshop/src/scripts/components/plugin-loader.js index 7a7cc5c64..1673d148a 100644 --- a/packages/uikit-workshop/src/scripts/components/plugin-loader.js +++ b/packages/uikit-workshop/src/scripts/components/plugin-loader.js @@ -19,7 +19,7 @@ export const pluginLoader = { const l = t.length - 1; const s = t[l]; const n = document.createElement('script'); - n.type = 'text/mustache'; + n.type = 'text/x-handlebars-template'; n.id = plugin.name.replace('/', '-') + '-' + key + '-template'; n.innerHTML = plugin.templates[key]; s.parentNode.insertBefore(n, s.nextSibling); diff --git a/packages/uikit-workshop/views/partials/general-footer.mustache b/packages/uikit-workshop/views/partials/general-footer.hbs similarity index 100% rename from packages/uikit-workshop/views/partials/general-footer.mustache rename to packages/uikit-workshop/views/partials/general-footer.hbs diff --git a/packages/uikit-workshop/views/partials/general-header.mustache b/packages/uikit-workshop/views/partials/general-header.hbs similarity index 100% rename from packages/uikit-workshop/views/partials/general-header.mustache rename to packages/uikit-workshop/views/partials/general-header.hbs diff --git a/packages/uikit-workshop/views/partials/patternSection.mustache b/packages/uikit-workshop/views/partials/patternSection.hbs similarity index 100% rename from packages/uikit-workshop/views/partials/patternSection.mustache rename to packages/uikit-workshop/views/partials/patternSection.hbs diff --git a/packages/uikit-workshop/views/partials/patternSectionSubgroup.mustache b/packages/uikit-workshop/views/partials/patternSectionSubgroup.hbs similarity index 100% rename from packages/uikit-workshop/views/partials/patternSectionSubgroup.mustache rename to packages/uikit-workshop/views/partials/patternSectionSubgroup.hbs diff --git a/packages/uikit-workshop/views/viewall.mustache b/packages/uikit-workshop/views/viewall.hbs similarity index 100% rename from packages/uikit-workshop/views/viewall.mustache rename to packages/uikit-workshop/views/viewall.hbs From 82d79c291ce347e1c9660cc4c5322dbb3b03f320 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Mon, 26 Dec 2022 00:34:02 +0100 Subject: [PATCH 02/30] refactor: changed mustache to handlebars extensions --- packages/core/src/lib/buildPatterns.js | 2 +- packages/core/src/lib/object_factory.js | 6 +- .../patternType1/patternSubType1/blue.hbs | 1 + .../patternSubType1/blue.mustache | 1 - .../patternType1/patternSubType1/red.hbs | 1 + .../patternType1/patternSubType1/red.mustache | 1 - .../patternType1/patternSubType1/yellow.hbs | 1 + .../patternSubType1/yellow.mustache | 1 - .../patternType1/patternSubType2/black.hbs | 1 + .../patternSubType2/black.mustache | 1 - .../patternType1/patternSubType2/grey.hbs | 1 + .../patternSubType2/grey.mustache | 1 - .../patternType1/patternSubType2/white.hbs | 1 + .../patternSubType2/white.mustache | 1 - .../files/{viewall.mustache => viewall.hbs} | 0 packages/core/test/lineage_hunter_tests.js | 28 ++--- packages/core/test/loadPattern_tests.js | 4 +- packages/core/test/object_factory_tests.js | 56 ++++----- packages/core/test/pattern_engines_tests.js | 18 +-- packages/core/test/processRecursive_tests.js | 12 +- packages/core/test/ui_builder_tests.js | 112 +++++++++--------- .../core/test/watchPatternLabFiles_tests.js | 6 +- .../docs/src/docs/data-pattern-specific.md | 2 +- packages/docs/src/docs/pattern-add-new.md | 14 +-- packages/docs/src/docs/pattern-documenting.md | 4 +- packages/docs/src/docs/pattern-hiding.md | 2 +- packages/docs/src/docs/pattern-including.md | 18 +-- .../docs/src/docs/pattern-organization.md | 6 +- .../docs/src/docs/pattern-pseudo-patterns.md | 16 +-- .../docs/src/docs/pattern-reorganizing.md | 18 +-- packages/docs/src/docs/pattern-states.md | 2 +- .../_meta/{_foot.mustache => _foot.hbs} | 0 .../_meta/{_head.mustache => _head.hbs} | 0 .../_meta/{_foot.mustache => _foot.hbs} | 0 .../_meta/{_head.mustache => _head.hbs} | 0 packages/plugin-tab/README.md | 2 +- 36 files changed, 169 insertions(+), 171 deletions(-) create mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType1/blue.hbs delete mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType1/blue.mustache create mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType1/red.hbs delete mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType1/red.mustache create mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.hbs delete mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.mustache create mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType2/black.hbs delete mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType2/black.mustache create mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType2/grey.hbs delete mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType2/grey.mustache create mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType2/white.hbs delete mode 100644 packages/core/test/files/_patterns/patternType1/patternSubType2/white.mustache rename packages/core/test/files/{viewall.mustache => viewall.hbs} (100%) rename packages/edition-node-gulp/source/_meta/{_foot.mustache => _foot.hbs} (100%) rename packages/edition-node-gulp/source/_meta/{_head.mustache => _head.hbs} (100%) rename packages/edition-node/source/_meta/{_foot.mustache => _foot.hbs} (100%) rename packages/edition-node/source/_meta/{_head.mustache => _head.hbs} (100%) diff --git a/packages/core/src/lib/buildPatterns.js b/packages/core/src/lib/buildPatterns.js index 476a373c6..cd0187b4c 100644 --- a/packages/core/src/lib/buildPatterns.js +++ b/packages/core/src/lib/buildPatterns.js @@ -91,7 +91,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => { //take the user defined head and foot and process any data and patterns that apply //todo this need to be made aware of multiple ui kits - //perhaps we can check for a convention like [uikitname]_00-head.mustache, and if found, add them to patternlab.uikits[uikitname].userFoot + //perhaps we can check for a convention like [uikitname]_head.hbs, and if found, add them to patternlab.uikits[uikitname].userFoot //then, if present, use those during compose() const headPatternPromise = processMetaPattern( `_head.${patternlab.config.patternExtension}`, diff --git a/packages/core/src/lib/object_factory.js b/packages/core/src/lib/object_factory.js index 704474881..e2ac77f8b 100644 --- a/packages/core/src/lib/object_factory.js +++ b/packages/core/src/lib/object_factory.js @@ -33,7 +33,7 @@ const Pattern = function ( patternlab, isPromoteToFlatPatternRun ) { - this.relPath = path.normalize(relPath); // 'atoms/global/colors.mustache' + this.relPath = path.normalize(relPath); // 'atoms/global/colors.hbs' /** * We expect relPath to be the path of the pattern template, relative to the @@ -52,7 +52,7 @@ const Pattern = function ( this.fileName = pathObj.name; // 'colors' this.subdir = pathObj.dir; // 'atoms/global' - this.fileExtension = pathObj.ext; // '.mustache' + this.fileExtension = pathObj.ext; // '.hbs' // TODO: Remove if block when dropping ordering by prefix and keep else code // (When we drop the info about the old ordering is deprecated) @@ -347,7 +347,7 @@ Pattern.prototype = { */ getPatternInfo: (pathObj, patternlab, isPromoteToFlatPatternRun) => { const info = { - // colors(.mustache) is deeply nested in atoms-/global/colors + // colors(.hbs) is deeply nested in atoms-/global/colors patternlab: patternlab, patternHasOwnDir: isPromoteToFlatPatternRun ? path.basename(pathObj.dir).replace(prefixMatcher, '') === diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType1/blue.hbs b/packages/core/test/files/_patterns/patternType1/patternSubType1/blue.hbs new file mode 100644 index 000000000..f5ac3db8c --- /dev/null +++ b/packages/core/test/files/_patterns/patternType1/patternSubType1/blue.hbs @@ -0,0 +1 @@ +blue \ No newline at end of file diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType1/blue.mustache b/packages/core/test/files/_patterns/patternType1/patternSubType1/blue.mustache deleted file mode 100644 index 24560d9b8..000000000 --- a/packages/core/test/files/_patterns/patternType1/patternSubType1/blue.mustache +++ /dev/null @@ -1 +0,0 @@ -blue diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType1/red.hbs b/packages/core/test/files/_patterns/patternType1/patternSubType1/red.hbs new file mode 100644 index 000000000..46f29e8eb --- /dev/null +++ b/packages/core/test/files/_patterns/patternType1/patternSubType1/red.hbs @@ -0,0 +1 @@ +red \ No newline at end of file diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType1/red.mustache b/packages/core/test/files/_patterns/patternType1/patternSubType1/red.mustache deleted file mode 100644 index a9d1386a1..000000000 --- a/packages/core/test/files/_patterns/patternType1/patternSubType1/red.mustache +++ /dev/null @@ -1 +0,0 @@ -red diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.hbs b/packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.hbs new file mode 100644 index 000000000..2ae696955 --- /dev/null +++ b/packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.hbs @@ -0,0 +1 @@ +yellow \ No newline at end of file diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.mustache b/packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.mustache deleted file mode 100644 index d1ed081df..000000000 --- a/packages/core/test/files/_patterns/patternType1/patternSubType1/yellow.mustache +++ /dev/null @@ -1 +0,0 @@ -yellow diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType2/black.hbs b/packages/core/test/files/_patterns/patternType1/patternSubType2/black.hbs new file mode 100644 index 000000000..b3ca90996 --- /dev/null +++ b/packages/core/test/files/_patterns/patternType1/patternSubType2/black.hbs @@ -0,0 +1 @@ +black \ No newline at end of file diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType2/black.mustache b/packages/core/test/files/_patterns/patternType1/patternSubType2/black.mustache deleted file mode 100644 index 7e66a17d4..000000000 --- a/packages/core/test/files/_patterns/patternType1/patternSubType2/black.mustache +++ /dev/null @@ -1 +0,0 @@ -black diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType2/grey.hbs b/packages/core/test/files/_patterns/patternType1/patternSubType2/grey.hbs new file mode 100644 index 000000000..d47f15103 --- /dev/null +++ b/packages/core/test/files/_patterns/patternType1/patternSubType2/grey.hbs @@ -0,0 +1 @@ +grey \ No newline at end of file diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType2/grey.mustache b/packages/core/test/files/_patterns/patternType1/patternSubType2/grey.mustache deleted file mode 100644 index 546ef5d97..000000000 --- a/packages/core/test/files/_patterns/patternType1/patternSubType2/grey.mustache +++ /dev/null @@ -1 +0,0 @@ -grey diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType2/white.hbs b/packages/core/test/files/_patterns/patternType1/patternSubType2/white.hbs new file mode 100644 index 000000000..65c27486f --- /dev/null +++ b/packages/core/test/files/_patterns/patternType1/patternSubType2/white.hbs @@ -0,0 +1 @@ +white \ No newline at end of file diff --git a/packages/core/test/files/_patterns/patternType1/patternSubType2/white.mustache b/packages/core/test/files/_patterns/patternType1/patternSubType2/white.mustache deleted file mode 100644 index 57d4625e3..000000000 --- a/packages/core/test/files/_patterns/patternType1/patternSubType2/white.mustache +++ /dev/null @@ -1 +0,0 @@ -white diff --git a/packages/core/test/files/viewall.mustache b/packages/core/test/files/viewall.hbs similarity index 100% rename from packages/core/test/files/viewall.mustache rename to packages/core/test/files/viewall.hbs diff --git a/packages/core/test/lineage_hunter_tests.js b/packages/core/test/lineage_hunter_tests.js index db1211b72..3e09844a9 100644 --- a/packages/core/test/lineage_hunter_tests.js +++ b/packages/core/test/lineage_hunter_tests.js @@ -22,7 +22,7 @@ const lineage_hunter = new lh(); // fake pattern creators function createFakeEmptyErrorPattern() { return new Pattern( - 'molecules/toast/error.mustache', // relative path now + 'molecules/toast/error.hbs', // relative path now null // data ); } @@ -61,7 +61,7 @@ function createBasePatternLabObject() { tap.test('find_lineage - finds lineage', function (test) { //setup current pattern from what we would have during execution var currentPattern = new Pattern( - 'organisms/global/header.mustache', // relative path now + 'organisms/global/header.hbs', // relative path now null // data ); extend(currentPattern, { @@ -77,7 +77,7 @@ tap.test('find_lineage - finds lineage', function (test) { Pattern.createEmpty({ name: 'atoms-images-logo', subdir: 'atoms\\images', - filename: 'logo.mustache', + filename: 'logo.hbs', data: null, template: '', @@ -98,7 +98,7 @@ tap.test('find_lineage - finds lineage', function (test) { Pattern.createEmpty({ name: 'molecules-navigation-primary-nav', subdir: 'molecules\\navigation', - filename: 'primary-nav.mustache', + filename: 'primary-nav.hbs', data: null, template: '\r\n', @@ -120,7 +120,7 @@ tap.test('find_lineage - finds lineage', function (test) { Pattern.createEmpty({ name: 'molecules-forms-search', subdir: 'molecules\\forms', - filename: 'search.mustache', + filename: 'search.hbs', data: null, template: '
\r\n
\r\n\t Search\r\n\t \r\n\t \r\n\t \r\n
\r\n
', @@ -178,7 +178,7 @@ tap.test( var patternlab = { graph: new PatternGraph(null, 0), patterns: [ - Pattern.create('atoms/alerts/error.mustache', null, { + Pattern.create('atoms/alerts/error.hbs', null, { template: '

{{message}}

', extendedTemplate: '

{{message}}

', }), @@ -377,7 +377,7 @@ tap.test( Pattern.createEmpty({ name: 'atoms-alerts-error', subdir: 'atoms\\alerts', - filename: 'error.mustache', + filename: 'error.hbs', data: null, template: '

{{message}}

', extendedTemplate: '

{{message}}

', @@ -435,7 +435,7 @@ tap.test( var currentPattern = Pattern.createEmpty({ name: 'molecules-toast-error', subdir: 'molecules\\toast', - filename: 'error.mustache', + filename: 'error.hbs', data: null, template: '{{> atoms-error:foo }}', extendedTemplate: '{{> atoms-error:foo }}', @@ -457,7 +457,7 @@ tap.test( Pattern.createEmpty({ name: 'atoms-alerts-error', subdir: 'atoms\\alerts', - filename: 'error.mustache', + filename: 'error.hbs', data: null, template: '

{{message}}

', extendedTemplate: '

{{message}}

', @@ -499,7 +499,7 @@ tap.test( var currentPattern = Pattern.createEmpty({ name: 'molecules-toast-error', subdir: 'molecules\\toast', - filename: 'error.mustache', + filename: 'error.hbs', data: null, template: '{{> atoms-error:foo }}', extendedTemplate: '{{>atoms-error:foo}}', @@ -521,7 +521,7 @@ tap.test( Pattern.createEmpty({ name: 'atoms-alerts-error', subdir: 'atoms\\alerts', - filename: 'error.mustache', + filename: 'error.hbs', data: null, template: '

{{message}}

', extendedTemlpate: '

{{message}}

', @@ -563,7 +563,7 @@ tap.test( var currentPattern = Pattern.createEmpty({ name: 'molecules-toast-error', subdir: 'molecules\\toast', - filename: 'error.mustache', + filename: 'error.hbs', data: null, template: '{{> atoms-e:foo }}', extendedTemplate: '{{>atoms-e:foo}}', @@ -585,7 +585,7 @@ tap.test( Pattern.createEmpty({ name: 'atoms-alerts-error', subdir: 'atoms\\alerts', - filename: 'error.mustache', + filename: 'error.hbs', data: null, template: '

{{message}}

', extendedTemplate: '

{{message}}

', @@ -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 Avatar ``` -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 Avatar @@ -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 @@
{{> test-styled-atom }} - {{> test-styled-atom:test_2(message: '2') }} - {{> test-styled-atom:test_3(message: '3') }} + {{> test-styled-atom additionalClasses="test_2" message="2" }} + {{> test-styled-atom additionalClasses="test_3" message="3" }} {{> test-styled-atom }}
diff --git a/packages/core/test/files/_patterns/test/c.hbs b/packages/core/test/files/_patterns/test/c.hbs index 6098102c8..5c462b9d2 100644 --- a/packages/core/test/files/_patterns/test/c.hbs +++ b/packages/core/test/files/_patterns/test/c.hbs @@ -1,2 +1,2 @@ c -{{> test-b(b: true) }} +{{> test-b b=true }} diff --git a/packages/core/test/files/_patterns/test/group2.hbs b/packages/core/test/files/_patterns/test/group2.hbs index a3986a1b5..e2c4a2330 100644 --- a/packages/core/test/files/_patterns/test/group2.hbs +++ b/packages/core/test/files/_patterns/test/group2.hbs @@ -1,6 +1,6 @@
- {{> test-styled-atom:test_1(message: "1" ) }} - {{> test-styled-atom:test_2(message: "2" ) }} - {{> test-styled-atom:test_3(message: "3" ) }} - {{> test-styled-atom:test_4(message: "4" ) }} + {{> test-styled-atom additionalClasses="test_1" message="1" }} + {{> test-styled-atom additionalClasses="test_2" message="2" }} + {{> test-styled-atom additionalClasses="test_3" message="3" }} + {{> test-styled-atom additionalClasses="test_4" message="4" }}
diff --git a/packages/core/test/files/_patterns/test/linkInParameter.hbs b/packages/core/test/files/_patterns/test/linkInParameter.hbs index 7cba618ce..aa2e1cd9b 100644 --- a/packages/core/test/files/_patterns/test/linkInParameter.hbs +++ b/packages/core/test/files/_patterns/test/linkInParameter.hbs @@ -1 +1 @@ -{{> test-link(url: 'link.test-comment') }} +{{> test-link url='link.test-comment' }} diff --git a/packages/core/test/files/_patterns/test/mixed-params.hbs b/packages/core/test/files/_patterns/test/mixed-params.hbs index 408b3f1e4..dcf8b6ebc 100644 --- a/packages/core/test/files/_patterns/test/mixed-params.hbs +++ b/packages/core/test/files/_patterns/test/mixed-params.hbs @@ -1,6 +1,6 @@
{{> test-styled-atom }} - {{> test-styled-atom:test_2(message: '2') }} - {{> test-styled-atom:test_3(message: '3') }} - {{> test-styled-atom:test_4(message: '4') }} + {{> test-styled-atom additionalClasses="test_2" message='2' }} + {{> test-styled-atom additionalClasses="test_3" message='3' }} + {{> test-styled-atom additionalClasses="test_4" message='4' }}
diff --git a/packages/core/test/files/_patterns/test/multiple-classes-numeric.hbs b/packages/core/test/files/_patterns/test/multiple-classes-numeric.hbs index 307439ce4..5e67cc16a 100644 --- a/packages/core/test/files/_patterns/test/multiple-classes-numeric.hbs +++ b/packages/core/test/files/_patterns/test/multiple-classes-numeric.hbs @@ -1,5 +1,5 @@
- {{> test-styled-atom:foo1 }} - {{> test-styled-atom:foo1|foo2 }} - {{> test-styled-atom:foo1|foo2(message: "bar") }} + {{> test-styled-atom additionalClasses="foo1" }} + {{> test-styled-atom additionalClasses="foo1 foo2" }} + {{> test-styled-atom additionalClasses="foo1 foo2" message="bar" }}
diff --git a/packages/core/test/files/_patterns/test/paramParent.hbs b/packages/core/test/files/_patterns/test/paramParent.hbs index 5ae3cb466..ee088d5f1 100644 --- a/packages/core/test/files/_patterns/test/paramParent.hbs +++ b/packages/core/test/files/_patterns/test/paramParent.hbs @@ -1 +1 @@ -{{> test-paramMiddle(additionalClasses: "foo") }} +{{> test-paramMiddle additionalClasses="foo" }} diff --git a/packages/core/test/files/_patterns/test/parameterTags.hbs b/packages/core/test/files/_patterns/test/parameterTags.hbs index d8d3955f4..fb6cd4fc0 100644 --- a/packages/core/test/files/_patterns/test/parameterTags.hbs +++ b/packages/core/test/files/_patterns/test/parameterTags.hbs @@ -1 +1 @@ -{{> test-comment-tag(tag1: 'Single-quoted', tag2: \"Double-quoted\", tag3: 'With attributes') }} +{{> test-comment-tag tag1='Single-quoted' tag2='Double-quoted' tag3='With attributes' }} diff --git a/packages/core/test/files/_patterns/test/sticky-comment-verbose.hbs b/packages/core/test/files/_patterns/test/sticky-comment-verbose.hbs index 168b757d9..e4359ba2c 100644 --- a/packages/core/test/files/_patterns/test/sticky-comment-verbose.hbs +++ b/packages/core/test/files/_patterns/test/sticky-comment-verbose.hbs @@ -1 +1 @@ -{{> test/comment(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }} +{{> test/comment description='A life is like a garden. Perfect moments can be had, but not preserved, except in memory.' }} diff --git a/packages/core/test/files/_patterns/test/sticky-comment.hbs b/packages/core/test/files/_patterns/test/sticky-comment.hbs index 4bc1899e9..ffaeeb272 100644 --- a/packages/core/test/files/_patterns/test/sticky-comment.hbs +++ b/packages/core/test/files/_patterns/test/sticky-comment.hbs @@ -1 +1 @@ -{{> test-comment(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }} +{{> test-comment description='A life is like a garden. Perfect moments can be had, but not preserved, except in memory.' }} From 764d0f2711763e06d2275cdcaf697dfad2fcfb44 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Tue, 3 Jan 2023 19:36:48 +0100 Subject: [PATCH 25/30] chore: set this explicitly, aligned with the others --- packages/engine-liquid/lib/engine_liquid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/engine-liquid/lib/engine_liquid.js b/packages/engine-liquid/lib/engine_liquid.js index b5e5dd56b..7f0b3e10f 100644 --- a/packages/engine-liquid/lib/engine_liquid.js +++ b/packages/engine-liquid/lib/engine_liquid.js @@ -40,7 +40,7 @@ module.exports = { // // partial expansion is only necessary for Mustache templates that have // // style modifiers or pattern parameters (I think) - // expandPartials: true, + expandPartials: false, // regexes, stored here so they're only compiled once findPartialsRE: utils.partialsRE, From 82916a1174a3fa85ea239a1073fa01fb894b31d1 Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:38:47 +0100 Subject: [PATCH 26/30] test: updated test case files --- .../test/files/_patterns/test/another-styled-atom.hbs | 2 +- .../core/test/files/_patterns/test/bookend-listitem.hbs | 2 +- packages/core/test/files/_patterns/test/bookend.hbs | 4 ++-- packages/core/test/files/_patterns/test/group.hbs | 8 ++++---- packages/core/test/files/_patterns/test/mixed.hbs | 6 +++--- .../core/test/files/_patterns/test/pseudomodifier.hbs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/core/test/files/_patterns/test/another-styled-atom.hbs b/packages/core/test/files/_patterns/test/another-styled-atom.hbs index 2f03b4974..55598c8ec 100644 --- a/packages/core/test/files/_patterns/test/another-styled-atom.hbs +++ b/packages/core/test/files/_patterns/test/another-styled-atom.hbs @@ -1 +1 @@ -{{> test-styled-atom:test_1 }} +{{> test-styled-atom additionalClasses="test_1" }} diff --git a/packages/core/test/files/_patterns/test/bookend-listitem.hbs b/packages/core/test/files/_patterns/test/bookend-listitem.hbs index 816c37c92..1ef36b08d 100644 --- a/packages/core/test/files/_patterns/test/bookend-listitem.hbs +++ b/packages/core/test/files/_patterns/test/bookend-listitem.hbs @@ -1,7 +1,7 @@
{{#listItems.two}} {{> test-styled-atom }} - {{> test-styled-atom:test_1 }} + {{> test-styled-atom additionalClasses="test_1" }} {{> test-styled-atom}} {{/listItems.two}}
diff --git a/packages/core/test/files/_patterns/test/bookend.hbs b/packages/core/test/files/_patterns/test/bookend.hbs index 74fc3451b..1589820c2 100644 --- a/packages/core/test/files/_patterns/test/bookend.hbs +++ b/packages/core/test/files/_patterns/test/bookend.hbs @@ -1,6 +1,6 @@
{{> test-styled-atom }} - {{> test-styled-atom:test_2 }} - {{> test-styled-atom:test_3 }} + {{> test-styled-atom additionalClasses="test_2" }} + {{> test-styled-atom additionalClasses="test_3" }} {{> test-styled-atom}}
diff --git a/packages/core/test/files/_patterns/test/group.hbs b/packages/core/test/files/_patterns/test/group.hbs index 24ee58979..a11a2dd1e 100644 --- a/packages/core/test/files/_patterns/test/group.hbs +++ b/packages/core/test/files/_patterns/test/group.hbs @@ -1,6 +1,6 @@
- {{> test-styled-atom:test_1 }} - {{> test-styled-atom:test_2 }} - {{> test-styled-atom:test_3 }} - {{> test-styled-atom:test_4 }} + {{> test-styled-atom additionalClasses="test_1" }} + {{> test-styled-atom additionalClasses="test_2" }} + {{> test-styled-atom additionalClasses="test_3" }} + {{> test-styled-atom additionalClasses="test_4" }}
diff --git a/packages/core/test/files/_patterns/test/mixed.hbs b/packages/core/test/files/_patterns/test/mixed.hbs index b0c6d610f..0f432dff1 100644 --- a/packages/core/test/files/_patterns/test/mixed.hbs +++ b/packages/core/test/files/_patterns/test/mixed.hbs @@ -1,6 +1,6 @@
{{> test-styled-atom }} - {{> test-styled-atom:test_2 }} - {{> test-styled-atom:test_3 }} - {{> test-styled-atom:test_4 }} + {{> test-styled-atom additionalClasses="test_2" }} + {{> test-styled-atom additionalClasses="test_3" }} + {{> test-styled-atom additionalClasses="test_4" }}
diff --git a/packages/core/test/files/_patterns/test/pseudomodifier.hbs b/packages/core/test/files/_patterns/test/pseudomodifier.hbs index 3ddc86ae6..6b3691bf7 100644 --- a/packages/core/test/files/_patterns/test/pseudomodifier.hbs +++ b/packages/core/test/files/_patterns/test/pseudomodifier.hbs @@ -1,2 +1,2 @@ {{test}} -{{> test-styled-atom:modifier--foo }} +{{> test-styled-atom additionalClasses="modifier--foo" }} From b5a44263ee6eafc209ae224d4b002080ce0f8eb6 Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:44:31 +0100 Subject: [PATCH 27/30] test: we need to ignore our handlebars files that contain partials references --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index e700be58e..bafc456f0 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,3 +14,4 @@ packages/**/annotations.js *.md *.scss **/_meta/_head.* +packages/core/test/**/*.hbs From 781f0b04cfcc5db89e824d2e776afda0fab8eb1a Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:45:19 +0100 Subject: [PATCH 28/30] chore: simple comment --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index bafc456f0..1f4bf3a91 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,4 +14,5 @@ packages/**/annotations.js *.md *.scss **/_meta/_head.* +# Ignoring handlebars template files that contain partials because of https://github.com/prettier/prettier/issues/11834 packages/core/test/**/*.hbs From f8bf5f1e7de2a577ad5fb07386724cea46faaba4 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Sat, 1 Apr 2023 19:37:20 +0200 Subject: [PATCH 29/30] refactor: removed expandPartials that was only necessary and active for Mustache engine --- packages/core/src/lib/decompose.js | 1 - packages/core/src/lib/expandPartials.js | 78 ------------------- .../lib/engine_handlebars.js | 4 - packages/engine-liquid/lib/engine_liquid.js | 4 - .../engine-nunjucks/lib/engine_nunjucks.js | 3 - packages/engine-react/lib/engine_react.js | 3 - .../engine-twig-php/lib/engine_twig_php.js | 1 - .../lib/engine_underscore.js | 4 - 8 files changed, 98 deletions(-) delete mode 100644 packages/core/src/lib/expandPartials.js diff --git a/packages/core/src/lib/decompose.js b/packages/core/src/lib/decompose.js index 4c35cd694..054c28634 100644 --- a/packages/core/src/lib/decompose.js +++ b/packages/core/src/lib/decompose.js @@ -4,7 +4,6 @@ const logger = require('./log'); const lh = require('./lineage_hunter'); const lih = require('./list_item_hunter'); const addPattern = require('./addPattern'); -const expandPartials = require('./expandPartials'); const lineage_hunter = new lh(); const list_item_hunter = new lih(); diff --git a/packages/core/src/lib/expandPartials.js b/packages/core/src/lib/expandPartials.js deleted file mode 100644 index d9f7fad8e..000000000 --- a/packages/core/src/lib/expandPartials.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -const logger = require('./log'); -const ph = require('./parameter_hunter'); -const jsonCopy = require('./json_copy'); -const getPartial = require('./get'); - -const parameter_hunter = new ph(); - -module.exports = function (currentPattern, patternlab) { - const processRecursive = require('./processRecursive'); - - //find how many partials there may be for the given pattern - const foundPatternPartials = currentPattern.findPartials(); - - // expand any partials present in this pattern; that is, drill down into - // the template and replace their calls in this template with rendered - // results - if ( - currentPattern.engine.expandPartials && - foundPatternPartials !== null && - foundPatternPartials.length > 0 - ) { - logger.debug(`found partials for ${currentPattern.patternPartial}`); - - // determine if the template contains any pattern parameters. if so they - // must be immediately consumed - return parameter_hunter - .find_parameters(currentPattern, patternlab) - .then(() => { - //do something with the regular old partials - foundPatternPartials.forEach((foundPartial) => { - const partial = currentPattern.findPartial(foundPartial); - const partialPattern = getPartial(partial, patternlab); - - //recurse through nested partials to fill out this extended template. - return processRecursive(partialPattern.relPath, patternlab) - .then(() => { - //eslint-disable-line no-loop-func - - //complete assembly of extended template - //create a copy of the partial so as to not pollute it after the getPartial call. - const cleanPartialPattern = jsonCopy( - partialPattern, - `partial pattern ${partial}` - ); - - //this is what we came here for - logger.debug( - `within ${currentPattern.patternPartial}, replacing extendedTemplate partial ${foundPartial} with ${cleanPartialPattern.patternPartial}'s extendedTemplate` - ); - - currentPattern.extendedTemplate = - currentPattern.extendedTemplate.replace( - foundPartial, - cleanPartialPattern.extendedTemplate - ); - - // update the extendedTemplate in the partials object in case this - // pattern is consumed later - patternlab.partials[currentPattern.patternPartial] = - currentPattern.extendedTemplate; - - return Promise.resolve(); - }) - .catch((reason) => { - console.log(reason); - logger.error(reason); - }); - }); - }) - .catch((reason) => { - console.log(reason); - logger.error(reason); - }); - } - return Promise.resolve(); -}; diff --git a/packages/engine-handlebars/lib/engine_handlebars.js b/packages/engine-handlebars/lib/engine_handlebars.js index d182971c1..615e5e710 100644 --- a/packages/engine-handlebars/lib/engine_handlebars.js +++ b/packages/engine-handlebars/lib/engine_handlebars.js @@ -54,10 +54,6 @@ const engine_handlebars = { engineName: 'handlebars', engineFileExtension: ['.hbs', '.handlebars'], - // partial expansion is only necessary for Mustache templates that have - // style modifiers or pattern parameters (I think) - expandPartials: false, - // render it renderPattern: function renderPattern(pattern, data, partials) { if (partials) { diff --git a/packages/engine-liquid/lib/engine_liquid.js b/packages/engine-liquid/lib/engine_liquid.js index 7f0b3e10f..13615ff51 100644 --- a/packages/engine-liquid/lib/engine_liquid.js +++ b/packages/engine-liquid/lib/engine_liquid.js @@ -38,10 +38,6 @@ module.exports = { engineFileExtension: ['.liquid', '.html'], isAsync: true, - // // partial expansion is only necessary for Mustache templates that have - // // style modifiers or pattern parameters (I think) - expandPartials: false, - // regexes, stored here so they're only compiled once findPartialsRE: utils.partialsRE, findPartialsWithStyleModifiersRE: utils.partialsWithStyleModifiersRE, diff --git a/packages/engine-nunjucks/lib/engine_nunjucks.js b/packages/engine-nunjucks/lib/engine_nunjucks.js index 939e21adc..cb43977f3 100644 --- a/packages/engine-nunjucks/lib/engine_nunjucks.js +++ b/packages/engine-nunjucks/lib/engine_nunjucks.js @@ -33,9 +33,6 @@ const engine_nunjucks = { engineName: 'nunjucks', engineFileExtension: '.njk', - //Important! Must be false for Nunjucks' block inheritance to work. Otherwise Nunjucks sees them as being defined more than once. - expandPartials: false, - // regexes, stored here so they're only compiled once findPartialsRE: /{%\s*(?:extends|include|import|from)\s+(?:'[^']+'|"[^"]+").*%}/g, diff --git a/packages/engine-react/lib/engine_react.js b/packages/engine-react/lib/engine_react.js index a27f0c432..c0ac7f889 100644 --- a/packages/engine-react/lib/engine_react.js +++ b/packages/engine-react/lib/engine_react.js @@ -87,9 +87,6 @@ var engine_react = { engineName: 'react', engineFileExtension: ['.jsx', '.js'], - // hell no - expandPartials: false, - // regexes, stored here so they're only compiled once findPartialsRE: /import .* from '[^']+'/g, findPartialsWithStyleModifiersRE: null, diff --git a/packages/engine-twig-php/lib/engine_twig_php.js b/packages/engine-twig-php/lib/engine_twig_php.js index 0f728dc6b..7e122c305 100644 --- a/packages/engine-twig-php/lib/engine_twig_php.js +++ b/packages/engine-twig-php/lib/engine_twig_php.js @@ -26,7 +26,6 @@ const engine_twig_php = { engine: TwigRenderer, engineName: 'twig-php', engineFileExtension: '.twig', - expandPartials: false, findPartialsRE: /{[%{]\s*.*?(?:extends|include|embed|from|import|use)\(?\s*['"](.+?)['"][\s\S]*?\)?\s*[%}]}/g, namespaces: [], diff --git a/packages/engine-underscore/lib/engine_underscore.js b/packages/engine-underscore/lib/engine_underscore.js index 86b34c307..f0b4dfb59 100644 --- a/packages/engine-underscore/lib/engine_underscore.js +++ b/packages/engine-underscore/lib/engine_underscore.js @@ -92,10 +92,6 @@ const engine_underscore = { engineName: 'underscore', engineFileExtension: ['.html', '.underscore'], - // partial expansion is only necessary for Mustache templates that have - // style modifiers or pattern parameters (I think) - expandPartials: false, - // regexes, stored here so they're only compiled once findPartialsRE: /<%=\s*_\.renderNamedPartial[ \t]*\(\s*("(?:[^"].*?)"|'(?:[^'].*?)').*?%>/g, // TODO From 80eadf78a5919aad9095a3501625c70cb7a8c2d3 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Sat, 1 Apr 2023 20:19:54 +0200 Subject: [PATCH 30/30] refactor: removed leftovers --- packages/core/src/lib/decompose.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/core/src/lib/decompose.js b/packages/core/src/lib/decompose.js index 054c28634..7622eb3c7 100644 --- a/packages/core/src/lib/decompose.js +++ b/packages/core/src/lib/decompose.js @@ -27,8 +27,6 @@ module.exports = function (pattern, patternlab, ignoreLineage) { patternlab ); - const expandPartialPromise = expandPartials(pattern, patternlab); - let lineagePromise; //find pattern lineage @@ -45,12 +43,9 @@ module.exports = function (pattern, patternlab, ignoreLineage) { addPattern(pattern, patternlab); }); - return Promise.all([ - listItemPromise, - expandPartialPromise, - lineagePromise, - addPromise, - ]).catch((reason) => { - logger.error(reason); - }); + return Promise.all([listItemPromise, lineagePromise, addPromise]).catch( + (reason) => { + logger.error(reason); + } + ); };