-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[minor][chore] Update component generator #460
[minor][chore] Update component generator #460
Conversation
@@ -181,6 +182,15 @@ var ReactComponentGenerator = yeoman.Base.extend({ | |||
this.template("packages/component/_readme.md", this.rootPath + "README.md"); | |||
}, | |||
component: function() { | |||
let getDemoFilePath = function(filepath) { | |||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what inside will throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jchip If the filepath does not exists, it will throw the error similar to below.
Scenario:
demo-helper version <@2.1.0 and if it is trying to copy demo folder:
events.js:160
throw er; // Unhandled 'error' event
^
AssertionError: Trying to copy from a source that does not exist: /Users/s0d00px/electrode/packages/generator-electrode/node_modules/electrode-demo-helper/demo
at EditionInterface.exports._copySingle (/Users/s0d00px/electrode/packages/generator-electrode/node_modules/yeoman-generator/node_modules/mem-fs-editor/lib/actions/copy.js:45:3)
at EditionInterface.exports.copy (/Users/s0d00px/electrode/packages/generator-electrode/node_modules/yeoman-generator/node_modules/mem-fs-editor/lib/actions/copy.js:23:17)
at EditionInterface.module.exports [as copyTpl] (/Users/s0d00px/electrode/packages/generator-electrode/node_modules/yeoman-generator/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:10:8)
at constructor.component (/Users/s0d00px/electrode/packages/generator-electrode/component/index.js:210:15)
at Object.<anonymous> (/Users/s0d00px/electrode/packages/generator-electrode/node_modules/yeoman-generator/lib/base.js:431:23)
at /Users/s0d00px/electrode/packages/generator-electrode/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
at /Users/s0d00px/electrode/packages/generator-electrode/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
at /Users/s0d00px/electrode/packages/generator-electrode/node_modules/yeoman-generator/lib/base.js:432:9
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
Update component generator with demo folder
Tested locally on component & component-add