Skip to content

Commit

Permalink
Merge pull request #1038 from pattern-lab/starterkit-handlebars-demo
Browse files Browse the repository at this point in the history
feat(starterkits): add starterkit-handlebars-demo
  • Loading branch information
bmuenzenmeyer authored Aug 23, 2019
2 parents d245b3b + f04fd26 commit 502fde7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 39 deletions.
12 changes: 4 additions & 8 deletions packages/cli/bin/inquiries/edition.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@ const editionSetup = [
message: 'Which edition do you want to use (defaults to edition-node)?',
choices: [
{
name: 'edition-twig (php engine)',
value: '@pattern-lab/edition-twig',
},
{
name: 'edition-node',
name: 'edition-node (handlebars engine)',
value: '@pattern-lab/edition-node',
},
{
name: 'edition-node-grunt',
value: '@pattern-lab/edition-node-grunt',
name: 'edition-twig (php engine)',
value: '@pattern-lab/edition-twig',
},
{
name: 'edition-node-gulp',
name: 'edition-node-gulp (legacy)',
value: '@pattern-lab/edition-node-gulp',
},
new inquirer.Separator(),
Expand Down
43 changes: 16 additions & 27 deletions packages/cli/bin/inquiries/starterkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,34 @@ const starterkitSetup = [
message: 'Which starterkit do you want to use?',
choices: [
{
name: 'starterkit-mustache-demo',
value: '@pattern-lab/starterkit-mustache-demo',
name: 'starterkit-handlebars-demo [Recommended]',
value: '@pattern-lab/starterkit-handlebars-demo',
},
{
name: 'starterkit-twig-demo [Recommended]',
value: '@pattern-lab/starterkit-twig-demo',
},
{
name: 'starterkit-mustache-bootstrap',
value: 'starterkit-mustache-bootstrap',
},
},
{
name: 'starterkit-mustache-demo',
value: '@pattern-lab/starterkit-mustache-demo',
},
{
name: 'starterkit-mustache-foundation',
value: 'starterkit-mustache-foundation',
},
// {
// name: 'starterkit-twig-base',
// value: 'starterkit-twig-base',
// },
{
name: 'starterkit-twig-demo',
value: '@pattern-lab/starterkit-twig-demo',
},
},
{
name: 'starterkit-mustache-materialdesign',
value: 'starterkit-mustache-materialdesign',
},
// {
// name: 'starterkit-twig-drupal-demo',
// value: 'starterkit-twig-drupal-demo',
// },
// {
// name: 'starterkit-twig-drupal-minimal',
// value: 'starterkit-twig-drupal-minimal',
// },
{
name: 'starterkit-mustache-webdesignday',
value: 'starterkit-mustache-webdesignday',
},
},
{
name: 'starterkit-mustache-base',
value: '@pattern-lab/starterkit-mustache-base',
},

new inquirer.Separator(),
{
name: 'Custom starterkit',
Expand All @@ -61,8 +50,8 @@ const starterkitSetup = [
},
],
default: {
name: 'starterkit-mustache-base',
value: 'starterkit-mustache-base',
name: 'starterkit-handlebars-demo',
value: 'starterkit-handlebars-demo',
},
},
{
Expand Down
15 changes: 15 additions & 0 deletions packages/cli/bin/install-edition.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,26 @@ const installEdition = (edition, config, projectDir) => {
}
// 4.2
case '@pattern-lab/edition-node': {
const editionPath = path.resolve('./node_modules', edition);
const editionConfigPath = path.resolve(
editionPath,
'patternlab-config.json'
);

const editionConfig = require(editionConfigPath);

pkg.scripts = Object.assign(
{},
pkg.scripts || {},
yield getJSONKey(edition, 'scripts')
);

yield copyAsync(
path.resolve(editionPath, '/helpers/test.js'),
path.resolve(sourceDir, '../', 'helpers/test.js')
);

config = merge(config, editionConfig);
break;
}
// 4.3
Expand Down
2 changes: 1 addition & 1 deletion packages/edition-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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/cli`: [GitHub](https://github.com/pattern-lab/tree/master/packages/cli) | [npm](https://www.npmjs.com/package/@pattern-lab/cli)
* `@pattern-lab/engine-mustache`: [GitHub](https://github.com/pattern-lab/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/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/tree/master/packages/uikit-workshop) | [npm](https://www.npmjs.com/package/@pattern-lab/uikit-workshop)

## Prerequisites
Expand Down
5 changes: 5 additions & 0 deletions packages/edition-node/helpers/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = function(Handlebars) {
Handlebars.registerHelper('test', function() {
return 'This is a test helper';
});
};
2 changes: 1 addition & 1 deletion packages/edition-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@pattern-lab/cli": "^0.0.3",
"@pattern-lab/core": "^3.0.1",
"@pattern-lab/engine-mustache": "^2.0.1-alpha.0",
"@pattern-lab/engine-handlebars": "^2.0.0-beta.1",
"@pattern-lab/uikit-workshop": "^1.0.1"
},
"keywords": [
Expand Down
9 changes: 7 additions & 2 deletions packages/edition-node/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"css": "public/css"
}
},
"patternExtension": "mustache",
"patternExtension": "hbs",
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportDirectory": "./pattern_exports/",
"patternExportPatternPartials": [],
Expand All @@ -90,5 +90,10 @@
"excludedPatternStates": [],
"excludedTags": []
}
]
],
"engines": {
"handlebars": {
"extend": "helpers/*.js"
}
}
}

0 comments on commit 502fde7

Please sign in to comment.