github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/blueprints/story/index.js (about)

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