phonegap / phonegap-template-framework7

A starter template for creating a hybrid app with Framework7.
Apache License 2.0
43 stars 35 forks source link

CB-11412 Update templates to designate template source dir #6

Closed carynbear closed 8 years ago

mwbrooks commented 8 years ago

Is there a standard format for this style of template?

I think we should use the folder name template instead of template_src.

carynbear commented 8 years ago

Nope, I just made those changes according to how templates are implemented in cordova create. We should definitely talk about what the default files/folders should look like (+ create a guide to creating templates), but some things will be project specific, like package.json and config.xml.

For now, package.json and config.xml within template_src will be copied and then package.json (name and version) and config.xml (name, id, and version) are updated to match the created project. If no config.xml is included in the template, we grab the one from cordova-app-hello-world. If no package.json is included in the template, nothing happens.

Also, why template vs template_src?

stevengill commented 8 years ago

I personally wouldn't bother with template vs template_src. It can be named whatever as long as dirname in index.js points to it.

devgeeks commented 8 years ago

So I could change it in my templates if I wanted. And a different template author could use something else?

stevengill commented 8 years ago

@devgeeks yup. Cordova doesn't care what you call the subdirectory.

mwbrooks commented 8 years ago

Thanks for the clarification @carynbear!

I'd like to see all PhoneGap projects use template/ and not template_src/. Underscores are not very common in node projects - I'm not sure why Cordova picked up using them. In directory structure, usually a dash - is used in place of a space and in syntax, it's camelCase.

carynbear commented 8 years ago

@mwbrooks Sorry I put this on the back burner while waiting for people to review it. I chose that naming convention mainly because node_modules/ has the same naming convention

I made some additions to docs on the topic of template usage and creation. Definitely not perfect, but I what I wrote is a little bit easier to digest if I use template_src to indicate the location of the template's contents and template to refer to the entire package. That can be revised so please review it with the naming conventions in mind. Let me know what you think and I'll go through and make changes uniformly for all the templates (and the docs)

carynbear commented 8 years ago

I'm merging this since it's been sitting for a week. (after I get write access) @mwbrooks in package.json my_app is now MyApp