-
Notifications
You must be signed in to change notification settings - Fork 60
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
Feat: Added generator for middleware #261
Conversation
I'm getting the following error due to the file path for the newly created middleware being invalid:
I'm guessing this is due to the |
|
||
case 'middleware': | ||
data = middlewareTemplate(name); | ||
break; | ||
} | ||
|
||
if (type === 'model') { |
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.
Ahh here's the culprit. We should probably replace that with a regexp /^(model|middleware)$/.test(type)
.
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.
Never mind that's the name haha. I got excited.
Ahh I figured out why I was getting that error. I had to remove the locally installed Lux to get the globally npm linked cli rather than the locally installed one. This is working as expect 👍. Disregard my comments. |
Ha great! Yeah I was wondering what was going wrong! It does actually give you a sense of some polishing that the generator could use, though — you'll get the same error anytime you misspell a generator. Instead, if it doesn't match anything, you might consider, at some point, giving suggestions for what generators are available. |
That's an awesome idea! Would you mind creating an issue for that with a feature label? |
Added the |
Added |
👍 Works great! |
Addresses #256