github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/blueprints/story/index.js (about) 1 /* eslint-disable ember/no-string-prototype-extensions */ 2 const getPathOption = require('ember-cli-get-component-path-option'); 3 const stringUtil = require('ember-cli-string-utils'); 4 const path = require('path'); 5 6 module.exports = { 7 description: 'generates a story for storybook', 8 9 fileMapTokens: function () { 10 let { project } = this; 11 return { 12 __path__: function () { 13 return path.relative(project.root, project.root); 14 }, 15 __markdownname__: function (options) { 16 return options.dasherizedModuleName; 17 }, 18 __name__: function (options) { 19 return options.dasherizedModuleName; 20 }, 21 }; 22 }, 23 24 locals: function (options) { 25 let contents = ''; 26 27 return { 28 contents: contents, 29 path: getPathOption(options), 30 header: stringUtil 31 .dasherize(options.entity.name) 32 .split('-') 33 .map((word) => stringUtil.capitalize(word)) 34 .join(' '), 35 }; 36 }, 37 };