-
Notifications
You must be signed in to change notification settings - Fork 7
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
Generator doesn’t use renamed custom template files #141
Comments
Problem is that we have the modlet files hardcoded and just copy those over: generator-donejs/component/index.js Line 114 in c6cc995
|
On second thought, this is working the only way it can. Each of the files in templates/ is a template, it has to be given data before the .html or .js or whatever file can be created. Because of that, it's indelibly tied to the component.js generator. component.js has to know about the templates it uses, it doesn't know that your demo.html is the same as the component.html file it knows about. I think what you want is a custom generator. |
@matthewp since I think it would be really helpful if we could move the list of files for each generator to within the templates folder for that generator - for example |
I look up table sort of thing might work but I think it's not going to be as flexible as you'll want it to be. It only works if the files map one-to-one, so in the case of .less to .css it works, but if you add some new arbitrary file, the component generator isn't going to know what data to pass into that template. Think about how you use stache templates, your JavaScript passes data into that template because it knows what data the template needs. It's sort of an interface; as long as you have another template with the same exact interface it works. I just question if it's going to be flexible enough, you might as well write an alternative generator at that point. |
The solution we came up with when discussing #148 (comment) was to write out all of the templates in the appropriate |
Steps to reproduce in a DoneJS app:
.donejs/templates/component/modlet/
component.html
todemo.html
in that folder.donejs add component test
Expected results:
src/test/demo.html
would existActual results:
src/test/test.html
exists and is empty.The text was updated successfully, but these errors were encountered: