dxw / whippet-theme-template

This repo holds the template for a Whippet-enabled theme.
2 stars 1 forks source link

Move most of the code into a separate composer module #7

Closed mallorydxw closed 8 years ago

mallorydxw commented 8 years ago

There are a few files like PostTypes and CustomFields which should stay. Should all live inside one directory in app/.


mallorydxw commented 8 years ago

Iguana would be a good name. Fairly short. It's also not whippet-something which is a definite plus. Only one other package with a similar name on packgist.

Source of the name: http://shop.oreilly.com/product/0636920029380.do?sortby=publicationDate

There is one other WP-related thing named Iguana: http://themeforest.net/item/iguana-responsive-multipurpose-wordpress-theme/5239597

But the logo looks nothing like an iguana. Clearly something closer to a gecko.

mallorydxw commented 8 years ago

After moving code to iguana - move code specific to themes into src/Theme and any plugin-specific code into src/Plugin.

mallorydxw commented 8 years ago

"iguana theme and plugin framework for WordPress" sounds like a good short description

or "iguana - the extensible theme and plugin framework for WordPress"

We can layout the Iguana code as src/Theme and src/Plugin, and add anything else as we go.

app
├── CoreBehaviour.php - THEME
├── di.php - TMPL
├── Helpers.php - IGUANA
├── Lib
│   ├── RootsWalkerComment.php - THEME
│   └── Whippet
│       ├── Layout.php - THEME
│       └── TemplateTags.php - THEME
├── load.php - TMPL
├── Posts
│   ├── CustomFields.php - TMPL
│   └── PostTypes.php - TMPL
├── Registerable.php - IGUANA
├── Registrar.php - IGUANA
├── SuperglobalGet.php - IGUANA (Superglobal/Get)
├── Superglobal.php - IGUANA (Superglobal/Base) - should be named generically as we'll add constants based on this class
├── SuperglobalPost.php - IGUANA (Superglobal/Post)
└── Theme
    ├── Helpers.php - THEME (requires modifications - should look for constant - and the constant should be provided via a Superglobal-type class)
    ├── Media.php - TMPL
    ├── Menus.php - TMPL
    ├── Pagination.php - TMPL?
    ├── Scripts.php - THEME
    ├── Titles.php - TMPL?
    ├── TitleTag.php - THEME
    └── Widgets.php - TMPL
mallorydxw commented 8 years ago

Or should iguana just provide the bare framework, and the theme-related components are in iguana-theme? Would perhaps be cleaner, and would help to keep each repo focussed and concentrated.

We could include in iguana a command vendor/bin/iguana which could be used as a generator for new themes/plugins (i.e. take over that role from whippet). And could also generate new classes in the appropriate style (take over the role of git@git.dxw.net:tools/generator-dxwwp).

But maybe we're getting ahead of ourselves. At any rate, that should probably live in a separate repository to iguana itself. Maybe that could be iguana-cmd.

mallorydxw commented 8 years ago
TMPL = belongs in the template forever because it's a bit of placeholder code meant to be replaced by a theme author
STABLE = hasn't been modified in a long time, isn't likely to be modified any time soon, and is well-used
THEME = will be moved to iguana-theme eventually
CORE = important core functionality of iguana-theme
app
├── CoreBehaviour.php - THEME => \Dxw\Iguana\Theme\UseAtom
├── Lib
│   ├── RootsWalkerComment.php - TMPL
│   └── Whippet
│       ├── Layout.php - STABLE THEME CORE => \Dxw\Iguana\Theme\Layout
│       ├── LayoutRegister.php - THEME CORE => \Dxw\Iguana\Theme\LayoutRegister
│       └── TemplateTags.php - we should move w_requested_template into Layout.php - but otherwise TMPL (see feature/tests)
├── Posts
│   ├── CustomFields.php - TMPL
│   └── PostTypes.php - TMPL
└── Theme
    ├── Helpers.php - TMPL for the moment
    ├── Media.php - TMPL
    ├── Menus.php - TMPL
    ├── Pagination.php - TMPL?
    ├── Scripts.php - THEME => \Dxw\Iguana\Theme\Assets
    ├── TitleTag.php - THEME
    └── Widgets.php - TMPL

Note that Layout is based on some roots code, that lives here: https://github.com/roots/sage/blob/8d7bcee4c46173d11dd8ea9a06021d8c27891b64/lib/wrapper.php

I looked at Sage to see if a) it had unit tests, and b) we could reuse the code by requiring a composer module. No on both counts, so let's stick with what we have here.

mallorydxw commented 8 years ago
mallorydxw commented 8 years ago

Done in https://github.com/dxw/iguana-theme/pull/5 and https://github.com/dxw/iguana-extras/commit/181869e32a5cb6a56f213e2bf1c12e28111dab96