alpineio / quixote

A Boilerplate WordPress Theme system to help rapidly create robust, testable WordPress themes using gulp, sass, bootstrap, and imagemin. Quixote also works with pre-built docker containers for rapid local development.
MIT License
0 stars 0 forks source link

Structure of theme package, considering src, tests, demo content, and output #7

Open bcash opened 8 years ago

bcash commented 8 years ago

I believe we want the final theme to have the following attributes:

  1. A quixote project is a fully self-contained and buildable theme. The theme includes all source files, original PSD or JPG mockups, fonts, images, etc. The only exception is readily available third party libraries with a reliable change management history such as bootstrap, jquery, etc.
  2. The final output of a quixote project is a "compiled" WP theme itself. Once compiled, the whole project (source and output), should be committed as a single source controlled repository. We are source controlling output, but that output is human editable code (minifying or uglifying aside), so it must also be committed together with the source controlled build files. Yes, this pairs source and output into the same commits.
  3. The WP theme (the output) should reside as a top-level resident of the repository - git allows for direct export to a .zip file. This would make the git export naturally a pre-packaged theme, fully ready for consumer WP installation.
  4. All demo, git housekeeping, and source content should be excluded from the .zip export process. Github and bitbucket both support download exclusions as defined in a .gitattributes file. Similar to tests, a /src subfolder should be excluded from production.

See i_dont_need_your_tests_in_my_production

If each package maintainer would include a .gitattributes file in which (s)he enumerates all the files and directories that can be excluded from dist, we could have a more clean vendor/

.gitattributes Example:

  • text=auto /src export-ignore /tests export-ignore /demo export-ignore /.gitattributes export-ignore /.gitignore export-ignore

Just commit a ".gitattributes" file in your git root directory and you are ready to go.

Using the command:

git archive --format zip --output /full/path master

This should produce a fully usable WordPress theme package, without any extra load such as source, tests, git housekeeping files, or demo content.

bcash commented 8 years ago

Better example .gitattributes file:

* text=auto 
/src export-ignore 
/tests export-ignore 
/demo export-ignore 
/.gitattributes export-ignore 
/.gitignore export-ignore
src/ export-ignore
app/*.map export-ignore
typings/ export-ignore
gulpfile.js export-ignore
package.json export-ignore
tsconfig.json export-ignore
typings.json export-ignore
moneal commented 8 years ago

What if we create a new folder for design assets that are not going to be included in the themes output and keep the current structure? This way everything is simple and we don't have to move all the files around to build. We could also create a folder for sample data.

bcash commented 8 years ago

Can you show an example in a screenshot?

bc

Brian Cash

What is Alpine Internet? Watch this Video > http://bit.ly/alpinevideo New Alpine Guidebook (Free Download) 22 SEO Myths Busted > http://bit.ly/alpineseomythsbusted New project idea? Schedule a quick chat > http://bit.ly/quickprojectreview http://bit.ly/quickprojectreview

p: 541-312-4704 ext. 100 m: 541-390-5862 e: bcash@alpineinternet.com w: http://alpineinternet.com

On Wed, Mar 2, 2016 at 11:56 AM, moneal notifications@github.com wrote:

What if we create a new folder for design assets that are not going to be included in the themes output and keep the current structure? This way everything is simple and we don't have to move all the files around to build. We could also create a folder for sample data.

— Reply to this email directly or view it on GitHub https://github.com/alpineio/quixote/issues/7#issuecomment-191399765.