Skip to content
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

Merged
merged 6 commits into from
Jul 6, 2017

Conversation

didi0613
Copy link
Contributor

@didi0613 didi0613 commented Jul 6, 2017

Update component generator with demo folder
Tested locally on component & component-add

@didi0613 didi0613 changed the title [major][chore] Update component generator [minor][chore] Update component generator Jul 6, 2017
@@ -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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what inside will throw?

Copy link
Contributor Author

@didi0613 didi0613 Jul 6, 2017

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)

@jchip jchip merged commit 3186264 into electrode-io:master Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants