Closed carynbear closed 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
?
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.
So I could change it in my templates if I wanted. And a different template author could use something else?
@devgeeks yup. Cordova doesn't care what you call the subdirectory.
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.
@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)
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
Is there a standard format for this style of template?
I think we should use the folder name
template
instead oftemplate_src
.