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

Generated files for templates should be ignored in git #52

Closed
bwl21 opened this issue Nov 25, 2015 · 8 comments
Closed

Generated files for templates should be ignored in git #52

bwl21 opened this issue Nov 25, 2015 · 8 comments

Comments

@bwl21
Copy link
Contributor

bwl21 commented Nov 25, 2015

I propose to put the templates/*/edres folders to .gitignore. This makes it easier for contributors, since these files are rebuilt by grunt and then flagged as changed.

@bago
Copy link
Member

bago commented Nov 25, 2015

Well, I'm not sure this would be ok. I think a template should include its own images.
The makeThumbs is just an helper function: you may want to use or not use it, you may want to generate your own thumbnail differently from the autogenerated ones.
So, I think it is ok to commit them.

They are not built as part of the library building, we just ignore what the library build builds.

@bwl21
Copy link
Contributor Author

bwl21 commented Nov 25, 2015

I understand. But this repository is a development repository. And If I understand right, the templates are primarily intended for demonstration. Shouldn't we consider the thumbnails of these templates therefore as part of the library build.

I do not insist ... please close the issue according to your decision.

@bago
Copy link
Member

bago commented Nov 25, 2015

I have to think a bit about this. On the "other side" I evaluated to commit also the "dist" folder so that some users could run it without building (expecially using the php backend). Many js libraries do this, expecially when you want other tools to easily depend on your repository (e.g: via bower).

@bwl21
Copy link
Contributor Author

bwl21 commented Nov 25, 2015

I see your point. The github repository may not be able to serve both, a development repository and an "run out of the box" thing. Could we build the latter as a zip-File and deliver it as release. I ha(d)ve many questions until I learned that mosaico does not provide a ready to use application but

  • a library (dist)
  • an example application (index.html, editor.html, backend)
  • a sample set of templates (templates)

If one wants to play out of the box, mosaico.it is pretty fine. If one wants to run it on his local box, a mosaico-sample.zip is fine. For integrators it should be a mosaico-runtime.zip which contains the dist - folder only. These files should be integrated but not touched.

This brings me back to the point that if one clones the mosaico repository, he should perform the appropriate grunt tasks. In order to contribute back, no unintended change/commit of a file should happen.

@bago
Copy link
Member

bago commented Dec 5, 2015

makeThumbs is not a "compiler" is a "generator" (precompiler?): you MAY want to use it or you MAY want to provide your own images. So, images generated by that "task" are not necessarily derived by the sources but are part of the sources (otherwise I would have added makeThumbs to the backend features and autogenerated them at runtime, in a working folder, the first time a template was loaded).

I'm convinced that at this time splitting mosaico would slow down the development and I don't want to over-engineering things.

Maybe in future we'll have a respository for each template and a website with a gallery of templates (free, opensource, commercial, who knows) and maybe we will have plenty of backends and demo applications, and also that we'll split mosaico.js in different projects (it already contains modules that could be used standalone or replaced) but in the mean time I like to have a single place to look.

Let's wait for more developers to approach the project and let's fix the issues once they give us problems.

(I updated the README so to avoid some confusion about the use of makeThumbs)

@bago bago closed this as completed Dec 5, 2015
@bwl21
Copy link
Contributor Author

bwl21 commented Dec 5, 2015

I agree to your thoughts - even if they do not solve my issue: during development of my template I regenerate parts of the distribution which I then manually have to reset.

Would it be possible to change makeThumbs to have an argument with the template name. In this case I can utilize it for my own templates without regenerating the images for the templates provided by the distribution.

@bago
Copy link
Member

bago commented Dec 5, 2015

Simply don't call "makeThumbs"
Call "makeThumbs:main:yourtemplatename" (README.md was saying this) only if you want to generate/update thumbnails.
If this makeThumbs update the thumbnails, push them to git.

Do you have other "generated files"?

@bwl21
Copy link
Contributor Author

bwl21 commented Dec 5, 2015

sorry, now I got it. It was my fault. I did not spot the change in commit 7310532

thanks

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

No branches or pull requests

2 participants