Ui/ember blueprint updates (#9627)

* Import layout in blueprint if generator used with --in flag

* Generated story works with hot reloading out of the box
This commit is contained in:
Chelsea Shaw 2020-07-30 11:15:03 -05:00 committed by GitHub
parent fb05f1efe8
commit 4eb156f707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View File

@ -58,7 +58,7 @@ module.exports = {
let contents = '';
// if we're in an addon, build import statement
if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy)) {
if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy) || !!options.in) {
if (options.pod) {
templatePath = './template';
} else {

View File

@ -1,16 +1,14 @@
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
<%= importMD %>
import { withKnobs } from '@storybook/addon-knobs';
storiesOf('<%= classifiedModuleName %>', module)
.addParameters({ options: { showPanel: true } })
.addDecorator(withKnobs())
.add(`<%= classifiedModuleName %>`, () => ({
template: hbs`
<h5 class="title is-5"><%= header %></h5>
<<%= classifiedModuleName %>/>
`,
context: {},
}),
{notes}
);
}));

View File

@ -38,9 +38,7 @@ module.exports = {
locals: function(options) {
let contents = '';
let importMD = "import notes from './" + stringUtil.dasherize(options.entity.name) + ".md';\n";
return {
importMD: importMD,
contents: contents,
path: getPathOption(options),
header: stringUtil