zerovm / zpm

ZeroVM Package Manager
Apache License 2.0
6 stars 11 forks source link

Allow specifying system templates in ui section #141

Open mgeisler opened 10 years ago

mgeisler commented 10 years ago

Inspired by the discussion in #109 I think it would be nice if I could pull in a system template in my ui section.

Assume I have the following ui section in my zapp.yaml file:

ui:
- "index.html"

The generated zapp wont have a zerocloud.js file.

I have to manually extract the file from a zapp and include it in my ui section. This also implies that I have to version control this auto-generated file — something which you normally try to avoid. If the ZeroCloud library changes in the future (perhaps with a bugfix), then I have to notice this and extract it again from a dummy zapp.

The syntax for this could be similar to includes in CPP:

ui:
- "index.html"
- "<zerocloud.js>"

This would mean that leaving out the ui section is equivalent to:

ui:
- "<index.html>"
- "<style.js>"
- "<zerocloud.js>"
larsbutler commented 10 years ago

This would mean that leaving out the ui section is equivalent to:

ui:
- "<index.html>"
- "<style.js>"
- "<zerocloud.js>"

Leaving out the ui section is equivalent to including all of the system defaults? If I'm reading that right, that doesn't make any sense.

larsbutler commented 10 years ago

I think the concept of system templates is overly complicated and unnecessary. I would much rather just have defaults which can be generated once and customized. This way we don't need to invent the concept of system templates, nor do we need to invent an "include" syntax.

mgeisler commented 10 years ago

I updated my opinion on this, see the comment in issue #109 where I suggest:

I think my suggestion in #141 would help: zpm new could generate a ui section with

ui:
- "<index.html>"
- "<style.css>"
- "<zerocloud.js>"

The user can then remove things from this list as desired or leave the section out completely. With no section, no UI files are added.